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 functools import wraps | |
| from flask import request, abort | |
| from lib.logger import logger | |
| def authorize_bearer(bearer): | |
| def authorize(f): | |
| @wraps(f) | |
| def decorated_function(*args, **kws): | |
| if 'Authorization' not in request.headers: |
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
| # see http://editorconfig.org | |
| root = true | |
| [*] | |
| indent_style = space | |
| end_of_line = lf | |
| charset = utf-8 | |
| trim_trailing_whitespace = true | |
| insert_final_newline = 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
| docker service logs my_service --follow 2>&1 | grep payload |
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 | |
| yum update -y | |
| yum install -y docker | |
| usermod -a -G docker ec2-user | |
| curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null | |
| chmod +x /usr/local/bin/docker-compose | |
| service docker start | |
| chkconfig docker on | |
| rm /etc/localtime |
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
| #!/usr/bin/env bash | |
| # execute via “dot space dot slash” to avoid a subshell. | |
| # for example: ". ./django.sh" instead "./django.sh" | |
| echo "$(tput setaf 1)Creating new virtual environment ...$(tput sgr0)" | |
| python -m venv venv | |
| source venv/bin/activate | |
| echo "$(tput setaf 1)Seting up django project ...$(tput sgr0)" | |
| touch README.md | |
| python -m pip install --upgrade pip |
OlderNewer