Skip to content

Instantly share code, notes, and snippets.

View mushkevych's full-sized avatar

Dan Mushkevych mushkevych

  • Portland, OR, USA
View GitHub Profile
#!/bin/sh
# Variables
USER="admin"
PASS="password"
# Assert Root User
SCRIPTUSER=`whoami`
if [ "$SCRIPTUSER" != "root" ]
then
@mushkevych
mushkevych / collection_context.py
Created November 15, 2011 00:48 — forked from awestendorf/mongo_rebalance.py
An example of rebalancing a pymongo MasterSlaveConnection
"""
Created on 2011-04-23
@author: Bohdan Mushkevych
@author: Aaron Westendorf
"""
import functools
import time
from pymongo.errors import AutoReconnect
from pymongo.connection import Connection as MongoConnection