Thanks to the solution number 8 to this issue, I got the code to fix the left-oriented buttons in Ubuntu 10.04.
Here you have the code (it is only one line):
gconftool-2 --type string --set /apps/metacity/general/button_layout "menu:minimize,maximize,close"