$ [sudo] apt-get update \
> && [sudo] apt-get install apache2-utils
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
# TODO: Change file name to errors.conf and load it on APIs servers block. | |
# TODO: Change .html to .json. | |
error_page 500 /500.html; | |
location /500.html{ | |
return 500 '{"error": {"status_code": 500,"status": "Internal Server Error"}}'; | |
} | |
error_page 502 /502.html; | |
location /502.html{ | |
return 502 '{"error": {"status_code": 502,"status": "Bad Gateway"}}'; |
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
# Force prompt update with pyenv-virtualenv | |
# see: https://github.com/pyenv/pyenv-virtualenv/issues/135 | |
function virtualenv_prompt { | |
WANTED_PROMPT="(${VIRTUAL_ENV##*/}) $ORIGINAL_PROMPT" | |
# Current virtualenv | |
if [[ $VIRTUAL_ENV != "" ]] && [[ $PS1 != $WANTED_PROMPT ]]; then | |
PROMPT=$WANTED_PROMPT | |
else |
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
""" | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar <[email protected]> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. |
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
# Include all local tasks. | |
include tasks/*.mk | |
# Add color to help printing. | |
PRINT = '{printf "\033[36m%-16s\033[0m : %s\n", $$1, $$2}' | |
help: ## Show this message. | |
@echo "usage: make [task]\n" \ | |
&& echo "available tasks:" \ |
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
"""Flask template decorator example. | |
:examples: | |
.. code-block:: python | |
# without the decorator | |
@app.route('/') | |
def index(): | |
return render_template('index.html', |