- 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 pike.discovery import py | |
| class MiddlewarePlugin(object): | |
| def __init__(self, config): | |
| self.config = config | |
| @classmethod | |
| def qualified_name(cls): | |
| __, __, module_name = cls.__module__.rpartition('.') |
This file contains hidden or 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 maya | |
| from datetime import timedelta | |
| def lookup_subtracted_time(days, hours, minutes): | |
| delta = timedelta(days=days, hours=hours, minutes=minutes) | |
| backdate = (maya.now() - delta).datetime() | |
| localtime = backdate.astimezone(maya.get_localzone()) | |
| return localtime.isoformat(), delta.total_seconds() / 60 |
This file contains hidden or 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
| #!/bin/bash | |
| export MESSAGE=$(echo -e "\n\n$(git log `git describe --tags --abbrev=0`..HEAD --oneline)") | |
| bumpversion \ | |
| --message 'Bump version: {current_version} → {new_version}{$MESSAGE}' \ | |
| ${@:1} |