Labels

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

Rsync

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 http://www.geekology.co.za/blog/2009/04/enabling-bash-terminal-directory-file-color-highlighting-mac-os-x/

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 

$(document).ready(function(){});

you need to use

jQuery(document).ready(function($){});

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"...my 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

http://5thirtyone.com/archives/862

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 http://www.linode.com/forums/viewtopic.php?t=5250&highlight=ipv6

To do the same on debian lenny add


alias net-pf-10 off
alias ipv6 off

To /etc/modprobe.d/00local

Thanks to http://www.debian-administration.org/article/Disabling_IPv6_under_a_2.6_kernel

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) 'gd.so' in Unknown on line 0

Ack!

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.