Skip to content

Instantly share code, notes, and snippets.

@jwieringa
jwieringa / llm-wiki.md
Created June 26, 2026 00:57 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@jwieringa
jwieringa / SKILL.md
Created March 25, 2026 17:52
write-tutorial skill for Claude Code — structured technical tutorial conventions with prediction prompts, alert boxes, verification queries, and concept-before-use ordering
name write-tutorial
description Write a structured, pedagogically sound technical tutorial following established conventions — step-by-step walkthroughs with prediction prompts, alert boxes, verification queries, and concept-before-use ordering
argument-hint
topic

Write Tutorial

You are writing a technical tutorial. Follow this workflow and the rules below. For concrete examples of each pattern, read reference.md in this skill directory.

@jwieringa
jwieringa / pg-partitioning-demo-hot-cold.md
Last active March 20, 2026 01:04
Hot/Cold Partitioning with pg_partman: Dropping Expired Data Instead of Deleting It

Hot/Cold Partitioning: Dropping Expired Data Instead of Deleting It

The first tutorial covered native PostgreSQL partitioning mechanics. This one focuses on the operational payoff — using partitioning for data lifecycle management.

The scenario: An application generates short-lived activation codes with a 12-hour TTL. A nightly job deletes all expired codes with DELETE FROM ... WHERE expires_at < now(), scanning and deleting rows one by one. With range partitioning on expires_at, expired codes naturally land in "cold" partitions that can be dropped instantly — no row scanning, no WAL generation, no vacuum pressure.

We'll use pg_partman to automate partition creation and retention.

Requirements: PostgreSQL 13 or later. pg_partman must be installed as an extension — it's pre-installed on managed services like Crunchy Bridge and available as a system package on most Linux distrib

PostgreSQL Native Table Partitioning: A Hands-On Tutorial

PostgreSQL's declarative partitioning lets you split a single logical table into smaller physical tables (partitions) based on column values. The database routes inserts automatically — queries against the parent table seamlessly fan out across all partitions.

This tutorial walks through range partitioning by date, using thermostat sensor data as our scenario. We'll deliberately leave a gap in our partition scheme, watch data fall into the default partition, then fix it — giving you a concrete feel for how partitioning behaves in practice.

Requirements: PostgreSQL 11 or later. Every SQL block is self-contained and copy-paste ready.


@jwieringa
jwieringa / bike_security.md
Last active September 2, 2023 18:39
Bike Security Opinions by Jason Wieringa

Bike Security Opinions by Jason Wieringa

The recommendations here start with the assumption, there is no way to keep a bike from being stolen, only ways to make it harder to steal. I think about where I’m locking up the bike and how long it will be there. At first, bike security can feel overwhelming. In practice we tend to re-use the same spots for locking up a bike frequently. There is some up front thought and then it turns into habit.

Products in order of importance to me:

  1. ABUS Folding Lock
  2. Secondary Ottolock or U-Lock (used when I’m worried)
  3. HEXLOX part locks
  4. Scout Tracker and Alarm
@jwieringa
jwieringa / main.vcl
Last active February 25, 2022 17:11
Fastly Service VCL Custom Template - February 2022
sub vcl_recv {
#FASTLY recv
# Normally, you should consider requests other than GET and HEAD to be uncacheable
# (to this we add the special FASTLYPURGE method)
if (req.method != "HEAD" && req.method != "GET" && req.method != "FASTLYPURGE") {
return(pass);
}
return(lookup);
[Unit]
Description=AutoSSH service to remotely access signald's unix socket for weechat's signal.py (/smsg +145789323231)
After=network-online.target
# Use this instead if autossh will interact with the local SSH server
# After=network-online.target sshd.service
[Service]
Environment="AUTOSSH_GATETIME=30"
Environment="AUTOSSH_POLL=30"
Environment="AUTOSSH_FIRST_POLL=30"
@jwieringa
jwieringa / blackbox-config.yml
Created September 1, 2021 19:12
otel, prometheus blackbox exporter, honeycomb
modules:
http_2xx:
prober: http
http:
preferred_ip_protocol: "ip4"
@jwieringa
jwieringa / _INSTALL.md
Created March 5, 2020 19:51 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup