Skip to content

Instantly share code, notes, and snippets.

@jkunkee
jkunkee / code.py
Last active April 26, 2023 06:22
Adafruit LED Glasses firmware (originally for FRC 2023 Worlds) (MIT license)
import board
# Do what the board object should have already done
import neopixel
from adafruit_is31fl3741.adafruit_ledglasses import LED_Glasses
import adafruit_is31fl3741
import adafruit_lis3dh
from digitalio import DigitalInOut, Direction, Pull
from adafruit_debouncer import Debouncer
@jkunkee
jkunkee / MC_World_Scrubber.ps1
Created June 29, 2020 00:05
Minecraft InhabitedTime chunk purge PowerShell script (very slow)
$nbtUtil = "<path to>\NBTUtil.exe"
$saveRoot = "$($env:APPDATA)\.minecraft\saves"
$targetWorldName = "<name of world>"
$worldRoot = "$saveRoot\$targetWorldName"
Get-ChildItem -Recurse -Path "$worldRoot\region" |
#select -Skip 10 -First 1 -last 20 |
% {
$regionFile = $_
# Chunks with isLightOn were prone to bad lighting updates during the 1.14 update on Realms.
# This NBTExplorer command invalidates the older style's cached ilghting data so the game will recalculate it.
NBTExplorer\NBTUtil\bin\Debug\NBTUtil.exe --path "region\*\*\Level\isLightOn" --setvalue=0
@jkunkee
jkunkee / 43AB3E4271A89DEE092F8C21A02A211099119D7E.asc
Created May 25, 2018 06:38
PGP Public Key for "Jon Kunkee" <jkunkee@microsoft.com>
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFsHbjoBEAC9YQfaDQSEg70KxTeOFT8k7Tna27WNM6J1CZoBn9w8qSHX2ZYm
2QdfYf10mIrbL5BzCxHP2sJzasyrjd+tgqBHIcdumQqy29aPYtPleQreK/y2USQ3
5wG5c+A8uEUkkCG30CLzSq/XeK4SwTkOUWSZUBxyNARmxzte9qf6wtUZM3caPb77
2RmD+mxaI3vwm59EWcWSdTJkfIMpJEV8emKmTLY+Id7DyK7zn4HLwny2BV2jWo9k
5o5lgip3o/jLkPwgEnB7aPqX37Mk4JMq/ahAQv1AH6jAwg2Wdy4mHkeHkBc1DWfN
aF69y924wQgci8z4gqliRSHmzNw2+7aHnhan1t9nId0eWHOjuQDPG1EvzSF+CkzO
za/cewYNySQnUwsqlIJy7GMO4lnDUPPdOwUzCHnjSitLNqGk+aOHMCFScn5iwciq
ZOrtO+hnj7UFWbpMwE9ZihBmR6gPHMPApvEE1YLAHsS1fPyacN54avAD4JNMxlKZ
@jkunkee
jkunkee / blinky.sh
Created April 20, 2015 02:43
Raspberry Pi 2 Gray Code Light Blinker
#!/bin/bash
BASE=/sys/class/gpio
RED=20
YELLOW=16
GREEN=12
function on() {
echo 1 > $BASE/gpio$1/value
@jkunkee
jkunkee / githook-receiver.conf
Created December 18, 2013 05:50
Simple Git hook for deploying on every commit. Readily refined and fairly easy to modify. I used the firewall to restrict who could trigger it, though I'm sure that's easily spoofed. Downsides: * security by obscurity, not proper authentication * always pulls, even when deployed branch isn't changed * doesn't call deploy script, like "npm instal…
description "Gutenberg's Box githook listener"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
umask 022
console none