Skip to content

Instantly share code, notes, and snippets.

Henry Todd hjst

Block or report user

Report or block hjst

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hjst / [Radio Streams].m3u
Created Oct 28, 2018
MPD playlist file for BBC radio streams at /var/lib/mpd/playlists/[Radio Streams].m3u
View [Radio Streams].m3u Hereford & Worcester Radio 1 Radio 1Xtra Radio 2 Radio 3 Radio 4 Radio 5 Live Radio 5 Live Sports Extra
hjst /
Created Apr 9, 2018
Modified Tango palette for GNOME Terminal (off-black background)
#!/usr/bin/env bash
# Base16 - Gnome Terminal color scheme install script
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="Tango Modified"
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="tango-modified"
[[ -z "$DCONF" ]] && DCONF=dconf
[[ -z "$UUIDGEN" ]] && UUIDGEN=uuidgen
dset() {
local key="$1"; shift
hjst /
Last active Sep 6, 2017
Proof for

Keybase proof

I hereby claim:

  • I am hjst on github.
  • I am hjst ( on keybase.
  • I have a public key ASBJkJk01iBJdIpckkRu-h2MPocZBPArZ-LXZEJkAFZsrgo

To claim this, I am signing this object:

hjst / send-to-pocket.el
Created Aug 28, 2017
ELisp function to send the URL under the cursor to Pocket for reading later (uses msmtp)
View send-to-pocket.el
(require 'url-util)
(defun hjst/send-to-pocket ()
"Send the URL at point to Pocket for reading later"
((url (url-get-url-at-point)))
(start-process-shell-command "msmtp" "*send-to-pocket*"
(concat "printf 'Add:\n%s\n'"
"| msmtp"))
hjst /
Created Jul 7, 2017
Try to find valid downloads for files with a version number in their URL
curl --head --silent --output /dev/null \
--write-out "%{http_code}: %{url_effective}\n" \[6-82].[0-9]-[1-9].baz.[0-9].tgz \
| grep -v ^403
# --head # do a HEAD, not a GET; understand the tradeoffs
# --silent # hush the usual output progress bars etc.
# --output /dev/null # hush the remaining output (header echoes)
# --write-out "%{http_code}: %{url_effective}\n" # output these specific fields on a line, suitable for grep
# .../bucket/foo/bar-2.[6-82].[0-9]-[1-9].baz.[0-9].tgz # URL pattern, usual bash syntax
hjst / Makefile
Created Jun 6, 2017
Makefile for use with PlantUML diagrams
View Makefile
DIAGRAMS_SRC := $(wildcard diagrams/*.plantuml)
DIAGRAMS_PNG := $(addsuffix .png, $(basename $(DIAGRAMS_SRC)))
DIAGRAMS_SVG := $(addsuffix .svg, $(basename $(DIAGRAMS_SRC)))
# Default target first; build PNGs, probably what we want most of the time
png: plantuml.jar $(DIAGRAMS_PNG)
# SVG are nice-to-have but don't need to build by default
svg: plantuml.jar $(DIAGRAMS_SVG)
hjst /
Created Jun 2, 2017
Shell function to set temporary MFA session env vars for AWS CLI access
aws_set_mfa_env_vars () {
# This assumes you have the aws-cli tool already set up and working:
# This is the ARN for your MFA device, it's found in the "Security
# Credentials" tab of your IAM user summary
# This function only takes one parameter: the current TOTP value
# shown on your MFA device (will be a 6 digit number)
hjst / 1_query.graphql
Last active May 11, 2017
Sample cross-table query with postgraphql 3.2.0
View 1_query.graphql
allFilms(first: 5) {
edges {
node {
actors: filmActorsByFilmId {
hjst /
Last active Apr 21, 2017
Reencode .VOB files from an old DVD to .mp4 files of reasonable size
# Based on the two-pass suggestions here:
# Optional: for multiple VOB files you wish to concatenate, do so *before* reencoding:
ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB|VTS_01_3.VOB" -c copy CONCAT.VOB
# The target average bitrate (for -b:v switch) is calculated like so:
# For a video that's 600 seconds long and a target filesize of 200MB
# (200 MiB * 8192 [converts MiB to kBit]) / 600 seconds = ~2730 kBit/s total bitrate
# 2730 - 128 kBit/s (desired audio bitrate) = 2602 kBit/s video bitrate
hjst / abbreviations.tsv
Created Dec 14, 2016
Tab-delimited file of abbreviations used in the OED.
View abbreviations.tsv
abbr title
a. adjective
a. adoption of, adopted from
a (in dates) ante
abbrev. abbreviation (of)
Aberd. Aberdeen
abl. ablative
absol. absolute(ly)
abstr. abstract
Acad. academia, academy, academic(al)
You can’t perform that action at this time.