I was accustomed to managing my windows on the right side so far, both in windows and linux. Suddenly Ubuntu decided to break away from this. So if we want to change it to the right again instead of the default left position. Enter the following command.
gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close