Skip to content

Instantly share code, notes, and snippets.

View evilpacket's full-sized avatar
:octocat:

Adam Baldwin evilpacket

:octocat:
View GitHub Profile
@evilpacket
evilpacket / gist:3628941
Created September 5, 2012 01:35
Top 1000 from Alexa Top 1million
wget -q http://s3.amazonaws.com/alexa-static/top-1m.csv.zip;unzip top-1m.csv.zip; awk -F ',' '{print $2}' top-1m.csv|head -1000 > top-1000.txt; rm top-1m.csv*
@evilpacket
evilpacket / gist:3647908
Created September 5, 2012 23:46
Pure lua MD5 Implementation
--[[---------------
LuaBit v0.4
-------------------
a bitwise operation lib for lua.
http://luaforge.net/projects/bit/
How to use:
-------------------
bit.bnot(n) -- bitwise not (~n)
@evilpacket
evilpacket / gist:3924845
Created October 20, 2012 21:14
Available Lua functions in Redis 2.6
_G.__redis__compare_helper()
_G.assert()
_G.collectgarbage()
_G.getfenv()
_G.getmetatable()
_G.newproxy()
_G.next()
_G.pcall()
_G.print()
_G.rawequal()
@evilpacket
evilpacket / gist:3997031
Created November 1, 2012 22:16
Base N in Lua
local floor,insert = math.floor, table.insert
local function basen(n,b)
n = floor(n)
if not b or b == 10 then return tostring(n) end
local digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
local t = {}
local sign = ""
if n < 0 then
sign = "-"
n = -n
#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Caveats
#
@evilpacket
evilpacket / gist:5856305
Created June 25, 2013 06:08
CSP and FF 21.0
So on FF 21.0 I set the following header X-Content-Security-Policy I get the following error message in the console.
```
The X-Content-Security-Policy and X-Content-Security-Report-Only headers will be deprecated in the future. Please use the Content-Security-Policy and Content-Security-Report-Only headers with CSP spec compliant syntax instead.
```
If I set the Content-Security-Policy header it does not honor the policy.
Additionally report only does not appear to work at all in FF 21.0
>> servo.1373062175128 Board <- Serialport ready /dev/cu.usbmodem1411
string_decoder.js:109
charStr += buffer.toString(this.encoding, 0, end);
^
RangeError: toString() radix argument must be between 2 and 36
at Number.toString (native)
at StringDecoder.write (string_decoder.js:109:21)
at ReadStream.onData (readline.js:833:39)
at ReadStream.EventEmitter.emit (events.js:95:17)
var five = require("johnny-five"),
board;
var keypress = require('keypress');
board = new five.Board();
board.on("ready", function() {
console.log( "Ready event. Repl instance auto-initialized" );
var servo = new five.Servo(10)
@evilpacket
evilpacket / letter_freq.json
Created July 11, 2013 07:17
English letter frequencies in json format
{
"a": 8.167,
"b": 1.492,
"c": 2.782,
"d": 4.253,
"e": 12.702,
"f": 2.228,
"g": 2.015,
"h": 6.094,
"i": 6.966,

Keybase proof

I hereby claim:

  • I am evilpacket on github.
  • I am adam_baldwin (https://keybase.io/adam_baldwin) on keybase.
  • I have a public key whose fingerprint is 06A7 065F ABC8 39CC 27D3 5E01 D9D0 F356 6734 88E4

To claim this, I am signing this object: