Friday, December 11, 2009

Postgresql cluster on Ubuntu

When having two versions of PostgreSQL on the same machine, need to use --cluster option for all psql command - psql, createuser, createdb, dropdb etc. The format is:-

psql --cluster version/cluster

$ pg_lsclusters
Version Cluster Port Status Owner Data directory Log file
8.3 main 5432 online postgres /var/lib/postgresql/8.3/main /var/log/postgresql/postgresql-8.3-main.log
8.4 main 5433 online postgres /var/lib/postgresql/8.4/main /var/log/postgresql/postgresql-8.4-main.log

$ psql --cluster 8.4/main mydb

dnsmasq for local virtual network

Setting up local virtual network with VirtualBox. The setup:-

Main Host
  • eth0/bridged mode listen on Connected to the real local LAN.
  • eth1 listen on - dnsmasq dhcp listen here.
Sub internal host
  • app2 - eth0/internal network
  • db - eth0/internal network
/etc/dnsmasq.conf setup so that the dhcp assigned the IP address from /etc/hosts for any matching hostname.


But the client still getting the lease in dhcp-range rather than the one set in /etc/hosts. Turn out we need to set "send host-name app2;" in /etc/dhcp3/dhclient.conf because dhclient does not send the hostname by default when acquiring the lease.

Thursday, December 10, 2009

Makefile notes

On changing directory in Makefile:-
Each command in a makefile is executed in its own shell. To execute three subcommands in the same shell, write them all as a single command. For instance, if your shell uses ';' as a subcommand separator, you might write

Tuesday, December 8, 2009

Drupal Install Profile

Collecting resources on Drupal install profile:-
Reason on why './profiles' stay at the same level as './site' and not under './sites/*/profiles':-
An attempt to use module as an alternative to install profile:-