Skip to content

Instantly share code, notes, and snippets.

View RealityAnomaly's full-sized avatar

Vertex RealityAnomaly

  • Thames Republic
View GitHub Profile
From 997148331011406a54157ad225ace20510eacc56 Mon Sep 17 00:00:00 2001
From: Vertex X7-53 <vertex@glassway.net>
Date: Sun, 17 Aug 2025 11:00:09 +0100
Subject: [PATCH] Xen PT power management support, including PME passthrough
---
hw/xen/xen_pt.c | 1 +
hw/xen/xen_pt.h | 1 +
hw/xen/xen_pt_config_init.c | 61 +++++++++++++++++++++++++++++++++++--
3 files changed, 61 insertions(+), 2 deletions(-)
From 67693cbca14f3ac40a9bf84f4574f5bbe7cc98c2 Mon Sep 17 00:00:00 2001
From: Vertex X7-53 <vertex@glassway.net>
Date: Sun, 17 Aug 2025 01:34:00 +0100
Subject: [PATCH] xen/pciback: Improve runtime power management
An important part of S0ix runtime power management is the control of PCI device D-states.
Without both the device and any applicable PCI bridges in D3cold, the PMC will
keep power applied to the bus, and in most cases this will prevent the CPU from reaching states lower than Package C2.
The vast majority of devices depend on PME (Power Management Events) to
@RealityAnomaly
RealityAnomaly / esxcli-software-patched.py
Last active January 4, 2024 10:55
esxcli-software-patched.py
import shutil
import subprocess
import tempfile
import sys
# example use: python3 ./patch.py vib.install -v /vmfs/volumes/65790f67-650d4902-c890-d0431e4ede0e/BCM_bootbank_dell-shared-perc8_06.806.92.00-1OEM.700.1.0.15843807.vib -f --dryrun
patch_data = '''
# start of patch area
import inspect
@RealityAnomaly
RealityAnomaly / imessage.txt
Created January 1, 2024 15:11
imessage.txt
APKTIDb9QuTtosrfTl377XkBTM6MgMcYUnqTuyG7wQ1j4my76wsg
@RealityAnomaly
RealityAnomaly / talos-kernel-stuff.md
Created November 30, 2021 18:54
Adding a proprietary kernel module to Talos OS

Adding a proprietary kernel module to Talos OS

  1. Patching and building the kernel image
    1. Clone the pkgs repository from Github and check out the revision corresponding to your version of Talos OS
      git clone https://github.com/talos-systems/pkgs pkgs && cd pkgs
      git checkout v0.8.0
    2. Clone the Linux kernel and check out the revision that pkgs uses (this can be found in kernel/kernel-prepare/pkg.yaml and it will be something like the following: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-x.xx.x.tar.xz)
#!/usr/bin/env python3
# Wrapper for `nix` commands that automatically override flake input paths
# via use of the special environment variables NIX_FLAKE_PATH_OVERRIDES and NIX_FLAKE_URL_OVERRIDES
import os
import sys
import json
import subprocess
from typing import List, Set, Mapping
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index f85bcf35..d10fa415 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -1527,6 +1527,11 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h)
if (!(i = nl_checkin(h, sizeof(*i))))
return;
+ /* Always skip FIB exception routes */
+ if (i->rtm_flags & RTM_F_CLONED) {
@RealityAnomaly
RealityAnomaly / tpm_zfs.sh
Last active March 18, 2023 15:49
Very specific script to unlock a ZFS volume with a key stored in a TPM 1.2
#!/bin/bash
# Copyright 2020 Joseph Marsden
# This is very specific to my setup and will probably not work on yours.
wrap_key() {
echo "Please enter the volume key"
read -s -p "Key: " KEY && echo -e "\n"
if [ -z $KEY ]; then
# key is blank, so generate one
@RealityAnomaly
RealityAnomaly / nvmgr.py
Created January 9, 2020 16:39
GPU Switcher v2
#!/bin/python3
import os
import sys
import time
import libvirt
import argparse
import subprocess
from primesel import Switcher
NVIDIA_PCI_ID = '0000:01:00.0'
@RealityAnomaly
RealityAnomaly / nvmgr.py
Created January 9, 2020 01:14
GPU Switcher
#!/bin/python3
import os
import sys
import time
import argparse
import subprocess
from primesel import Switcher
nvidia_modules = [
'nvidia_uvm',