Automatic MacOS shutdown
From time to time my Mac is doing stuff which takes quite awhile. Converting images, converting videofiles between formats or other stuff, which may take a long time (but reasonable predictable).
In those cases I run a little command in the terminal, to automatically shut down the Mac upon completion:
sudo shutdown -h +120
This command sets a timer which shutdown the machine after two hours (the 120 parameters being after 120 minutes).