Here is a quick guide on how to change the position of the maximize, close, and minimize buttons in Ubuntu Gnome.
For Ubuntu 12.04 (and 12.10), install Gnome Configuration Editor if it’s not in your system:
sudo apt-get install gconf-editor
Run gconf-editor , f.ex from Alt-F2 by typing it into the box, and press Enter to run it.
Ubuntu 12.04: Browse to apps > metacity > general, look for “button_layout” on the right panel.
Ubuntu 12.10: org > gnome > desktop > wm > preferences , look for “button_layout” on the right panel.
I found it usefull to change “button_layout” from close,minimize,maximize: to menu:minimize,maximize,spacer,close and then press the Enter key.