My Laptop Sleeps, but My Code Never Does: A Remote Shell and IRC Bouncer Setup
I used to wake up to broken pipelines because my laptop was asleep overnight. My cron jobs, log watchers, and one-off test scripts all lived on the machine under my desk. When it slept, they did too. That reactive rhythm ended when I moved everything to a persistent remote shell and wired it up to an IRC bouncer. Now my code watches itself and taps me on the shoulder via IRC, whether I'm at my keyboard or not.
The Fragile Local Automation Trap
Local cron is unreliable. A 3 AM nightly backup script will never fire if your laptop lid is closed. Even on a desktop, a power outage or OS update can silently kill your watchers. You end up checking dashboards in the morning like your grandparents checked the milkbox, hoping nothing burned down overnight. The fix is simple: offload the nerve center to a machine that never sleeps.
The Shell That Never Sleeps
Grab the smallest Linux VPS you can find, or a managed shell host. I use a $5 shell from xShellz for most of this, but any box with a public IP will do. The only hard requirement is that it stays powered on and connected. Once you have it, set up passwordless SSH keys and maybe a tmux session to resume work, but that's optional. The important thing: this machine runs your automation while your laptop recharges in your bag.
IRC Bouncer: Never Miss a Message
An IRC bouncer like ZNC acts as a persistent IRC client. It stays connected to your channels even when your local client disconnects, buffers all messages, and replays them when you reconnect. More useful for automation: ZNC usually listens on a local port (6667) where other processes on the same box can send messages directly.
Install ZNC, create a user, connect it to a network like Libera.Chat, and join a private channel (e.g., #ops). Now any script on that host can reach you, even if your phone is off.
echo "PRIVMSG #ops :Tests failed on staging at $(date)" | nc localhost 6667
That single line, dropped into a shell watcher, replaces a dozen dashboard refreshes. The bouncer logs everything, so when you connect from your phone hours later you see the full timeline.
Writing the Watchdogs
Start with simple shell scripts that grep logs for trouble and ping IRC.
#!/bin/bash
# tests-watchdog.sh
if ! /home/user/project/run_tests.sh; then
echo "PRIVMSG #alerts :Tests failed on $(hostname) at $(date)" | nc localhost 6667
fi
Run that from cron every 10 minutes. It's brain dead, but it flips the model: you stop polling for failures and start getting nudged. For live log monitoring, use tail -F and a small Python daemon that waits for a regex match, then fires off an IRC note. You can even chain inotifywait to trigger actions when a file changes. The remote shell never goes to sleep, so these watchers are genuinely always on.
If you're feeling ambitious, hook in an AI agent. xShellz offers borg, a terminal agent that runs in the same environment. You can give it a prompt like "watch the error log, summarise the last 5 lines if anything goes critical, and report in #alerts". But a simple grep and netcat already get you 90% of the way without any AI.
The Workflow, Summarised
- A remote Linux shell running cron (or systemd timers) plus ZNC.
- A handful of shell scripts that send IRC messages when something breaks.
- An IRC client on your phone (I use Revolution IRC on Android) configured to connect to the bouncer.
When a staging test fails at 4 AM, my phone buzzes. I can sleep, tap the notification in the morning, and scroll back through the buffered messages to see exactly what happened. My laptop was dead to the world, but my code never stopped watching.
What You Trade for Freedom
You're adding a new point of failure. The remote host could go down, though a $5 VPS with good uptime history rarely does. You must lock down SSH keys and avoid storing secrets in plaintext scripts. If you're sending alerts over IRC, consider a self-hosted ZNC instance so messages never leave your box until you connect over TLS. Still, for many side projects and internal tools the trade-off is worth it.
Moving automation off my laptop was the single biggest efficiency gain I've made. I'm not tied to my machine anymore. If you want a remote shell that bundles an IRC bouncer as a managed add-on, xShellz has that. But the recipe works on any Linux box. The real change is in the mindset: stop babysitting your code and let it tap you when it needs you.