Skip to content

Instantly share code, notes, and snippets.

View AfroThundr3007730's full-sized avatar
πŸ”§
Hacking all the things...

Eddie Carswell AfroThundr3007730

πŸ”§
Hacking all the things...
View GitHub Profile
@AfroThundr3007730
AfroThundr3007730 / zfs-module-build.service
Last active February 19, 2026 23:21
Build binary zfs-module packages for all kernel packages
[Unit]
Description=Build binary ZFS module packages and publish repo
RequiresMountsFor=/mnt/pool0/data/app /mnt/pool0/mirror/repo
[Service]
Type=simple
Restart=no
ExecStart=/mnt/pool0/data/app/repo/debian-zfs/bin/zfs-module-build -y
EnvironmentFile=-/mnt/pool0/data/app/repo/debian-zfs/etc/environment
EnvironmentFile=-%h/.config/systemd/user/zfs-module-build.env
@AfroThundr3007730
AfroThundr3007730 / create-pki-certs.sh
Last active January 13, 2026 15:19
Generating x509 PKI certs inline
#!/bin/bash
config='
[ca_cert]
basicConstraints=critical,CA:true,pathlen:1
authorityKeyIdentifier=keyid:always,issuer
subjectKeyIdentifier=hash
keyUsage=critical,keyCertSign,cRLSign
[sign_cert]
@AfroThundr3007730
AfroThundr3007730 / vod-splice.sh
Last active February 17, 2026 20:47
Splice VOD list via ffmpeg (in remote container)
#!/bin/bash
# Splice VOD list via ffmpeg (in remote container)
set -euo pipefail
shopt -s extdebug
export REMOTE=debsrv01.dm4productions.com
export VOD_DIR=/mnt/pool0/media/archive/twitch
export OHNO=twitch_disconnect_4s.m2t
@AfroThundr3007730
AfroThundr3007730 / fix_json_dates.py
Last active June 9, 2025 15:14
Fixup JSON dates exported by .NET JavaScriptSerializer
#!/usr/bin/env python3
# Updated 2025-06-02 by AfroThundr
'''
Fixup JSON dates exported by .NET JavaScriptSerializer
Example input file:
> $FormatEnumerationLimit = -1
> Get-ADUser -Filter * -Properties * |
@AfroThundr3007730
AfroThundr3007730 / zfs_autosnap.py
Last active January 8, 2026 16:57
Borg-like ZFS pool snapshot and retention with configurable policies
#!/usr/bin/env python3
# Borg-like ZFS pool snapshot and retention with configurable policies
# with inspiration from borgbackup: borg/src/borg/archiver/prune_cmd.py
# Version 0.2.7 modified 2026-01-07 by AfroThundr
# SPDX-License-Identifier: GPL-3.0-or-later
# For issues or updated versions of this script, browse to the following URL:
# https://gist.github.com/AfroThundr3007730/a4c58c13a97cb20a08720eed5d53d4c5
"""Borg-like ZFS pool snapshot and retention with configurable policies"""
@AfroThundr3007730
AfroThundr3007730 / 1-vscode-cleanup.sh
Last active May 15, 2025 19:36
vscode profile cleanup tasks
#!/bin/bash
set -euo pipefail
shopt -s extdebug
# Purge extensions cache
rm -fr /vscode{,/vscode-server}/extensionsCache/* \
~/.vscode-{server,remote}/extensionsCache/*
# Remove older extension versions
@AfroThundr3007730
AfroThundr3007730 / bookmarklets.js
Last active February 17, 2026 20:32
Browser bookmarklets
// switch to menlo proxy: πŸ”
javascript:(()=>window.location.replace('https://safe.menlosecurity.com/'+window.location))()
;
// switch to wayback machine: πŸ—ƒοΈ
javascript:(()=>window.location.replace('https://web.archive.org/'+window.location))()
;
// invert the current page: πŸŒ™
javascript:(()=>document.head.insertAdjacentHTML('beforeend','<style>html{filter:invert(1) hue-rotate(180deg)}img{filter:invert(1) hue-rotate(180deg)}</style>'))()
;
// invert the current pdf (pdfJS): πŸ“–
@AfroThundr3007730
AfroThundr3007730 / PS_AutomationNull.md
Last active June 29, 2024 21:59
Using PowerShell's AutomationNull to avoid automatic type conversion

PowerShell Type Conversion and AutomationNull

This all started because I wanted to use [System.IO.FileNotFoundException][1] in a function. Specifically, [this constructor][2], which allows you to set the error message and the file that caused the exception:

public FileNotFoundException (string? message, string? fileName);
@AfroThundr3007730
AfroThundr3007730 / Invoke-AutoCurl.ps1
Last active October 4, 2024 21:38
cURL wrapper to auto resume downloads
function Invoke-AutoCurl {
<# .SYNOPSIS
cURL wrapper to auto resume downloads #>
[Alias('autocurl')]
Param(
[Parameter(Mandatory)]
[Uri]$URL
)
do {
@AfroThundr3007730
AfroThundr3007730 / gpg-agent.ps1
Created April 24, 2024 21:16
powershell start background gpg-agent
[Diagnostics.Process]::Start(
[Diagnostics.ProcessStartInfo]@{
CreateNoWindow = $true
WindowStyle = 'Hidden'
FileName = 'gpg-agent.exe'
Arguments = '--daemon'
}
)