Skip to content

Instantly share code, notes, and snippets.

@kimono-koans
kimono-koans / microgpt.py
Created February 17, 2026 01:32 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
#!/usr/bin/env bash
# Invocation: zfs list -H -o mountpoint | grep -v -e legacy -e none | xargs -I{} find "{}" -xdev -type f | \
# parallel -j 8 'zfs_corruption_detector "{}" 2>/dev/null | grep ERR' > report.txt
set -euf -o pipefail
#set -x
print_err() {
printf "%s\n" "$*" 1>&2
@kimono-koans
kimono-koans / gist:7641ee7bc7ce91f520b324bb08d699c8
Last active October 3, 2024 15:36
How I purged zsys and lived to tell the tale
You're going to need to snap your root according to zsys convention (just using a date won't work), like this:
#!/bin/bash
DATE_HASH="$( date | cksum | cut -f1 -d' ' | tr -d '\n' | xargs -0 printf '%x\n' )"
zfs snapshot -r bpool@snap_"$DATE_HASH"_prepApt
zfs snapshot rpool@snap_"$DATE_HASH"_prepApt
zfs snapshot -r rpool/ROOT@snap_"$DATE_HASH"_prepApt
zfs snapshot -r rpool/USERDATA@snap_"$DATE_HASH"_prepApt