4 ms·
If you don't want to run your machine 24/7 (whether for electrical consumption, environmental, noise, etc reasons), I wrote an ssh proxy [1] that will send WOL
by purrcat259 9mo ago
If you don't want to run your machine 24/7 (whether for electrical consumption, environmental, noise, etc reasons), I wrote an ssh proxy [1] that will send WOL packets to a target machine and hold your connection until its alive.
I then configured debian-autoshutdown [2] to turn the machine off if there's no traffic on ssh after 15 minutes.
This way I just ssh into my machine (whether via antigravity on my laptop or termius on my phone) and within 30 or so seconds its awake, no physical button presses needed. I documented the whole flow in more detail on my blog [3].
I'm now working on an improvement called machine on proxy (or mop) that will allow me to start Proxmox VMs instead of physical machines, so I can let gemini-cli run wild and if it decides to wipe the entire hard drive I can restore from a snapshot.
[1] https://github.com/simonamdev/ssh-wol-proxy https://github.com/simonamdev/ssh-wol-proxy
[2] https://github.com/mnul/debian-autoshutdown https://github.com/mnul/debian-autoshutdown
[3] https://www.simonam.dev/ssh-wol-proxy/ https://www.simonam.dev/ssh-wol-proxy/
- LeonM 9mo agoI do the same. I can SSH into my router at home (which is on 24/7), then issue a WOL request to my dev machine to turn it on. You don't even have to fully shut down you dev machine, you can allow it to go into stand-by. For that it needs to be wired by cable to LAN, and configured to leave the NIC powered on on stand-by. You can then wake up the device remotely via a WOL magic packet. Maybe this is possible with WLAN too, but I have never tried. Also, you don't need a Tailscale or other VPN account. You can just use SSH + tunneling, or enable a VPN on your router (and usually enjoy hardware acceleration too!). I happen to have a static IP at home, but you can use a dynamic DNS client on your router to achieve the same effect.
- exographicskip 9mo agoI run a lot of small form factor (SFF) machines including NUCs, Minisforums, and a Mac Studio. At idle, they aren't loud or consuming much electricity compared to sleep/shutdown. Fruit co devices in particular are extremely efficient; the Studio is rated at 6W idle, 145W max consumption (cf. https://support.apple.com/en-us/102027 https://support.apple.com/en-us/102027 )
- fittingopposite 9mo agoCan you do the same to remotely wake up my MacBook on demand via WoL and ssh into it from my phone? What are the security risks?
- purrcat259 9mo agoI don't think WOL works over Wi-Fi and whether you can get WOL from a USB ethernet adapter. My proxy doesn't attempt to handle security. Most folks use either Tailscale or some other VPN solution. In my case I use the wireguard server in my router to VPN into home which gives me access to the proxy and consequently to the machine.