Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Cipriani thcipriani

View GitHub Profile
View cold-brew-coffee.org

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
View gerritUsernameToLowercase.sh
#!/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+
View exif-for-fp.py
#!/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
View most-read-man-pages.txt
(/^ヮ^)/*:・゚✧ 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
View cycletime.py
"""
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 Jan 7, 2019
Because I can never remember how to find docker images and their tags
View wm-docker-static
#!/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 Nov 26, 2018
Quick groovy script to check disk-space on a subset of integration machines via the script console.
View diskspace.groovy
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()
View minikube-raw-notes.org

Minikube raw notes

Make a docker container to run on minikube

Ensure that you are using the minikube docker context:

$ eval $(minikube docker-env)
View wmf-folks.py
#!/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
View timebetween.sh
#!/usr/bin/env bash
output() {
printf "%s %s\n" "$@"
}
STARTDATE="$1"
ENDDATE="$2"
STARTSECONDS=$(date +%s -d"${STARTDATE}")