Skip to content

Instantly share code, notes, and snippets.

@aarmea
aarmea / goodbye-reddit.md
Last active September 11, 2023 11:03
How to migrate, not nuke, your Reddit content

I edited my Reddit comments using a version of Power Delete Suite that I modified to do the following:

  • Include a patch by james2432 on GitHub to add a 5 second delay between every write to avoid running into Reddit's (pre-7/1/23) API limits.
  • Backup comments and self-post text as base64 instead of raw text so that the formatting can be restored.
  • Include the URI-encoded permalink in the edited comment to allow deep links to the comment itself in the mirror. To use this, enable the "Edit comments / self posts" option and put %encoded_permalink% somewhere in your text.

My fork is available here. If you want to do this too, make sure to run this scrip

@aarmea
aarmea / luks_boot_server_local.sh
Created December 25, 2024 19:09
Script that connects to a server by MAC, rather than IP, address
#!/bin/bash
# Scans all available local networks for the host specified by `MAC_ADDRESS`
# then connects to it over SSH with the provided parameters.
# Useful for hosts whose root partitions are encrypted that also have Dropbear SSH
# set up in the bootloader as described at https://www.cyberciti.biz/security/how-to-unlock-luks-using-dropbear-ssh-keys-remotely-in-linux/
# Replace these values as appropriate
MAC_ADDRESS="01:23:45:67:89:ab" # Letters must be lowercase
SSH_PORT=1234
USER="root"
#!/usr/bin/env bash
set -euo pipefail
# usb-port-to-pci.sh
# Map a USB device/port to the backing PCI USB controller (BDF like 0000:03:00.0).
# Usage:
# ./usb-port-to-pci.sh --watch
# ./usb-port-to-pci.sh 1:3 # BUS:DEV from `lsusb`
# ./usb-port-to-pci.sh 046d:c332 # VID:PID from `lsusb`
# ./usb-port-to-pci.sh --bus 1 # show which PCI controller owns USB bus 1