Skip to content

Instantly share code, notes, and snippets.

@VorpalBlade
VorpalBlade / prepare-bench.sh
Created November 20, 2025 23:04
Script to make system more predictable during benchmarking
#!/bin/bash
#
# Notes to self:
# * https://github.com/andrewrk/poop as an alternative to hyperfine
# * https://easyperf.net/blog/2019/08/02/Perf-measurement-environment-on-Linux
if [[ -z "$1" ]]; then
echo "Usage: $0 {bench|normal}"
exit 1
@VorpalBlade
VorpalBlade / dectalk.py
Last active September 10, 2022 18:48 — forked from AkBKukU/dectalk.py
Python script for writing to DECtalk devices with resets for commands
#!/usr/bin/python3
import serial
import sys
VT = b'\013' # ASCII vertical tab!
CLEANUP = VT + b'[:nh][:dv ap 90 pr 0].END OF LINE[:np][:pp 0][:cp 0][:rate 200][:say line][:punct none][:pitch 35].\r'
# DECtalk output over serial with command resetting
ser = serial.Serial('/dev/ttyUSB0',9600,timeout=1) # open serial port with 9600 8N1 defaults
@VorpalBlade
VorpalBlade / aur.zsh
Last active April 19, 2022 06:53
AUR zsh completion prototype
#compdef aur
# Helper to complete aur package names
# TODO: This is a bit slow (multiple seconds) when tab completing without any leading characters,
# which suggests it is the built in compadd (or some presentation layer) being slow rather than
# aur pkglist itself. See if anything can be done about this.
__aur_list_pkgs() {
local -a pkgs
# TODO: Longer TTL?
pkgs=( $(aur pkglist 2>/dev/null) )