Skip to content

Instantly share code, notes, and snippets.

@kennwhite
kennwhite / 1944_OSS_Simple_Sabotage_Field_Manual.md
Last active July 16, 2026 06:41
1944 OSS Simple Sabotage Field Manual
@kennwhite
kennwhite / gce_kms_notes.sh
Last active June 1, 2026 16:33
Using Customer-supplied encryption keys with GCP for new full disk encryption in GCE
# These are my notes, circa Jan 17, 2017 for full volume encryption using customer supplied encryption keys (CSEK)
# Caveat emptor.
# Install Google Cloud Platform (GCP) SDK command line tools
curl -s -L -O -J https://sdk.cloud.google.com/
# (inspect and run it)
# Cloud KMS/keyring not needed for one-off volume encryption with CSEKs
# gcloud beta kms keyrings create KEYRING_NAME --location LOCATION
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active May 21, 2026 11:48
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@kennwhite
kennwhite / monterey_hidden_files.sh
Created September 4, 2022 02:33
Permanently show hidden files in MacOS Monterey including Sublime Text
# To change the default Finder behavior and actually show hidden files/directories
defaults write com.apple.finder AppleShowAllFiles -boolean true; killall Finder
# To make the Sublime 4 (Build 4126 at time of writing) File Open dialog boxes to also show hidden files
defaults write com.sublimetext.4 AppleShowAllFiles -bool true
@kennwhite
kennwhite / tree_build.sh
Created March 11, 2025 08:14
Install tree utility on MacOS without Brew
#!/usr/bin/env bash
#
# Download tar file for "tree" here: https://oldmanprogrammer.net/source.php?dir=projects/tree
# Maintained here: https://github.com/Old-Man-Programmer/tree
# (No, really. It's 10+ years old, and updated as recently as Nov 25, 2024)
#
# I think this requires XCode pre-installed for gcc etc.
curl -LO https://github.com/Old-Man-Programmer/tree/archive/refs/heads/master.zip
unzip ./master.zip
@kennwhite
kennwhite / https.go
Last active February 27, 2026 14:42
Simple https http/2 static web server with HSTS & CSP (A+ SSLLabs & securityheaders.io rating) in Go using LetsEncrypt acme autocert
package main
import (
"crypto/tls"
"golang.org/x/crypto/acme/autocert"
"log"
"net"
"net/http"
)
@kennwhite
kennwhite / North_Indian_Chicken_Korma.md
Last active January 24, 2026 14:58
Vijaya Selvaraju North Indian Chicken Korma
@kennwhite
kennwhite / VS_Code_go_debugging.md
Last active January 2, 2026 21:41
Setting up VS Code and Golang with debug & build flag (-tags foo) support

Setting up VS Code and Golang with debug & build flag (-tags foo) support

This is the setup that worked for me after half a day of hacking around and chasing rabbit holes down old forum posts and open & closed Github issues.

Problem: While Go integration with VS Code is pretty slick in general, I needed to pass compile-time build flags, e.g., -tags foo[^1] to go build and go run directives, and I wanted to be able to properly debug with breakpoints etc. While there are some promising tutorials out there like this on Digital Ocean and on Log Rocket it turned out that one of the first things they both say to do is add the Delve extension to VS Code,

@kennwhite
kennwhite / Gatekeeper Exception command line.md
Last active July 22, 2025 19:28
Bypass MacOS Gatekeeper for specific apps & executables on command line

To override Big Sur's Gatekeeper restriction: "cannot be opened because the developer cannot be verified" from the command line

Example with MongoDB (can be run against a folder e.g., JavaSDK or individual executables):

xattr -d com.apple.quarantine /Users/me/Downloads/mongodb-macos-x86_64-enterprise-4.4.2/bin/*

This appears to be sticky for all identical versions of that executable, i.e., if you have two copies of the identical binary in unrelated directories, removing quarantine for one seems to enter a file signature hash into the allowed list globally.

@kennwhite
kennwhite / killBashWarningEverywhere.md
Last active March 25, 2025 21:33
Kill every warning of "The default interactive shell is now zsh." everywhere on MacOS

I'm well aware of how old the version of Bash is that ships with MacOS and Apple's public deprecation plans. That said, I don't like having to fiddle with this in VS Code and every other tool that tries to be clever. This will kill the message everywhere for processes of this user. Don't bother screwing around with $HOME .bashrc .profiile .bash_profile BS. Or do, but realize the local config specific to the user won't suffice for VS Code et al. You can also use Brew to do this, which will use the most recent version of Bash, but I have a love-hate relationship with Brew and prefer to use this approach instead. Caveat Emptor: This works for me, but use at your own risk.