Skip to content

Instantly share code, notes, and snippets.

View nottrobin's full-sized avatar

Robin Winslow nottrobin

View GitHub Profile
[tool.poetry]
name = "django-project"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.5"
django = "^2.1"
[tool.poetry]
name = "django-project"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.5"
[tool.poetry.dev-dependencies]
[tool.poetry]
name = "django-project"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^2.7"
django = "^2.1"
$ python3 -m venv env3
$ source env3/bin/activate
$ pip install -e .
$ which documentation-builder
env3/bin/documentation-builder
$ documentation-builder --source-folder docs
Built:
- build/en/structure.html
- build/en/index.html
- build/en/homepage-examples/enterprise-proxy-example.html
@nottrobin
nottrobin / postgres.yaml
Created May 17, 2018 12:28
Basic postgres kubernetes configuration
# A basic service running an *ephemeral* postgres instance
# This can then be used in applications by pointing at "postgres://postgres@postgres/postgres"
kind: Service
apiVersion: v1
metadata:
name: postgres
spec:
selector:
app: postgres
@nottrobin
nottrobin / restart_k8s_pod.sh
Created April 28, 2018 18:55
Restart Kubernetes pod
#! /usr/bin/env bash
if [ -z "${1}" ]; then echo "Usage: restart_pod {pod_name}"; exit 1; fi
kubectl get pod ${1} --namespace staging -o yaml | kubectl replace --force -f -
@nottrobin
nottrobin / clean-repo.sh
Created April 28, 2018 18:53
Clean and possibly delete a Git repo if it's completely synced with the remotes
set -e
rm -rf env/ env2/ env3/
if [ ! -d .git ]; then
echo ""
echo "==="
echo "Not a git repository: `pwd`"
echo "==="
echo ""
@nottrobin
nottrobin / slow_wsgi.py
Created February 12, 2018 08:12
A basic WSGI JSON response that takes 1.3 seconds to respond.
from wsgiref.simple_server import make_server
import time
def application(env, start_response):
"""
A basic WSGI application
"""
time.sleep(1.3)
@nottrobin
nottrobin / randomly_failing_wsgi.py
Created February 8, 2018 00:51
Randomly failing python WSGI server
from wsgiref.simple_server import make_server
import random
def application(env, start_response):
"""
A basic WSGI application
"""
if random.random() < 0.5:
@nottrobin
nottrobin / urls-from-insights.ubuntu.com.txt
Created February 7, 2018 17:55
List of URLs from spidering the old website at insights.ubuntu.com
https://insights.ubuntu.com/articles
https://insights.ubuntu.com/author/alexia-emman/
https://insights.ubuntu.com/author/aprilswang/
https://insights.ubuntu.com/author/canonical/
https://insights.ubuntu.com/author/canonical/feed/
https://insights.ubuntu.com/author/canonical/page/2/
https://insights.ubuntu.com/author/cjohnston/
https://insights.ubuntu.com/author/davidc3-2/
https://insights.ubuntu.com/author/davidc3-2/feed/
https://insights.ubuntu.com/author/davidc3-2/page/2/