Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# climbing_stats.py - Compute climbing stats from Google location history
#
# Author: Amber Sprenkels <[email protected]>
# Date: 2024-03-12
#
# This scripts computes the number of times I went to a local climbing or
# bouldering gym close to where I live, based on my Google location history.
#!/bin/bash
# install.sh
#
# Installation instruction for getting Ethan's Dilithium code up and running.
#
# Author: Amber Sprenkels <[email protected]>
# Date: 17 May 2022
# shellcheck disable=SC2164,SC2155
#!/bin/sh
# Do a nightly build of LLVM master.
#
# Author: Daan Sprenkels <[email protected]>
set -e
WORKSPACE="$1"
@dsprenkels
dsprenkels / .gitignore
Last active March 30, 2020 09:45
Primitive 512th roots of unity mod q ≈ 2^16; SUPERSEDED BY <https://github.com/mkannwischer/dilithium-m3/blob/master/sage/find_moduli.sage>!
*.py
#!/bin/sh
readonly txtfile="$(mktemp "print-plaintext.XXXXXXXXXX.txt")"
readonly pdffile="${txtfile/.txt/.pdf}"
cat "$@" >"$txtfile"
libreoffice --convert-to "pdf" "$txtfile"
lpr "$pdffile"
#!/bin/sh
readonly OUTPUT_FMT="%(uploader)s [%(upload_date)s] - %(title)s.%(ext)s"
readonly COOKIES_FILE="$(dirname "$0")/.config/cookies.txt"
readonly ONLY_DOWNLOAD_LAST_N="10"
SYNC="0"
if [ "$1" = "sync" ]; then
# Add a channel; i.e. prefill the cache
SYNC="1"
@dsprenkels
dsprenkels / monkeypatch-cups-smbclient.sh
Created March 18, 2019 09:43
How to debug SMB bugs in CUPS
#!/bin/bash
mv /usr/lib/cups/backend/smb /usr/lib/cups/backend/smb.dist
echo >/usr/lib/cups/backend/smb <<EOF
#!/bin/bash
/usr/bin/smbspool "" "$@"
EOF
chmod 755 /usr/lib/cups/backend/smb
@dsprenkels
dsprenkels / fe4x10_carry.pipeline.txt
Last active November 28, 2018 17:22
Pipeline analysis of radix-2^25.5 interleaved carry ripple modulo 2^255-19
Iterations: 100
Instructions: 4200
Total Cycles: 1406
Dispatch Width: 4
IPC: 2.99
Block RThroughput: 13.0
Instruction Info:
[1]: #uOps
#!/bin/sh
DIR="$(mktemp --directory)" && (wget --quiet --spider --tries=20 --recursive --directory-prefix="$DIR" "https://codimd.example.com/"; rm -rf "$DIR")
#!/bin/sh
# csd-power-watchdog
#
# Description: check if csd-power is quiet and restart if it is
# Author: Daan Sprenkels <[email protected]>
#
# On my system, csd-power often locks up when closing the lid of my laptop
# when an external monitor is attached. This script is a watchdog to kick
# the csd-power daemon if it looks unresponsive.