How to change “postgres” user’s password (Postgresql 9.3) on Ubuntu 14.04

1. In pg_hba.conf, insert or change the below line.
from :

local all postgres

to

local all postgres trust

2. Restart PostgreSQL services in order for Step 1 changes to take effect :

/etc/init.d/postgresql restart

3. Login to PostgreSQL on the local machine with the user name "postgres" to change the password :

psql -U postgres

4. At the "postgres=#" prompt, change the user name "postgres" password :

ALTER USER postgres with password ‘new-password’;

5. Quit PostgreSQL interactive session by executing "\q", to exit

6. Alter the configuration (what we did in Step 1) to disable password-less login from local machine to PostgreSQL by changing the word "trust" to "md5" in pg_hba.conf.
from:

local all postgres trust

to:

local all postgres md5

7. Restart PostgreSQL to make Step 6 changes take effect by repeating Step 2.

8. Update .pgpass with your new password if you are using one

/home/<user>/.pgpass

9. Re-login to PostgreSQL using the new password by :

psql -U postgres

Advertisements

How to set PcManFm as the default file manager in Ubuntu 14.04

After struggling with this Nautilus’ slowness for a while, I decided to change my default as well. The simple solution that works for me in all cases without mucking with changing desktop files was to do the following two commands:

sudo mv /usr/bin/nautilus /usr/bin/nautilus.bak
sudo ln -s /usr/bin/pcmanfm /usr/bin/nautilus

You can of course replace /usr/bin/pcmanfm with /usr/bin/thunar, or whatever.

If you also want to have a desktop, open /etc/xdg/autostart/nautilus-autostart.desktop and make the Exec line

Exec=nautilus --desktop