I hereby claim:
- I am samwho on github.
- I am samwho (https://keybase.io/samwho) on keybase.
- I have a public key whose fingerprint is BCFF 3E0B 91E0 6AD7 330B FA5B 589B 3CBE 7241 6055
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import logging | |
import socket | |
import string | |
from StringIO import StringIO | |
logging.getLogger().setLevel(logging.INFO) | |
class HttpRequest: | |
__slots__ = ['verb', 'path', 'protocol', 'headers', 'body'] | |
def __init__(self, verb, path, protocol, headers, body): |
#include <errno.h> | |
#include <error.h> | |
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/capability.h> | |
#include <sys/prctl.h> | |
#include <sys/ptrace.h> | |
#include <sys/reg.h> |
INFO global: Vagrant version: 1.9.0 | |
INFO global: Ruby version: 2.2.5 | |
INFO global: RubyGems version: 2.4.5.1 | |
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.9.0\\bin\\vagrant" | |
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded" | |
INFO global: VAGRANT_INSTALLER_ENV="1" | |
INFO global: VAGRANT_INSTALLER_VERSION="2" | |
INFO global: VAGRANT_LOG="debug" | |
INFO global: VAGRANT_OLD_ENV_ACLOCAL_PATH="C:\\Program Files\\Git\\mingw64\\share\\aclocal;C:\\Program Files\\Git\\usr\\share\\aclocal" | |
INFO global: VAGRANT_OLD_ENV_ALLUSERSPROFILE="C:\\ProgramData" |
# Ruby creates symbols at many different points in execution. Symbols occupy | |
# between 4 and 8 bytes in memory. Check using this code: | |
# | |
# #include <ruby/ruby.h> | |
# #include <stdio.h> | |
# | |
# int main(int argc, char* argv[]) { | |
# printf("%d\n", sizeof(ID)); | |
# return 0; | |
# } |
devrand = File.open("/dev/random", 'r') | |
valid = 0 | |
invalid = 0 | |
at_exit do | |
puts "\n\n\n\n#{valid}/#{valid + invalid}" | |
end | |
while chunk = devrand.read(64) |
def test_interspersity array | |
# Calculate the ideal average distance between elements by summing how many of | |
# each element exist and then dividing the length of the array by that number. | |
ideal_avg_distance = Hash.new(0) | |
array.each { |elem| ideal_avg_distance[elem] += 1 } | |
ideal_avg_distance.keys.each do |k| | |
ideal_avg_distance[k] = array.length.to_f / ideal_avg_distance[k] | |
end | |
# Gather up all of the indices that each element appears at. |
WORDLIST = [ | |
"fuck", | |
"shit", | |
"cunt", | |
"wtf", | |
"wank", | |
"crap", | |
"hell", | |
"lame", | |
"rubbish", |
man_pages = `manpath`.chomp.split(':').inject([]) do |memo, path| | |
memo += Dir[File.join(path, 'man*', '*')] | |
end.select { |path| path.match(/.*?\.[1-9]$/) } | |
exec "man #{man_pages[rand(man_pages.length)]}" |