Skip to content

Instantly share code, notes, and snippets.

View kiler129's full-sized avatar

Gregory House kiler129

  • noFlash
  • Chicago, IL (USA)
View GitHub Profile
@kiler129
kiler129 / zzz-update-backup-grub
Created June 28, 2026 21:08
Pleace in /etc/kernel/postinst.d/zzz-update-backup-grub; then chmod +x
#!/bin/sh
set -e
# This is a bit of a "hack" to update the UEFI default "BOOTAA64.EFI" boot file. Normally grub will
# only update it's own in "\EFI\debian\grubaa64.efi", but bootloaders can silently boot the default
# per-UEFI-standard "\EFI\BOOT\BOOTAA64.EFI". This usually will work OK... until it doesn't d/t it
# being too old/incompatible/etc.... and results in a spectacular CPU crash with a stack pointing
# to the EFI *firmware* itself crashing on a serial console like so:
#
# Welcome to GRUB!
@kiler129
kiler129 / Validate-Steam-Games.ps1
Last active April 17, 2026 12:32
Mass-validate all Steam games on Windows
########################################################################################################################
# Mass Steam Game Validator
#
# This script, meant to be used on Windows, validates whole Steam libraries. By default, Steam client can only do it
# one-by-one which is cumbersome in larger libraries. This tool uses the Valve's official steamCMD.
# The tool, by default, will attempt to validate all games in all libraries found, using the default account. Use -Help
# to see available options.
#
# To run this tool, save it as ".ps1" file, start Windows PowerShell/Windows Terminal, and type
# .\Validate-Steam-Games.ps1 in the console. You may need to enable PS scripts (https://superuser.com/a/106362) first.

PHP vs Alpine

TL;DR: Alpine is slow in memory-intensive workloads, like 2x slower...

Bookworm     Alpine   % difference
 1534.76    3449.95        -124.8%
 1724.67    3835.08        -122.4%
 1678.51    3493.07        -108.1%
 1668.49    3542.68        -112.3%
 1721.22    3260.29         -89.4%
@kiler129
kiler129 / pp-iptables.py
Last active May 26, 2025 00:47 — forked from intijk/pp-iptables.py
Pretty print iptables output. Align columns and strip out comments.
#!/usr/bin/python3
import re
import sys
import os
from tabulate import tabulate
strip_comments = os.getenv('IPT_STRIP_COMMENTS') == '1'
comments_re = re.compile(r'/\*(.*?)\*/')
@kiler129
kiler129 / 99-ups-eaton.rules
Created May 18, 2025 09:42
Udev example to symlink UPS devices in /dev/ups
SUBSYSTEM=="usb", ATTR{idVendor}=="0463", ATTR{idProduct}=="ffff", PROGRAM="/usr/local/bin/nut-usbups-name", SYMLINK+="ups/%c"
@kiler129
kiler129 / twilio_sms_to_telegram.js
Created February 28, 2024 03:57
CloudFlare worker to redirect SMS to Telegram
// Receives Twilio SMS WebHook and sends message via Telegram
//
//Define the following as variables on CF:
// - ACCESS_USER (encrypt): long unpredictible string, shared with Twilio
// - ACCESS_PASS (encrypt): long unpredictible string, shared with Twilio
// - TELEGRAM_CHAT_ID: chat id for Telegram conversation
// - TELEGRAM_API_TOKEN (encrypt): API token for Telegram intragration
//
// Configure Twilio with SMS WebHook to call https://<ACCESS_USER>:<ACCESS_PASS>@<worker name>.<cf login>.workers.dev/notify
// e.g. https://foo:bar@twilio-telegram-fwd.superuser123.workers.dev/notify
@kiler129
kiler129 / iommu.sh
Last active December 20, 2023 02:34 — forked from Roliga/iommu.sh
#!/bin/bash
### Improved IOMMU/PCIe list script
# The script was originally authored by Roliga (https://gist.github.com/Roliga/d81418b0a55ca7682227d57af277881b)
# This version changes:
# 1) enable listing of devices even if IOMMU is disabled
# 2) add support for NVMe & SAS block devices
# 3) display disks serial & firmware (if available)
# 4) QOL improvements: disabled paging by default; don't crash on missing lsusb
@kiler129
kiler129 / scrypted-webhook-disable-enable-homekit.ts
Created June 12, 2023 04:36
Scrypted WebHook to disable/enable HomeKit via webhook
class DisableEnableHomeKitWebHook implements HttpRequestHandler {
readonly devType = 'Camera';
readonly roomName = 'Inside';
// readonly roomName = 'Outside';
readonly sharedSecret = 'kfjshflhwfiwheifhawleichiewchewiucahewihc';
async onRequest(request: HttpRequest, response: HttpResponse) {
const query = this.getQueryParams(request);
if (!this.verifySecret(query)) {
response.send("Invalid secret");
@kiler129
kiler129 / generate_smbios.sh
Created April 12, 2023 07:38
Script to generate real SMBIOS for QEMU
#!/bin/bash
# See https://www.qemu.org/docs/master/system/invocation.html?highlight=smbios#hxtool-4
declare -A smb0
declare -A smb1
declare -A smb2
declare -A smb3
declare -A smb4
declare -A smb11
declare -A smb17
#!/bin/bash
set -e -o errexit -o pipefail -o nounset
###################################
# This script can be used by itself, but it's recommended that you read
# a tutorial on Proxmox forum first: https://forum.proxmox.com/threads/hey-proxmox-community-lets-talk-about-resources-isolation.124256/
###################################
# Do not modify these variables (set by Proxmox when calling the script)
vmId="$1"