Skip to content

Instantly share code, notes, and snippets.

@kommander
kommander / boo-agent-session-upload.sh
Last active September 9, 2026 20:22
Export an OpenCode session and upload its ZIP to Boo support
#!/usr/bin/env bash
set -euo pipefail
umask 077
work=$(mktemp -d "$HOME/boo-agent-export.XXXXXXXX")
export_file="$work/boo-agent-session.json"
zip="$work/boo-agent-session.zip"
# Export first. The picker selects the conversation; stdout is the JSON file.
# Use the terminal for input even when this script was piped into bash.
@kommander
kommander / boo-collect-boot-logs.sh
Created August 27, 2026 19:00
Boo: collect support logs and boot timings onto BOOLOGS
#!/usr/bin/env bash
# Collect locally, then export to the uniquely labelled BOOLOGS FAT partition.
# No uploads, disk repairs, configuration changes, or reboots are performed.
set -euo pipefail
umask 077
if (( EUID != 0 )); then
printf 'Root is required. Run: sudo bash %q\n' "$0" >&2
exit 1
fi
@kommander
kommander / bun-stdin-close-repro.js
Created April 27, 2026 16:33
Bun spurious stdin close repro
#!/usr/bin/env bun
import { join } from "node:path"
import { pathToFileURL } from "node:url"
const RESOURCE_PATH = join(import.meta.dir, ".bun-stdin-close-tiny-repro.txt")
const RESOURCE_URL = pathToFileURL(RESOURCE_PATH).href
const PALETTE_QUERY = Array.from({ length: 256 }, (_, index) => `\x1b]4;${index};?\x07`).join("")
const RESET_SEQUENCE = "\x1b[?2026l\x1b[?1003l\x1b[?1002l\x1b[?1000l\x1b[?1006l\x1b[?2004l\x1b[?1049l\x1b[?2031l\x1b[?25h\x1b[0m"
@kommander
kommander / colors.sh
Created November 24, 2025 20:27
output terminal palette colors as hex
#!/usr/bin/env bash
# Put terminal into raw mode to capture OSC responses
stty -icanon -echo min 0 time 1
# Create temp file
tmp=$(mktemp)
# Send OSC 4 queries for all 256 colors
for i in {0..255}; do
@kommander
kommander / multilevel_prefetch.patch
Created October 1, 2011 23:11
A patch to add multi level prefetch to persistencejs, a javascript ORM.
From b6b903a3f6f9c1d5113bf98baab12bbfa009dadf Mon Sep 17 00:00:00 2001
From: Sebastian Herrlinger <sebastian@formzoo.com>
Date: Fri, 16 Sep 2011 13:36:58 -0700
Subject: [PATCH 1/3] Hack: Multi Level Prefetch
---
lib/persistence.store.sql.js | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
mode change 100644 => 100755 lib/persistence.store.sql.js