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
import struct | |
import io | |
import sys | |
import datetime | |
import re | |
import os | |
try : | |
from StringIO import StringIO | |
except ImportError: | |
from io import StringIO |
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 | |
#-*- coding: utf-8 -*- | |
""" | |
reference: | |
http://developer.chrome.com/extensions/crx.html | |
http://blog.roomanna.com/12-12-2010/packaging-chrome-extensions | |
https://www.dlitz.net/software/pycrypto/api/current/ | |
get pycrypto |
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
import pymongo | |
mongoh = pymongo.MongoClient('localhost',27030) | |
def enable_sharding(db): | |
try: | |
mongoh.admin.command('enableSharding', db) | |
except pymongo.errors.OperationFailure,e: | |
if 'already enabled' not in str(e): | |
raise |