Skip to content

Instantly share code, notes, and snippets.

@rcarmo
rcarmo / main.ts
Created September 30, 2026 18:53
pi-decision
import type { Context, Models, SimpleStreamOptions, Usage } from "@earendil-works/pi-ai";
export const DEFAULT_MODEL = "github-copilot/gpt-6-luna";
export type Json = null | boolean | number | string | Json[] | { [key: string]: Json };
export type Question =
| { type: "noul"; instructions: string; criteria?: { true: string; false: string } }
| { type: "choice"; instructions: string; criteria: Record<string, string> }
| { type: "score"; instructions: string; criteria: string[] };
export type Questions = Record<string, Question>;
export type Answer =
@rcarmo
rcarmo / Plan.md
Created July 16, 2026 22:42
# Piclaw Earendil 0.80.9 Upgrade Plan

Piclaw Earendil 0.80.9 Upgrade Plan

Prepared: 2026-07-16
Baseline: Piclaw 6f340fd65 on main
Current Earendil: 0.80.7
Target Earendil: 0.80.9
Scope: @earendil-works/pi-agent-core, @earendil-works/pi-ai, @earendil-works/pi-coding-agent, and all Piclaw-private provider/model extensions that register providers, inspect models, or issue auxiliary model requests

1. Executive summary

@rcarmo
rcarmo / temp.py
Created July 3, 2026 07:19
Stupidly Visible Temperature Display
#!/usr/bin/env python3
"""
Print the lm-sensors "Package id 0" temperature in a huge terminal font.
Usage:
./scripts/package-temp-big.py # watch, run sensors every 2s, large font
./scripts/package-temp-big.py -i 5 # watch every 5s
./scripts/package-temp-big.py --scale 3 # even larger
./scripts/package-temp-big.py --once # one-shot
sensors | ./scripts/package-temp-big.py --stdin

The Steering/Auditor Loop

How a steering auditor supervises a set of independent worker sessions toward a goal — without ever doing the work itself. This describes the mechanism only; it says nothing about what any individual worker is actually building.


Roles

#!/usr/bin/env python3
"""
Provision a Cloudflare Tunnel and install a systemd service.
Usage:
sudo python3 setup.py \
--tunnel-name piclaw-vm \
--hostname piclaw.example.com \
--service-url http://localhost:3000 \
--user agent
@rcarmo
rcarmo / nsmb.conf
Created February 1, 2026 14:53 — forked from Zahorone/nsmb.conf
Fix for macOS 26 Tahoe Time Machine SMB backup failing with BACKUP_FAILED_DISCONNECTED_DISK_IMAGE error on Synology, QNAP, TrueNAS, UNAS. nsmb.conf configuration guide.
[default]
signing_required=yes
streams=yes
soft=yes
dir_cache_max_cnt=0
protocol_vers_map=6
mc_prefer_wired=yes
@rcarmo
rcarmo / docker-top.py
Created January 24, 2026 11:03
A nice way to keep tabs of Docker container resource usage
#!/usr/bin/env python3
import asyncio
import socket
import json
import curses
import argparse
from collections import defaultdict, deque
MAX_HISTORY = 200 # Max history samples to keep
BRAILLE_4 = ["⣀", "⣄", "⣆", "⣇", "⣿"] # 0–4 levels
@rcarmo
rcarmo / norns_helper.py
Last active January 2, 2026 03:45
an MCP server to develop and debug Norns/Supercollider audio synthesiis/plugins/filters
#!/usr/bin/env python3
"""
norns_helper.py - MCP server for Norns development workflow automation
This Model Context Protocol (MCP) server provides tools for deploying and debugging
Norns audio scripts remotely over SSH. It was designed to eliminate manual SSH
workflows and Makefile dependencies, enabling rapid iteration during development.
Target System:
Monome Norns (https://monome.org/docs/norns/) is a sound computer for exploring new
@rcarmo
rcarmo / kmeans.js
Created March 4, 2025 23:11
Quick KMeans hack for Node-RED
function initCentroids(pts, k) {
var randPts = pts.slice(0);
randPts.sort(() => Math.floor(Math.random() * pts.length));
return randPts.slice(0, k);
}
function dist(v1, v2) {
var sum = 0;
for (var i = 0; i < v1.length; i++) {
if (i !== 0) sum += Math.pow(v2[i] - v1[i], 2);
@rcarmo
rcarmo / enphase_average.5m.py
Created October 11, 2024 07:11 — forked from jasonsnell/enphase_average.5m.py
Enphase Envoy Local Data - SwiftBar Menu Bar Script
#! /usr/bin/env python3
# Adapted from grzegorz914@icloud.com
# see https://github.com/grzegorz914/homebridge-enphase-envoy
# <xbar.title>Enphase Solar (Averages)</bitbar.title>
# <xbar.version>v1.2</xbar.version>
# <xbar.author>Jason Snell</xbar.author>
# <xbar.author.github>jasonsnell</xbar.author.github>
# <xbar.desc>Display local Enphase solar stats.</xbar.desc>
# <swiftbar.hideAbout>true</swiftbar.hideAbout>