Skip to content

Instantly share code, notes, and snippets.

View jwhitlock's full-sized avatar

John Whitlock jwhitlock

View GitHub Profile
@jwhitlock
jwhitlock / bcd_prs.py
Created April 11, 2018 15:33
Generate a list of open PRs on mdn/browser-compat-data, from smallest to largest
#!/usr/bin/env python
'''Create list of PRs, smallest to largest.'''
from __future__ import print_function, unicode_literals
import pprint
import re
import sys
from argparse import ArgumentParser
from datetime import timedelta
@jwhitlock
jwhitlock / bcd_prs.txt
Created April 11, 2018 15:30
BCD PRs, smallest first
PR 1724, Add alternative names to `fullscreenElement` by timm-gs, has 9 changes: https://github.com/mdn/browser-compat-data/pull/1724
PR 1333, remove Chrome/Firefox support for ReadableStream in Request Body by AnthumChris, has 30 changes: https://github.com/mdn/browser-compat-data/pull/1333
PR 1707, Add Navigator.serviceWorker by ExE-Boss, has 36 changes: https://github.com/mdn/browser-compat-data/pull/1707
PR 1681, add simple JSON pointer parsing to prevent data duplication by patrickkettner, has 37 changes: https://github.com/mdn/browser-compat-data/pull/1681
PR 1390, add compat data for DOMErrorHandler by gsouquet, has 40 changes: https://github.com/mdn/browser-compat-data/pull/1390
PR 1314, Add helper script for sorting browser versions by enjikaka, has 48 changes: https://github.com/mdn/browser-compat-data/pull/1314
PR 1378, New: add calc() values in grid-gap(gutter properties) by yisibl, has 48 changes: https://github.com/mdn/browser-compat-data/pull/1378
PR 1696, Add BeforeUnloadEvent by kaycebasques,
@jwhitlock
jwhitlock / rerender_docs.py
Last active March 27, 2019 01:12
Re-render documents that use a macro
# From https://gist.github.com/jwhitlock/43e34e07bef8c3f1863e91f076778ca6
from time import sleep, time
import redis
from celery.states import READY_STATES
from django.conf import settings
from kuma.wiki.models import Document
from kuma.wiki.tasks import render_document
@jwhitlock
jwhitlock / subtree_count.py
Created December 5, 2017 13:59
Get the year's revision count for a subtree of MDN pages
from datetime import datetime, date
from urlparse import urlparse
from kuma.wiki.models import Document
pages = [page for page in '''\
https://developer.mozilla.org/en-US/docs/Tools
https://developer.mozilla.org/en-US/Firefox
https://developer.mozilla.org/en-US/Firefox/Releases
https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox
https://developer.mozilla.org/en-US/docs/Mozilla
@jwhitlock
jwhitlock / parse_log.py
Created December 4, 2017 18:05
Count IP addresses from the Kuma papertrail log, to analyze downtimes
#!/usr/bin/env python
'''
Parse a Kuma papertrail log, mostly to count IP addresses to find the scrapers.
To get some log entries, use command line papertrail, like:
papertrail --min-time '2017-11-12 4:00 AM' --max-time '2017-11-12 5:00 AM' -g portland -- mdn-prod_web '-"GET /readiness"' '-"GET /healthz"' '-"- - HTTP/1.0"' > trouble.log
A simplier version can be used to just count IP addresses, but I was being bolder,
so I could parse on other elements.
@jwhitlock
jwhitlock / kuma_report.py
Last active December 5, 2017 15:43
Generate the first draft of the monthly Kuma Report
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from argparse import ArgumentParser
from cgi import escape
from collections import defaultdict, Counter, OrderedDict
from datetime import date, datetime, timedelta
from textwrap import wrap
import pprint
import re
@jwhitlock
jwhitlock / output.20171023.shm2g.txt
Created October 23, 2017 15:04
PR 4915 - Log from "TRACE_GECKODRIVER=1 SELENIUM_LOGS=1 BROWSERS=firefox scripts/run_selenium_hub.sh", with "--shm-size 2g"
#!/bin/bash -vx
PYTEST_ARGS="${@}"
+ PYTEST_ARGS=
if [ -z "$PYTEST_ARGS" ]; then
PYTEST_ARGS="tests/functional -m \"not login\" -vv -sx"
fi
+ '[' -z '' ']'
+ PYTEST_ARGS='tests/functional -m "not login" -vv -sx'
echo "ARGS=$PYTEST_ARGS"
+ echo 'ARGS=tests/functional -m "not login" -vv -sx'
@jwhitlock
jwhitlock / output.20171023.txt
Created October 23, 2017 14:50
PR 1015 - Log from "TRACE_GECKODRIVER=1 SELENIUM_LOGS=1 BROWSERS=firefox scripts/run_selenium_hub.sh"
#!/bin/bash -vx
PYTEST_ARGS="${@}"
+ PYTEST_ARGS=
if [ -z "$PYTEST_ARGS" ]; then
PYTEST_ARGS="tests/functional -m \"not login\" -vv -sx"
fi
+ '[' -z '' ']'
+ PYTEST_ARGS='tests/functional -m "not login" -vv -sx'
echo "ARGS=$PYTEST_ARGS"
+ echo 'ARGS=tests/functional -m "not login" -vv -sx'
@jwhitlock
jwhitlock / output.20171006.txt
Created October 6, 2017 13:44
PR 4915 - Log from "BROWSERS=firefox SELENIUM_LOGS=1 scripts/run_selenium_hub.sh"
#!/bin/bash -vx
PYTEST_ARGS="${@}"
+ PYTEST_ARGS=
if [ -z "$PYTEST_ARGS" ]; then
PYTEST_ARGS="tests/functional -m \"not login\" -vv -sx"
fi
+ '[' -z '' ']'
+ PYTEST_ARGS='tests/functional -m "not login" -vv -sx'
echo "ARGS=$PYTEST_ARGS"
+ echo 'ARGS=tests/functional -m "not login" -vv -sx'
Very first discussion about potentially moving MDN to Cloud Services infrastructure in 2015
Context via cyliang:
"I'm part of the IT WebOps team, which is separate from the infra team spearheaded by Corey (cshields). jthomas and oremj are part of a completely different operations team (Service Operations is part of Cloud Services) and reports to a different VP. Right now, MDN is part of Cloud Services, but their infrastructure and operations is currently managed by the IT WebOps group."
Feb 4
Repository + stable parameter
tag, commit, branch wants to go to prod