postgres not null

psql select not working

PSQL Select not working – or other simple commands not working

Working with command line postgres tool psql and having an issue?

Why doesn’t the psql command show the simple select query?

PSQL select not working is a problem that can happen in either of the following scenarios:

  1. Are you on the right database?
    Chances are you might not be on the right database at all and the relation you are trying to find might not be there at all:Check if you are on the right database.
     
    Run the command \l to see the available databases.How to connect to the postgres database from the list?
    Use the command \c database_name
    Let’s say the database name is inventory then:\c inventory will connect you to the right database
  2. Continue reading psql select not working

lmagick works from command line but not from php script, sh: convert: command not found

Working with something that needs a shell access, like working with awesome imagick function and stuck with sh: convert: command not found

The thing is it works when the same command that run from php script is run on the command line.
It is a path issue.

exec("convert soruce.ext converted.ext", $report);

Here the report would tell how it goes and it will get back with the news

sh: convert: command not found

Now do

which convert

To get the full path of the command and use it

exec("full-path-to-convert source.ext converted.ext", report);

The above would work for any command that creates related problems.

Process Commands in Linux

To stop the current process and get back to the shell:

ctrl+z

To put the current process in the backgroup

bg

To bring the background process to front

fg

To send the the job to background on one line, put ambersand (&) at the end eg usingvi command:

vi somefile.txt &

To see all the background jobjs

jobs

Bringing specific job from background to foreground

fg %1 - this will bring the job number 1 to front

List all the running processes

ps aux

To filter some process, like to get the process id and stuff

ps aux | grep "process name"