Posts
Category Archives: Uncategorized
Units
teresita:~$ units -1 -o “%.0f” “299792458 m/s” “furlongs per fortnight” * 1802617499785 teresita:~$
Posted in Uncategorized
Leave a comment
Ellipse
#! /usr/bin/python3 import math import sys a = float(sys.argv[1]) b = float(sys.argv[2]) h = ((a – b) / (a + b))**2 eps = sys.float_info.epsilon def binom_half(n): coef = 1.0 for k in range(n): coef *= (0.5 – k) / (k … Continue reading
Posted in Uncategorized
Leave a comment
Html.py
Python script to convert the text in your json Mastodon timeline archive to html import json with open(“outbox.json”) as f: outbox = json.load(f) with open(“actor.json”) as f: actor = json.load(f) articles = [] for s in [item.get(“object”) for item in … Continue reading
Posted in Uncategorized
Leave a comment
Xkcd
Revel in your Linux nerddom with two xkcd fonts mkdir -p $HOME/.local/share/fonts/xkcd cd $HOME/.local/share/fonts/xkcd wget https:// github.com/ipython/xkcd-font/raw/refs/heads/master/xkcd/build/xkcd.otf wget https:// github.com/ipython/xkcd-font/raw/refs/heads/master/xkcd-script/font/xkcd-script.ttf fc-cache -f
Posted in Uncategorized
Leave a comment
Alpine
This is the way. My first thirty years online looked like this. Usenet on UW’s legendary Pine then later the Alpine fork.
Posted in Uncategorized
Leave a comment
Fsum
Python reminder: floating point is weird. math.fsum() is less weird.
Posted in Uncategorized
Leave a comment
Toot TUI
Toot TUI. Pressing G will pull up a menu to access your #Mastodon home timeline, local public timeline, global public timeline, bookmarks, notifications, conversations, and hashtag timeline.
Posted in Uncategorized
Leave a comment
Bases
Convert between numerical bases with #bash and #bc #!/bin/bash num=$1 from=$2 to=$3 dec=$(echo “ibase=$from; $num” | bc) conv=$(echo “obase=$to; $dec” | bc) echo “$conv”
Posted in Uncategorized
Leave a comment