Skip to content

Instantly share code, notes, and snippets.

View thcipriani's full-sized avatar

Tyler Cipriani thcipriani

View GitHub Profile
@thcipriani
thcipriani / cold-brew-coffee.org
Created June 25, 2019 22:18
Cold Brew Coffee

Cold Brew Coffee

This is how I made cold brew coffee for the first time in a long time on 2018-09-17!

Equipment

  • Toddy brewer
  • scale
  • water pitcher
#!/usr/bin/env bash
#
# Username To Lowercase
# =====================
#
# Script for converting gerrit:-scheme usernames to lowercase directly
# in a checkout of refs/meta/external-ids of the All-Users git repo.
#
# Copyright: Tyler Cipriani <tcipriani@wikimedia.org> 2019
# License: GPLv3+
#!/usr/bin/env python3
# exif-for-fp
# ~~~~~~~~~~~
#
# Copyright: Tyler Cipriani (c) 2019
# License: GPLv3
#
# Crawl featured picture gallery pages and extract camera/lens
# total and display that data
(/^ヮ^)/*:・゚✧ grep -aP '\bman\b' ~/.muh_history | awk '{print $(NF)}' | sort | uniq -c | sort -rn | head -20
54 date
53 ssh
50 bash
37 curl
35 sudo
34 man
32 ssh-keygen
32 rsync
31 ascii
"""
Cycle Time
==========
> The time from deciding that you need to make a change to having it in
> production is known as the _cycle time_.
>
> -- _Continuous Delivery_ by Jez Humble and David Farley
This is an attempt to approximate cycle time for MediaWiki core at the point
@thcipriani
thcipriani / wm-docker-static
Last active January 7, 2019 21:23
Because I can never remember how to find docker images and their tags
#!/usr/bin/env bash
BASE="/home/thcipriani/public_html/docker"
INDEX="${BASE}/index.html"
IMAGES="$(wm-docker-tags --repos)"
IMAGE_LIST=
mkdir -p "$BASE"
make_image_index() {
@thcipriani
thcipriani / diskspace.groovy
Created November 26, 2018 16:52
Quick groovy script to check disk-space on a subset of integration machines via the script console.
import hudson.util.RemotingDiagnostics
def groovyScript = 'println "df -h /srv".execute().text'
def computerNamePrefix = 'integration-slave-'
for (slave in hudson.model.Hudson.instance.slaves) {
def computer = slave.computer
def computerName = computer.getName()

Minikube raw notes

Make a docker container to run on minikube

Ensure that you are using the minikube docker context:

$ eval $(minikube docker-env)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
wmf-folks
~~~~~~~~~
A naïve attempt to answer the burning question: *exactly* how many
people work at the Wikimedia Foundation now?
"""
import requests
#!/usr/bin/env bash
output() {
printf "%s %s\n" "$@"
}
STARTDATE="$1"
ENDDATE="$2"
STARTSECONDS=$(date +%s -d"${STARTDATE}")