Skip to content

Instantly share code, notes, and snippets.

View brennen's full-sized avatar

Brennen Bearnes brennen

View GitHub Profile
@dancysoft
dancysoft / push-one-commit
Created February 23, 2021 19:35
Push a single commit to Gerrit
#!/bin/bash
# Pushes a single commit to Gerrit.
# Contributors:
# Ahmon Dancy
# Kevin Layer
# Willem Broekema
set -ue
#!/usr/bin/env python
# Pytail
# ------
# Dumb python program that lets you tail a file while interactively filtering it
import os
import re
import select
import subprocess
import sys
import time
@egardner
egardner / Dockerfile
Last active January 28, 2021 17:39
Basic MW dev environment with Docker
# Put this in web/Dockerfile
# Adapted from https://github.com/wikimedia/mediawiki-docker/blob/master/1.32/Dockerfile
FROM php:7.2-apache
# System Dependencies.
RUN apt-get update && apt-get install -y \
git \
imagemagick \
libicu-dev \
@thcipriani
thcipriani / ksphelper
Created July 28, 2017 15:05
A gpgparticipants(1) helper script. The idea is to not import the keys you have initially, but only after the ksp-file.txt has been verified as correct.
#!/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.
@thcipriani
thcipriani / spell.sh
Created February 23, 2017 17:00
I keep this function sourced from my .bashrc—it is incredibly useful.
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':' '/^&/ {
@thcipriani
thcipriani / focal_length_stats.awk
Last active February 11, 2017 19:02
Quick(ish) awk script to find some stats about the focal length of pictures I've taken.
#!/usr/bin/awk -f
BEGIN {
FL_SUM = 0
FL_CUR = 0
FL_TOTAL = 0
}
{
getFocalLength($0)
@thcipriani
thcipriani / archive-org-m3u.py
Created March 28, 2016 18:20
Create m3u files from Archive.org search results
#!/usr/bin/env python2
# coding: utf-8
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@erikaheidi
erikaheidi / le-renew.sh
Last active February 23, 2022 02:13
Auto renewal for Let's Encrypt Apache
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on Ubuntu/Debian
# @author Erika Heidi<erika@do.co>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1mbVihI
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@thcipriani
thcipriani / BangOpen.vim
Created October 1, 2015 19:22
Open the output of a command as a file in a new tab: i.e. :BangOpen which git-new-workdir
" BangOpen ------------------------------------------------------------ {{{
function! BangOpen(arg)
execute 'tabe ' . system(a:arg)
endfunction
command! -nargs=1 BangOpen :call BangOpen(<f-args>)
" }}}