Sometimes you don't want your Mac OS X Mountain Lion powered computer to go to sleep, here's a nice little trick how to temporary prevent a Mac from going into a sleep mode.
Click the Finder icon in the right corner of your Mac screen, enter terminal in the search field and click to open Terminal (see picture).
2.
A terminal command line window should open.
Not simply enter caffeinate and press Enter.
Your Mac should now be prevented from going into the sleep mode. To deactivate the caffeinate close the Terminal window or press Ctrl + C.
3.
If you want to temporary prevent your Mac from falling asleep, you can specify the amount of seconds you don't want it to sleep.
Again in the Terminal window enter caffeinate -t 100000 and press Enter.
-t is a time attribute and 100000 is a number of seconds you want your Mac to stay awake. You can specify any amount of seconds you want. To stop caffeinate close the window or press Ctrl + C.