Skip to content

Instantly share code, notes, and snippets.

View asteven's full-sized avatar

Steven Armstrong asteven

  • Zürich, Switzerland
View GitHub Profile
@asteven
asteven / retry-systemd-unit
Last active September 20, 2025 13:43
Retry systemd units (e.g. targets) until they are active.
#!/bin/sh
#
# Tries to restart the given systemd UNIT until it is active.
#
unit="$1"
#set -x
# Prevent output as it clutters up journal/syslog.
@asteven
asteven / network-wait-usable.service
Last active September 20, 2025 23:18
Script and systemd unit that delays the activation of the network-online.target until the network is not only up but also usable.
[Unit]
Description=Wait for the network to be usable
Documentation=man:ifup(8)
DefaultDependencies=no
Conflicts=shutdown.target
After=network.target
Before=network-online.target
[Service]
Type=oneshot
@asteven
asteven / README
Created November 1, 2018 12:49
Python logging server and client
% ./server.py &
% ./client.py
% ./cli.py info my favorite message of the day
% ./cli.py error nope, that did not work