Skip to content

Instantly share code, notes, and snippets.


Richard Bateman taxilian

View GitHub Profile
taxilian /
Created Sep 8, 2021
Bash script to export all kubernetes resources as YAML files in a directory structure
allCRDs=$(kubectl get crd -o name | cut -d '/' -f 2)
for crd in $allCRDs; do
scope=$(kubectl describe crd $crd | grep "Scope" | cut -d ':' -f 2 | sed 's/^ *//g')
if [ "$scope" == "Namespaced" ]; then
taxilian /
Created Aug 4, 2021
Tool for testing how often a command succeeds
declare -i COUNT
declare -i SUCCESS
for i in {1..100}; do
taxilian / ExampleSourceComponent.vue
Last active Jul 9, 2021
Dialog abstraction example
View ExampleSourceComponent.vue
<script lang="ts">
import {showDialog} from './dialogMgr';
export default class MyOtherComponent extends Vue {
markdown = '(some loaded markdown here)';
async openDialog() {
taxilian / app.ts
Last active Apr 7, 2021
My attempt at implementing a node.js server with kubernetes best practices for closing gracefully
View app.ts
const dbConnections: Array<MongoClient> = [];
export type startupMiddleware = ReturnType<typeof initMiddleware>;
let failCase: Error;
export function setUnrecoverableError(err: Error) {
failCase = err;
console.warn(`Unrecoverable error set:`, err, err.stack);
taxilian /
Created Mar 28, 2021
Bootstrapping a kubeadm cluster on ubuntu 20.04
taxilian / arrlVeList.ts
Last active Mar 14, 2021
Get ARRL ve lists for each state
View arrlVeList.ts
// Originally written by Jason Sweeney, refactored by Richard Bateman
// 2021
import axios from "axios";
import cheerio from "cheerio";
const stateListUrl = "";
const stateUrl = "";
type PromisedReturnType<T extends (...args: any) => any> = T extends (...args: any) => Promise<infer R> ? R : ReturnType<T>;
taxilian /
Created Jan 4, 2021
macOS set up yubico-piv-tool


Homebrew build doesn't work -- dunno why. I should figure out why and fix it then submit a PR, but I'm lazy.


brew install cmake libtool pkg-config check gengetopt help2man pcsc-lite openssl
taxilian / .zshrc
Last active Jul 19, 2021
Easily switch between different SSH agents on mac, probably easy to adapt to any linux
View .zshrc
function showAgent() {
echo The current SSH agent is $(readlink ~/.ssh-agent-link)
function updateSshAgentSock() {
if [ -z "$NEWSOCK" ]; then
echo -n "No socket found for ${1}; not changing agents. "
return 1
elif [ ! -S "$NEWSOCK" ]; then
taxilian / compress.yaml
Last active Sep 16, 2020
Traefik kubernetes configuration that I use
View compress.yaml
# Enable gzip compression
kind: Middleware
name: gzip-compress
compress: {}
taxilian / common.ts
Created Sep 14, 2020
Example typescript pattern for defining a view using 'mongoose-decorators-ts'
View common.ts
export const readOnlyExcludeKeysModel = <const>[
'watch', 'bulkWrite', 'create', 'createCollection',
'syncIndexes', 'listIndexes', 'ensureIndexes',
'createIndexes', 'findByIdAndRemove', 'findByIdAndDelete',
'findByIdAndUpdate', 'findOneAndRemove', 'findOneAndDelete',
'findOneAndUpdate', 'insertMany', 'remove', 'deleteOne',
'deleteMany', 'replaceOne', 'update', 'updateMany', 'updateOne',
export type readOnlyExcludeKeysModel = typeof readOnlyExcludeKeysModel[number];
export const readOnlyExcludeKeysDoc = <const>[