- apt-get update
- apt-get upgrade -y
- apt-get install -y apt-transport-https ca-certificates
- apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" > /etc/apt/sources.list.d/docker.list
- apt-get update
- apt-get install -y docker-engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind: 0.0.0.0:8000 | |
workers: 1 | |
worker_class: "example.worker:CustomWorker" | |
timeout: 30 | |
ca_certs: ca.crt | |
certfile: server.crt | |
keyfile: server.key | |
cert_reqs: 2 | |
do_handshake_on_connect: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install libjson-glib-dev libgee-0.8-dev libsecret-1-dev libnotify-dev \ | |
librest-dev libwebkit2gtk-4.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | |
libgoa-1.0-dev libpeas-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import shutil | |
import signal | |
import tempfile | |
import time | |
class RethinkProcess(object): | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate(schema): | |
def decorator(func): | |
def wrapper(self, req, resp, *args, **kwargs): | |
try: | |
raw_json = req.stream.read() | |
obj = json.loads(raw_json.decode('utf-8')) | |
except Exception: | |
raise falcon.HTTPBadRequest( | |
'Invalid data', | |
'Could not properly parse the provided data as JSON' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Sample Application | |
Usage: | |
sample [options] | |
Options: | |
-h --help Show this screen. | |
""" | |
import aumbry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_results(): | |
lines = [] | |
while True: | |
try: | |
line = raw_input() | |
except EOFError: | |
break | |
if line: | |
lines.append(line) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.4 | |
MAINTAINER Random Author <[email protected]> | |
# Update Python Container | |
RUN apt-get update && apt-get upgrade -y | |
RUN apt-get install -y vim | |
# Copy all project files and set as the working dir | |
COPY . /opt/app_name | |
WORKDIR /opt/app_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016-07-07 14:49:23.475 19260 140246374881024 DEBUG app.py:136 log [-] Starting up | |
2016-07-07 14:49:23.513 19260 140246374881024 INFO chain.py:94 log [-] Registered plugin reader in position 0 | |
2016-07-07 14:49:23.513 19260 140246374881024 INFO chain.py:94 log [-] Registered plugin aggregator in position 1 | |
2016-07-07 14:49:23.513 19260 140246374881024 INFO chain.py:94 log [-] Registered plugin writer in position 2 | |
2016-07-07 14:49:23.513 19260 140246374881024 INFO chain.py:94 log [-] Registered plugin exception_handler in position 3 | |
2016-07-07 14:49:23.513 19260 140246374881024 INFO chain.py:111 log [-] Starting chain worker | |
2016-07-07 14:49:23.513 19260 140246374881024 INFO chain.py:100 log [-] Initializing chain worker | |
2016-07-07 14:49:23.513 19260 140246374881024 DEBUG db_connectors.py:27 log [-] PostgresWriter initialize | |
2016-07-07 14:49:23.517 19260 140246374881024 DEBUG chain.py:68 log [-] Validating chain integrity for chain worker | |
2016-07-07 14:49:23.517 19260 140246374881024 DEBUG pykafka_connectors.p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import falcon | |
import jinja2 | |
def load_template(name): | |
path = os.path.join('templates', name) | |
with open(os.path.abspath(path), 'r') as fp: | |
return jinja2.Template(fp.read()) |