Skip to content

Instantly share code, notes, and snippets.

@bjgill
bjgill / get_crds.py
Created September 27, 2019 16:16
Extract K8s CRDs for use by IntelliJ
"""
Extract Kubernetes Custom Resource Definitions (CRDs) from the raw output of `kubectl get crds -o yaml` for use by
IntelliJ Ultimate.
"""
# Crown Copyright (Government Digital Service)
# Released under the MIT license
import argparse
import os
import sys
import yaml
@bjgill
bjgill / .bashrc
Created October 11, 2018 13:44
.bashrc
# I, for one, am ready to be polite to our new robot overlords.
eval $(thefuck --alias oops)
alias please=sudo
# Prompt with colors and git branch information
if [[ $(id -u -n) != "<username>" ]]; then
USERNAME_STRING='\[\033[0;32m\]\u'
else
USERNAME_STRING=''
fi
@bjgill
bjgill / update_register.py
Created September 20, 2018 13:44
Script for updating the Enfield Green Party voting records
#!/usr/bin/env python3
"""update_register.py
Usage:
update_register.py [-h] FILENAME
"""
from docopt import docopt
import openpyxl
@bjgill
bjgill / patching.sh
Created April 26, 2018 15:03
Patching a qcow2
qemu-img convert image.qcow2 image.raw
sudo kpartx -av image.raw
mkdir temp
sudo mount /dev/mapper/loop0p2 temp
...
sudo umount temp
sudo kpartx -dv /dev/loop0
qemu-img convert -c -f raw -O qcow2 image.raw image-patched.qcow2
@bjgill
bjgill / .gitconfig
Last active March 5, 2023 12:16
My ~/.gitconfig
[user]
email = git@bgill.eu
name = Benjamin Gill
signingkey = C3EAA99A1E587915
[push]
default = simple
[pull]
ff = only
[alias]
# Aliases for laziness - fewer characters