Skip to content

Instantly share code, notes, and snippets.

@polymorphm
polymorphm / kernel-flash
Last active November 22, 2019 19:50
running kernel from a flash; and verifying that boot files are still okay
#!/usr/bin/bash
kernel_flash_name='plm-notebook'
boot_path='/boot'
kernel_vmlinuz_file='vmlinuz-linux'
kernel_img_files=('intel-ucode.img' 'amd-ucode.img' 'initramfs-linux.img')
kernel_cmdline="\\kernels\\$kernel_flash_name\\$kernel_vmlinuz_file.efi initrd=\\kernels\\$kernel_flash_name\\intel-ucode.img initrd=\\kernels\\$kernel_flash_name\\amd-ucode.img initrd=\\kernels\\$kernel_flash_name\\initramfs-linux.img root=UUID=6581314d-6709-416e-9c61-166211b7163e rw rootflags=subvol=arch1-root rd.luks.name=e85a4aea-f191-431c-b6f8-93ba70d95d73=root loglevel=3 quiet"
flash_path='/dev/disk/by-id/usb-SanDisk__Cruzer_Fit_4C530000240815113164-0:0'
flash_part_path="$flash_path-part1"
run_path="/run/$kernel_flash_name.kernel-flash"
@polymorphm
polymorphm / br-lan-init.service
Last active May 20, 2022 09:02
/etc/nftables.conf , /etc/systemd/system/br-lan-init.service , /etc/br-lan-init.sh , /etc/openvpn/client/unloved-public-inet-hook.sh , /etc/wireguard/mullvad-se14.conf , /etc/wireguard/wg-vpn-hook.sh , /etc/systemd/networkd.conf
[Unit]
Description=br-lan init script
After=network.target
Before=network-online.target
[Service]
Type=oneshot
ExecStart=/etc/br-lan-init.sh start
ExecStop=/etc/br-lan-init.sh stop
RemainAfterExit=yes
@polymorphm
polymorphm / install-vmlinuz-linux.sh
Last active August 16, 2020 17:56
/etc/install-vmlinuz-linux.sh: coping/generation vmlinuz and initramfs
#!/bin/bash
set -e
boot_vmlinuz_path='/boot/vmlinuz-linux'
boot_initramfs_path='/boot/initramfs-linux.img'
new_boot_vmlinuz_path="$boot_vmlinuz_path.new"
new_boot_initramfs_path="$boot_initramfs_path.new"
bak_boot_vmlinuz_path="$boot_vmlinuz_path.bak"
bak_boot_initramfs_path="$boot_initramfs_path.bak"
@polymorphm
polymorphm / wg-internet.conf
Last active January 30, 2024 20:58
wg-quick to Global Internet usefull ip rules details
[Interface]
PrivateKey = ...
Address = ...
DNS = ...
FwMark = 2901
Table = 2901
PostUp = ip -4 rule add pri 2999 lookup default || true
PostUp = ip -4 rule add pri 2010 to 10.0.0.0/8 goto 2999 || true
PostUp = ip -4 rule add pri 2010 to 172.16.0.0/12 goto 2999 || true