Skip to content

Instantly share code, notes, and snippets.

View bburky's full-sized avatar

Blake Burkhart bburky

View GitHub Profile

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 September 23, 2020 19:34
Delete any orphaned CNS volumes found in vCenter without a corresponding Kubernetes PV
#!/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 July 7, 2020 21:50
Delete all vSphere CNS volumes
// 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 22:15
Calculate Sizes of All Installed Games (Playnite Extension)

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 00:20
Python WinRT Image Capture (and Focus Stacking)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bburky
bburky / 2018 podcast CPEs.ipynb
Last active March 21, 2020 15:41
Podcast CPEs
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 April 15, 2019 04:34
regdiff Playnite Extension: Registry snapshot and comparison
Name: regdiff
Author: Blake Burkhart
Version: 1.1
Module: regdiff.ps1
Type: Script
Functions:
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 October 26, 2019 02:37
Import Installed Discord Games Playnite Extension
$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
@bburky
bburky / README.md
Last active August 24, 2023 03:09
Get Steam Cover Images Playnite Extension

Get Steam Cover Images Playnite Extension

Replaces the cover image of the selected games with the Steam header image for the game. If the game is not a Steam game, the game's links will be parsed for a Steam store link to guess the game's AppID.

Setting game's covers to an internet URL may be slow to load, so enabling "Asynchronous image loading" in Playnite's settings is suggested.

I recommend first running "Tools" → "Download Metadata" with "Only download metadata for games missing them" unchecked and select only:

  • Cover Image "Offical Store > IGDB"
  • Links "IGDB > Offical Store"