Skip to content

Instantly share code, notes, and snippets.

@jaredkrinke
jaredkrinke / building-oasis-linux-on-alpine.md
Created January 25, 2026 05:37
Building Oasis Linux from Alpine Linux

Following the official install instructions I built Oasis under Alpine Linux (which already uses musl libc), requiring the following:

Notes:

  • Needed to symlink lua to lua5.4
  • Built in a few minutes
  • Resulting binaries (with no toolchain) totaled 82 MB
  • Full source, build objects, Git overhead, etc. added roughly 1.5 GB
  • I didn't build a kernel or add a bootloader since I was planning to use this in a chroot or container

Dependencies:

@jaredkrinke
jaredkrinke / find-url-fragment-limit.html
Created December 23, 2025 19:10
Script to find upper bound on URL fragment length
<html>
<body>
<pre id="log"></pre>
<script>
const d = document.getElementById("log");
function log(text) { d.appendChild(document.createTextNode(text + "\n")); }
function underLimit(n) {
try {
@jaredkrinke
jaredkrinke / validate-feed.md
Created April 15, 2025 22:53
Validate an Atom feed using W3C validator using curl
curl -X POST --data-urlencode rawdata=$(< test.xml) --data-urlencode manual=1 https://validator.w3.org/feed/check.cgi

Annoyingly, I couldn't find a way to have curl do a "dry run" (show me the request without sending it). Someone else had this issue and netcat was suggested (and worked for my purposes): https://stackoverflow.com/questions/6180162/echo-curl-request-header-body-without-sending-it

Additionally, I couldn't find a way to URL-encode a file using curl's CLI, so I had to resort to shell magic. Again, someone else already asked about this and a workaround was suggested: https://unix.stackexchange.com/questions/270457/how-can-i-give-an-argument-as-an-external-file-to-curl-with-url-encode

@jaredkrinke
jaredkrinke / lua-repl.c
Last active March 31, 2025 18:42
Minimal Lua5.1 test app for POSIX (compiled size on x64 Debian is ~130 KB with static Lua, dynamic libc/libm)
#include <stdio.h>
#include <stdlib.h>
#include <lua.h>
#include <lauxlib.h>
int main()
{
lua_State* L = luaL_newstate();
char* line = NULL;
size_t n = 0;
@jaredkrinke
jaredkrinke / how-to-exit-grub.md
Created March 3, 2025 23:13
If you're stuck in GRUB and the power button doesn't work, try Ctrl+Alt+Del

How to exit GRUB minimal command line

Today, I got stuck in the GRUB minimal command line. "Stuck" because the power button on my laptop wouldn't shut off the computer. exit and quit didn't work either, and I didn't want to have to wait for my battery to run down. Fortunately, there was a solution:

Ctrl+Alt+Del

@jaredkrinke
jaredkrinke / chat-server.py
Last active January 31, 2025 22:08
Minimal TCP-based chat server in Python, using `select`
import selectors
import socket
from sys import argv
# Arguments: HOST PORT
host, port = argv[-2], int(argv[-1])
max_message_size = 1000
max_pending_clients = 5
# Bind top-level listener for registering new client connections
@jaredkrinke
jaredkrinke / _etc_dhcpcd.conf
Created December 26, 2024 17:22
Raspberry Pi as gateway, with static IPs (output interface is "wg0" in this example; replace `_` with `/` in filenames)
interface eth0
static ip_address=172.16.0.1/24
@jaredkrinke
jaredkrinke / easy-script-c64-ref.md
Created September 5, 2024 21:40
Quick reference page for Easy Script on the Commodore 64

Easy Script is a word processor for the Commodore 64. For comprehensive documentation and a tutorial, see the original manual (on The Internet Archive).

Keyboard shortcuts

Key(s) Description
Ctrl+W Move to next word
Ctrl+← Move to previous word

F1 commands

| Key | Descriptions|

@jaredkrinke
jaredkrinke / p56.c
Created August 30, 2024 04:07
Project Euler problem 56, in C (to compare against G-Pascal)
// Project Euler problem 56, in C (to compare against G-Pascal)
#include <stdio.h>
#define DIGITS 200
unsigned char a[DIGITS];
unsigned char m[DIGITS];
unsigned char m2[DIGITS];
void numclear(unsigned char *n) {
@jaredkrinke
jaredkrinke / bforth.txt
Created August 21, 2024 03:50
ASCII dump of Blazin' Forth (Commodore 64) documentation, by Scott Ballantyne ("Distribution on a not for profit basis is encouraged.")
Introduction
This manual describes the special features of the Blazin' Forth compiler. It is not necessary to read the entire document before using the compiler.
I would strongly urge you to at least glance through the first part paying special attention to the sections describing MOUNT and the EDITOR.
Once this has been taken care of, you may proceed immediately to the portion you are most interested in. Blazin' Forth supports the sound chip, Turtle Graphics, and Sprites, as well as containing a complete string handling package. Please feel free to start with the sections which interest you the most.
Blazin' Forth Documentation,System Information
Description
Blazin' Forth is a complete Forth-83 system for the Commodore-64 computer. It includes all the words from the Required Word Set, the Double Number Extension Word Set, and the Assembler Extension Word set. It also includes almost all of the Controlled Reference Word set, and applicable words from the Uncontrolled Reference Word Set. Th