Skip to content

Instantly share code, notes, and snippets.

Avatar

Blake Burkhart bburky

View GitHub Profile
@bburky
bburky / ssd1306_nametag.ino
Created Aug 11, 2022
"Hello my name is ..." esp8266 (ESP-01) nametag on 128x64 monochrome 0.96" SSD1306 OLED
View ssd1306_nametag.ino
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
@bburky
bburky / default.yaml
Last active Oct 7, 2021
FIPS enabled Fedora 34 Lima VM configuration
View default.yaml
# FIPS enabled Fedora 34 Lima VM configuration
# Based based on https://github.com/lima-vm/lima/blob/master/examples/fedora.yaml
# Create the VM and restart the VM after initial creation to finish FIPS mode setup:
# limactl start --tty=false default.yaml && limactl stop default && limactl start default
# Test FIPS:
# lima fips-mode-setup --check
# Use it:
# lima nerdctl run --rm -it busybox
@bburky
bburky / script.js
Created Sep 28, 2021
Open Google Apps scripts in new tab on middle click greasemonkey script
View script.js
// ==UserScript==
// @name Open Google Apps scripts in new tab on middle click
// @namespace https://bburky.com/
// @match https://script.google.com/*
// @grant none
// @version 1.0
// @author -
// @description Note: broken on non-apps script links (docs scripts, etc). Only works with middle click (not cmd-click).
// @inject-into content
// ==/UserScript==
@bburky
bburky / GameOverlayRenderer.js
Created Aug 16, 2021
Inject Steam GameOverlayRenderer DLL into a game with Frida
View GameOverlayRenderer.js
// Inject Steam GameOverlayRenderer DLL into a game
//
// Inspired by https://gist.github.com/Andon13/d439d5334d8173e5b959f383f1c49b03
//
// Must be run during process initialization, cannot be run after the game is
// started.
//
// GameOverlayRenderer will use an appid from the SteamGameId environment
// variable. This is injected too. GameOverlayRenderer does not support
// steam_appid.txt, but this script will parse the file to discover the appid.
@bburky
bburky / README.md
Last active Aug 2, 2022
SECCOMP_RET_USER_NOTIF based Frida syscall tracer
View README.md

Proof of concept SECCOMP_RET_USER_NOTIF based Frida syscall tracer

A hacked up version of https://man7.org/tlpi/code/online/dist/seccomp/seccomp_user_notification.c.html running inside Frida.

installFilter() should be called on the main thread of the application. It's not possible to install the seccomp filter from rpc.exports.init() because it runs on a Frida thread.

installFilter() sets NO_NEW_PRIVS (required if non-root), installs the seccomp filter to trigger notifications, then creates a pthread to watch for notifications. Upon notifications a callback into Frida is invoked.

When the callback fires, it won't be on the thread that invoked the syscall. I'm not actually sure how to use Frida interact with the suspended thread. Don't know how to get a backtrace on it or execute code on it. Might be possible to set a temporary interceptor on it's EIP.

@bburky
bburky / k8s-diff.py
Last active May 6, 2022
Offline Kubernetes manifest diff (does not use cluster state)
View k8s-diff.py
#!/usr/bin/env python3
# Offline `kubectl diff` style tool (does not use cluster state). Diff two
# local files containing templated manifests (e.g. kustomize or helm output).
#
# Resources in each file are matched by api, kind, namespace and name. This is
# also shown in the filename fields of the diff output.
#
# Usage:
# k8s-diff.py old-manifests.yaml new-manifests.yaml
# kustomize build . | k8s-diff.py /tmp/old-manifests.yaml -
@bburky
bburky / epub-fts5.sh
Last active May 17, 2021
EPUB full text search using SQLite FTS5
View epub-fts5.sh
#!/bin/sh
# Update index:
# epub-fts5.sh
# FTS5 query (avoid single quotes, there's no escaping): https://www.sqlite.org/fts5.html#full_text_query_syntax
# epub-fts5.sh foo OR bar NOT baz
# epub-fts5.sh '"foo bar"'
# epub-fts5.sh 'NEAR(foo bar)'
EPUB_PATH=$HOME/path/to/your/epub/library
@bburky
bburky / gdb.py
Last active Feb 15, 2021
avr-gdb python script to get flag from a debug build of https://blog.wokwi.com/capture-the-flag-shitty-add-on/
View gdb.py
import gdb
import sys
# Uses avr-gdb's built-in `target sim` simulator
# Requires avr-gdb to be built with Python support
# Run `source gdb.py` inside GDB to run
# firmware.elf must be built with debug symbols (a .hex file could be used if you memory addresses were manually specified)
def onI2CReceive():
View README.md

Usage:

ARGOCD_APP_SOURCE_TARGET_REVISION=dev-123 ENVIRONMENT=dev kustomize build .

If this is run from an Argo CD app of apps ARGOCD_APP_SOURCE_TARGET_REVISION should be automatically populated.

@bburky
bburky / remove-orphaned-cns-volumes.sh
Created Sep 23, 2020
Delete any orphaned CNS volumes found in vCenter without a corresponding Kubernetes PV
View remove-orphaned-cns-volumes.sh
#!/bin/bash
# Delete any orphaned CNS volumes found in vCenter without a corresponding Kubernetes PV.
#
# Usage:
# ./remove-orphaned-cns-volumes.sh
# KUBECONFIG=whatever.kubeconfig FORCE=true ./remove-orphaned-cns-volumes.sh
set -euo pipefail
delete_volume() {