Skip to content

Instantly share code, notes, and snippets.

View evindunn's full-sized avatar

Evin Dunn evindunn

  • Zoom Video Communications
  • Colorado
View GitHub Profile
@evindunn
evindunn / subnet_ip_owners.py
Created September 24, 2026 16:10
verify ownership of every ip contained by a list of subnets
#!/usr/bin/env python3
"""Write RDAP-reported owners for every address in CIDRs as CSV.
The input file contains one CIDR per line. Blank lines and lines beginning with
``#`` are ignored. The script deliberately includes network and broadcast
addresses because they are addresses contained by the requested network.
poetry run python subnet_ip_owners.py < subnets.txt | tee owners.csv
"""
@evindunn
evindunn / docker-system-prune.service
Created August 23, 2026 06:36
docker-system-prune-syd-timer
[Unit]
Description=Prune unused Docker data
[Service]
Type=oneshot
ExecStart=/usr/bin/docker system prune -f
@evindunn
evindunn / .gitconfig
Created May 5, 2026 02:26
my gitconfig
[user]
name = Evin Dunn
[alias]
open = "!f() { url=$(git config --get remote.origin.url); case \"$url\" in git@*) url=$(echo \"$url\" | sed -E \"s#^git@([^:]+):(.+)#https://\\1/\\2#\");; esac; url=$(echo \"$url\" | sed -E \"s#\\.git$##\"); /usr/bin/open \"$url\"; }; f"
@evindunn
evindunn / get_firewalld_state.py
Last active December 20, 2023 19:41
Poll Firewalld State as JSON
#!/usr/bin/env python3
import dbus
import json
FIREWALLD_BUS = "org.fedoraproject.FirewallD1"
FIREWALLD_RUNTIME_OBJ = "/org/fedoraproject/FirewallD1"
FIREWALLD_CONFIG_OBJ = "/org/fedoraproject/FirewallD1/config"
@evindunn
evindunn / crypto_worker.py
Last active June 27, 2022 23:29
Async argon2-ffi
from asyncio import wrap_future, get_running_loop
from concurrent.futures import ProcessPoolExecutor
from multiprocessing import cpu_count, Lock
from atexit import register as atexit_register
from argon2 import PasswordHasher
from argon2.exceptions import VerifyMismatchError
from os import getpid
@evindunn
evindunn / gcp_firewalld_ipset.py
Created May 26, 2022 17:16
Generates a firewalld ipset from the current list of GCP IPs
#!/usr/bin/env python3
import xml.etree.ElementTree as ET
from urllib.request import urlopen
from json import loads as json_loads
from xml.dom import minidom
def main():
@evindunn
evindunn / clock.py
Last active May 12, 2022 06:50
RPLCD World Clock
#!/usr/bin/env python3
from RPLCD.i2c import CharLCD
from pytz import timezone, utc
from datetime import datetime
from time import sleep, time as get_ts
from concurrent.futures import ThreadPoolExecutor
I2C_EXPANDER = "PCF8574"
#!/bin/bash
if [ $# -lt 1 ]; then
echo Provide a date to convert
exit 1
fi
# Provide 'Fri 18 Feb 2022 05:30:00 PM PST'
DATE=$1
@evindunn
evindunn / cockroach.docker-compose.yml
Last active December 6, 2021 20:18
CockroachDB cluster in docker-compose
# See https://www.cockroachlabs.com/docs/v21.2/start-a-local-cluster-in-docker-mac.html
version: "3.9"
services:
roach1:
image: "cockroachdb/cockroach:v21.2.2"
container_name: taxonTree-roach1
hostname: roach1
networks: [ roachnet ]
volumes: [ "roach1-data:/cockroach/cockroach-data" ]
command:
@evindunn
evindunn / temp_server.py
Last active September 28, 2021 20:38
DHT11 Temperature Sensor as HTTP Service
#!/usr/bin/env python3
from argparse import ArgumentParser
from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler
from json import dumps as json_dumps
from threading import Thread, RLock
from time import sleep
import Adafruit_DHT