Skip to content

Instantly share code, notes, and snippets.

View hawko2600's full-sized avatar
🎯
Focusing

Matthew Hawkins hawko2600

🎯
Focusing
  • Canberra, Australia
View GitHub Profile
@hawko2600
hawko2600 / heartbleed-apps
Created April 9, 2014 12:08
List apps linked against a potentially heartbleed-vulnerable openssl on your Mac
View heartbleed-apps
for i in /usr/local/{bin,sbin}/*; do otool -L $i; done | sed -e '/^.*is not an object file.*$/d' -e 's|^\(/.*\):$|@\1|' | awk 'BEGIN { RS="@" } !/ssl/ { next } !/^[[:space:]]*(\/.*ssl\.0.9.8.*\.dylib)/ { print $1 }'
@hawko2600
hawko2600 / netbox+uwsgi.md
Last active October 14, 2017 03:46
Running digitalocean/netbox under nginx + uwsgi
View netbox+uwsgi.md

nginx + uwsgi installation

uwsgi is an alternative to using gunicorn + supervisord. It has native proxy support via the WSGI protocol in nginx.

# apt-get install uwsgi uwsgi-plugin-python3

Add a site to uwsgi in /etc/uwsgi/apps-available/netbox.ini:

@hawko2600
hawko2600 / zsh-addon-update-check.zsh
Last active June 30, 2018 05:55
zsh addon update check
View zsh-addon-update-check.zsh
function _do-gen-update() {
echo "Upgrading $2..."
case "$2" in
volt) volt self-upgrade -check ;;
zplugin) zplugin upgrade --all ;;
*) echo "Unknown application $2. Moving on..." ;;
esac
touch "$1"
}
@hawko2600
hawko2600 / nifi-ca.sh
Created September 20, 2023 00:15
Java keytool based CA and certificate signer for Apache NiFi
View nifi-ca.sh
#!/bin/bash
CANAME=${CANAME:-rootCA}
CA2NAME=${CA2NAME:-intermediateCA}
NIFI_SERVER=${NIFI_SERVER:-nifi01}
DOMAIN=${DOMAIN:-localdomain}
IP_ADDRESS=${IP_ADDRESS:-127.0.0.1}
EMAIL="${EMAIL:-nifi@${NIFI_SERVER}.${DOMAIN}}"
EXT="SAN=IP:127.0.0.1,IP:${IP_ADDRESS},DNS:${NIFI_SERVER}.${DOMAIN},DNS:${NIFI_SERVER},DNS:localhost,EMAIL:${EMAIL}"
EXT2="KeyUsage=digitalSignature,keyEncipherment,nonRepudiation,dataEncipherment,keyAgreement,keyCertSign,cRLSign"