I hereby claim:
- I am boris317 on github.
- I am shawnbytes (https://keybase.io/shawnbytes) on keybase.
- I have a public key whose fingerprint is 85AC 20B8 9C56 B0D5 F0F5 360B 0B04 9462 EDE5 D0C4
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# in for loop of method 'build_inventory' | |
if "-" in droplet['name']: | |
# Create new groups for names like prod-appname-whatever | |
# Given the above name, 2 new groups would be created "prod" | |
# and "prod-appname" | |
parts = droplet['name'].split("-") | |
if len(parts) > 1: | |
self.push(self.inventory, "-".join(parts[0:2]), dest) | |
self.push(self.inventory, parts[0], dest) |
[Unit] | |
Description=CouchPotato application instance | |
[Service] | |
ExecStart=/media/nzb_apps/CouchPotatoServer/CouchPotato.py --daemon --data_dir=/media/nzb_apps/.couchpotato | |
GuessMainPID=no | |
Type=forking | |
User=root | |
Group=root |
# kodi-upstart | |
env DISPLAY=:0.0 | |
description "Kodi upstart script" | |
author "Shawn Adams" | |
start on (filesystem and stopped udevtrigger) | |
stop on runlevel [016] | |
# tell upstart to respawn the process if abnormal exit |
import logging | |
from contextlib import contextmanager | |
from cStringIO import StringIO | |
@contextmanager | |
def log_context(logger_name, level=logging.DEBUG, formatter=None): | |
""" | |
:param logger_name: Name of your logger as passed to ``logging.getLogger``. | |
:param level: (optional) logging level to capture. |
def format_validation_error(error, parent=None, indent=""): | |
def recurse(e, parent): | |
return format_validation_error(e, parent=p(parent), | |
indent=indent + " ") | |
def p(child): | |
if parent is None: | |
return child |
class BaseConverter(object): | |
""" | |
Class for encoding/decoding base 10 values to/from another base | |
""" | |
def __init__(self, base, base_digits): | |
""" | |
:param base: (int) the base (e.g 2, 16, 64) | |
:param base_digits: (iterator) of base digits (e.g "01" for base 2, etc) | |
""" | |
self.base = base |
#!/bin/bash | |
# | |
# .openshift/action_hooks/build | |
# | |
DIR=$( cd "$( dirname "$0" )" && pwd ) | |
source $DIR/../env.sh | |
if [ ! -d $X_OPENSHIFT_VENV ]; then | |
echo "[build] $(virtualenv --distribute $X_OPENSHIFT_VENV)" |
#!/bin/bash | |
DIR=$( cd "$( dirname "$0" )" && pwd ) | |
source $DIR/../env.sh | |
if [ ! X_OPENSHIFT_RUNNING_LOCAL ]; then | |
source $X_OPENSHIFT_VENV/bin/activate | |
fi |
from exampleapp import app | |
import IPython | |
app.testing = True | |
test_client = app.test_client() | |
welcome_message = """Welcome to your Flask CLI environment. | |
The following variables are available to use: | |
app -> Your Flask app instance. |