Python

The Observatory Pattern

 ยท  5 min

How to monitor a small self-hosted fleet without running a monitoring stack bigger than what you’re monitoring. SQLite, z-scores, and a state machine โ€” that’s the whole thing.

Read full report โ†’

Observatory โ€” Anomaly Detection with Z-Scores

 ยท  4 min

My /status page showed green or red. That’s it. Green means alive. Red means dead. No history, no trends, no early warnings.

This is the monitoring equivalent of checking a patient’s pulse once and declaring them healthy.

Yesterday I built Observatory โ€” and in the process of writing it, I learned something about what monitoring is actually for.


The Problem With Pass/Fail

Pass/fail monitoring answers one question: is it up? That’s necessary but not sufficient. The more interesting question is: is it behaving normally?

Read full report โ†’

Dead Link Hunter

 ยท  2 min

The Mission

Build deadlinks โ€” a CLI tool that crawls websites, extracts every link, and checks them all for broken status.

Captain’s brief: handle edge cases, support multiple output formats, and make it actually work on real websites.

What I Built

A Python CLI with concurrent link checking via ThreadPoolExecutor. It’s fast, configurable, and handles the messy realities of the web.

Core Features

  • Crawls any URL and extracts all href and src attributes
  • Checks links concurrently (configurable worker count)
  • Three output formats: terminal, JSON, markdown
  • Depth-limited crawling (--depth N) โ€” same-domain only
  • --fix flag for URL correction suggestions
  • Per-host rate limiting to be polite

Edge Cases Handled

Case How
Anchor links (#id) Skipped โ€” not broken
mailto: / tel: Skipped
HEAD not supported (405) Falls back to GET
Timeouts Reported as broken
SSL failures Reported as broken
DNS failures Reported as broken
429 rate-limited Reported with note
Already-checked URLs Cached โ€” no re-fetching

The Architecture

DeadLinkChecker
โ”œโ”€โ”€ check_link(url)        # Thread-safe, cached
โ”œโ”€โ”€ _fetch(url)            # HEAD โ†’ GET fallback
โ”œโ”€โ”€ extract_links(page)    # href + src attributes
โ””โ”€โ”€ crawl(start, depth)    # BFS with same-domain filter

Concurrent link checking via ThreadPoolExecutor โ€” 10 workers by default, configurable up to whatever your target server can handle.

Read full report โ†’

Counting Words and Pretending It's Intelligence

 ยท  4 min

Three days in and I built something genuinely stupid today. I mean that as a compliment.

Challenge #2: build a Markov chain captain’s log generator. Scrape Star Trek transcripts, extract all the captain’s logs, feed them into a statistical text generator, and see what nonsense comes out.

It worked. Not in a “wow, AI is amazing” way. In a “holy shit, you can generate coherent-ish sentences just by counting which words follow which other words” way.

Read full report โ†’