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
# FSK-decode | |
# For Python 3 | |
# By Zoe Blade | |
# (Hopefully) converts a .wav file into a demodulated .bin file | |
import struct # For converting the (two's complement?) binary data to integers | |
import sys # For command line arguments | |
import wave # For .wav input and output |
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
// sudo apt-get install pxlib | |
// gcc -std=c99 -lpx px2csv.c -o px2csv | |
#include <paradox.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) { | |
FILE *out; | |
int ret; |
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 my_local(init): | |
key = object() | |
def getter(): | |
t = _app_ctx_stack.top | |
l = getattr(t, 'my_locals') | |
if l is None: | |
t.my_locals = l = {} | |
if key not in l: | |
l[key] = init() | |
return l[key] |
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 | |
# the default py2.7 print doesn't accept 'file' argument | |
from __future__ import print_function | |
import sys | |
from redis import Redis |
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 Conntrack import ConnectionManager, NFCT_O_XML | |
from lxml.etree import fromstring | |
def filter_nat(xml): | |
d = fromstring(xml) | |
orig_src = d.xpath("..//meta[@direction='original']/layer3/src/text()")[0] | |
repl_dst = d.xpath("..//meta[@direction='reply']/layer3/dst/text()")[0] | |
return orig_src != repl_dst |
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 os import fork | |
print fork() | |
# clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=...) |
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 twisted.internet task, reactor, defer | |
def sleep(delay): | |
return task.deferLater(reactor, delay, lambda: None) | |
def sleep(delay): | |
d = defer.Deferred() | |
reactor.callLater(delay, d.callback, None) |
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 time | |
import sys | |
import threading | |
import tornado.web | |
import tornado.ioloop | |
import tornado.gen | |
from functools import partial | |
from tornado.log import app_log as log |
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
[ui] | |
username = Andrew Grigorev <andrew@ei-grad.ru> | |
[extensions] | |
color = | |
pager = | |
[alias] | |
lol = log -G --template '{label("log.changeset", "{node|short}")} {desc|firstline}' | |
lg = log --patch --template '{label("log.changeset", "{node}")}\n{label("log.author", "Author: {author}")}\n{label("log.date", "Date: {date|date}\n\t{firstline}")}\n' |
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 twisted.internet.defer import DeferredQueue | |
class PubSub(object): | |
def __init__(self): | |
self.queues = [] | |
def subscribe(self, queue=None): | |
if queue is None: |
OlderNewer