Skip to content

Instantly share code, notes, and snippets.

View wommy's full-sized avatar

Tommy Williams wommy

View GitHub Profile
@wommy
wommy / README.md
Created May 21, 2026 19:19
Turso shared-WAL stale tshm + empty wal reproducer

Turso shared-WAL stale -tshm resurrects frames from empty -wal

Summary

A persisted shared-WAL authority (db-tshm) can claim positive WAL frames while the paired WAL file (db-wal) is empty. open_shared_from_authority_if_exists() correctly detects that the authority is not provably reusable and rebuilds local WAL state from disk, but the later shared-WAL reconciliation can re-adopt the same stale -tshm authority and its frame index. A reader then asks the frame index for a page, gets a stale frame id, and attempts to read that frame from a zero-byte WAL.

Observed failure shape:

rebuilding WAL state from disk because persisted authority is not provably reusable reason=WalTooShortForSnapshot
// scripts/lib/code-mode.ts (v1.0)
// Pure code-mode primitive: composes any registry of MCP-style ClientFactories
// into a flat Tools deck. Project-think L207-217 binding pattern.
//
// Dependency-inverted: knows nothing about specific servers. Caller injects
// the registry via opts.registry. Sister extracted from mocks/mcporter-cli-v0/tools.ts
// (saga-20 v1.0 → primitive lift). Sister to projection-cache.ts pattern: pure
// reusable lib at scripts/lib/, mock-side at mocks/<X>/<thin-config>.ts.
//
// Invariants:

Produce an exceptionally thorough implementation plan using multi-agent exploration.

Instructions:

  1. Use the Task tool to spawn parallel agents to explore different aspects of the codebase simultaneously:
    • One agent to understand the relevant existing code and architecture
    • One agent to find all files that will need modification
    • One agent to identify potential risks, edge cases, and dependencies
  2. Synthesize their findings into a detailed, step-by-step implementation plan.
  3. Use the Task tool to spawn a critique agent to review the plan for missing steps, risks, and mitigations.
  4. Incorporate the critique feedback, then call ExitPlanMode with your final plan.
@wommy
wommy / bookworm_to_trixie.sh
Created December 2, 2025 18:13
upgrade bookworm to trixie
## from https://linuxiac.com/how-to-upgrade-to-debian-13-trixie-from-12-bookworm/
## but a personalized variant
apt update ; apt upgrade -y
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sed -i 's/contrib/contrib non-free non-free-firmware/g' /etc/apt/sources.list
apt update ; apt upgrade --without-new-pkgs -y ; apt full-upgrade -y ; apt modernize-sources
echo "# Modernized from /etc/apt/sources.list
Types: deb
#!/usr/bin/bash
## Watch This Space || full write-up, accompanying explainer doc coming soon
### zram kernel optimizations
## https://github.com/garyexplains/examples/blob/master/how_to_enable_ZRAM_Raspberry_Pi.md#kernel-parameters-to-make-better-use-of-zram
cat << 'EOF' | sudo tee /etc/sysctl.d/99-vm-zram-parameters.conf
vm.vfs_cache_pressure=500
vm.swappiness=100
vm.dirty_background_ratio=1
#!/usr/bin/bash
## apt-cache
echo 'Acquire::http::Proxy "http://192.168.10.14:3142";' | sudo tee /etc/apt/apt.conf.d/00aptproxy
## etckeeper
sudo apt update ; sudo apt install -y etckeeper
### zram
## zram-tools
## LINKS
## https://pbs.proxmox.com/docs/backup-client.html#
## https://ed.llo:8007/#DataStore-pbs:content
proxmox-backup-client backup \
--repository ed:pbs \
--ns hosts/skylake1 \
root.pxar:/root \
etc.pxar:/etc --exclude /etc/pve
#!/bin/bash
## from https://backports.debian.org/Instructions/
## and Andrea Borman 's https://www.youtube.com/@AndreaBorman
## youtube video :: How To Update With Debian Backports On Debian Bookworm.
## https://www.youtube.com/watch?v=XDF2CB-q60M
sudo sed -i -E '
s/^(Suites:.*)(\s*)$/\1 trixie-backports\2/;
/^Components:/ s/main.*/main contrib non-free non-free-firmware/
#!/usr/bin/bash
## so we're taking the Proxmox VE Host Backup script, former ttech :: https://community-scripts.github.io/ProxmoxVE/scripts?id=host-backup
## aka :: bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/host-backup.sh)"
## the only line we need is 65 or
## tar -czf "$BACKUP_PATH$BACKUP_FILE-$(date +%Y_%m_%d).tar.gz" --absolute-names "${selected_directories[@]}"
## we're going to improve this using zstd
## ssh into NAS and then SSH into Node
#!/bin/bash
sed -i 's/#no-cgroups = false/no-cgroups = true/g' "/etc/nvidia-container-runtime/config.toml"