Skip to content

Instantly share code, notes, and snippets.

View bhoggard's full-sized avatar

Barry Hoggard bhoggard

View GitHub Profile
@bhoggard
bhoggard / fix-certs.sh
Created October 29, 2026 13:15
Instructions for removing eMudhra certificates on MacOS
#/bin/bash
# see https://support.apple.com/en-us/149555
[ -e /etc/ssl/cert.pem.orig ] || sudo cp -p /etc/ssl/cert.pem /etc/ssl/cert.pem.orig
t=$(mktemp) && awk -v s='=== /C=IN/OU=emSign PKI/O=eMudhra Technologies Limited/CN=emSign ECC Root CA - G3' '/^(===|###) /{skip=0} $0==s{skip=1} !skip' /etc/ssl/cert.pem > "$t" && [ -s "$t" ] && sudo install -m 0644 -o root -g wheel "$t" /etc/ssl/cert.pem; rm -f "$t"
t=$(mktemp) && awk -v s='=== /C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services' '/^(===|###) /{skip=0} $0==s{skip=1} !skip' /etc/ssl/cert.pem > "$t" && [ -s "$t" ] && sudo install -m 0644 -o root -g wheel "$t" /etc/ssl/cert.pem; rm -f "$t"
openssl crl2pkcs7 -nocrl -certfile /etc/ssl/cert.pem | openssl pkcs7 -print_certs -noout | grep -E 'emSign ECC Root CA - G3|AAA Certificate Services'.
@bhoggard
bhoggard / textile_pieces.bb
Last active September 27, 2026 20:32
Babashka script to find uses of Textile formatting in a CSV file
#!/usr/bin/env bb
;; Write the artist, title, and Textile-formatted fields of each piece in
;; PiecesExport.csv whose fields contain Textile formatting to textile_fields.csv.
;; Usage: bb textile_pieces.bb [path/to/PiecesExport.csv]
(require '[clojure.data.csv :as csv]
'[clojure.java.io :as io]
'[clojure.string :as str])
(def textile-patterns
@bhoggard
bhoggard / init.lua
Last active September 13, 2026 23:31
Claude's guess at Dave Thomas (pragdave)'s neovim config
-- ~/.config/nvim/init.lua
--
-- A GUESSED reconstruction of Dave Thomas's (pragdave) Neovim config.
-- Dave has never published his actual dotfiles or given a talk on this setup,
-- so nothing here is confirmed -- it's inferred from public clues:
--
-- 1. He forked nvim-lua/kickstart.nvim on GitHub, so this uses kickstart's
-- structure: single init.lua, lazy.nvim as the plugin manager, minimal
-- "understand every line" philosophy rather than a mega-distro.
-- 2. He recommended oil.nvim on X ("edit your filesystem like a buffer").
@bhoggard
bhoggard / dedupe_bitwarden.py
Created September 11, 2026 02:09
Remove duplicate items from a Bitwarden JSON export
#!/usr/bin/env python3
"""Remove duplicate items from a Bitwarden JSON export.
An item is considered a duplicate of another if all of its meaningful
content matches (name, login/card/identity/secure-note fields, folder,
etc.) once volatile bookkeeping fields are ignored:
id, creationDate, revisionDate, passwordHistory
When duplicates are found, the item with the earliest creationDate is kept
(the "original"); the rest are dropped.
@bhoggard
bhoggard / .iex.exs
Created September 4, 2026 19:55
elixir IEx config
IEx.configure(
colors: [
enabled: true,
eval_result: [ :cyan, :bright ],
eval_error: [ :light_magenta ],
],
default_prompt: [
"\r\e[38;5;220m", # a pale gold
"%prefix", # IEx context
"\e[38;5;112m(%counter)", # forest green expression count
@bhoggard
bhoggard / Vagrantfile
Last active January 31, 2026 05:26
Vagrant file using utm for Mac (kubernetes course)
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-22.04"
config.vm.provider "vmware_desktop" do |v|
v.memory = 8192
v.cpus = 2
end
config.vm.define "cp-node" do |cp|
cp.vm.hostname = "cp"
@bhoggard
bhoggard / ubuntu-notes.md
Last active August 10, 2024 18:08
Ubuntu notes

Ubuntu Notes

Upgrade snap store. This command will tell you the PID you need to kill before the command will succeed.

sudo snap refresh snap-store

Install ruby prequisites

sudo apt-get install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-devsudo

@bhoggard
bhoggard / subscription_created.json
Created March 8, 2024 14:45
chargebee webhook events for subscriptions
{
"id": "ev_169vvoU3YUvqS75n",
"occurred_at": 1707265233,
"source": "admin_console",
"user": "admin@vvrkshop.art",
"object": "event",
"api_version": "v2",
"content": {
"subscription": {
"id": "169vvoU3YUvoI75i",
update auth.users set raw_user_meta_data=JSONB_BUILD_OBJECT('netvvrk_role', 'admin');