Skip to content

Instantly share code, notes, and snippets.

View gist:b23c4d4fe76da5b00ae3
import threading
import os
import time
import commands
import redis
class RedisServer(threading.Thread):
def __init__(self, binary = 'redis-server', port = 7777):
threading.Thread.__init__(self)
self.binary = binary
View gist:03f43b6789f14e1fe878
import threading
import os
import time
import commands
import redis
class RedisServer(threading.Thread):
def __init__(self, binary = 'redis-server', port = 7777):
threading.Thread.__init__(self)
self.binary = binary
@idning
idning / gist:11279924
Created Apr 25, 2014
mongodb-pre-split
View gist:11279924
#3. Pre-Splitting
# export_size > 64K(records) and no data in dest collection
chunksize = self.args.chunksize # default 64K items (for 64MBytes chunksize)
maxshardkey = self.args.maxshardkey
if not(self.pre_src_count > chunksize and self.pre_to_count == 0):
logging.info('we will not pre-split !')
return
logging.info('we will pre-split by chunksize: %d, maxshardkey is: %d' % (chunksize, maxshardkey))
View gist:3296652
import os
import logging
import pybcs
#设置日志级别
pybcs.init_logging(logging.INFO)
AK = os.environ['AK'] #请改为你的AK