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
### Keybase proof
I hereby claim:
* I am ageis on github.
* I am ageis (https://keybase.io/ageis) on keybase.
* I have a public key whose fingerprint is 2258 6762 C39A 5DFF F7D7 FDC5 5F4F 4788 5921 D69C
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ageis on github.
  • I am ageis (https://keybase.io/ageis) on keybase.
  • I have a public key whose fingerprint is 2C84 664F 26AA E27B AD57 90FD B604 C32A D5D7 C6D8

To claim this, I am signing this object:

## Address Space Protection
# Disable privileged io: iopl(2) and ioperm(2)
# Warning: Xorg without modesetting needs it to be 0
kernel.grsecurity.disable_priv_io = 1
kernel.grsecurity.deter_bruteforce = 1
kernel.grsecurity.deny_new_usb = 0
kernel.grsecurity.harden_ipc = 1
## Filesystem Protections
@ageis
ageis / .bash_functions
Last active August 27, 2017 06:32
systemd service unit management in minimal keystrokes.
#!/bin/bash
function stop () {
sudo systemctl stop "$1"
sleep 3s
}
function start () {
sleep 3s
sudo systemctl start "$1"
@ageis
ageis / updateall.sh
Last active February 9, 2018 07:15
Update gems, nodejs, Perl, PyPi modules and apt packages
function updateall() {
#set -o pipefail noclobber erexit
set -v
#set -e
#set -x
function exit_error() {
echo "You can only run updateall() once at a time." >&2
}
function status() {
echo "Exit code is $1"
@ageis
ageis / tor_monitor.py
Created February 12, 2018 17:57
Simple Prometheus exporter in Python for traffic metrics from a running Tor daemon.
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Simple Prometheus exporter for traffic metrics
from a running Tor daemon. """
import re
import time
import sys
from prometheus_client import start_http_server, Gauge
import stem
from stem.control import Controller
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
ageis / HTTP_Ubuntu_Mirrors.txt
Created February 22, 2018 15:15
List of Ubuntu Mirrors as of Feb 22, 2018
http://ubuntu.unc.edu.ar/ubuntu/
http://mirrors.asnet.am/ubuntu/
http://mirror.aarnet.edu.au/pub/ubuntu/archive/
http://mirror.waia.asn.au/ubuntu/
http://ubuntu.melbourneitmirror.net/archive/
http://ubuntu.mirror.solnode.io/ubuntu/
http://ftp.iinet.net.au/pub/ubuntu/
http://mirror.as24220.net/pub/ubuntu-archive/
http://mirror.as24220.net/pub/ubuntu/
http://mirror.intergrid.com.au/ubuntu/
@ageis
ageis / smartcard-reset.txt
Created August 25, 2017 20:48
Raw hex gpg-agent commands to reset OpenPGP smartcard(s) to factory defaults
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@ageis
ageis / testdns.sh
Last active April 15, 2018 00:37
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"