Skip to content

Instantly share code, notes, and snippets.

View ageis's full-sized avatar
💭
available for hire in Bay Area https://cointel.pro/resume

Kevin M. Gallagher ageis

💭
available for hire in Bay Area https://cointel.pro/resume
View GitHub Profile
@ageis
ageis / systemd_service_hardening.md
Last active May 14, 2025 22:12
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:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@ageis
ageis / YubiKey-GPG-SSH-guide.md
Last active April 10, 2025 08:49
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
ageis / vlcrc
Last active March 14, 2025 02:58
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)
compressor-rms-peak=0.100000
# Attack time (float)
compressor-attack=50.000000
# Release time (float)
compressor-release=250.000000
# Threshold level (float)
compressor-threshold=-20.000000
# Ratio (float)
@ageis
ageis / .gitconfig
Last active February 22, 2025 12:01
@ageis .gitconfig
[user]
email = kevingallagher@gmail.com
name = Kevin M. Gallagher
signingkey = 0x3B324F4FF73BECF8
[core]
editor = vim
excludesfile = /etc/gitignore
autocrlf = true
compression = 9
fscache = true
@ageis
ageis / Generating stronger DH parameters for nginx
Last active January 28, 2025 02:45 — 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
ageis / get-figlet-fonts.sh
Last active January 23, 2025 01:58
Grab all Figlet fonts in existence (WIP)
#!/bin/bash
# Installs as many fonts for Figlet/Toilet as possible from multiple sources.
# Author: Kevin M. Gallagher (@ageis)
#set -u
#set -x
export FIGLET_FONT_DIR=$(figlet -I2)
export TMP_FONT_DIR="$(pwd)/fonts"
export TMP_DEST_DIR="$(pwd)/tmp"
export FONT_REGEX=".*\.\(flf\|tlf\|flc\)$"
@ageis
ageis / openpgp-card-guide.md
Last active November 6, 2024 14:28
Quick GPG Smartcard Guide
@ageis
ageis / testdns.sh
Last active October 30, 2024 10:38
Bash script that measures ICMP and DNS latency to many popular public nameservers.
#!/bin/bash
# Measures ICMP and DNS latency to many popular public DNS servers.
# Works concurrently or in parallel.
# Author: Kevin M. Gallagher (@ageis)
#set -x
#set -e
#set -o nounset
#set -v
export ERRFILE="./testdns_errs.txt"
@ageis
ageis / certbot_exporter.md
Last active October 24, 2024 17:41
certbot Prometheus exporter (Let's Encrypt metrics)

This is a script written in Python intended to run alongside a certbot instance and export statistics for monitoring purposes. It assumes the existence of certbot in the PATH plus read access to /etc/letsencrypt.

It tracks stuff like: number of certs, number of SANs, expiry time, seconds until expiry, and the status of the certificate per ACME.

How it works

Prometheus is a monitoring system and time-series database.

Building a grsec-patched Linux kernel for Debian 8 and DigitalOcean

It's possible to run a custom (instead of hypervisor-managed) kernel for use with Debian 8.x on a DigitalOcean droplet.

We'll build one with grsecurity, "an extensive security enhancement to the Linux kernel that defends against a wide range of security threats through intelligent access control, memory corruption-based exploit prevention, and a host of other system hardening".

Note: The stable patches for Linux 3.14.x and 3.2.x are not publicly available anymore, so we'll be applying the free 4.3.x (test) patch. The URLs and filenames in this document may become outdated, so fetch the latest from grsecurity.net and kernel.org.

Install dependencies: