Skip to content

Instantly share code, notes, and snippets.

@erkolson
erkolson / fit-files.py
Last active July 14, 2020 13:21
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 = []
@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 = []
@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 / gcloud-shell-rc.sh
Created May 27, 2020 03:08
gcloud shell access shortcuts
gcloudctx() {
context=$1
if [ -z "$context" ] ; then
echo "USAGE: gcloudctx <context-name>"
echo "Available contexts:"
gcloud config configurations list
elif gcloud config configurations list --format="value(Name)" | grep "^$context$" &>/dev/null; then
gcloud config configurations activate $context
else
echo "Creating context $context"
@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 / 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"]
#!/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 / 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
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
- 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>