Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Adam Watkins stupidpupil

I may be slow to respond.
View GitHub Profile
stupidpupil /
Last active Aug 29, 2020
Yet Another Minecraft systemd service file, and accessories. (Gracefully handles shutdown properly, whilst still eventually SIGKILL-ing if that doesn't work.)
server_properties_path=$(dirname "$0")"/../server/"
rcon_port=$(awk -F "=" '/rcon.port/ {print $2}' "$server_properties_path")
rcon_password=$(awk -F "=" '/rcon.password/ {print $2}' "$server_properties_path")
"$(dirname "$0")/mcrcon" -H -P "$rcon_port" -p "$rcon_password" "$1"
stupidpupil / chickenpox.json
Last active Jul 10, 2019
From, 10th July 2019
View chickenpox.json
"description": "Find out all you need know about chickenpox, including what the symptoms are, how to treat it and when to get medical advice.",
"author": {
"logo": "",
"email": "",
"url": "",
"name": "NHS website",
"@type": "Organization"
"lastReviewed": ["2017-05-26T00:00:00+00:00", "2020-05-26T00:00:00+00:00"],
View CoH2 to

I note that I've done most of my actual file and audio processing under either macOS or Linux, where I'm much more familiar with the scripting tools. I might not be able to help you as much I'd like.

General advice for trying to make a voice pack

I'd suggest taking a look at my voicepack template or at least Kregano's tutorial that it's based off.

Why? Well, Kregano's tutorial covers using a script (by robojumper) that fixes several problems with the built-in approach to voice 'banks', and my template then tries to help you avoid having to decide what to name bits of code and stuff.

If you do try my template, I suggest calling your project and your mod something like 'SlickSlothGrenadierVoice' or something (without spaces, and the same name for the project and mod) otherwise it ends up even more confusing in places...

Getting CoH2 sound files into XCOM 2

View ZeteticCharacterVoice_ZetBastila.uc
class ZeteticCharacterVoice_ZetBastila extends XComCharacterVoice;
struct EventMap
var() Name EventName;
var() array<Name> FallbackNames;
var() array<Name> SoundCueNames;
stupidpupil /
Created Dec 22, 2018
Recolouring a film using ffmpeg and magick
ffmpeg -i original.mp4 "original_frames/$filename%04d.png"
for infile in original_frames/*.png; do
convert "$infile" -color-matrix '0.6 -0.2 0.1 -0.4 0.4 0.4 -0.4 0.5 0.4' -modulate 180% "new_frames/$(basename "$infile")"
ffmpeg -y -i new_frames/%04d.png -r 25 -pix_fmt yuv420p out.mp4
View bnf_name.peg
bnf_name <-
("Gppe " form "_" product_name_word (" "* (ratio / quantity / modifier / product_name_word))*) /
((product_name_word " "?)+ "_" (" "* (!form product_name_word))* " "* form (" "* (ratio / quantity / modifier))*)
product_name_word <- r'[^\s_]+' ;
ratio <- (quantity / number) ("/" / ";") (ratio / quantity / unit / number);
stupidpupil / GalliumOS on Edgar.markdown
Last active Aug 19, 2020
Guide to installing GalliumOS on an Acer Chromebook 14" (CB3-431) 'Edgar'
View GalliumOS on Edgar.markdown

GalliumOS on Edgar

This document sets out how I installed GalliumOS 2.1 on a new Acer Chromebook 14" (CB3-431) 'Edgar' in April 2017. I installed GalliumOS on the internal eMMC storage, but left Chrome OS in place (allowing dual-booting).

It is meant to be an easy-to-follow and particularly thorough (if repetitive) guide, but I make no warranty that it will work correctly for you. It will wipe all data on your Edgar.

I have tried to provide references for each section; see the GalliumOS wiki guide to chrx installation for an overview of the general process.

Caution: There have been reports of Edgars' speakers overheating, due to a malfunction of the audio hardware, when booted into anything other than Chrome OS. I have not experienced this, and it seems to be believed that this will not now occur under GalliumOS. More information can be found in the comments for the [GalliumOS Braswell Platform Validation

View plotIsOnAnIsland.lua
function plotIsOnAnIsland(pPlot)
local canGoOnLand
canGoOnLand = function (pStartingPlot, iDirection, iDistance, iDirectionConstraint)
if iDirectionConstraint == nil then
iDirectionConstraint = iDirection
local directionMeetsConstraint = function(dir)
stupidpupil / usr.sbin.hostapd
Last active Sep 12, 2017
hostapd Debian AppArmor profile
View usr.sbin.hostapd
#include <tunables/global>
/usr/sbin/hostapd {
#include <abstractions/base>
#include <abstractions/nameservice>
capability net_admin,
capability net_raw,
network packet,
network raw,
stupidpupil / alfa.rb
Created Jan 10, 2017
A script for spelling out strings using macOS's `say` command
View alfa.rb
#!/usr/bin/env ruby
# A script for spelling out strings using macOS's `say` command.
# Uses the NATO/ICAO spelling alphabet, mostly.
# Mapped to spellings that produce the desired effect, specifically with the Fiona voice.
# Didn't use phonemes as these are not reliably available for recent (Nuance) voices.
# TODO: Use ICU to get Unicode character names
mapping = {
'a' => 'alfa',
You can’t perform that action at this time.