Can't find the 'libpq-fe.h header

I need to install pg 0.17.1 gem on a server running CentOS. This is the error message I saw: # gem install pg -v '0.17.1' Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. ... First thing came to my mind was I must have forgotten to install the -dev package. ...

February 3, 2014 · 1 min · 192 words · kenno

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