Friday, January 2, 2015

psql: FATAL: Ident authentication failed for user "root"

Postgresql error
psql: FATAL:  Ident authentication failed for user "root"

If you run command psql on terminal as root user and you get the error
psql: FATAL:  Ident authentication failed for user "root"
Here is solution for you. 

To resolve this error, Run these two commands on your terminal.
sudo -u postgres createuser root
It might give you this message
could not change directory to "/root"
Do not worry about it, when it asks
Shall the new role be a superuser? (y/n)

Enter y and press return key.

and the other command is
sudo -u postgres createdb root -O root
Now run command psql on terminal and you will log into postgresql command prompt as user root.

To check the list of postgresql databases, run command
\list

to quit the psql command prompt, run command
\q

Find Orientation of an image captured by a digital camera or mobile / cell phone

Download exiftool tar file from http://www.sno.phy.queensu.ca/~phil/exiftool/ and extract it. Now run these commands.
First change directory.
cd Image-ExifTool-9.78/
Run these commands one by one.

perl Makefile.PL
make
make test
make install

To find the orientation of a camera image run command after installation :

exiftool Orientation -n "/path/of/camera_image.jpg"
Do not use downloaded image, make sure it is clicked by digital camera.

Note : Orientation means the correct position of the image with respect to the camera button when it was clicked.

ssh: Could not resolve hostname bitbucket.org: Name or service not known

If you are trying to run git commands to pull and push and you are getting this. Here is the solution for you.

Open file /etc/resolv.conf and add following line in it

nameserver 8.8.8.8
Now save the file and try to pull/push again.