Skip to content

Instantly share code, notes, and snippets.

View er0k's full-sized avatar
💃
put on your red shoes and dance the blues

er0k

💃
put on your red shoes and dance the blues
View GitHub Profile
@er0k
er0k / networkd-workarounds.md
Last active September 3, 2025 23:05
networkd issues/workarounds

The Problem

There is a longstanding systemd/networkd bug that causes our pet instances (AWS EC2 Ubuntu) to fall off the network, detailed in this gist.

To confirm if you are affected, look for messages like Could not set DHCPv4 address: Connection timed out in syslog by running grep 'Connection timed out' /var/log/syslog or zgrep 'Connection timed out' /var/log/syslog.*.gz on your pet.

If your pet is currently inaccessible, you'll need to restart it via the awscli by running:

aws --profile "$PROFILE" ec2 reboot-instances --instance-ids "$INSTANCE"
@er0k
er0k / pet
Last active September 30, 2025 16:54
pet helper
#!/bin/bash
# aws profile name for your pet
PROFILE="pet-role-yourname"
# aws instance ID
INSTANCE="i-00000abcd0000abcd"
case "$1" in
start|stop|reboot)
aws --profile "$PROFILE" ec2 "${1}"-instances --instance-ids "$INSTANCE"
#!/bin/bash
# https://wiki.debian.org/iPhone
# installs deps
# apt install libimobiledevice6 libimobiledevice-utils ifuse
# pair the phone. will prompt for passcode
idevicepair pair || exit 1
#!/usr/bin/env python
import time
def isAllowed(clientId, map) -> bool:
now = round(time.time())
if now in map:
map[now].append(clientId)
@er0k
er0k / lin.sh
Last active September 23, 2021 21:18
create a linode with keys
curlie \
-H "Authorization: Bearer $LINODE_TOKEN_RW" \
-X POST -d "$(jo \
image="linode/debian11" \
root_pass="$(pwgen 128 1)" \
authorized_keys="$(curl -s -H "Authorization: Bearer $LINODE_TOKEN_RW" 'https://api.linode.com/v4/profile/sshkeys' \
| jq -r '.data[].ssh_key' \
| jo -a)" \
booted=true \
label=zzz \