Compare commits
3 Commits
a9f86e7ced
...
4c119f0b80
Author | SHA1 | Date |
---|---|---|
Simon Bruder | 4c119f0b80 | |
Simon Bruder | 939df6ae2a | |
Simon Bruder | 8f1d0a149c |
|
@ -67,12 +67,7 @@ in
|
|||
id = host;
|
||||
address = hostAddresses;
|
||||
})
|
||||
addresses) ++ lib.optional isPrimaryHost {
|
||||
id = "inwx";
|
||||
# INWX only allows the specification of one primary DNS,
|
||||
# which limits the IP protocol usable for zone transfers to one.
|
||||
address = lib.singleton "185.181.104.96";
|
||||
};
|
||||
addresses);
|
||||
}
|
||||
(lib.mkIf isPrimaryHost {
|
||||
policy = lib.singleton {
|
||||
|
@ -90,7 +85,7 @@ in
|
|||
zonefile-load = "difference-no-serial";
|
||||
journal-content = "all";
|
||||
# secondary
|
||||
notify = [ "inwx" ] ++ secondaryHosts;
|
||||
notify = secondaryHosts;
|
||||
# dnssec
|
||||
dnssec-signing = true;
|
||||
dnssec-policy = "default";
|
||||
|
|
|
@ -8,7 +8,10 @@
|
|||
enable = config.sbruder.wireguard.home.enable;
|
||||
listenAddress = config.sbruder.wireguard.home.address;
|
||||
enabledCollectors = [ "systemd" ];
|
||||
disabledCollectors = [ "rapl" ];
|
||||
disabledCollectors = [
|
||||
"arp.netlink" # https://github.com/prometheus/node_exporter/issues/2849
|
||||
"rapl"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services.prometheus-node-exporter.after = [ "wireguard-wg-home.service" ];
|
||||
|
|
|
@ -61,15 +61,6 @@ def get_color_for_time(time: datetime.time, base=(60, 60, 60)) -> (int, int, int
|
|||
)
|
||||
|
||||
|
||||
def update(client: mqtt.Client):
|
||||
time = datetime.datetime.now().time()
|
||||
color = get_color_for_time(time)
|
||||
print(f"{time}: setting color to {color}")
|
||||
sys.stdout.flush()
|
||||
set_color(client, *color)
|
||||
pass
|
||||
|
||||
|
||||
client = mqtt.Client("wordclock.py")
|
||||
|
||||
user = os.environ["WORDCLOCK_MQTT_USER"]
|
||||
|
@ -83,6 +74,15 @@ host = os.environ["WORDCLOCK_MQTT_HOST"]
|
|||
client.username_pw_set(user, password)
|
||||
client.connect(host, 1883, 60)
|
||||
|
||||
color = (0, 0, 0)
|
||||
|
||||
while True:
|
||||
update(client)
|
||||
time = datetime.datetime.now().time()
|
||||
new_color = get_color_for_time(time)
|
||||
if new_color != color:
|
||||
color = new_color
|
||||
print(f"setting color to {color}")
|
||||
sys.stdout.flush()
|
||||
set_color(client, *color)
|
||||
|
||||
sleep(300)
|
||||
|
|
Loading…
Reference in New Issue