Get size of Postgres DB from filesystem

Get the size accurately from postgres local filesystem, i guess there is some sql stuff that can do that but that does the job as well for me : #!/bin/bash /usr/lib/postgresql/8.1/bin/oid2name -U postgres|while read -a e;do name=${e[1]} oid=${e[0]} [[ $oid == "All" || $oid == "Oid" || -z $oid || -z $name ]] && continue typeset -a size size=(`du -s /var/lib/postgresql/8.1/main/base/$oid`) size=${size[0]} printf "%-20s %-20s\n" ${name} ${size} done | sort -n -r -k 2 |awk '{printf "%-20s%20d Mb\n", $1, $2 / 1024}'

5 June 2006 · 1 min

Jabber/Asterisk and Gajim notification

At work we are using Asterisk and Jabber and i am using Gajim as my client. I did a quick patch to have a notification on my desktop when someone call me and i get my big headphones (not that i like the phone very much but well), here is the patch for people who may wants it : http://trac.gajim.org/ticket/1998

25 May 2006 · 1 min

svn diff without spaces

I am sic of spaces and having svn diff that does not get the spaces removed. So here is a simple script that does the stuff that you can use as your diff-cmd : #!/bin/bash for i in $@;do echo $i |grep -q ")" && continue echo $i |grep -q "(" && continue t="$t $i" done diff -bBw $t

25 May 2006 · 1 min

X86_64

On X86_64 VM Emulation works way better with Xen 3.0 than with Vmware. Xen is pretty awesome compared to Vmware for my use. The only thing i have to figure out is how to get rpmstrap get it workin on Debian base system.

11 May 2006 · 1 min

Mixing 64 bytes and 32 Bytes Libraries on Solaris

Remind to myself to use the switch -64 on solaris with crle to tell the linker on solaris to get the linker ‘seeing’ 64 libraries. I wonder why everything is not as simple as linux thought where we have everything in one place with /etc/ld.so.config

29 April 2006 · 1 min

Python 2.5 Beta

I have been looking at the What’s new __of Python 2.5. There is some cool features inside it : Conditional Expressions: This stuff basically allow to do standard C idiom (that we found in every kind of derivative language) like ...

9 April 2006 · 2 min