Our great sponsors
-
displayplacer
macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
- Time Machine Backups (locally)
To monitor Plex activities, we access the local Plex API and for Time Machine we simply monitor any file access at /mnt using "lsof." In case there has been no activity for 15 consecutive minutes, the server goes to sleep. (Nobody streams, pausing a video doesn't count as activity, and no backup is running.) A Web server on a Raspberry Pi hosts a website that obtains the current state of the home server provided via the Home Assistant REST API. In case the server sleeps, and I like to backup or stream something, I can wake the server using a simple button press that sends a magic packet using a wakeonlan Perl script.
GitHub: https://github.com/m33x/wol-plex-server
I had a similar problem with identical monitors that I used something called displayplacer
https://github.com/jakehilborn/displayplacer
Later I chained the displays differently and moved the adapters around so it stopped being an issue.
I wrote something remarkably similar a few years ago, for similar reasons. I was pretty baffled that nothing similar already existed. Auto-wake with the RTC timer was what I really wanted.
Link, in case you care: https://github.com/mrmekon/circadian
I have a "NAS", which is really an enormous desktop tower crammed full of hard drives. It auto-wakes once per day, pulls backups from my various servers all over the place, then returns to sleep.
I built something similar to this to turn on / off a windows gaming PC when I first made my switch to 100% full Linux on my main computer: https://github.com/gravypod/SteamStreamScripts
There's a huge amount of savings in energy to be had from automatically sleeping + WOLing PCs.
Related posts
- Circadian – Suspend-on-Idle Daemon for GNU/Linux Power Management
- Ubuntu 24.04 (and Debian) removed libsystemd from SSH server dependencies
- Systemd minimizing required dependencies for libsystemd
- Going in circles without a real-time clock
- Excellent succinct breakdown of the xz mess, from an OpenBSD developer