This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Docker Image Prune | |
After=docker.socket | |
Requires=docker.socket | |
[Service] | |
Type=oneshot | |
ExecStart=docker image prune --all --force --filter "until=24h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import requests | |
import sys | |
from datetime import datetime | |
import time | |
import random | |
import signal | |
# arbitrarily chosen prime numbers | |
SLEEP_MIN = 127 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Redis = require('redis') | |
import fs = require('node:fs') | |
const config = JSON.parse(fs.readFileSync('config.json', 'utf8')) | |
const redisConfig = config.redisConfig | |
const redisClient = Redis.createClient({ | |
url: `rediss://${redisConfig.USERNAME}:${redisConfig.PASSWORD}@${redisConfig.HOST}:${redisConfig.PORT}`, | |
socket: { | |
tls: true, | |
servername: redisConfig.HOST, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=ZFS Encryption Keys | |
DefaultDependencies=no | |
After=zfs-import.target | |
After=zfs-import-cache.service | |
After=systemd-modules-load.service | |
Before=zfs-mount.service | |
[Service] | |
Type=oneshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
test $UID -ne 0 && echo Must be root. && exit 2 | |
test -z "$2" && printf "\nSyntax: $0 DRIVE EFI_FILE\n\n" && exit 2 | |
DRIVE="$1" | |
EFI_FILE="$2" | |
# ensure DRIVE is block device |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[email protected] | |
md5=$(printf $EMAIL | md5sum | tr -cd '0-9a-f') | |
echo "https://www.gravatar.com/avatar/$md5?s=200&forcedefault=y&d=robohash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# wipe first and last 10MiB | |
SECTORS_WIPE=20480 | |
# ensure $1 is block device | |
test -b $1 | |
# get number of 512-byte sectors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
HOST=$1 | |
test "$UID" -ne "0" && echo "Must be root." >&2 && exit 2 | |
test -z "$HOST" && echo -e "\n\tUSAGE: $0 HOST\n" >&2 && exit 2 | |
echo HOST: $HOST | |
echo Generating SSL certificate... | |
docker run -it --rm --name certbot -v "$HOME/workspace/letsencrypt/etc:/etc/letsencrypt" -v "$HOME/workspace/letsencrypt/var:/var/lib/letsencrypt" certbot/dns-cloudflare certonly --agree-tos -d $HOST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wg genkey > wgkey | |
chmod 400 wgkey | |
wg pubkey < wgkey | |
sudo ip link add wg0 type wireguard | |
sudo ip addr add dev wg0 172.16.1.1/24 | |
sudo wg set wg0 private-key wgkey | |
sudo ip link set wg0 up | |
sudo wg set wg0 listen-port PORT | |
sudo wg set wg0 peer PUBKEY allowed-ips 172.16.1.1/24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=preseed file generator | |
Documentation=https://www.npmjs.com/package/preseed | |
Requires=network.target | |
After=network.target | |
AssertFileNotEmpty=/etc/preseed/config.json | |
[Service] | |
User=daemon |
NewerOlder