This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName local.site | |
ProxyPass / http://local.site:81/ timeout=9999999 | |
ProxyPassReverse / http://local.site:81/ | |
RequestHeader unset Accept-Encoding | |
AddOutputFilterByType SUBSTITUTE text/html | |
Substitute s/www.site/local.site.nl/ni | |
Header edit Location ^http://www. http://local. | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys | |
import re | |
import json | |
def batch_execute(args): | |
print args[0] | |
return subprocess.check_output( | |
[ | |
'mysql', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[branch] | |
autosetuprebase = always | |
[remote] | |
pushdefault = meeuw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.ext.automap import automap_base | |
from sqlalchemy.orm import Session, sessionmaker | |
from sqlalchemy import create_engine, MetaData, Column, Table | |
import sqlalchemy.dialects.mysql.base | |
import sqlalchemy.dialects.sqlite | |
dest_engine = create_engine('sqlite:////tmp/test.sqlite3', echo=True, encoding='utf8') | |
DestSession = sessionmaker(dest_engine) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function curl($opts) | |
{ | |
$ch = curl_init(); | |
foreach ($opts as $opt_key => $opt_value) { | |
if ($opt_key == CURLOPT_POSTFIELDS) { | |
$opt_value = http_build_query($opt_value); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
} | |
curl_setopt($ch, $opt_key, $opt_value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pdf-parser.py -s ICCBased my.pdf | |
pdf-parser.py -o 21 -f -d 21.stream my.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def recurse(lst, c): | |
s = sum(lst) | |
if s > c: | |
return | |
if s == c: | |
print lst | |
return | |
for i in range(1, c+1): | |
if lst and lst[-1] < i: continue | |
recurse(lst+[i], c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import radiotap as r, pcap | |
pc = pcap.pcap(name='/tmp/monitor.pcap') | |
while 1: | |
tstamp, pkt = pc.next() | |
off, radiotap = r.radiotap_parse(pkt) | |
off, pkt = r.ieee80211_parse(pkt, off) | |
if 'type' in pkt and pkt['type'] == 0 and 'subtype' in pkt and pkt['subtype'] == 4: | |
if pkt['data'][0] != '\x01': | |
print radiotap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
table = 'table' | |
with open('output.csvdiff') as f: | |
diff = json.loads(f.read()) | |
for added in diff["added"]: | |
print "INSERT INTO %s (%s) VALUES ('%s');" % (table, ", ".join(added.keys()), "', '".join(added.values())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://rdf.dmoz.org/rdf/content.rdf.u8.gz | |
zcat content.rdf.u8.gz |egrep -o 'r:resource="[^"]*'|cut -c13- > testurls | |
shuf testurls|head -n1000|xargs -n1 -P50 curl -m300 > /dev/null |