css (1) jQuery (7) linux (38) mac (70) php (29) python (1) svn/git (9) trac (4) ubuntu (1) virtualbox (6) vista (2) windows (14)

Tuesday, 30 March 2010


This is just a reminder to myself since I can never remember the arguments for putting files over ssh using rsync

rsync -avz -e 'ssh -p [port]' [localfile] [remoteuser]@[remotehost]:[remotepath]

OS X terminal colours

Here's how to add colour to the ls command in OSX's terminal

Thursday, 18 March 2010

OS X File Vault doesn't reclaim space when deleting files

When deleting files a few days ago with file vault enabled (your home directory is encrypted) on OS X I deleted 10+ gigs of files to make room for some photos and videos, but the space wasn't reclaimed when emptying the trash!

Normally when you log out OS X reclaims disk space on your encrypted home directory but for some reason it didn't work (I wonder if it was because I had so little free space less than a gig). Anyway to reclaim it log in as another user (i.e. root) and open terminal, type

hdiutil compact /Users/<your username>/<your username>.sparsebundle

and press enter, that will reclaim any disk space it can (I got 16 gigs back not bad :) ).

Additionally, file vault won't clean up if you're on battery power and time machine won't back up a file fault on battery power.

Friday, 12 March 2010

Wordpress theme caveat

If you have a wordpress theme and name a file home.php (make sense as a template for the home page) then have a static home page and other page for the blog, the blog will use the home.php template...weird.

Wordpress JQuery Hack

By default jquery for wordpress runs in no conflict mode, this means instead of 


you need to use


Thursday, 11 March 2010

Gmail/Google Mail/Google Apps Mail Deleting Mail with Apple Mail

One annoying thing about the reccomended settings for gmail imap and apple mail is not to do anything special with deleted mails. Google's version of delete is "archive and don't worry about it" version of delete is...well delete and it's gone (if you saw the number of automated emails I get you'd know why I like to delete!).

Anyway thanks to this

It confirms my suspicions that you have to go into "Preferences" > "Accounts" > tick "Move deleted messages to trash" and tick "Store deleted messages on the server".

Then find your "Bin"/"Trash" mail box in apple mail, then click mailbox from the menu bar, then click use as, and click trash.

Disable IPV6 on ubuntu

I wanted to disable IPV6 on ubuntu (I don't use it).

How to do it? Use the following:

echo "net.ipv6.conf.all.disable_ipv6=1" > /etc/sysctl.d/60-noipv6.conf

That will disable it on reboot, and to disable on this session use

 sysctl -w net.ipv6.conf.all.disable_ipv6=1

thanks to

To do the same on debian lenny add

alias net-pf-10 off
alias ipv6 off

To /etc/modprobe.d/00local

Thanks to

Monday, 8 March 2010

SIOCADDRT: no such process

I've just configured an ubuntu server to have a static IP and when it booted the network didn't start...ahh! After running /etc/init.d/networking restart I got the error SIOCADDRT: no such process

Cryptic huh? Turns out I typed the IP address in wrong (put a 1 where a 2 should be...don't work on servers when sleep deprived).

Saturday, 6 March 2010

PHP Warning: PHP Startup: Invalid library (maybe not a PHP library)

I hadn't compiled the gd and mcrypt extensions into php and didn't want to recompile the whole thing so I did a phpize && compile && make && make install

When running php I got the following error

PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) '' in Unknown on line 0


Turns out that because I used sources that I compiled php with instead of a fresh untar'd copy it didn't compile properly...weird!

So if you ever see that error, try using fresh sources.