Skip to content

Instantly share code, notes, and snippets.

import time
class Retry(object):
default_exceptions = (Exception)
def __init__(self, tries, exceptions=None, delay=0):
"""
Decorator for retrying function if exception occurs
tries -- num tries
exceptions -- exceptions to catch
@tylerdave
tylerdave / setup-statsd-centos.sh
Last active August 29, 2015 13:57 — forked from GregMefford/setup-statsd-centos.sh
Basic install and setup for Bucky (statsd replacement) on CentOS. This is a work in progress.
# I'm starting with a clean CentoOS 6.5 install on Rackspace Cloud (which includes EPEL by default.)
# Install yum packages
# TODO: Install Python stuff into virtualenv rather than from yum packages
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached python-bucky
# ===== BEGIN MANUAL STEP =====
# run syncdb to setup the db and prime the authentication model (if you're using the DB model)
python /usr/lib/python2.6/site-packages/graphite/manage.py syncdb
# ===== END MANUAL STEP =====