Skip to content

Instantly share code, notes, and snippets.

View AndrewKvalheim's full-sized avatar

Andrew AndrewKvalheim

View GitHub Profile
@AndrewKvalheim
AndrewKvalheim / ecm-classika-pid.dot
Created April 29, 2020 22:44
Diagram of ECM Classika PID
graph {
nodesep = 0.2; ranksep = 0.2;
water [shape=plain, group=a];
reservoir [shape=oval, group=a];
split_a [shape=point, group=a];
filter_a [shape=box, label="filter", group=a];
pump [shape=box, group=a];
one_way [shape=diamond, group=a, label="one way", margin=0];
split_b [shape=point, group=a];
@AndrewKvalheim
AndrewKvalheim / mastodon-notes.md
Last active February 9, 2024 18:30
Notes on running a personal Mastodon instance

Personal Mastodon instance

Effective total cost: $3–5/mo

Setup

Decide on an EC2 instance type:

  1. At AWS Console → EC2 → Instance Types, filter for ≥1 GB RAM and sort by price.
  • t4g.micro is lowest.
@AndrewKvalheim
AndrewKvalheim / private-build-plans.toml
Created March 31, 2021 18:06
Iosevka configuration
#
# Proportional
#
[buildPlans.iosevka-custom-proportional]
family = "Iosevka Custom Proportional"
slopes = { upright = "normal", italic = "italic" }
widths = { normal = { css = "normal", menu = 5, shape = 500 } }
ligations = { inherits = "jspt" }
quasiProportionalDiversity = 1
@AndrewKvalheim
AndrewKvalheim / readme.md
Last active June 5, 2021 16:21
Make the Firefox 89 “compact” mode actually compact

screenshot

  1. Remove waypoints and imprecise points with [GPSBabel]:

    gpsbabel \
      -i 'gpx' -f 'original/2021-08-23T21-35-41Z Mary Avenue Trail.gpx' \
      -x 'nuketypes,waypoints' \
      -x 'discard,hdop=2' \
      -o 'gpx' -F '/tmp/2021-08-23T21-35-41Z Mary Avenue Trail.gpx'
@AndrewKvalheim
AndrewKvalheim / off
Created March 8, 2022 18:04
End-of-day update and shut down script
#!/usr/bin/env bash
set -Eeuo pipefail
sudo --validate
concurrently \
--names 'apt,docker,node,ruby,rust' \
--prefix-colors 'yellow,blue,green,red,cyan' \
'sudo apt-get update && sudo apt-get upgrade --yes' \
'docker system prune --force --volumes' \
@AndrewKvalheim
AndrewKvalheim / README.md
Last active February 14, 2024 04:32
Simple Dokku virtual machine

Create the Dokku instance:

vagrant up

Configure SSH (see how to enable ~/.ssh/config.d):

vagrant ssh-config --host 'dokku' > ~/.ssh/config.d/dokku
@AndrewKvalheim
AndrewKvalheim / readme.md
Created June 10, 2022 15:40
JOSM Scripting Plugin on NixOS
@AndrewKvalheim
AndrewKvalheim / github-remote
Created June 28, 2022 03:06
Configure GitHub remotes for HTTPS fetch and SSH push
#!/usr/bin/env bash
set -Eeuo pipefail
if [[ ! ( "${1-}" =~ ^([-_[:alnum:]]+)/([-_.[:alnum:]]+)$ ) ]]; then
echo "Usage: ${0##*/} <owner>/<repo>" >&2
exit 1
fi
owner="${BASH_REMATCH[1]}"
repo="${BASH_REMATCH[2]}"
@AndrewKvalheim
AndrewKvalheim / disabled-extensions-notification
Last active March 1, 2024 22:51
Notification of automatically disabled GNOME Shell extensions
#!/usr/bin/env bash
set -Eeuo pipefail
[[ "$(gsettings get org.gnome.shell disable-user-extensions)" == 'true' ]] || exit
case "$(notify-send --urgency 'critical' --icon 'extensions' \
'Extensions have been automatically disabled.' \
--action 'enable=Re-Enable' \
--action 'settings=Settings…')" \
in