Skip to content

Instantly share code, notes, and snippets.

View shawnsi's full-sized avatar

Shawn Siefkas shawnsi

View GitHub Profile
@shawnsi
shawnsi / aws-ip-ranges.py
Created December 16, 2014 20:43
AWS IP Range Parsing
#!/usr/bin/env python
from __future__ import print_function
import requests
def merge_prefixes(payload):
"""
Converts the AWS services JSON payload into a list of tuples.
Arguments:
@shawnsi
shawnsi / gist:0ea9127d4f9be6bf2fcc
Created December 2, 2014 22:51
Apache Proxy for Spring Security
NameVirtualHost IP:80
<VirtualHost IP:80>
ServerName local.bhg.com
RequestHeader set X-Forwarded-Proto https
RewriteRule ^(/.*)?$ http://localhost:9094$1 [P]
ProxyPassReverse / http://localhost:9094/
</VirtualHost>
@shawnsi
shawnsi / pacdiff.sh
Created November 20, 2014 17:18
Backups to supplement Pacman based restores
#!/bin/bash
#
# Creates a tarsnap backup of all files we can't reasonably expect to get back
# from pacman. Files matching these conditions are included:
#
# 1. located in /etc and not owned by any package
# 2. owned by a package and modified since installation
# Create temporary space
INCLUDES=$(mktemp)
@shawnsi
shawnsi / tid.tcl
Last active August 29, 2015 14:08
F5 Transaction ID
when HTTP_REQUEST {
# Initialize the hex string variable
set hex ""
# Loop to create 8 random bytes
for {set i 0} {$i<8} {incr i} {
# Create a byte from the PRNG
set byte [expr { int(rand() * 256) }]
@shawnsi
shawnsi / gist:5256438
Created March 27, 2013 17:41
Setting up a docker bridge on Arch

Up

brctl addbr dockbr0
ip a add 172.16.0.1/24 dev dockbr0
ip link set dockbr0 up

Down

@shawnsi
shawnsi / gist:5222443
Last active December 15, 2015 07:19
Docker -d crash info (Issue #97)

Issue #97

Quick rundown of my experience with moby/moby#97

The docker binary is built with the development environment instructions in the README. I move the binary into /usr/local/bin in the vagrant vm and restart the dockerd service.

Cause

All is well until I start a container with port forwarding like so. Any image, any port, and any command seem to cause the problem.

@shawnsi
shawnsi / Makefile
Last active December 13, 2015 17:28
ImageMagick Makefile - Solaris 10
# Parallelization
CORES?=1
# Configure Command
PREFIX?=/usr/local
AS=${PREFIX}/bin/as
LD=${PREFIX}/bin/ld
CPPFLAGS=-I${PREFIX}/include
LDFLAGS=-L${PREFIX}/lib:/usr/lib -R${PREFIX}/lib:/usr/lib -lsocket
CONFIGURE=./configure --prefix=${PREFIX}