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 | |
function post_to_slack () { | |
SLACK_MESSAGE="$1" | |
SLACK_URL=https://hooks.slack.com/services/YOUR_WEBHOOK_TOKENS_HERE | |
case "$2" in | |
INFO) | |
SLACK_ICON=':slack:' | |
;; |
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 xlsxwriter | |
from io import BytesIO | |
from django.http import StreamingHttpResponse | |
from django.views.generic import View | |
def get_foo_table_data(): | |
""" | |
Some table data | |
""" |
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
# HTTP server: Enforce HTTPS by HTTP 301 | |
server { | |
listen 80; | |
listen [::]:80 ipv6only=on; | |
server_name couch-gateway.site.ru; | |
return 301 https://$server_name$request_uri; | |
} | |
# SSL server |
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
# Ping location | |
location /ping { | |
add_header "Allow" "GET, OPTIONS, HEAD" always; | |
# CORS headers | |
add_header "Access-Control-Allow-Origin" "*"; | |
add_header "Access-Control-Allow-Methods" "GET, OPTIONS, HEAD"; | |
add_header "Access-Control-Allow-Headers" "Accept,Accept-Encoding,Cache-Control,Content-Type,DNT,If-Modified-Since,Origin,User-Agent,X-Requested-With"; | |
if ( $request_method !~ ^(GET|OPTIONS|HEAD)$ ) { | |
return 405 "Only GET, OPTIONS, HEAD allowed"; |