Thursday, December 22, 2011

Take Screenshots in Linux/Fedora

Many a times we need to take screenshot. Today, I have installed kdegraphics for having the screenshot feature in my Fedora v14 OS.
The installation procedure is pretty simple :)


You simply have to do sudo yum install kdegraphics and it will install the application for you along with the required dependencies. 

Now you can take screenshots. You can launch the application from Applications->Accessories->Take Screenshot

You will get 3 different options for taking the screenshot.

Wednesday, December 21, 2011

POSTGRESQL: Ident authentication error

Today,

I was trying to configure POSTGRESQL server in Fedora Linux OS system. On my surprise, when I typed:

# psql -d railsapp_development -U rails_db_user -W

It gave me the following error:

# psql: FATAL: Ident authentication failed for user "username" 

For, solving this issue, you will have to edit the following file:

vim /var/lib/pgsql/data/pg_hba.conf

This file has various functionalites apart from controlling how the user/clients are  authenticated. By default, POSTGRESQL, supporst IDENT based authentication. IDENT based authentication will not allow you to login with -U and -W option. 

The following changes has to be done inside pg_hba.conf file:

# Type    Database     User     CIDR-ADDRESS            METHOD
----------------------------------------------------------------------------------------------------
  local        all               all                                                   trust
  host         all               all          127.0.0.1/32                     trust 


Basically you will have to replace ident with trust

Now restart the server with the following command:

# /etc/init.d/postgresql restart

After this you will be able to login. 

Note, that I was facing the above mentioned error, when I was trying to invoke the command rake db:migrate in rails.


But after doing the above mentioned changes, migrations started working fine.