Skip to content

Instantly share code, notes, and snippets.

Avatar

Blake Burkhart bburky

View GitHub Profile
@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() {
@bburky
bburky / delete-all-cns-volumes.go
Created Jul 7, 2020
Delete all vSphere CNS volumes
View delete-all-cns-volumes.go
// Based on https://github.com/vmware/govmomi/blob/a411671fde1b6ac482ef96e0ae4f22d415cbf256/cns/client_test.go
// Delete all CNS volumes:
// go get -u github.com/vmware/govmomi
// go run delete-all-cns-volumes.go
package main
import (
"context"
"log"
@bburky
bburky / README.md
Created May 15, 2020
Calculate Sizes of All Installed Games (Playnite Extension)
View README.md

Calculate Sizes of All Installed Games

This extension calculates the sizes of the InstallDirectory of all installed games.

Emulated games may not be correctly supported. If only GameImagePath is set and not InstallDirectory, no size will be listed. If multiple games are in the same InstallDirectory, the total size of the directory will be listed for both games.

This script uses some pretty simple logic for calculating file sizes (the sum of the file size of each file, recursively). The file size may not be correctly calculated for a number of reasons (weird filesystem things, junction points, NTFS compressed files, etc.) Therefore, the reported size does NOT reflect "Size on disk", it's closer to Windows's "Size" calculation.

The report is saved as a game-sizes.csv file in your Playnite profile's ExtensionData folder. The extension automatically launches the file (probably with Excel) after completion.

@bburky
bburky / Python WinRT Image Capture.ipynb
Created May 3, 2020
Python WinRT Image Capture (and Focus Stacking)
View Python WinRT Image Capture.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View 2018 podcast CPEs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bburky
bburky / extension.yaml
Last active Apr 15, 2019
regdiff Playnite Extension: Registry snapshot and comparison
View extension.yaml
Name: regdiff
Author: Blake Burkhart
Version: 1.1
Module: regdiff.ps1
Type: Script
Functions:
View IsThereAnyDeal.ps1
function ConvertGamesToITAD ($allGames) {
foreach ($group in $allGames | Group-Object -Property Name) {
$games = $group.Group
$playtime = ($games.Playtime | Sort-Object)[-1]
$status = ($games.CompletionStatus | Sort-Object)[-1]
@{
title = $games[0].Name
status = ([string]$status).ToLower()
playtime = $playtime / 60
copies = @(foreach ($game in $games) {
@bburky
bburky / discord.ps1
Last active Oct 26, 2019
Import Installed Discord Games Playnite Extension
View discord.ps1
$discordApplications = Invoke-RestMethod "https://discordapp.com/api/v6/applications"
function InstalledDiscordGames {
# Some reason GetUnistallProgramsList has duplicates, is that normal?
foreach ($program in [Playnite.Common.System.Programs]::GetUnistallProgramsList()) {
if ($program.UninstallString -match "cmd /c start discord:///library/(\d+)/uninstall") {
$id = $matches[1]
$game = [Playnite.SDK.Models.Game]::new($program.DisplayName)
$game.Source = "Discord"
$game.GameId = $id