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/python | |
''' | |
s3lzocp | |
Version 0.2 2012-10-22 | |
sync log from local to s3 and lzo it. | |
make sure lzop and s3cmd is installed. | |
usage: | |
s3lzocp.py /path/to/dir s3://bucket-name/path/to/dir | |
''' | |
import re |
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/python | |
''' | |
sync user from svn to review board | |
sample usage: | |
syncuser.py -c root:password@localhost:rbdatabase --update /var/svn/passwd | |
''' | |
import datetime | |
import getopt | |
import MySQLdb as mdb | |
import re |
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 re | |
mode = r'([A-Z_]*)="([^"]+)"' | |
vmode = r'\(([^)]+)\)\(([^)]+)\)\(([^)]+)\)' | |
filename = 's3.txt' | |
f = open(filename,'r') | |
lines = f.readlines() | |
jobinfo = lines[-1] | |
info = [] | |
for k,v in re.findall(mode, jobinfo): | |
for kk1, kk2, vv in re.findall(vmode, v): |
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
''' | |
email send service library. Using SMTP. | |
author: yaowei | |
last modify: 2012-07-30 | |
''' | |
import datetime | |
import logging | |
import os |
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
''' | |
Simple async callback using tornado and redis | |
example: | |
from channel import * | |
import tornado.ioloop | |
import functools | |
def callback(x, prefix=''): | |
print prefix+str(x) |
NewerOlder