Skip to content

Instantly share code, notes, and snippets.

View ageis's full-sized avatar
available for hire in Bay Area

Kevin M. Gallagher ageis

available for hire in Bay Area
View GitHub Profile
ageis /
Created May 14, 2018 09:15
OpenPGP KDF-DO setup script for smartcards
#! /bin/bash
# Original author: NIIBE Yutaka <>
# URL:
# Usage: ./
ageis / vlcrc
Last active June 17, 2024 12:44
Best VLC settings for listening to music or audio. Sections go in ~/.config/vlcrc. Applies compression, an equalizer emphasizing low and high mids, volume normalization plus highest-quality sample rate conversion.
[compressor] # Dynamic range compressor
# RMS/peak (float)
# Attack time (float)
# Release time (float)
# Threshold level (float)
# Ratio (float)
ageis /
Last active June 17, 2024 07:52
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

ageis /
Last active June 14, 2024 07:10
Quick GPG Smartcard Guide
ageis /
Last active June 5, 2024 01:36
Prometheus exporter for monitoring statistics of Bitcoin daemon

This is a script written in Python intended to run alongside a Bitcoin node and export statistics for monitoring purposes. It assumes the existence of bitcoin-cli in the PATH and access to the RPC interface over localhost.

It tracks stuff like: block height, difficulty, number of peers, network hash rate, errors, uptime in seconds, mempool size, size of recent blocks, number of transactions within blocks, chaintips, total bytes received and sent, and transaction inputs and outputs. These Bitcoin metrics are refreshed once every 5 minutes.

How it works

Prometheus is a monitoring system and time-series database.

Usage: apt-get -o "Dpkg::options==--option" --reinstall install <package>
$ dpkg --force-help
[!] all Set all force options
[*] downgrade Replace a package with a lower version
configure-any Configure any package which may help this one
hold Process incidental packages even when on hold
not-root Try to (de)install things even when not root
bad-path PATH is missing important programs, problems likely
bad-verify Install a package even if it fails authenticity check
ageis /
Last active May 20, 2024 09:52
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.

ageis / .bashrc 02-25-2020
Last active May 10, 2024 02:34
@ageis's ~/.bashrc 🖥️ with numerous useful functions, aliases and one-liners. ⚠️ NOTE: many paths in sourced scripts and environment variables are specific to my system, but if you dig in I hope you'll find something you can use!
# ~/.bashrc: executed by bash(1) for non-login shells.
# kevin gallagher (@ageis) <>
# normally I divide this into separate files: .bashrc, .bash_profile, .bash_aliases and .bash_functions (also .bash_logout), but it's all concatenated here.
ulimit -s unlimited
export MYUID=$(id -u)
export USER="$(id -un)"
if [[ "$TILIX_ID" ]] || [[ "$VTE_VERSION" ]]; then
ageis / Generating stronger DH parameters for nginx
Last active May 5, 2024 12:11 — forked from plentz/nginx.conf
Generating stronger DH parameters for nginx's SSL
# run in the terminal, then set as ssl_dhparam in nginx.conf
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 4096
ageis / dirmngr.conf
Last active February 19, 2024 21:05
GnuPG configuration files
log-file /home/kevin/.gnupg/dirmngr.log
debug-level basic
debug ipc,dns
keyserver hkps://
hkp-cacert /usr/share/gnupg/sks-keyservers.netCA.pem