OSX Lion Dashboard and Dock

So having recently rebuilt a couple of machines recently I was missing a few of the tweaks that I’d used in the past, so here for my future reference are the commands required to disable the Dashboard and also make the Dock appear to be flat.

Using Terminal (which can be found under utilities:

defaults write com.apple.dock no-glass -boolean YES
defaults write com.apple.dashboard mcx-disabled -boolean YES
killall Dock

And to re-enable

defaults write com.apple.dock no-glass -boolean NO
defaults write com.apple.dashboard mcx-disabled -boolean NO
killall Dock