Skip to content

Instantly share code, notes, and snippets.

View fawkesley's full-sized avatar

Paul Fawkesley fawkesley

View GitHub Profile
fawkesley / scrubEmailsAndNamesOfGamesStartedOver90DaysAgo.js
Created November 15, 2023 16:30
Google Sheets Apps Script to redact certain columns for rows older than 90 days (for use with Google Forms)
View scrubEmailsAndNamesOfGamesStartedOver90DaysAgo.js
function scrubEmailsAndNamesOfGamesStartedOver90DaysAgo() {
const sheetName = 'responses';
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName(sheetName);
if(!sheet) {
throw new Error('failed to get sheet `' + sheetName + '`');
const data = sheet.getDataRange().getValues();
fawkesley /
Last active May 23, 2022 01:27 - wait for laptop battery to drain to 80% then power off. save battery lifetime.
#!/bin/sh -eu
while true
sudo whoami > /dev/null
BATT_PERCENT=$(cat /sys/class/power_supply/BAT0/capacity)
fawkesley / logger.go
Created May 22, 2022 16:58
Golang logger with custom colour support
View logger.go
package logger
import (
fawkesley /
Created February 7, 2020 15:51
change a booking date

booking server:

select * from bookings where primary_email='<EMAIL>';

(write down the booking UUID, game UUID)

update bookings SET date='', game_url='', sent_joining_instructions=false WHERE uuid = '';
fawkesley /
Last active December 7, 2021 15:22
utm_medium / utm_source / utm_campaign
  • utm_medium required - can be e.g. referral, social, email
  • utm_source is required - e.g.
  • utm_campaign is optional e.g. june-giveaway

Use these utm_* parameters in these scenarios:

facebook ad (boosted post / ad)

fawkesley /
Last active December 16, 2019 20:17
SSH user / authorized keys
export NEW_USER=exampleuser
export NEW_HOME=/home/$NEW_USER
sudo useradd $NEW_USER \
--home $NEW_HOME \
--create-home \
--shell /bin/bash \
--groups ssh
sudo passwd $NEW_USER
fawkesley / .gitconfig
Created March 11, 2019 21:33
.gitconfig snippet for nice `git log` showing signature status
View .gitconfig
date = relative
pretty = "%C(yellow)%h %C(blue)%<(50,trunc)%s %C(green)%<(8,trunc)%ad %C(reset)%ae%n%>(69,trunc)%C(magenta)%G? %GS%n%-b"
fawkesley /
Created January 11, 2019 10:51
Raid-1 + LUKS encrypted filesystem

make encrypted luks partition on raid-1 array from free space

  • use cfdisk /dev/sda to create a new partition in free space with type "Linux RAID"
  • repeat for /dev/sdb
  • cat /proc/mdstat to see what /dev/mdX device is next
$ mdadm --create --verbose /dev/md4 --level=1 --raid-devices=2 /dev/sda6 /dev/sdb6
View termtosvg-emoji.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.