This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
versionsfordblist | |
~~~~~~~~~~~~~~~~~ | |
Dumps out versions in use for any dblist on noc.wikimedia.org | |
Usage: | |
versionsfordblist <dblist> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import requests | |
from bs4 import BeautifulSoup | |
base_url = 'https://www.whitelabs.com' | |
page = ('yeast-bank?keywords=' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
train.py | |
~~~~~~~~ | |
Find deployments of a given type in a given time period. | |
""" | |
from __future__ import division |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -x | |
mkdir -p rsync1/versions/version1/cache/l10n | |
touch rsync1/versions/version1/cache/l10n/en.cdb | |
touch rsync1/versions/version1/cache/l10n/en.json | |
rsync -avz --delete --exclude='**/cache/l10n/*.cdb' rsync1/ rsync2/ | |
touch rsync2/versions/version1/cache/l10n/en.cdb | |
rm -rf rsync1/versions/version1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
help() { | |
cat<<HELP 2>&1 | |
USAGE: | |
ksphelper <party name> <keymaster> <keysfile> | |
ksphelper helps create a gpgparticipants file from a list of keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
update-wikimedia-repos.py | |
~~~~~~~~~ | |
Update all Wikimedia repositories to point to the code mirror on gerrit. | |
Prompts for username and password as well as 2fa code. You will be prompted twice | |
for a 2fa code -- once for listing orgs, once for listing repos. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" SetSpaces ------------------------------------------------------------ {{{ | |
function! SetSpaces(arg) | |
echo "settings spaces to: " . a:arg | |
execute 'set tabstop=' . a:arg | |
execute 'set shiftwidth=' . a:arg | |
execute 'set softtabstop=' . a:arg | |
endfunction | |
command! -nargs=1 SetSpaces :call SetSpaces(<f-args>) | |
" }}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spell() { | |
# /me futilely avoids googling words to find their correct spelling | |
local candidates oldifs word array_pos | |
oldifs="$IFS" | |
IFS=':' | |
# Parse the apsell format and return a list of ":" separated words | |
read -a candidates <<< "$(printf "%s\n" "$1" \ | |
| aspell -a \ | |
| awk -F':' '/^&/ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Embed exif info inside of a photo | |
DEBUG=0 | |
DRY_RUN=0 | |
OUTPUT_DIR= | |
FILES= | |
TAGS=( | |
'FocalLength' | |
'ExposureTime' | |
'Make' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Vigenère Cipher | |
=============== | |
This is a slightly more complicated version of the classic Ceaser cipher (A.K.A | |
Rot13). Rather than rotate each letter of the alphabet 13 characters, we rotate | |
each letter of a message by the offset of the cooresponding letter of a | |
variable length key. |