Completely Disable Suspend and Hibernate on Linux

To prevent your Linux system from suspending or going into hibernation, you need to disable the following systemd targets:

$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Stolen from here.