Skip to content

Instantly share code, notes, and snippets.

View vectorsigma's full-sized avatar

Vector Sigma vectorsigma

View GitHub Profile
@vectorsigma
vectorsigma / pem-to-jwk.py
Last active December 27, 2023 23:22
convert a PEM formatted private key to a JWKS formatted private key
#!/usr/bin/env python3
#
# import a PEM formatted private key made by some legacy build of certbot a few months earlier in 2023
# and output a JWKS version of the same key since that format changed on disk and I didn't know it.
# Also, I used chat-gpt-4 to help me write this, because finding out which crypto libraries
# were the right ones to use was a nightmare. It worked, well, and fast, and that should scare the
# shit out of anyone trying to get into the world of programming at this moment in time.
from cryptography.hazmat.primitives import serialization # Deal with X509/PEM formatted ecdsa keys
from jwcrypto import jwk # work with JWK's, `sudo dnf -y install python3-jwcrypto`
@vectorsigma
vectorsigma / backup-disc.sh
Created March 9, 2023 23:25
quick script to assist batch optical media copying
#!/bin/bash
#
# small script to help automate backup and recovery of my box o dvd backups.
# Config parameters
BACKUP_DIR="/mnt/nas/optical/backup"
DISC_MP="/mnt/cdrom"
BACKUP_VOL="$(lsblk --output LABEL /dev/sr0 | tail -1)"
ERROR_LOG="${BACKUP_DIR}/backup-${BACKUP_VOL}-log-$(date +%Y%m%d).txt"
BACKUP_DEST="${BACKUP_DIR}/${BACKUP_VOL}"
@vectorsigma
vectorsigma / upgrading-mbox2-firmware.md
Created April 25, 2020 22:29
How to upgrade the firmware of an old MBox 2 so it will work in Linux

Upgrading Avid (Nee digidesign) MBox2 Firmware

The back story

Found a free mbox 2 on craigslist. Picked it up, thinking it would unlock protools LE at least right? And maybe work on linux? Right??

Yeah, no, on both counts. What follows is the herculean effort I went through to get the firmware up from V 124 to V 138 (so at least the Linux sound driver would work).