Skip to content

Instantly share code, notes, and snippets.

Alastair Firth afirth

  • Berlin, Germany
Block or report user

Report or block afirth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View kubebuilder-2019-08-30.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
afirth / getopt.bash
Created Jul 18, 2019
bash getopt get args getargs limoncelli
View getopt.bash
function usage { echo " Usage: $0 [-d] [-a author] [-c file.txt] [-h] dir1 [dir1 ...] -d debug, don't actual run command -a author name of the author -c copyright override default copyright file -h this help message " exit 1 }
# Set our defaults:
# Process command-line arguments, possibly overriding defaults
args='getopt da:c:h $*'
if [ $? != 0 ] then usage fi
set -- $args
for i do
View gist:ca016f72fc98a05e3d8145911d70f3a8
time="2019-06-14T00:20:28Z" level=info msg="running version stable-2.3.2"
INFO [ 0.001275s] linkerd2_proxy::app::main using destination service at Some(ControlAddr { addr: Name(NameAddr { name: "linkerd-destination.linkerd.svc.cluster.local", port: 8086 }), identity: Some("linkerd-controller.linkerd.serviceaccount.identity.linkerd.cluster.local") })
INFO [ 0.001575s] linkerd2_proxy::app::main using identity service at Name(NameAddr { name: "linkerd-identity.linkerd.svc.cluster.local", port: 8080 })
INFO [ 0.001750s] linkerd2_proxy::app::main routing on V4(
INFO [ 0.001961s] linkerd2_proxy::app::main proxying on V4( to None
INFO [ 0.002152s] linkerd2_proxy::app::main serving admin endpoint metrics on V4(
INFO [ 0.002277s] linkerd2_proxy::app::main protocol detection disabled for inbound ports {25, 3306}
INFO [ 0.002407s] linkerd2_proxy::app::main protocol detection disabled for outbound ports {25, 3306}
INFO [ 0.004537s] trust_dns_proto::
afirth / Dockerfile
Created May 29, 2019
Add jmx_exporter to Camunda BPM
View Dockerfile
FROM camunda/camunda-bpm-platform:tomcat-7.11.0
## Add prometheus exporter
RUN wget -P lib/
#9404 is the reserved prometheus-jmx port
ENV CATALINA_OPTS -javaagent:lib/jmx_prometheus_javaagent-0.11.0.jar=9404:/etc/config/prometheus-jmx.yaml
afirth / go get binaries available on path
Last active May 29, 2019
Make binaries installed with go get available on path
View go get binaries available on path
# add to [bash/zsh]rc and source
# Golang
which go > /dev/null && \
export GOPATH=$(go env GOPATH) && \
export PATH=$GOPATH/bin:$PATH
View afirth.zsh-theme
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%~%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
View 2019-06-15 zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Golang
which go > /dev/null && \
export GOPATH=$(go env GOPATH) && \
export PATH=$GOPATH/bin:$PATH
afirth /
Created Jan 26, 2019
tillerless helm
#!/usr/bin/env bash
# this starts a local tiller service with secret storage driver, then runs helm commands against it
# setting $TILLER_NAMESPACE is strongly recommended
# usage: ./ <valid helm args>
# afirth 2018
set -eu -o pipefail
# default to use if TILLER_NAMESPACE is not set
# kube-system (the default) is not a great idea
afirth /
Created Jan 26, 2019
save a subpath of a github repository
#!/usr/bin/env bash
set -eux -o pipefail
# --wildcards required on linux but not osx
if [ "$(uname)" == "Linux" ]; then
afirth /
Created Jan 26, 2019
get latest github release tag
#!/usr/bin/env bash
set -eux -o pipefail
helmrelease=$(curl -sL "" | awk -F '"' '/tag_name/{print $4}')
echo using latest helm $helmrelease
You can’t perform that action at this time.