View gist:e787d2b2348bb854cd67
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 | |
# encoding: utf-8 | |
import argparse | |
import os | |
import sys | |
from jinja2 import Template | |
parser = argparse.ArgumentParser(description='µ template') |
View gist:8b88f834ae2493e5f57a
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 socket | |
import struct | |
def ip_to_long(ip): | |
return struct.unpack('!L', socket.inet_aton(ip))[0] | |
def subnet_match(ip, subnet): | |
lsubnet = ip_to_long(subnet) | |
return lsubnet == (ip_to_long(ip) & lsubnet) |
View Dockerfile
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 debian:wheezy | |
RUN apt-get -y update | |
RUN apt-get -y upgrade | |
RUN apt-get -y install ca-certificates wget fakeroot | |
WORKDIR /tmp | |
ADD https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-cli-updatedeb.sh /tmp/ | |
RUN /bin/bash wp-cli-updatedeb.sh |
View gist:cab5efe261dc05c8186e
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
docker rm `docker ps -f status=exited -q` |
View gist:0088f0ea3356d13c42ef
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
var casper = require("casper").create({ | |
verbose: true, | |
logLeval: "debug", | |
timeout: 5000, | |
onTimeout: function() { | |
casper.echo("oups Timeout", arguments); | |
} | |
}); | |
var args = casper.cli.args; |
View gist:a39ae465c86d92e3e01b
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 sqlparse | |
from sqlparse.sql import Comment, Identifier, Parenthesis | |
from phpserialize import loads, phpobject | |
f = open('dump-no-contents.sql', 'r') | |
for line in sqlparse.split(f): | |
p = sqlparse.parse(line)[0] | |
if type(p.tokens[0]) == Comment: |
View gist:0bdb2fcfad82a57cd22a
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 socket | |
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
sock.connect('/var/run/audispd_events') | |
def read(s): |
View helloworld.py
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 timeit | |
import json | |
import eventlet | |
from nameko.rpc import Rpc, RpcProxy | |
q = eventlet.Queue() | |
def read_events(q): | |
with open('timing.log', 'w') as l: |
View header.py
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 re | |
import glob | |
import os.path | |
GARBAGE = re.compile("^(\s|[*#])+") | |
def headers(lines, keys=["Plugin Name", "Plugin URI", "Version", "Author", | |
"License", "Author URI", "Description", "Network"]): |
View gist:635b01795cb8e399fa9c
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 requests | |
import json | |
s = requests.Session() | |
r = s.get('http://localhost:3000/login') | |
print r | |
r = s.post('http://localhost:3000/login', | |
data=json.dumps(dict(user="admin", email="", password="admin")), |