Skip to content

Instantly share code, notes, and snippets.

View linux4life798's full-sized avatar

Craig Hesling linux4life798

View GitHub Profile

Setup

# Show list of FIDO2 devices.
systemd-cryptsenroll --fido2-device=list

# Enroll one of the FIDO2 devices.
systemd-cryptsenroll --fido2-device=auto /dev/vda5

# Test FIDO2 unlock. Any of these should work, the --token-only will not provide
@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 May 28, 2024 06:31
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 May 27, 2024 07:20
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 / sedutil-experimentation.bash
Last active May 27, 2024 02:32
Demonstate how the sedutil-cli command works and how that works with a SED SSD.
ssd_show_data() {
sudo dd if=/dev/nvme0n1 bs=1 count=9000 status=none | hd
}
# ssd_write_data <data_message> [location]
#
# location is the offset in bytes.
ssd_write_data() {
local data="$1"
local location="${2:-0}" # In bytes
@linux4life798
linux4life798 / ddclient.conf
Last active December 9, 2023 04:15
Setup ddclient config for Google Nest router and Cloudflare using https://github.com/linuxserver/docker-ddclient
# This is an example ddclient configuration that uses fetch-nest-wan-ipv4.sh
# and Cloudflare.
# The fetch-nest-wan-ipv4.sh script must be in whatever working directory ddclient
# is run from, or change the below path to the command to be absolute.
######################################################################
##
## Define default global variables with lines like:
## var=value [, var=value]*
## These values will be used for each following host unless overridden
@linux4life798
linux4life798 / Dockerfile
Last active October 10, 2023 17:46
Docker setup local user/group
FROM debian:latest
ENV USER me
RUN useradd --create-home --user-group "${USER}"
# HOME will be set already within the container, after setting user, but we
# set it here to be usable from within this Dockerfile.
ENV HOME "/home/${USER}"
WORKDIR "${HOME}"
RUN pwd