postgres gem on ubuntu

Posted by Dick on May 02, 2007

Ubuntu put their postgresql client bits where gems can’t see them.

Google turned up the answer in the past, but today I had to figure it out myself.
So for the next time, here’s how to get the client bits needed for a gem build.

planb $ sudo apt-get install  postgresql-client-8.2 libpq-dev
planb $ sudo gem install postgres -- \
--with-pgsql-include-dir=/usr/include/postgresql \
--with-pgsql-lib-dir=/usr/lib/postgresql

Rails (well, rake) calls out to dropdb and createdb to flush the test database. If you want to do TDD, make sure the rails DB user has ‘createdb’ rights and owns the 3 databases:

postgres@elephantom $ createuser -PREdS railsguy
postgres@elephantom $ createdb -O railsguy live
postgres@elephantom $ createdb -O railsguy dev
postgres@elephantom $ createdb -O railsguy test

dropdb/createdb need access to the ‘postgres’ database to operate. Until you know this,
errors like

FATAL: no pg_hba.conf entry for host “1.2.3.4”, user “railsguy”, database “postgres”, SSL off

will have you staring at database.yml until your eyes cross.

you might as well have a pg_hba.conf line like

#TYPE  DB   USER       CIDR         METHOD
host   all   railsguy    1.2.3.4/32   md5

and have done.

totem the have-a-go hero

Posted by Dick on February 26, 2007

I’m on Ubuntu for most stuff (though I escaped from GNOME a while back). Here’s a question:

Why does totem think it can play any content at all?

Whenever I go to a webpage with quicktime/real/anything video, it pops up “Totem could not play ‘fd://0’”.

Totem, we know. As we’ve established, you are fucking useless. The only shame is that you persist in trying.

Mplayer can play any video format ever, from the command line, with about 30 alternative output mechanisms for audio and video (watching star wars in an xterm is highly recommended).

Rather than put this in the base, Ubuntu decided it would be more fun to have me
alternate between swearing at ‘plugger’ and resorting to ‘view source’ and wget.

So, if you’d like to watch video on ubuntu, you need to:

  1. enable the ‘multiverse’ repo
  2. sudo apt-get update
  3. sudo apt-get install mplayer mozilla-mplayer
  4. sudo apt-get remove totem-mozilla

Then go to the mplayer site ,download the right ‘Binary Codec Packages’ for your architecture (these work on any UNIX). It untars to make a folder called something like:
essential-20061022’ – rename that to /usr/lib/win32 and you’re done.

No idea how to get quicktime and realplayer to do the same,