Skip to content

Instantly share code, notes, and snippets.

View ~ › .config › nixpkgs › overlays › unstable.nix
_: pkgs:
let
unstable = import <unstable> { overlays = [ ]; };
overrideUntilVersion = p: v: (if pkgs ? ${p} && pkgs.lib.versionAtLeast pkgs.${p}.version v then pkgs else unstable).${p};
in
builtins.mapAttrs overrideUntilVersion {
aws-sam-cli = "1.52.0";
darktable = "4.0.0";
efficient-compression-tool = "0.9.1";
kitty = "0.25.2";
@AndrewKvalheim
AndrewKvalheim / disabled-extensions-notification
Last active Jul 3, 2022
Notification of automatically disabled GNOME Shell extensions
View disabled-extensions-notification
#!/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
@AndrewKvalheim
AndrewKvalheim / github-remote
Created Jun 28, 2022
Configure GitHub remotes for HTTPS fetch and SSH push
View github-remote
#!/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 / readme.md
Created Jun 10, 2022
JOSM Scripting Plugin on NixOS
View readme.md
@AndrewKvalheim
AndrewKvalheim / README.md
Last active Mar 20, 2022
Simple Dokku virtual machine
View README.md

Create the Dokku instance:

vagrant up

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

vagrant ssh-config --host 'dokku' &gt; ~/.ssh/config.d/dokku
@AndrewKvalheim
AndrewKvalheim / off
Created Mar 8, 2022
End-of-day update and shut down script
View off
#!/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' \
View GPS trace processing.md
  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 / readme.md
Last active Jun 5, 2021
Make the Firefox 89 “compact” mode actually compact
View private-build-plans.toml
#
# 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 / mastodon-notes.md
Last active May 1, 2022
Notes on running a personal Mastodon instance
View mastodon-notes.md

Personal Mastodon instance

Effective total cost: $3–4/mo

Setup

Decide on an EC2 instance type:

  1. At AWS Console → EC2 → Instance Types, filter for ≥1 GB RAM and sort by price.
  • t3a.micro is lowest.