Skip to content

Instantly share code, notes, and snippets.

Robin Winslow nottrobin

Block or report user

Report or block nottrobin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nottrobin /
Last active Jun 14, 2019
Test out the devrun snap with
snap install --devmode --beta dotrun
git clone -b dotrun ubuntu-dotrun
cd ubuntu-dotrun
dotrun serve --watch
View developer-redirects.conf
Redirect permanent /static/resources/ubuntu-core-16-security-whitepaper.pdf
Redirect permanent /core/get-started/raspberry-pi-2-3
Redirect permanent /core/get-started/installation-medias
Redirect permanent /core/get-started
Redirect permanent /
Redirect permanent /core
Redirect permanent /core/get-started/intel-nuc
Redirect permanent /core/get-started/developer-setup
Redirect permanent /core/get-started/kvm
Redirect permanent /core/examples/snaps-on-mir
nottrobin /
Created May 15, 2019
Get target URLs from a redirect mapping
#! /usr/bin/env python3
import requests
from urllib.parse import urlparse
import yaml
for path, location in yaml.load(open("redirect-source.yaml")).items():
response = requests.get(f"{location}")
if response.ok:
nottrobin / renovate.json
Created May 9, 2019
Webteam default renovate config
View renovate.json
"extends": [
"packageRules": [
"depTypeList": ["devDependencies"],
"extends": [":automergeMinor"]
View karls-branch.diff
diff --git a/docs/.env b/docs/.env
index b24647eb..9f09d4cb 100644
--- a/docs/.env
+++ b/docs/.env
@@ -1 +1,2 @@
\ No newline at end of file
\ No newline at end of file
nottrobin /
Last active Apr 17, 2019
Benchmark tests for Yarn vs NPM speed

Yarn vs NPM speed test

Work in progress

I recently made a claim on Twitter that yarn is still significantly faster than npm for installing NodeJS dependencies.

My belief here was based on some light research I did near the end of 2017, not too long after NPM 5 was released claiming huge speed improvements. I found a blog post at the time claiming Yarn was still faster, and then did some light testing which confirmed this for me, by a large margin.

However, my assertion was challenged:

View blog-prometheus-metrics
# HELP wsgi_latency Multiprocess metric
# TYPE wsgi_latency histogram
wsgi_latency_sum{method="GET",status="200",view="flask.helpers.static"} 23.605999999999998
wsgi_latency_sum{method="GET",status="200",view="app.homepage"} 8083.161
wsgi_latency_sum{method="GET",status="304",view="flask.helpers.static"} 5.361
wsgi_latency_sum{method="GET",status="200",view="app.cloud_and_server"} 2901.036
wsgi_latency_bucket{le="4.0",method="GET",status="200",view="flask.helpers.static"} 4.0
wsgi_latency_bucket{le="8.0",method="GET",status="200",view="flask.helpers.static"} 7.0
wsgi_latency_bucket{le="16.0",method="GET",status="200",view="flask.helpers.static"} 7.0
wsgi_latency_bucket{le="32.0",method="GET",status="200",view="flask.helpers.static"} 7.0
nottrobin /
Last active Mar 14, 2019
Get first non-ready kubernetes pod
deployment_failed_reason=$(kubectl get deployment --namespace staging --selector app=${app} -o=jsonpath='{.items[0].status.conditions[1].reason}')
if [ "${deployment_failed_reason}" == "ProgressDeadlineExceeded" ]; then
non_ready_pod=$(kubectl get pod --namespace staging --selector app=${app} --output json | jq -r '(.items | map(select(.status.containerStatuses[0].ready==false)))[0]')
kubectl logs ${non_ready_pod} --namespace staging
#! /usr/bin/env python3
# Standard library
import re
from io import BytesIO
from glob import glob
from PIL import Image
from urllib.parse import urlparse, parse_qs
from urllib.request import urlopen
from xml.etree import ElementTree
nottrobin /
Last active Feb 15, 2019
Converting juju docs
# Get juju-docs and discoursifier
git clone -b devel ~/git/juju-docs
git clone ~/git/discoursifier
# Setup python venv for discoursifier
python3 -m venv ~/git/discoursifier/env3
source ~/git/discoursifier/env3/bin/activate
pip install -r ~/git/discoursifier/requirements.txt
# Enter the documentation directory
You can’t perform that action at this time.