Skip to content

Instantly share code, notes, and snippets.

View linux4life798's full-sized avatar

Craig Hesling linux4life798

View GitHub Profile
@linux4life798
linux4life798 / portainer.md
Last active February 2, 2026 18:51
Setup Portainer on Debian with Tailscale
@linux4life798
linux4life798 / qemu-guest-debian.md
Last active July 15, 2024 03:18
Setup Debian as QEMU/KVM/libvirt guest

Channel: unix + org.qemu.guest_agent.0

It doesn't need to be the QEMU agent type. Both the unix and QEMU vdagent channels have "clipboard" support, but neither seem to work. Clipboard support of the spicevmc does seem to work.

You need the following package to enable this channel, but it is usually automatically installed during debian installer:

sudo apt install qemu-guest-agent

Setup

Very unfortunatley, there is not a reasonable way to get Debian's default initramfs-tools to unlock LUKS volumes using tokens, like FIDO2 or TPM2. The best attempt to make this work using initramfs-tools is https://github.com/bertogg/fido2luks.

The most common way to handle unlocking these LUKS volumes is to use dracut to generate an initram filesystems. I'm not saying that dracut is great, but it will allow you to easily use systemd-cryptenroll tokenized luks unlock methods.

Setup dracut on Debian

@linux4life798
linux4life798 / pstore.md
Last active May 28, 2024 06:53
Info about enabling kernel log dump to pstore

On Debian the /usr/lib/tmpfiles.d/systemd-pstore.conf file can modified to enable pstore log saving on panic and shutdown.

w- /sys/module/printk/parameters/always_kmsg_dump - - - - Y
w- /sys/module/kernel/parameters/crash_kexec_post_notifiers - - - - Y

The systemd-pstore service is already configured to read from /sys/fs/pstore on the next boot and add these log fragment to the journal log and directly copy to /var/lib/systemd/pstore/.

@linux4life798
linux4life798 / btrfs.md
Last active November 19, 2025 23:58
Resources for BTRFS Setup and Management
@linux4life798
linux4life798 / date-format-for-file-name.bash
Last active May 27, 2024 00:01
Print a file path worthy timestamp
# Date formatting for file name purposes.
# You can lock in one timezone by setting the TZ environment variable.
# 2024-05-26_04:55:50PM_PDT
TZ='America/Los_Angeles' date "+%Y-%m-%d_%I:%M:%S%p_%Z"
# 2024-05-26_07:59:06PM_EDT
TZ='America/New_York' date "+%Y-%m-%d_%I:%M:%S%p_%Z"
@linux4life798
linux4life798 / 0-io-block-size-tuning-and-benchmarking.md
Last active October 28, 2024 04:14
I/O Benchmarking and NVME/Encryption/FS Tuning

Here is the cheatsheet for block size tuning of NVME drives, LUKS encryption, filesystem, and partitions.

@linux4life798
linux4life798 / golang_debian_control
Last active May 5, 2024 03:59
Build simple Golang binary package without packaging all dependencies
# You need the following entry in the control file:
XS-Go-Import-Path: github.com/linux4life798/cmpconflash

Manually Fix WIFI 6E Issue

sudo dpkg-divert --rename --add /usr/lib/firmware/mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin
sudo dpkg-divert --rename --add /usr/lib/firmware/mediatek/WIFI_RAM_CODE_MT7922_1.bin
dpkg-divert --list
#pushd ~/src/linux-firmware/mediatek
@linux4life798
linux4life798 / sed-nvme-cli-test.md
Last active October 28, 2024 06:17
Demonstate how the sedutil-cli command works and how that works with a SED SSD.

Functions

ssd_show_data() {
	local location="${1:-0}" # In bytes

	sudo dd if=/dev/nvme0n1 bs=1 count=9000 skip="${location}" status=none | hd
}

# ssd_write_data <data_message> [location]