Skip to content

Instantly share code, notes, and snippets.

@kmplngj
kmplngj / geekmagic-smalltv-07c9f4.yaml
Last active December 11, 2025 12:12
GeekMagic Display Small TV ESPHome Config
# This ESPHome configuration file is for a GeekMagic Display device (esp01).
# It sets up the device to display pages of text and notifications,
# with customizable intervals and padding. The display is updated
# periodically and can show different pages based on Home Assistant sensors.
# # License & Terms
# **Free and Open Use** - This code may be freely used, modified, and distributed by anyone.
# **Copyleft Requirement** - Any derivative works, modifications, or forks must also be
# distributed freely under the same terms. You cannot restrict access to modified versions.
# **Attribution Note** - This code was primarily written with AI assistance.

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

@sorend
sorend / Update firwmware WD Black SN770 firmware on Arch Linux.md
Last active December 5, 2025 17:37
Update firmware WD Black SN770 firmware on Arch Linux

Update firmware WD Black SN770 firmware on Arch Linux

Been having problems with my new SN770 drive, and decided to check if I can firmware update it on Linux. WD only provides a Windows tool, Western Digital Dashboard to download and install firmwares, but, it's possible to find the firmware and install it using Linux tooling as well.

1. Check that nvme-cli is installed:

❱ sudo pacman -S nvme-cli
@peters
peters / Sony WH-1000XM4.md
Last active September 22, 2025 11:52
Connecting Sony WH-1000XM4 to Ubuntu 22.04 (Jammy)

Connecting Sony WH-1000XM4 to Ubuntu 22.04 (Jammy)

This guide will help you connect your Sony WH-1000XM4 headset to Ubuntu 22.04 using Bluetooth. Once connected, you'll be able to listen to music and use the microphone on apps like Microsoft Teams.

1. Connect to Bluetooth Headset

Steps:

  1. Open a terminal and launch bluetoothctl:
@jimboy-701
jimboy-701 / archlinuxzbm.md
Last active November 28, 2025 18:57
Arch Linux with ZFS root, zfs-dkms, ZFSBootMenu, and Secure Boot enabled

Install Arch Linux with ZFS root filesystem, zfs-dkms, ZFSBootMenu, Pacman Auto-snapshots, Secure Boot enabled

Configure system BIOS

Go into your BIOS settings and make Secure Boot is either turned off or set to Audit Mode.

Decide which install method \ Media to use

Method 1. Use a Script to add ZFS support after booting the vanilla Arch install media Builds the necessary zfs modules within the Arch install enviroment.

@gangefors
gangefors / Install FreeNAS SCALE on a partition and create a mirror.md
Last active December 10, 2025 13:01
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

@iacchus
iacchus / install_fonts.sh
Last active November 10, 2025 06:18
Install all Google Fonts on Linux (Debian/Ubuntu etc.)
#!/usr/bin/env sh
# Original author: Michalis Georgiou <mechmg93@gmail.comr>
# Modified by Andrew http://www.webupd8.org <andrew@webupd8.org>
# Current version by Kassius Iacchus https://github.com/iacchus/
# Depends on: `wget`
#
# Install `wget` on Debian/Ubuntu with:
# apt install wget
@j-keck
j-keck / nixos-as-bhyve-guest.md
Last active July 19, 2025 01:09
nixos as bhyve guest

create a vm

root@main:~ # vm create -t debian -s 100G nixos
root@main:~ # vm iso /stuff/downloads/nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso 
root@main:~ # vm -f install nixos nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso

boot the image

determine the 'init' executable path from '(cd0)/isolinux/isolinux.cfg'. look for a line which start's with: 'APPEND init=/nix/store/.....'

@dzamlo
dzamlo / 99-lifx-keyboard.rules
Created September 11, 2016 16:41
Quick and dirty way to use a cheap bluetooth selfie remote on a linux server (like a raspberry pi) to control lifx lights
ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="AB Shutter3 ", TAG+="systemd", PROGRAM="/bin/systemd-escape -p --template=lifx-remote@.service $env{DEVNAME}", ENV{SYSTEMD_WANTS}+="%c"
@austinmarton
austinmarton / recvRawEth.c
Created June 3, 2012 07:55
Receive raw Ethernet frames in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <linux/ip.h>