This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# climbing_stats.py - Compute climbing stats from Google location history | |
# | |
# Author: Amber Sprenkels <amber@electricdusk.com> | |
# Date: 2024-03-12 | |
# | |
# This scripts computes the number of times I went to a local climbing or | |
# bouldering gym close to where I live, based on my Google location history. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
WGET="wget --quiet" | |
URL="http://example.com/piwik/index.php" | |
# make sure that these values are correctly url-encoded! | |
MYSQL_DB="piwik" | |
MYSQL_USER="piwik" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright 2015 Daan Sprenkels <dsprenkels@gmail.com> | |
export MPD_HOST="$MPD_PASSWD@localhost" | |
export MPD_PORT=6600 | |
PLAYLISTS_DIR="/var/lib/mpd/playlists" | |
# Don't activate if we are already playing music |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# install.sh | |
# | |
# Installation instruction for getting Ethan's Dilithium code up and running. | |
# | |
# Author: Amber Sprenkels <amber@electricdusk.com> | |
# Date: 17 May 2022 | |
# shellcheck disable=SC2164,SC2155 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# CHANGELOG | |
# | |
# [2015-12-21 Daan] Basic /etc/firewall.sh configuration | |
# This configuration is based on the whitelist principle, in contrast to the | |
# previous configuration, which only dropped packets based on specific rules. | |
# make iptables wait for exclusive lock always | |
IPTABLES="/sbin/iptables -w" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
A toy implementation of Shamir's secret sharing scheme in Python | |
Copyright (c) 2017 Daan Sprenkels <hello@dsprenkels.com> | |
*Do not use in production code!* | |
This is a toy implementation. This code is hardened against regular and cache | |
timing attacks. But Python is a high-level language, and thus not suitable for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Do a nightly build of LLVM master. | |
# | |
# Author: Daan Sprenkels <daan@dsprenkels.com> | |
set -e | |
WORKSPACE="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
readonly txtfile="$(mktemp "print-plaintext.XXXXXXXXXX.txt")" | |
readonly pdffile="${txtfile/.txt/.pdf}" | |
cat "$@" >"$txtfile" | |
libreoffice --convert-to "pdf" "$txtfile" | |
lpr "$pdffile" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
readonly OUTPUT_FMT="%(uploader)s [%(upload_date)s] - %(title)s.%(ext)s" | |
readonly COOKIES_FILE="$(dirname "$0")/.config/cookies.txt" | |
readonly ONLY_DOWNLOAD_LAST_N="10" | |
SYNC="0" | |
if [ "$1" = "sync" ]; then | |
# Add a channel; i.e. prefill the cache | |
SYNC="1" |
NewerOlder