Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am erkolson on github.
  • I am erkolson (https://keybase.io/erkolson) on keybase.
  • I have a public key whose fingerprint is E433 F8B5 952D E6D4 C977 EEE3 4BBC A4E6 C95C 3247

To claim this, I am signing this object:

- name: drone-agent
image: drone/drone:0.7.1
imagePullPolicy: IfNotPresent
args:
- agent
env:
- name: DRONE_SERVER
value: ws://drone-drone-server.drone.svc.cluster.local:80/ws/broker
- name: DRONE_SECRET
value: <SECRET>
ctx () {
context=$1
if [ -z "$context" ]
then
echo "USAGE: ctx <context-name>"
echo "Available contexts:"
kubectl config get-contexts
else
kubectl config use-context $context
fi
#!/usr/bin/env sh
usage() {
cat <<-EOM
USAGE: `basename $0` <max_retries> <command> [<param1> [<param2> [...] ] ]
Retry shell commands until they work or max retries has been reached.
Helpful in a long running automation pipeline where a single non-zero
return status can waste a lot of time.
@erkolson
erkolson / go-builder.Dockerfile
Created March 24, 2018 00:40
Copy credentials into build container for git cloning, etc
FROM iron/go:dev as builder
ARG GH_TOKEN=default
RUN echo "machine github.com" > "/root/.netrc" \
&& \
echo "login x-oath-basic" >> "/root/.netrc" \
&& \
echo "password $GH_TOKEN" >> "/root/.netrc" \
&& \
chmod 600 /root/.netrc
#!/usr/bin/env bash
SCRIPT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
LOGS_DIR=${LOGS_DIR:-"./migration-logs"}
usage() {
echo "node_migration.sh <command>"
echo "commands:"
echo " migrate Run the migration scripts"
echo " summary Parse BSO logs for migration summary"
@erkolson
erkolson / Dockerfile
Created May 12, 2020 17:47
Python purge ttl packaging
FROM python:3.7.7-buster
COPY purge_ttl.py /app/
COPY requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
ENTRYPOINT ["/app/purge_ttl.py"]
@erkolson
erkolson / kube-shell-rc.sh
Last active May 27, 2020 03:09
Kubernetes shell shortcuts
alias k=kubectl
alias kks='kubectl -n kube-system'
alias wp='watch kubectl get pods'
ctx() {
context=$1
if [ -z "$context" ] ; then
echo "USAGE: ctx <context-name>"
echo "Available contexts:"
kubectl config get-contexts
@erkolson
erkolson / 120_min_endurance.zwo
Last active June 3, 2020 13:37
Some zwift workouts to break the monotony
<workout_file>
<author>E.Olson</author>
<name>120 min Endurance</name>
<description></description>
<sportType>bike</sportType>
<tags/>
<workout>
<IntervalsT Repeat="2" OnDuration="720" OffDuration="180" OnPower="0.77449995" OffPower="0.65449995" pace="0" OverUnder="1"/>
<SteadyState Duration="300" Power="0.90449995" pace="0"/>
<IntervalsT Repeat="2" OnDuration="720" OffDuration="180" OnPower="0.77449995" OffPower="0.65449995" pace="0" OverUnder="1"/>
@erkolson
erkolson / fit-files.py
Created July 13, 2020 19:24
compare hrm from 2 different devices
#!/usr/bin/env python3
from fitparse import FitFile
import matplotlib.pyplot as plt
garmin_fitfile = FitFile('./Evening_Ride.fit')
wahoo_fitfile = FitFile('./short_scream_into_the_void_race_.fit')
garmin_hr = []