Assumptions:
- You use Django with [Django-Storages][storages] for saving your STATIC and MEDIA files to S3
- You use Nginx to reverse proxy to Django
- You want to protect any URLs that start with /admin or /subscribe
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| gh_url = 'https://api.github.com' | |
| req = urllib2.Request(gh_url) | |
| password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
| name: CI | |
| on: [push] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: |
| import inspect | |
| import logging | |
| import shutil | |
| import sys | |
| from time import time | |
| from types import MethodType | |
| from typing import Optional | |
| from django.conf import settings | |
| from django.db import DEFAULT_DB_ALIAS, connections |
| #!/usr/bin/env bash | |
| # This script prints out all of your Redis keys and their size in a human readable format | |
| # Copyright 2013 Brent O'Connor | |
| # License: http://www.apache.org/licenses/LICENSE-2.0 | |
| human_size() { | |
| awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } ' | |
| } |
| .* | |
| !.coveragerc | |
| !.env | |
| !.pylintrc |
| """ | |
| License: MIT - https://opensource.org/licenses/MIT | |
| ChromeLogger is a protocol which allows sending logging messages to the Browser. | |
| This module implements simple support for Django. It consists of two components: | |
| * `LoggingMiddleware` which is responsible for sending all log messages | |
| associated with the request to the browser. | |
| * `ChromeLoggerHandler` a python logging handler which collects all messages. |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>DB Stacktrace</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <!-- Bootstrap --> | |
| <link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet" media="screen"> | |
| <link href="http://getbootstrap.com/docs-assets/css/pygments-manni.css" rel="stylesheet" media="screen"> | |
| <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> |
| #!/usr/bin/env python | |
| from checkpid import pidcheck | |
| from time import sleep | |
| import logging | |
| log = logging.getLogger("checkpid") | |
| log.setLevel(logging.INFO) | |
| log.setLevel(logging.DEBUG) | |
| ch = logging.StreamHandler() |