From f4227ee3bdedb48c0eb078cd2d2d22bc7fa0db67 Mon Sep 17 00:00:00 2001 From: alisceon Date: Fri, 30 Jan 2026 18:56:08 +0100 Subject: [PATCH 1/3] a ship of wol --- home/wm/sway.nix | 2 +- hosts/inuc/configuration.nix | 24 ++++++++++++++++++++++++ util/wol_man.py | 32 +++++++++++++++++++++++++++++--- 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/home/wm/sway.nix b/home/wm/sway.nix index 1f00fbe..571f81a 100644 --- a/home/wm/sway.nix +++ b/home/wm/sway.nix @@ -409,7 +409,7 @@ }; "bluetooth" = { format-connected = "| ᛒ"; - format-disconnected = "| ᚧ"; + format-on = "| ᚧ"; format-no-controllers = ""; interval = 15; on-click = "${uwsm} ${term} -e bluetui"; diff --git a/hosts/inuc/configuration.nix b/hosts/inuc/configuration.nix index 55f72b6..d2338e4 100644 --- a/hosts/inuc/configuration.nix +++ b/hosts/inuc/configuration.nix @@ -28,5 +28,29 @@ networking.firewall.allowedUDPPorts = [ 53 ]; + systemd = { + timers = { + "autowin" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "Wed *-*-21..28 02:00:00"; + Unit = "autowin.service"; + }; + }; + }; # end timers + + services = { + "autowin" = { + script = '' + ${pkgs.python3Packages.python}/bin/python /home/alisceon/.nixos_config/util/wol_man.py autowin + ''; + serviceConfig = { + Type = "oneshot"; + TimeoutStartSec = "3600"; + User = "alisceon"; + }; + }; # end "hello-world" + }; # end services + }; # end systemd } # end file diff --git a/util/wol_man.py b/util/wol_man.py index a4e9865..c324d22 100644 --- a/util/wol_man.py +++ b/util/wol_man.py @@ -12,7 +12,7 @@ TARGET_IP = socket.gethostbyname(TARGET_HOSTNAME) def remote_cmd(command): print(f"Executing: ssh alisceon@tower.home.the.malice.zone '{command}'") - response = subprocess.run(f"ssh tower '{command}'", shell=True, capture_output=True, text=True) + response = subprocess.run(f"ssh tower -o 'StrictHostKeyChecking no' '{command}'", shell=True, capture_output=True, text=True) return (response.returncode, response.stdout, response.stderr) def weboot(): @@ -123,6 +123,29 @@ def shutdown(): print("Failed to shut down target") return False +def winupdate() : + print("Starting Windows Update process") + if get_os() != "windows": + print("Target is not running Windows, cannot update") + return False + code, stdout, stderr = remote_cmd('powershell -Command "Start-Service wuauserv"') + if code != 0: + raise RuntimeError(f"Failed to start Windows Update service: {stderr}") + time.sleep(30) + code, stdout, stderr = remote_cmd('powershell -Command "UsoClient StartScan"') + if code != 0: + raise RuntimeError(f"Failed to start Windows Update scan: {stderr}") + time.sleep(300) + code, stdout, stderr = remote_cmd('powershell -Command "UsoClient StartDownload"') + if code != 0: + raise RuntimeError(f"Failed to start Windows Update download: {stderr}") + time.sleep(600) + code, stdout, stderr = remote_cmd('powershell -Command "UsoClient StartInstall"') + if code != 0: + raise RuntimeError(f"Failed to start Windows Update installation: {stderr}") + time.sleep(1800) + return True + def action_do(action): match action: case "get_os": @@ -154,6 +177,9 @@ def action_do(action): else: print("Failed to shutdown") case "winupdate": + if winupdate(): + print("Windows update commands sent successfully") + case "autowin": if get_os() != "offline": print("Target is in use, belaying update 1h") time.sleep(3600) @@ -163,7 +189,7 @@ def action_do(action): else: print("Failed to boot Windows for update") return - code, stdout, stderr = remote_cmd("powershell -Command \"& {Install-WindowsUpdate -AcceptAll -AutoReboot}\"") + winupdate() if code == 0: print("Windows update initiated successfully") else: @@ -180,7 +206,7 @@ def action_do(action): def main(): parser = argparse.ArgumentParser(description="WOL and reboot utility") - parser.add_argument("action", choices=["get_os", "boot_linux", "boot_windows", "swap_os", "reboot", "shutdown", "winupdate"], help="Action to perform") + parser.add_argument("action", choices=["get_os", "boot_linux", "boot_windows", "swap_os", "reboot", "shutdown", "winupdate", "autowin"], help="Action to perform") action_do(parser.parse_args().action) if __name__ == "__main__": From ab69e6fec0982b7188452717c7338d9fe6b69637 Mon Sep 17 00:00:00 2001 From: alisceon Date: Fri, 30 Jan 2026 19:20:12 +0100 Subject: [PATCH 2/3] need my pw auth --- hosts/common/server.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/hosts/common/server.nix b/hosts/common/server.nix index 3837a76..4731834 100644 --- a/hosts/common/server.nix +++ b/hosts/common/server.nix @@ -8,7 +8,6 @@ openssh = { enable = true; permitRootLogin = "no"; - passwordAuthentication = false; }; # end openssh }; # end services From 1821b84cae98044d0b27d1f111b150274b573ae0 Mon Sep 17 00:00:00 2001 From: alisceon Date: Fri, 30 Jan 2026 22:23:45 +0100 Subject: [PATCH 3/3] thats an order --- util/open_dailies.xsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/open_dailies.xsh b/util/open_dailies.xsh index d6699f2..1d0ae87 100644 --- a/util/open_dailies.xsh +++ b/util/open_dailies.xsh @@ -8,9 +8,8 @@ dailies = [ "https://www.flagle.io/", "https://flagsgame.net/", "https://flagpixel.com/", - "https://flagle-game.com/daily", - "https://flagdoku.com/", "https://geoworldle.com/flaggrid", + "https://flagdoku.com/", "https://games.oec.world/en/tradle/", "https://oec.world/en/games/connectrade/", "https://geoconnections.net/",