Skip to content

Instantly share code, notes, and snippets.

@kenske
kenske / grafana-dashboards.sh
Created January 31, 2024 19:12
Create Grafana Dashboards
#!/usr/bin/env sh
set -e
# Verify that dashboards are ready
response_code=0
while [ "$response_code" -ne 200 ] ; do
echo "Waiting for dashboards to be ready..."
sleep 5
path="/api/dashboards/uid/some_dashboard"
@kenske
kenske / authy.js
Created May 4, 2022 03:24
Export Authy TOTP seeds
function hex_to_b32(hex) {
let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
let bytes = [];
for (let i = 0; i < hex.length; i += 2) {
bytes.push(parseInt(hex.substr(i, 2), 16));
}
let bits = 0;
let value = 0;
let output = '';
@kenske
kenske / git-cleanup.sh
Created November 14, 2019 20:46
Cleanup local branches
set -e
git checkout master
git remote prune origin
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' | xargs git branch -D
@kenske
kenske / aws-ecs-cluster-list.js
Created May 8, 2018 16:48
Tampermonkey script that sets the AWS ECS cluster page to list view instead of card view.
// ==UserScript==
// @name AWS ECS list view
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Default to list view on AWS ECS
// @author Kenneth Skertchly
// @match https://console.aws.amazon.com/ecs/home?region=us-east-1
// @grant none
// ==/UserScript==
@kenske
kenske / terraform-upgrade.sh
Last active January 29, 2018 18:50
Automatic terraform upgrade
#!/usr/bin/env bash
# Upgrade an existing terraform installation.
currentVersion=$(terraform version | head -n1 | awk '{print $2}' | cut -c 2-)
installPath=$(which terraform)
echo "Checking latest release..."
LATEST_RELEASE=$(curl -# https://api.github.com/repos/hashicorp/terraform/releases/latest | jq --raw-output '.tag_name' | cut -c 2-)
@kenske
kenske / timelapse.sh
Created October 12, 2017 22:39
Create timelapse
#!/bin/bash
# Create 1080p and 4k timelapse
# Requires imagemagick, mencoder and parallel
# Resizes and crops images and creates video
if [[ "$#" == 0 ]]; then
echo "Usage: $0 <sourcedir>"
exit 1
fi