Skip to content

Instantly share code, notes, and snippets.

View davidcollom's full-sized avatar
🐢
I may be slow to respond.

David Collom davidcollom

🐢
I may be slow to respond.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am davidcollom on github.
  • I am davidcollom (https://keybase.io/davidcollom) on keybase.
  • I have a public key whose fingerprint is 586F C999 658B A5A1 A55D 4FCA B480 42C8 D905 FF99

To claim this, I am signing this object:

@davidcollom
davidcollom / export-k8s.sh
Last active October 9, 2020 09:23
export k8s cluster
#!/usr/bin/env bash
EXCLUDE_RESOURCES="pods|endpoints|controllerrevisions.apps|replicasets|events"
for ns in $(kubectl get ns -o json | jq -r '.items[].metadata.name'); do
for obj in $(kubectl api-resources --namespaced -o name | grep -vE "${EXCLUDE_RESOURCES}"); do
for name in $(kubectl -n $ns get $obj -o json | jq -r '.items[].metadata.name'); do
echo ${ns}/${obj}/${name}
mkdir -p ${ns}/${obj};
kubectl -n $ns get $obj $name -o yaml \
@davidcollom
davidcollom / monzo-alertmanager-config.yaml
Created October 14, 2019 11:23 — forked from milesbxf/monzo-alertmanager-config.yaml
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@davidcollom
davidcollom / Dockerfile
Last active February 22, 2020 10:45 — forked from nneul/packt-sync.pl
Quick ugly script for bulk download of packt ebooks from your own account
FROM perl:5
RUN cpanm -in URI::Escape LWP LWP::Protocol::https JSON Cwd Log::Log4perl
ADD packt-sync.pl /packt-sync.pl
ENTRYPOINT [ "/packt-sync.pl" ]
@davidcollom
davidcollom / README.md
Created July 18, 2017 16:07 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@davidcollom
davidcollom / election_candidate.rb
Last active January 20, 2016 10:38 — forked from fabrizioc1/election_candidate.rb
Zookeeper leader election using Ruby
# http://zookeeper.apache.org/doc/r3.3.4/recipes.html#sc_leaderElection
require 'rubygems'
require 'bundler/setup'
require 'zookeeper'
require 'hashie'
class ElectionCandidate
attr_reader :zookeeper, :children, :root_path, :node_path, :my_path
attr_accessor :logger
@davidcollom
davidcollom / README.md
Last active August 29, 2015 14:24 — forked from tolleiv/README.md
Puppet dashboard radiator widget for Dashing

Puppet Radiator Widget

This is a Dashing widget and all components needed to port the original radiator information into an Dashing Widget.

##Usage

To use this widget, copy puppet_radiator.html, puppet_radiator.coffee, and puppet_radiator.scss into the /widgets/puppet_radiator directory. Put the puppet_radiator.rb file in your /jobs folder. Or simply run dashing install c695b22a12259f0809f8 to let dashing do that for you.

To include the widget in a dashboard, add the following snippet to the dashboard layout file:

#!/bin/bash
set -eu
shopt -s nullglob
readonly base_dir=/var/lib/docker/registry
readonly output_dir=$(mktemp -d -t trace-images-XXXX)
readonly jq=/usr/bin/jq
readonly repository_dir=$base_dir/repositories
#!/bin/bash
set -eu
shopt -s nullglob
readonly base_dir=/var/local/docker-registry
readonly output_dir=$(mktemp -d -t trace-images-XXXX)
readonly jq=/tmp/jq
readonly repository_dir=$base_dir/repositories
#!/usr/bin/env bash
ipconfig | grep IPv4 | awk -F: '{print $2}' | tr -d ' '