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)

Friday, 30 April 2010

Split Mac dmg files

If you need to split mac disk images into smaller files (say for upload/email) use the following command in terminal
hdiutil create -verbose -srcfolder "path to files to image" -nospotlight -format UDZO "path to temp image"
This creates a disk image which is compressed and doesn't have a spotlight index.
Next you need to run prinf password| hdituil segment -o "path to final image" -segmentSize 1g -encryption AES-256 -stdinpass "path to tmp image" This will segment the image with a maximum size of 1GB per segment and encrypt it using AES-256 the printf password sets the password to "password"

Monday, 26 April 2010

Ubuntu Manpages

http://manpages.ubunut.com has a new layout. Shiny!

Python dictionary iteration


To iterate through a python dictionary using a for loop use the following

for v in dict:
........

but if you want the key as well then use

for k,v in dict.items():
......

Thursday, 22 April 2010

Spotlight doesn't index some files


If spotlight isn't indexing some files (in my case applications) try the following

In terminal run:

find /Applications -name "*.app" -exec arch -i386 mdimport -d 1 {} \; 

This finds all applications in the /Applications folder and imports them into spotlight.

Saturday, 10 April 2010

Dock Spaces

Here's a cool way of adding spaces between icons in the dock on os x 10.5+ 

defaults write com.apple.dock persistent-apps -array-add '{ "tile-type" = "spacer-tile"; }'
killall Dock

Sunday, 4 April 2010

Friday, 2 April 2010

VMWare fusion boot camp cannot install ethernet driver

If your boot camp partition can't install the vmware fusion ethernet driver do the following

1) Shutdown and close vmware fusion
2) Go to /users/[your user]/Library/Application Support/Vmware Fusion/Virtual Machines/Boot Camp/%2Fdev%2Fdisk0/
3) Right click bootcamp partition and click show package contents
4) Open bootcamp.vmx in text edit
5) add the following line somewhere in the file ethernet0.virtualDEV = "e1000"
6) Save the file and restart vmware fusion.

The network bridge on device /dev/vmnet0 is not running.

I tried to connect my boot camp partion using vmware fusion to my network on bridged mode and got the following error "The network bridge on device /dev/vmnet0 is not running." to fix it type

sudo /Library/Application\ Support/VMware\ Fusion/boot.sh --restart


In Terminal (on mac) and press enter. Then try and reconnect.