Skip to content

Instantly share code, notes, and snippets.

View mbklein's full-sized avatar

Michael B. Klein mbklein

  • Northwestern University
  • Evanston, IL
View GitHub Profile
@mbklein
mbklein / nginx.conf
Created October 8, 2018 15:53 — forked from regadas/nginx.conf
nginx cached forward proxy #example
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
multi_accept on;
use epoll;
}
@mbklein
mbklein / proxy-toggle.sh
Created April 16, 2018 23:04 — forked from dgoguerra/proxy-toggle.sh
Script to toggle Mac OS X SOCKS proxy, and setup a SOCKS server with SSH
#!/bin/sh
PROXY_INTERFACE="Wi-Fi"
PROXY_HOST=127.0.0.1
PROXY_PORT=1080
# A host where ssh can login without interaction, with a key-based
# authentication.
SOCKS_PROC_USER="username"
SOCKS_PROC_HOST="example.com"
@mbklein
mbklein / powssl
Created February 5, 2014 18:14 — forked from paulnicholson/powssl

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.github.com/mbklein/8829826/raw/3ea59efe8c7e9013c265313045a9fdda5c653963/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
#!/usr/bin/env ruby
require 'benchmark'
N = 10000000
vals = [1, 2, 'string', {}, [], false, true, nil]
enum = N.times.map { vals[rand(vals.length-1)] }
def process(v)
v
end
@mbklein
mbklein / everything_besides_iulib.diff
Created August 14, 2012 14:36 — forked from brendano/NOTES.md
Patches to compile ocropus on Mac OSX 10.6 -- see explanation at NOTES.md at bottom https://gist.github.com/2919800#file_notes.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ocroinst.osx Tue Jun 12 18:25:15 2012 -0400
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+# Vaguely following ocroinst
+# Tested on Mac OSX 10.6
+# Assume we're using Homebrew: http://mxcl.github.com/homebrew/
+# Assume we're using pip, e.g.
+# https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python