Skip to content

Instantly share code, notes, and snippets.

View stupidpupil's full-sized avatar
💭
I may be slow to respond.

A Watkins stupidpupil

💭
I may be slow to respond.
View GitHub Profile
class ZeteticCharacterVoice_ZetBastila extends XComCharacterVoice;
struct EventMap
{
var() Name EventName;
var() array<Name> FallbackNames;
var() array<Name> SoundCueNames;
};
@stupidpupil
stupidpupil / recolour.sh
Created December 22, 2018 11:37
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")"
done
ffmpeg -y -i new_frames/%04d.png -r 25 -pix_fmt yuv420p out.mp4
@stupidpupil
stupidpupil / bnf_name.peg
Last active August 8, 2018 19:33
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
stupidpupil / GalliumOS on Edgar.markdown
Last active April 21, 2022 22:42
Guide to installing GalliumOS on an Acer Chromebook 14" (CB3-431) 'Edgar'

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

function plotIsOnAnIsland(pPlot)
local canGoOnLand
canGoOnLand = function (pStartingPlot, iDirection, iDistance, iDirectionConstraint)
if iDirectionConstraint == nil then
iDirectionConstraint = iDirection
end
local directionMeetsConstraint = function(dir)
@stupidpupil
stupidpupil / usr.sbin.hostapd
Last active September 12, 2017 00:04
hostapd Debian AppArmor profile
#include <tunables/global>
/usr/sbin/hostapd {
#include <abstractions/base>
#include <abstractions/nameservice>
capability net_admin,
capability net_raw,
network packet,
network raw,
@stupidpupil
stupidpupil / alfa.rb
Created January 10, 2017 22:33
A script for spelling out strings using macOS's `say` command
#!/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',
@stupidpupil
stupidpupil / pre-commit.sh
Last active September 1, 2016 00:32
Beancount git pre-commit hook
#!/bin/sh
git stash --quiet --keep-index --include-untracked
bean_check_err=`bean-check main.beancount 2>&1 >/dev/null`
git stash pop --quiet --index
error_lines=`printf "$bean_check_err" | wc -l | awk {'print $1'}`
if [ $error_lines -eq 0 ]; then
echo "\\033[32mBean-check passed! 💰\\033[0;39m"
@stupidpupil
stupidpupil / keybase.md
Last active August 27, 2016 20:13
Keybase proof

Keybase proof

I hereby claim:

  • I am stupidpupil on github.
  • I am stupidpupil (https://keybase.io/stupidpupil) on keybase.
  • I have a public key ASDrdrqkxDCuh0QfHB9aKB6FAFsbD7XGnwoauKin2JGNego

To claim this, I am signing this object:

@stupidpupil
stupidpupil / suricata.service
Last active May 17, 2021 13:26
Suricata systemd file
[Unit]
Description=Suricata IDS/IDP daemon
After=network.target
Requires=network.target
Documentation=man:suricata(8) man:suricatasc(8)
Documentation=https://redmine.openinfosecfoundation.org/projects/suricata/wiki
[Service]
Type=forking
Environment=LD_PREDLOAD=/usr/lib/libtcmalloc_minimal.so.4