Skip to content

Instantly share code, notes, and snippets.

def produce_lists(elements, n):
sources = [range(n) for _ in range(elements)]
return product(*sources)
@OddBloke
OddBloke / ical_uid_test.py
Last active August 29, 2015 14:00
Test of iCalendar UIDs
#!/usr/bin/env python
from datetime import date
from icalendar import Calendar, Event, vCalAddress, vText
def add_person(event):
person = vCalAddress('http://foo.bar.com/blah/')
person.params['cn'] = vText('Our Example Person')
event.add('attendee', person)
@OddBloke
OddBloke / pre-push
Last active August 29, 2015 14:01
Ahhh... Push It
#!/bin/sh
curl -s "$(youtube-dl -g http://www.youtube.com/watch\?v\=vCadcBR95oU)" | mplayer -really-quiet -cache 8192 -vo null - > /dev/null 2>&1 &
Xlib: extension "RANDR" missing on display ":99".
*** LOG addons.manager: Application has been upgraded
*** LOG addons.xpi: startup
*** LOG addons.xpi: checkForChanges
*** LOG addons.xpi: Directory state JSON differs: cache [] state [{"name":"app-system-share","addons":{"ubufox@ubuntu.com":{"descriptor":"/usr/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/ubufox@ubuntu.com","mtime":1401360312000,"rdfTime":1375741724000}}},{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"/usr/lib/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1401360309000,"rdfTime":1398715524000},"langpack-en-GB@firefox.mozilla.org":{"descriptor":"/usr/lib/firefox/browser/extensions/langpack-en-GB@firefox.mozilla.org.xpi","mtime":1398716532000},"langpack-en-ZA@firefox.mozilla.org":{"descriptor":"/usr/lib/firefox/browser/extensions/langpack-en-ZA@firefox.mozilla.org.xpi","mtime":1398716532000}}},{"name":"app-profile","addons":{"fxdriver@googlecode.com":{"descri
2014-Aug-01 16:51:40 LedgerConsensus:NFO initial position 0000000000000000000000000000000000000000000000000000000000000000
2014-Aug-01 16:51:42 LedgerConsensus:NFO Proposers:5 nw:70 thrV:3 thrC:4
2014-Aug-01 16:51:42 LedgerTiming:NFO normal consensus
2014-Aug-01 16:51:42 LedgerConsensus:NFO Converge cutoff (5 participants)
2014-Aug-01 16:51:42 LedgerConsensus:NFO CNF newLCL 3E9A03856D2A06F8816180269941153E7D9FF26951CC7C9F71FA2FF289F9482D
2014-Aug-01 16:51:42 LedgerMaster:NFO Advancing accepted ledger to 89583 with >= 3 validations
2014-Aug-01 16:51:42 Ledger:WRN Ledger 3 missing hash for 1 (1,2)
2014-Aug-01 16:51:42 Ledger:WRN Can't get seq 1 from 3 past
2014-Aug-01 16:51:42 Ledger:WRN Ledger 3 missing hash for 0 (1,3)
2014-Aug-01 16:51:42 Ledger:WRN Can't get seq 0 from 3 error
### Keybase proof
I hereby claim:
* I am OddBloke on github.
* I am odd_bloke (https://keybase.io/odd_bloke) on keybase.
* I have a public key whose fingerprint is 5848 D31C A3C4 2D64 609F 49EB DDAA DAB0 E8A4 14F6
To claim this, I am signing this object:
@OddBloke
OddBloke / reproduce.sh
Last active August 29, 2015 14:17
CVE-2015-2296 Reproduction
#!/bin/bash
set -m
cleanup () {
jobs -p | xargs kill -INT
}
python source.py &
python target.py &

Keybase proof

I hereby claim:

  • I am OddBloke on github.
  • I am odd_bloke (https://keybase.io/odd_bloke) on keybase.
  • I have a public key whose fingerprint is 4ADD 4744 1A66 23E7 291B F2B9 EEE6 8776 EDB1 3EA0

To claim this, I am signing this object:

f = open(...)
try:
json.loads(f.read())
except ValueError:
print "Invalid JSON"
raise
finally:
f.close()
#!/usr/bin/env python2
import json
import os
import re
import scrapy
from scrapy.crawler import CrawlerProcess
RELEASE_MAP = {