Updated 00-write-defaults.sh

Took a lot of inspiration from http://mths.be/osx