SVN Diff against changes in the remote repository.

A useful svn wrapper scripts. Get a diff of your local repostitory against the upstream repository changes. I wonder why it is not builtins though like a svn status -u but for dif.


for line in `svn status -u`;do
    [[ $line != "   "* ]] && continue
    rev=`echo $line|awk '{print $2}'`
    ff=`echo $line|awk '{print $3}'`
    svn diff -r${rev}:HEAD $ff

History expansion and substitions in ZSH

I better to keep that somewhere since i always forget that thing, to do a search and replace from the command line in zsh. you just have to do the :s^FOO^BAR after your expansion

For example you just have typed the long command line :

blah bar FOO=1 FOO=3 FOO=6 cnt=1

you can just type :


and it will be expanded to :

blah bar VALUE=1 VALUE=3 VALUE=6 cnt=1

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 :

/usr/lib/postgresql/8.1/bin/oid2name  -U postgres|while read -a e;do
[[ $oid == "All" || $oid == "Oid" || -z $oid || -z $name ]] && continue
typeset -a size
size=(`du -s /var/lib/postgresql/8.1/main/base/$oid`)
printf "%-20s %-20s\n" ${name} ${size}
done | sort -n -r -k 2 |awk '{printf "%-20s%20d Mb\n", $1, $2 / 1024}'

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 :

for i in $@;do
echo $i |grep -q ")" && continue
echo $i |grep -q "(" && continue
t="$t $i"
diff -bBw $t