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') |
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) |
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 |
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` |
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; |
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: |
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): |
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: |
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"]): |
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")), |