I have a Linux box in the shed that I want to be able to log in to using SSH to run numerical calculations. But I don’t want it on all the time.
I want to be able to control it from my laptop. The idea is that we don’t want the fan and suchlike making noise in the house when the machine runs overnight, so it is in the shed, but I also don’t want it wasting electricity by running when not needed. Now, suspending does not zero power use, but does cut it down a lot.
So, the simple plan is to install pm-utils on the box (Devuan) and use a wake-on-LAN (WOL) utility on the laptop. So let’s assume the box was put to sleep using the pm-suspend command.
The laptop runs Windows 10, and I use Cygwin on Windows.
I looked for but did not see anything in the Cygwin repository. Did not look all that hard…
Searched the web. Found a couple of options.
(1) A PowerShell module thingy
Ran PowerShell as admin.
PS>> Install-Module -Name WakeOnLan
On my old laptop, that takes a while! It installed but did not work — did not even run. I don’t mess around with PowerShell. It’s just not my thang. (Better things to do.) If does not work out of the box … into the bin!
PS>> Uninstall-Module -Name WakeOnLan
(2) Some old program
Found a utility described as ‘a bit old’. Sounds good to me: https://sites.google.com/site/sysutil/wakeup. I mean, who needs a GUI for this kind of thing!
Copied wakeup.exe into my bin dir — no need for admin, which is good — and ran it — note that 00:25:F3:C9:41:F8 is the MAC address of the Ethernet card on the server in the shed, and the BIOS is set to allow WOL. You can get the MAC address in many ways, but an easy one is to run ifconfig on the server (may need to be root):
c:\bin\> wakeup 00:25:F3:C9:98:F8
at the prompt and… bingo. I could then SSH into the box and do my wacky bit of science.
To make it simpler to use wakeup.exe from within a Cygwin session, I just created a little script in the Cygwin bin directory, one that included the MAC address of the machine in question:
$ echo "/cygdrive/c/bin/wakeup.exe 0025f3c998f8" >> ~/bin/wakeshed $ chmod +x ~/bin/wakeshed
Done!
Thanks to the mysterious https://sites.google.com/site/sysutil