In this article I will show you how to disable your Linux System from going to sleep. Of course, your desktop environment must have some option for doing this, but I am not interested, since I want something generically, that could work on more than one system.

This can be easily done from the grub. The grub sends commands to the kernel directly.
In the /etc/default/grub, modify the GRUB_CMDLINE_LINUX_DEFAULT to look like this:
$ GRUB_CMDLINE_LINUX_DEFAULT=acpi=off apm=off
Next run sudo update-grub and reboot your system.