Skip to content

Instantly share code, notes, and snippets.

View kgriffs's full-sized avatar

Kurt Griffiths kgriffs

View GitHub Profile
@kgriffs
kgriffs / GPG and git on macOS.md
Created August 29, 2017 22:13 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@kgriffs
kgriffs / aws.md
Created April 28, 2018 19:50 — forked from colinvh/aws.md
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@kgriffs
kgriffs / compile-haproxy.sh
Created May 25, 2018 23:16 — forked from meanevo/compile-haproxy.sh
Compile HAProxy from source on CentOS 7
# Make sure you have these installed
yum install -y make gcc perl pcre-devel zlib-devel
# Download/Extract source
wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz
tar -zxvf /tmp/haproxy.tgz -C /tmp
cd /tmp/haproxy-*
# Compile HAProxy
# https://github.com/haproxy/haproxy/blob/master/README
make \
TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
@kgriffs
kgriffs / gcp_ips.sh
Last active October 15, 2019 17:17 — forked from vulkoingim/gcp_ips.sh
Get GCP Public IP Ranges
#!/usr/bin/env bash
# This script lists all ip ranges currently used by
# the google cloud platform, according to ns-lookup / dig
# TXT _cloud-netblocks.googleusercontent.com
#
# https://cloud.google.com/compute/docs/faq#find_ip_range
errcho() {
>&2 echo "$@"
@kgriffs
kgriffs / unused.py
Created January 20, 2020 22:47 — forked from jmvrbanac/unused.py
Get Unused Port
def get_unused_port():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('localhost', 0))
_, port = sock.getsockname()
sock.close()
return port
@kgriffs
kgriffs / naxsi.rules
Created March 17, 2020 15:12 — forked from goblindegook/naxsi.rules
WordPress (Nginx)
# -*- mode: nginx; mode:autopair; mode: flyspell-prog; ispell-local-dictionary: "american" -*-
# LearningMode;
SecRulesEnabled;
DeniedUrl "/RequestDenied"
CheckRule "$SQL >= 8" BLOCK;
CheckRule "$RFI >= 8" BLOCK;
CheckRule "$TRAVERSAL >= 4" BLOCK;