Skip to content

Instantly share code, notes, and snippets.

@coderjo
coderjo / gist:2255976
Created March 30, 2012 22:05
2xSDS drive info
=======================
1.4Mb 2xSDS
Y-E Data 6130S or 6331S
=======================
600 RPM (Normal) 720 RPM *
------------------- -------------
ET '' ET ''
PC '' PC ''
IT '' IT ''
@coderjo
coderjo / ustream.py
Created December 12, 2011 20:33
simple script to build the proper rtmpdump command line for a live ustream feed
#!/usr/bin/env python
flashVer = "WIN 10,3,183,7"
from HTMLParser import HTMLParser
from pyamf.remoting.client import RemotingService
import urllib2, sys
from time import time
# first we need to define a very basic html parser to get two meta properties
@coderjo
coderjo / sqlite_integrity_check.py
Created December 6, 2011 17:40
whitemice's sql integrity check
#!/usr/bin/env python
import sqlite3, sys, fnmatch, os, platform
def verify_database_file(path):
connection = None
sys.stdout.write('Checking database @ "{0}".\n'.format(path))
try:
connection = sqlite3.connect(path, isolation_level="EXCLUSIVE")
except Exception, e:
sys.stderr.write('Unable to connect to database.\n')
@coderjo
coderjo / gist:1432614
Created December 5, 2011 06:53
python win32 file api workarounds
def stathax(path):
if "Windows" == platform.system():
return os.stat(u'\\\\?\\%s' % path)
else:
return os.stat(path)
def openhax(path, mode):
if "Windows" == platform.system():
return open(u'\\\\?\\%s' % path, mode)
else:
@coderjo
coderjo / parseit.py
Created November 6, 2011 09:58
simple scientific american pdf url builder
#!/usr/bin/env python
from HTMLParser import HTMLParser
import urllib2, re
pdfre = re.compile(r"^pdf/1[89][0-9][0-9]-[0-9]{2}-[0-9]{2}\.pdf$")
journalpage = re.compile(r"^/scientificamerican/journal/v([1-9]|[1-9][0-9]|10[01])/")
class SAParser(HTMLParser):
def __init__(self, linkcallback):