Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block kennwhite

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
set -e
# Send a private message to someone on slack
# from the command line.
# Print a usage message and exit.
local name=$(basename "$0")
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
View gist:9690720
urlencode() {
# urlencode <string>
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
' ') printf + ;;
*) printf '%%%X' "'$c"

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)

kennwhite /
Created Apr 4, 2014 verification

Keybase proof

I hereby claim:

  • I am kennwhite on github.
  • I am kwhite ( on keybase.
  • I have a public key whose fingerprint is 757B 3A56 7E3C 9BF6 CE78 0C2D A01E DA60 0C2A 97FE

To claim this, I am signing this object:

View ct32.c
Constant-time integer comparisons
Written in 2014 by Samuel Neves <>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with
kennwhite /
Last active Aug 29, 2015
Disable WD utilities auto-mount on OSX (SL, Lion, Mountain Lion)
# vifs can be used too, but this works.
sudo sh -c "echo UUID=`diskutil info /Volumes/WD\ SmartWare/ | grep 'UUID' | awk '{print $NF}'` none hfs rw,noauto 0 0 >> /etc/fstab"
kennwhite / ptrace_stack_control.c
Created Jul 9, 2014
Ptrace stack control PoC CVE-2014-4699
View ptrace_stack_control.c
CVE-2014-4699 ptrace stack control POC By Andy Lutomirski
#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/syscall.h>
#include <sys/user.h>
#include <unistd.h>
# Print random number range, Linux or OSX:
# ex: 4707
cat /dev/urandom | od -N2 -An -i|awk -v f=1 -v r=65000 '{printf "%i\n", f + r * $1 / 65536}' | head -n 1
# Create OSX dictionary-based passphrases
# Ex: banish-wilsomeness-piquant
cnt=$( wc -l /usr/share/dict/words | awk '{print $1;}' ); \
for i in {1..3}
do awk -v lineno=$(jot -r 1 1 $cnt) 'lineno==NR{printf $0"-" ;exit}' \
kennwhite /
Last active Aug 29, 2015
Launch php page in Safari from localhost built-in server, in current directory
# !/bin/bash
# Requires OSX Mavericks for php 5.4+
# Instantiate stand-alone server, suppress all stdout logging from php & bash job messages
echo '<?php phpinfo();' > info.php && { php -S localhost:8000 >/dev/null 2>&1 & } 2>/dev/null
sleep 2
osascript \
You can’t perform that action at this time.