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)

Friday, 29 October 2010

Add hostname and ip address to bash prompt

It's useful to identify servers by hostname and ip address, adding this to your .bash_rc does both!

export PS1='\[\033[0;35m\]\h\[\033[0;33m\] \w\[\033[00m\]'`hostname`:`ifconfig|grep Bcast|awk ' { print $2 }'|awk -F":" ' { print $2 }'`'$ '

Tuesday, 26 October 2010

Convert spaces to tabs on linux, the easy way.

If you want to convert spaces to tabs in a text file on linux it's simple use unexpand sourcefile >  destfile

Sunday, 24 October 2010


I'm compiling mysql using some CFLAGS and CXXFLAGS using a script, since the flags contained spaces I put them in quotes...weirdly enough this causes gcc to fail, the flags have to be exported without quotes.

Wednesday, 20 October 2010

Slow DNS in Safari and Firefox but not Opera and Chrome

I recently installed a new ubuntu server installation using vmware's nat interface, now I found when navigating via a domain name to the web server DNS resolution via Safari and Firefox were excessively slow (minutes) however chrome and opera didn't have the same issue. Turns out disabling mac's ipv6 fixes the issue.

dpkg-reconfigure interface

If say your keyboard configuration is broken and you need to use dpkg-reconfigure console-setup to fix it you may have a hard time using the default dialog interface to change it use dpkg-reconfigure -f readline console-setup which uses a simple readline interface.

Thursday, 14 October 2010

Mac Alt (option) key symbols and linux vmware fusion

I've recently started trying vmware fusion after problems with virtualbox and I've finally got around to figuring out why the alt (option) key then the 3 key doesn't bring up a # this is because by default ubuntu setup has it as the RIGHT alt key, you can change it by running dpkg-reconfigure console-setup and changing the AltGr key binding.

Mount LVM using ubuntu live CD

To mount lvm partitions on ubuntu live cd do the following

apt-get install lvm2
This will show any logical volumes
vgchange -ay <name of logical volume from vgscan>
This will list the logical volumes
then just mount it as normal
mount /logicalvolume /path-to-mount-to

Friday, 8 October 2010

Mac tar delete

This is weird, the mac version of tar doesn't have a --delete option, looks like I'll switch to zip for this archive.