Skip to content

Instantly share code, notes, and snippets.

@arrjay
arrjay / config.txt
Created March 14, 2025 14:44
rpi boot logging for new firmware
enable_uart=1
dtoverlay=vc4-kms-v3d
gpu_mem=32
uart_2ndstage=1
[pi1]
kernel kernel.img
initramfs initramfs followkernel
[pi2]
kernel kernel7.img
initramfs initramfs7 followkernel
@arrjay
arrjay / console.out
Created September 25, 2024 00:51
booting with the zfs-key-in-luks and clevis pins - LOOK MA NO HANDS
Booting a command list
Loading Linux 6.1.0-25-amd64 ...
Loading initial ramdisk ...
Please enter passphrase for disk luks-5ae80134-9b2a-4c82-9953-3b400c023a8f: (press TAB for no echo)
[ 19.073974] platform regulatory.0: firmware: failed to load regulatory.db (-2)
[ 19.075258] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
[ 19.076895] platform regulatory.0: firmware: failed to load regulatory.db (-2)
Debian GNU/Linux 12 hotblack ttyS0
@arrjay
arrjay / module-setup.sh
Created September 24, 2024 17:08
dracut module to load ZFS keys from a LUKS volume (specified via a ZFS property)
#!/usr/bin/env bash
# internal to get if the zfs root has a luks property
get_zfs_luksholder () {
# we need to find the zfs dataset for root (if any)
# this is somewhat duplicated from zfsexpandknowledge, but we want
# abstract datasets, not devices.
local mp
local fstype
local _
@arrjay
arrjay / gist:c4ca8da015a66fb077b5725fe206a650
Last active August 27, 2024 22:08
let's boot random NVME drives!
$ sudo efibootmgr -v
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0000,0002,0003
Boot0000* Fedora HD(1,GPT,c978e4f4-827a-48e4-9331-bb9cd58c9862,0x800,0x12c000)/File(\EFI\FEDORA\SHIMX64.EFI)
Boot0002* UEFI: ZMVE Ext Hard Disk, Partition 1 PciRoot(0x0)/Pci(0x8,0x1)/Pci(0x0,0x3)/USB(1,0)/Unit(1)/HD(1,MBR,0x1b04edba,0x800,0xee7b000)..BO
Boot0003* UEFI: ZMVE Virtual CDRom 1.00 PciRoot(0x0)/Pci(0x8,0x1)/Pci(0x0,0x3)/USB(1,0)/CDROM(1,0x2b,0x4f3c)..BO
Boot0004* Fedora HD(1,GPT,c978e4f4-827a-48e4-9331-bb9cd58c9862,0x800,0x12c000)/File(\EFI\FEDORA\SHIM.EFI)..BO
$ lspci -tv
@arrjay
arrjay / module-setup.sh
Created August 22, 2024 05:16
dracut module to rewrite a partition table pre-mount
#!/usr/bin/bash
# called by dracut
check() {
require_binaries awk gdisk lsblk mknod parted partx sgdisk sfdisk || return 1
return 0
}
# called by dracut
depends() {
@arrjay
arrjay / fs-layout.sh
Created August 10, 2024 19:19
latest fs-layout from fossil
#!/usr/bin/env bash
# Created by argbash-init v2.10.0
# ARG_OPTIONAL_SINGLE([targetpath],[T],[mounted target system path],[/mnt/sysimage])
# ARG_OPTIONAL_SINGLE([lukspass],[p],[password for LUKS unlock])
# ARG_OPTIONAL_SINGLE([minsize],[m],[minimum size in bytes to consider disk for usage],[6442450944])
# ARG_OPTIONAL_BOOLEAN([data-partition],[S],[create slices for data volumes],[off])
# ARG_OPTIONAL_BOOLEAN([noop],[W],[actually run partitioning commands],[on])
# ARG_OPTIONAL_BOOLEAN([force-hfs-efi],[H],[force creating EFI partition as HFS filesystem],[off])
# ARG_OPTIONAL_BOOLEAN([stack-integrity-volumes],[I],[create integrity volumes in storage stack (SLOW)],[off])
#!/usr/bin/env bash
# trivially sync git + submodules
submodule="${1}"
check_sneaky_paths "${submodule}"
# jump into password store dir now and commit (or not)
cd "${PREFIX}" || exit 1
git commit -am "gitsync $(date +%s)"
@arrjay
arrjay / gpg.bash
Created November 22, 2023 16:43
pass extension for gpg shenanigans
#!/bin/bash
# Created by argbash-init v2.10.0
# Rearrange the order of options below according to what you would like to see in the help message.
# ARG_OPTIONAL_SINGLE([id],[u],[gpg/pass id to use],[])
# ARG_OPTIONAL_SINGLE([name],[N],[gpg identity name for creation],[])
# ARG_OPTIONAL_SINGLE([email],[E],[gpg identity email for creation],[])
# ARG_OPTIONAL_SINGLE([ciphertype],[C],[gpg key cipher type (ecc/rsa)],[ecc])
# ARG_OPTIONAL_SINGLE([passlength],[L],[password length for generated passphrase],[32])
# ARG_OPTIONAL_BOOLEAN([nosym],[X],[exclude symbols in generated password],[off])
# this file goes in $HOME/.config/systemd/user
[Unit]
Description=beepy backlight controller
[Service]
Type=simple
# adjust this path to where you wrote the script out
ExecStart=/home/rj/bin/noarch/beepy-bl.sh
Restart=on-failure
@arrjay
arrjay / pull_zyx_poe.expect
Created July 24, 2023 02:58
expect script to munge Zyxel poe status from telnet into a json blob
#!/usr/bin/env expect
#exp_internal 1
#log_user 1
# hi! we're hand-crafting JSON, fuckit
puts "{"
log_user 0
set timeout 5
set host [lindex $argv 0]