Skip to content

Instantly share code, notes, and snippets.

View jwilkins's full-sized avatar

Jonathan Wilkins jwilkins

  • San Francisco, CA
View GitHub Profile
@jwilkins
jwilkins / reval.rb
Created January 18, 2014 07:11 — forked from postmodern/reval.rb
#!/usr/bin/env ruby
#
# Name: reval.rb
# License: MIT
# Author: postmodern (postmodern.mod3 at gmail.com)
# Description:
#
# Re-evaluates a specified Ruby file whenever the file changes.
# Reval was inspired by Giles Bowkett's kickass talk on Archaeopteryx at
# RubyFringe 2008, where Giles used some mad Ruby to re-evaluate his
773 ɪ
750 ə
547 n
489 t
480 ː
393 d
334 s
327 a
304 l
296 e
@jwilkins
jwilkins / rngtest.log
Created July 15, 2013 03:30
effects of low entropy on linux
$ rngtest -c 200000 -b 2000 < /dev/urandom
.....
rngtest: bits received from input: 4000000032
rngtest: FIPS 140-2 successes: 199848
rngtest: FIPS 140-2 failures: 152
rngtest: FIPS 140-2(2001-10-10) Monobit: 24
rngtest: FIPS 140-2(2001-10-10) Poker: 15
rngtest: FIPS 140-2(2001-10-10) Runs: 60
rngtest: FIPS 140-2(2001-10-10) Long run: 54
@jwilkins
jwilkins / gist:5997296
Created July 15, 2013 03:23
Remotely deplete entropy on linux boxes via SYN scan
# Heroku box
heroku$ curl icanhazip.com
54.242.20.250
heroku$ cat /proc/sys/kernel/random/entropy_avail
3962
###########
attacker$ sudo nmap -sS -p 1-65535 54.242.20.250
heroku$ cat /proc/sys/kernel/random/entropy_avail
@jwilkins
jwilkins / heroku_entropy.sh
Created July 15, 2013 03:19
monitor entropy on heroku dynos
#!/bin/bash
DATE="date +%Y%m%d%H%M%S"
RDATE="date +%Y%m%d%H%M%S"
IP='curl icanhazip.com'
ENTROPY='cat /proc/sys/kernel/random/entropy_avail'
LOG='heroku-entropy.log'
touch $LOG
while true; do
heroku run "echo \"$($DATE),\$($RDATE),\$($IP),\$DYNO,\$($ENTROPY)\"" 2>&1 | egrep "^20" >> $LOG;
done
@jwilkins
jwilkins / gist:5790778
Created June 16, 2013 04:33
bitmessage setup notes (OSX 10.8)
brew install python qt cryptopp swig sip qt
wget http://download.sf.net/project/pyqt/sip/sip-4.13.3/sip-4.13.3.tar.gz
tar xf sip-4.13.3.tar.gz
cd sip-4.13.3
python configure.py
make && make install
wget http://www.riverbankcomputing.com/static/Downloads/PyQt4/PyQt-x11-gpl-4.10.2-snapshot-11b3001947c9.tar.gz
tar xf PyQt-x11-gpl-4.10.2-snapshot-11b3001947c9.tar.gz
#!/usr/bin/env bash
NOW=$(date +"%Y%m%d%H%M%S")
if [ "$#" -eq 0 ];then
echo "Usage $0 keyfile"
echo " or $0 -a Convert all keys"
exit
fi
function convert_file {
module Kernel
alias :old_req :require
def require(*args)
puts "Require called with: #{args}"
old_req *args
end
end
require 'pp'
@jwilkins
jwilkins / bootstrap.sh
Created May 12, 2013 01:17
bootstrap a ruby project w/ bundler & rbenv
#!/usr/bin/env bash
NOW=$(date +"%Y%m%d%H%M%S")
echo -n "[*] bootstrapping "
# Export CC to explicitly set the compiler used for cexts.
export CC=cc
function abspath {
if [[ -d "$1" ]]; then
pushd "$1" >/dev/null
pwd
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):