Skip to content

Instantly share code, notes, and snippets.

View stania's full-sized avatar

Albert Hwang stania

View GitHub Profile
@stania
stania / anonymous.py
Created April 3, 2013 11:28
prerequisite: gnu mpfr (may can be installed by distribution installer) pycrypto, pycryptopan (both can be installed by pip)
from cryptopan import CryptoPan
import re, sys
c = CryptoPan("".join([chr(x) for x in range(0, 32)]))
p = re.compile(r"^([^ ]+) ([^ ]+)")
def replace(mo):
try:
domain = mo.group(1)
@stania
stania / gist:5274560
Created March 30, 2013 00:09
araqne batch script enhancement example.
# this is comment
logstorage.dropTable iis01
logstorage.createTable iis01 v3p
# lines before "EOF" will be used as inputstream. input lines are not trimmed and cannot commented.
logpresso-index.createIndex iis01 i1 <<EOF
delimiter
;/
@stania
stania / gist:4992670
Created February 20, 2013 03:39
GridMove .grid sample
[Groups]
NumberOfGroups = 4
[1]
TriggerTop = [Monitor1Top] + 400
TriggerRight = [Monitor1Right]
TriggerBottom = [Monitor1Bottom]
TriggerLeft = [Monitor1Left]
@stania
stania / setupVSEnv.py
Last active June 11, 2016 21:45
python implementation replacing "call vsvars32.bat"
from subprocess import Popen
import os, subprocess
def parseEnv(envoutput):
handle_line = lambda l: tuple(l.rstrip().split("=", 1))
pairs = map(handle_line, envoutput)
valid_pairs = filter(lambda x: len(x) == 2, pairs)
valid_pairs = [(x[0].upper(), x[1]) for x in valid_pairs]
return dict(valid_pairs)