git init
git remote add origin [email protected]:something/something.git
git pull origin master
git config --add remote.origin.push 'refs/tags/:refs/tags/'
# Reject traffic out to a specific IP | |
iptables -o eth0 -I OUTPUT -d 10.207.47.148 -j REJECT |
#!/bin/bash | |
launchctl setenv KEY value |
def cache(lifetime=None, cache_size=0): | |
""" Caching decorator. """ | |
def attach_caching(method): | |
method._cache = pylru.lrucache(cache_size) if cache_size else {} | |
method._cache_updated = {} | |
@functools.wraps(method) | |
def wrapper(*args, **kw): | |
# frozenset is used to ensure hashability | |
key = args, frozenset(kw.iteritems()) if kw else args |
def time_method(stat_name): | |
""" | |
Attaches a timeout to the deferred returned by the wrapped function. | |
After timeout seconds the deferred is canceled and an exception raised. | |
""" | |
def attach_timing(method): | |
@functools.wraps(method) | |
def wrapper(self, *args, **kwargs): | |
start = time() |
def wrap_exception(handle, error_type, error_message, log=None): | |
def attach_check(method): | |
@functools.wraps(method) | |
def wrapper(self, *args, **kwargs): | |
d = method(self, *args, **kwargs) | |
def on_error(failure): | |
failure.trap(handle) | |
logger = logging if not log else logging.getLogger(log) | |
logger.error("%s, %s" % (error_message, failure.getErrorMessage())) | |
raise error_type(error_message) |
def sleep(secs): | |
d = Deferred() | |
reactor.callLater(secs, d.callback, None) | |
return d |
def timeout(seconds=5, error_type=None, error_message=None): | |
""" | |
Attaches a timeout to the deferred returned by the wrapped function. | |
After timeout seconds the deferred is canceled and an exception raised. | |
""" | |
def attach_timeout(method): | |
@functools.wraps(method) | |
def wrapper(self, *args, **kwargs): | |
d = method(self, *args, **kwargs) | |
def on_timeout(): |
git init
git remote add origin [email protected]:something/something.git
git pull origin master
git config --add remote.origin.push 'refs/tags/:refs/tags/'
#!/bin/sh | |
liquibase --driver=com.mysql.jdbc.Driver --url=jdbc:mysql://localhost/db --username=root --changeLogFile=changelog.xml $@ |