This simple tutorial shows how to enable Windows 7 aero snap like functionality in Ubuntu with compiz.

First of all, open up a terminal window from Applications -> Accessories menu and install the required programs:

sudo apt-get install compizconfig-settings-manager wmctrl

and make sure Extra is being selected in Change Desktop Background -> Visual Effects tab.

Now, follow the steps below:

Step 1:

Open CCSM at System -> Preferences -> CompizConfig Settings Manager. In Genaral, tick Commands and click to go into its configuration window.

Step 2:

Copy and paste following into command line 0, command line 1, and command line 2

command line 0 :
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1

command line 1 :
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1

command line 2:
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz

Step 3:

Head to Edge Blindings tab, set as follow:

Run Command 0 – Left
Run Command 1 – Right
Run Command 2 – Top

Step 4:

Finally, click Back and then click on General Options. Set value of Edge Trigger Delay to 500 or something you feel comfortable with.

Now, choose a window and move you cursor to left, right, or top of screen and wait (the delay 500ms) for the effect.

Check on ubuntuforums.org