This file contains hidden or 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 python2 | |
from __future__ import print_function | |
from dns import resolver | |
from StringIO import StringIO | |
import sys | |
buff = StringIO() | |
answers = resolver.query(sys.argv[1], 'TXT') |
This file contains hidden or 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 os | |
def pam_sm_open_session(pamh, flags, args): | |
try: | |
user = pamh.get_user(None) | |
except pamh.exception, e: | |
return e.pam_result | |
with open('/tmp/debug', 'w') as d: | |
d.write(user) |
This file contains hidden or 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
require "set" | |
require 'regexp_parser' | |
require 'commons-collections4-4.1.jar' | |
module PreRegexp | |
def self.tokenize sentence | |
sentence.split(/[\s;()|]+/).sort.reverse | |
end |
This file contains hidden or 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 sys | |
sys.path.append('gen-py') | |
from gunicorn.app.base import Application | |
from gunicorn.workers.sync import SyncWorker | |
from gunicorn.arbiter import Arbiter | |
from thrift.transport.TSocket import TSocket |
This file contains hidden or 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 bucketize(items): | |
# Bucketsize = 1 minute | |
bucket = [] | |
ts = None | |
for item in items: | |
if item is None: | |
continue | |
dt = (item['datetime'].day, | |
item['datetime'].hour, | |
item['datetime'].minute) |
This file contains hidden or 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 asyncio | |
class Boniface: | |
""" | |
Like Boniface Malcoeur, the necromancer | |
""" | |
def __init__(self, redis): | |
self._redis = redis |
This file contains hidden or 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 asyncio | |
from msgpack import Unpacker, packb | |
class App(dict): | |
def make_handler(self): | |
return MsgpackProtocol(self) |
This file contains hidden or 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 | |
from time import sleep | |
import os | |
from billiard import freeze_support | |
freeze_support() | |
from celery.concurrency import prefork | |
from celery.concurrency.prefork import TaskPool |
This file contains hidden or 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")), |
This file contains hidden or 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"]): |