Skip to content

Instantly share code, notes, and snippets.

View JonathonReinhart's full-sized avatar

Jonathon Reinhart JonathonReinhart

View GitHub Profile
@JonathonReinhart
JonathonReinhart / dropbox.md
Created October 15, 2021 21:37
Installing Dropbox on Linux

See https://www.dropbox.com/install?os=lnx

curl -L -O https://www.dropbox.com/download?dl=packages/ubuntu/dropbox_2020.03.04_amd64.deb

apt install python3-gpg
apt install ./dropbox_*.deb

dropbox start -i
@JonathonReinhart
JonathonReinhart / travis-debug.md
Last active October 3, 2021 03:46
Remotely debugging Travis CI

This is a method of using ngrok to live-debug a Travis CI build.

(This is from some terse notes I took while working on staticx and hasn't been re-verified.)

Add to .travis.yml:

env:
  NGROK_TOKEN=...

addons:
@JonathonReinhart
JonathonReinhart / powerline.md
Last active December 14, 2021 23:13
Installing Powerline on Debian

First, install powerline:

$ sudo apt install powerline

Optionally consult docs:

$ less /usr/share/doc/powerline/README.Debian

Enable in ~/.bashrc:

@JonathonReinhart
JonathonReinhart / findoldpy.py
Created August 7, 2021 06:05
Find Python scripts which use an old Python shebang
#!/usr/bin/env python3
import os
from pathlib import Path
import sys
bad_shebangs = {
'/usr/bin/python',
'/usr/bin/env python',
}
@JonathonReinhart
JonathonReinhart / data.txt
Created April 2, 2021 22:03
Are multiple MAP_PRIVATE mappings of the same file, in the same process, still private?
0123456789ABCDEF
@JonathonReinhart
JonathonReinhart / google_dns_thing.py
Created February 19, 2021 05:29
Fetch all Google mail netblocks
#!/usr/bin/env python3
import dns.resolver
from ipaddress import IPv4Network, IPv6Network, ip_address
GOOGLE_NETBLOCKS = [
'_netblocks.google.com',
'_netblocks2.google.com',
'_netblocks3.google.com',
]
@JonathonReinhart
JonathonReinhart / .env
Last active January 4, 2021 02:55
phpdotenv unset variable demo
# A simple, constant env var
CONST='A constant env var'
# Derived from another variable
DERIV="I came from ${CONST} with some more"
# An environment variable we expect to be set on the outside
EXT_SET=${ENV_EXT_SET}
# An environment variable we expect *not* to be set on the outside
@JonathonReinhart
JonathonReinhart / decrypt-pfsense-config.sh
Created November 5, 2020 09:17
Decrypt pfSense encrypted config backups
#!/bin/bash
# Adapted from https://forum.netgate.com/topic/139561
set -o pipefail
if [[ $# -lt 1 ]]; then
echo "Usage: $(basename $0) <encrypted-config>"
exit 1
fi
inpath="$1"
tmpout="$(mktemp)"
@JonathonReinhart
JonathonReinhart / docker-compose.yml
Last active March 23, 2026 12:00
Mysql docker image: Always run initialization scripts
version: '2'
services:
# MySQL Database
db:
image: mysql:5.6
volumes:
- ./data/mysql:/var/lib/mysql
- ./mysql-entrypoint.sh:/custom-entrypoint.sh:ro
@JonathonReinhart
JonathonReinhart / ANSI.md
Last active September 17, 2020 19:14 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27