PostgreSQL: Peer authentication failed for user

Ever since Oracle took the ownership of MySQL, I’ve been leaning more and more toward PostgreSQL, or other NoSQL database like MongoDB. Also, I’m not completely new to PostgreSQL, but the fact that I only have to touch it once in awhile, makes me feel PostgreSQL is so hard to use and missing the goold-oldie MySQL. Anyway, this is the issue I had: # su - postgres -bash-4.1$ psql -l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -------------+----------+----------+-------------+-------------+----------------------- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres-db | postgres | UTF8 | en_US.UTF8 | en_US.UTF8 | puppetdb | puppetdb | UTF8 | en_US.UTF8 | en_US.UTF8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres (5 rows) -bash-4.1$ psql -d puppetdb -U puppetdb --password Password for user puppetdb: psql: FATAL: Peer authentication failed for user "puppetdb" To fix it, we need to modify pg_hba.conf, which is located in the /var/lib/pgsql/9.3/data/ directory on my system. ...

January 23, 2014 · 2 min · 238 words · kenno

How to suspend/hibernate from command line

First find out what states your system is supported: $ cat /sys/power/state mem disk To suspend to ram: # echo -n mem > /sys/power/state To hibernate: # echo -n disk > /sys/power/state Ref: http://askubuntu.com/questions/1792/how-can-i-suspend-hibernate-from-command-line

January 6, 2014 · 1 min · 34 words · kenno

Installing Plasma on Fedora 20

From the command line: # yum install -y kde-runtime.x86_64 kdm @kde-desktop Optionally, if you want to run KDM instead of GDM: # systemctl disable gdm # systemctl stop gdm # systemctl start kdm Note: This guide should work on Fedora 19 as well; but I haven’t tested it. Source: http://marcofalchi.blogspot.com.au/2013/10/fedora-1920-install-kde-kdm-swith-from.html

January 2, 2014 · 1 min · 50 words · kenno

How to extract .xz file

Today is the first time I ever saw a compressed file in *.xz format. According to this page TIP: extract .xz format, we can decompress it by running the following command: $ unxz sample.xz Just make sure you have “xz-utils” package, on Debian system, or something equivalent on other distros installed.

December 29, 2013 · 1 min · 51 words · kenno

Setting proxy for CPAN

To enable CPAN behind proxy: # perl -MCPAN -e shell Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help. cpan[1]> o conf init /proxy/ If you're accessing the net via proxies, you can specify them in the CPAN configuration or via environment variables. The variable in the $CPAN::Config takes precedence. <ftp_proxy> Your ftp_proxy? [] <http_proxy> Your http_proxy? [webproxy.yourdomain.com:8080] <no_proxy> Your no_proxy? [] If your proxy is an authenticating proxy, you can store your username permanently. If you do not want that, just press RETURN. You will then be asked for your username in every future session. Your proxy user id? [] Please remember to call 'o conf commit' to make the config permanent! cpan[2]> o conf commit commit: wrote '/usr/share/perl5/CPAN/Config.pm' Ref: ...

November 15, 2013 · 1 min · 131 words · kenno