Skip to content

Instantly share code, notes, and snippets.

View progrium's full-sized avatar
💭
working on Gophercon talk

Jeff Lindsay progrium

💭
working on Gophercon talk
View GitHub Profile
@progrium
progrium / build-lima-recovery.sh
Created October 13, 2026 17:35
enter recovery mode for mac lima vms. start a mac vm once, then stop it, then run `lima-recovery ~/.lima/your-vm`
swiftc -O -o lima-recovery main.swift
codesign --force --entitlements vz.entitlements -s - lima-recovery
@progrium
progrium / 1_session.txt
Last active October 5, 2026 22:00
pi (go port) session using virgil-client used to make swift library. from copying the virgil-client binary in to working cli against my 9p2k.L server ~30 min. both txt and md versions since md isn't perfectly formatted from pi terminal output.
xcodevm@xcodevms-Virtual-Machine P9Client % pi -m claude-opus-5-5
pi (go) · anthropic/claude-opus-5-5 · cwd /Users/xcodevm/Desktop/test/P9Client
Type your message. /help for commands, Ctrl-D or /quit to exit.
> use the virgil-client command as a guide to build a single file 9p2k client library and separate single file cli to use the library against virgil. the client and library should be swift. use virgil-client -h to get started. just pass level 1
· bash(ls -la; virgil-client -h 2>&1 | head -100; which virgil-c...)
└ ok
· bash(find . -type f | xargs ls -la; cat go.mod; find cmd -type...)

SSH and Plan 9 rcpu Compared

Executive summary

SSH and Plan 9’s modern rcpu stack solve superficially similar problems, but they embody very different architectural bets. SSH is a single, standardized, layered protocol family: a transport protocol provides encryption and host authentication, a user-authentication protocol authenticates the client, and a connection protocol multiplexes multiple logical channels over one encrypted tunnel. That design makes SSH broadly interoperable and feature-rich, especially for shells, port forwarding, X11 forwarding, agent forwarding, and subsystem execution. The core architecture is explicitly defined in RFC 4251-4254. citeturn29view0turn29view1turn29view2turn29view3

Plan 9’s rcpu stack is different in kind. It is not one giant transport with a large built-in channel taxonomy. Instead, it is a composed system service: rcpu, rimport, rexport, and rconnect are front-end commands; tlssrv/tlsclient provide mutually authenticated encrypted

Translating WebUSB Into USB/IP Wire Packets

Executive summary

The clean way to think about this bridge is not “WebUSB emits USB/IP.” The practical model is: your bridge acts as a USB/IP server, the Linux side acts as the normal USB/IP client, and every incoming USB/IP request is executed against a real device through WebUSB, then answered with the corresponding USB/IP reply. In other words, the Linux side remains authoritative for URB submission order and sequencing; the browser side is an execution engine plus descriptor source. USB/IP itself uses a short discovery/import phase (OP_REQ_DEVLIST/OP_REP_DEVLIST, OP_REQ_IMPORT/OP_REP_IMPORT) followed by a persistent URB channel carrying USBIP_CMD_SUBMIT, USBIP_RET_SUBMIT, USBIP_CMD_UNLINK, and USBIP_RET_UNLINK. All integer fields in the USB/IP protocol are in network byte order. citeturn10search0turn4view0turn5view0

For actual I/O, the mapping is straightforward for generic control, bulk, interrupt, and most *

@progrium
progrium / spec.md
Last active November 4, 2025 08:49
Filesystem over HTTP spec. Looking for review / comments

HTTP Filesystem Protocol Specification

Overview

The HTTP Filesystem Protocol provides a RESTful interface for performing POSIX-like filesystem operations over HTTP. It enables hierarchical file and directory manipulation using standard HTTP methods with filesystem-specific metadata encoded in HTTP headers.

Protocol Design

Core Principles

@progrium
progrium / Dockerfile
Last active September 25, 2025 10:23
Minimal VSCode for Web deployment. This includes a minimal Dockerfile to build VSCode and then an HTML file to run it.
FROM node:22-alpine
ARG VSCODE_VERSION=1.103.2
RUN apk add -u krb5-dev libx11-dev libxkbfile-dev libsecret-dev git build-base python3
RUN git clone --depth 1 https://github.com/microsoft/vscode.git -b $VSCODE_VERSION
WORKDIR /vscode
RUN npm i
RUN npm run gulp vscode-web-min
@progrium
progrium / script.js
Last active April 27, 2025 00:44
original "paper prototype" demo script / spec for wanix 0.3 imagining how basic primitives would be used to bootstrap a terminal+vm using only filesystem operations
const w = new Wanix()
Object.getPrototypeOf(w)
// {readFile: ƒ, writeFile: ƒ, readDir: ƒ, exists: ƒ}
await w.readDir(".")
// ['dom/', 'fsys/', 'proc/', 'term/', 'vm/']
await w.readDir("fsys")
// ['ctl', 'new/']
await w.readDir("fsys/new")
@progrium
progrium / fsys.md
Last active January 6, 2025 00:20
go filesystem api design walkthrough

io package

Core interfaces

type Reader interface {
	Read(p []byte) (n int, err error)
}

type Writer interface {
	Write(p []byte) (n int, err error)
@progrium
progrium / vscode86.md
Created June 24, 2024 19:44
vscode integrated with v86, a dev environment entirely in the browser
#!/bin/sh
apptron app indicator - ./icon.png <<MENU |
Timers
5 seconds
10 seconds
30 seconds
Say Hello
---
Quit
MENU