Skip to content

Instantly share code, notes, and snippets.

@zajdee
zajdee / 90_efi_fix
Created September 17, 2024 11:41
Fix for the grub/uefi/dual-efi-partition issue. Runs on every `update-grub` or `grub-mkconfig`, but not on `grub-install`.
#!/bin/bash
#
# Save the file as /etc/grub.d/90_efi_fix
#
# if recreating the boot partitions, do not forget to update partition IDs in /etc/fstab
# use the following to find out the UUIDs
# lsblk -o UUID -nr /dev/sda1
# lsblk -o UUID -nr /dev/sdb1
# also add ",nofail" to the fstab entry options, in case the drive dies, so that you are not stuck during boot
#
# /etc/udev/rules.d/10-usbports.rules
ACTION=="add", ATTRS{interface}=="eBus Coupler 12001", SYMLINK+="ttyeBus"
# /etc/default/ebusd
PARAMETERS='-d /dev/ttyeBus --latency=0 -c /etc/ebusd/ --log="all info" --mqtthost=127.0.0.1 --mqttport=1883 --mqttuser=(...) --mqttpass=(...) --mqttlog --scanconfig --configlang=en --accesslevel="*"'
# diff -u ebusd-2.1.x/en/vaillant/hcmode.inc /etc/ebusd/vaillant/hcmode.inc
--- ./ebusd-configuration/ebusd-2.1.x/en/vaillant/hcmode.inc 2023-10-23 10:03:16.245419205 +0000
+++ /etc/ebusd/vaillant/hcmode.inc 2023-11-12 11:03:08.281734797 +0000
@@ -8,6 +8,7 @@
@zajdee
zajdee / 10-bridges.link
Created December 3, 2024 08:56
If your Linux bridges created by systemd/netplan are stuck in "NO-CARRIER" mode, you need this
@zajdee
zajdee / dhcpd6.conf
Created December 3, 2024 11:06
ISC DHCPv6 config for the network boot, including support for a DHCPv6 relay request logging
# BEGIN DHCP Header
# ----------
# dhcpd6.conf
# ----------
default-lease-time 2592000;
preferred-lifetime 604800;
option dhcp-renewal-time 3600;
option dhcp-rebinding-time 7200;
allow leasequery;
# ----------
@zajdee
zajdee / fix-grub-efi-mdraid.sh
Created January 17, 2025 09:37
A dumb script to fix Grub when /boot/efi is on mdraid (RAID1)
#!/usr/bin/env bash
# This script is for Debian/Ubuntu Linux (tested on Ubuntu 22.04)
# This script fixes a case of /boot/efi being installed on a mdraid (RAID1) device
# That's not a supported configuration as of Grub on Ubuntu 22.04
# You have to stop and remove the mdraid, reinitialize the FAT volumes, remount /boot/efi,
# then configure grub to use both devices (using debconf-set-selections),
# and finally run grub reconfiguration (in this case noninteractively), which will install
# grub (both EFI partitions of the former RAID1) to EFI nvram