Skip to content

Instantly share code, notes, and snippets.

View rmkraus's full-sized avatar

Ryan Kraus rmkraus

View GitHub Profile
#!/bin/bash
set -o errexit
if [ "$KUBECONFIG" == "" ]; then
KUBECONFIG=~/.kube/config
fi
echo "Kubeconfig file at: $KUBECONFIG"
gist_id_file="$(dirname $KUBECONFIG)/.$(basename $KUBECONFIG)-gist-id"
## CONNECT TO AN EXISTING GIST
@rmkraus
rmkraus / k8s-tools.sh
Last active September 22, 2023 01:59
A package manager for container and k8s tools that isn't a package manager.
#! /bin/bash
set -e
# credit: http://nparikh.org/notes/zshrc.txt
# Usage: extract <file>
# Description: extracts archived files / mounts disk images
# Note: .dmg/hdiutil is Mac OS X-specific.
extract () {
if [ -f $1 ]; then
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>,
# Daniel Lobato Garcia <dlobatog@redhat.com>
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@rmkraus
rmkraus / unifi_dhcp_automation.yml
Last active March 15, 2024 03:37
Ansible Automation for Static DHCP Entries on UniFi Gear
#!/usr/bin/ansible-playbook
# more api documentation here:
# https://ubntwiki.com/products/software/unifi-controller/api
---
- name: test unifi api
hosts: localhost
gather_facts: no
vars:
unifi_user: SVC_ACCT_USERNAME

Keybase proof

I hereby claim:

  • I am rmkraus on github.
  • I am rkraus (https://keybase.io/rkraus) on keybase.
  • I have a public key ASBm72nfcj2gJmJyZoRnJcTenH8d4WsohJjQtHezV60K0Qo

To claim this, I am signing this object:

from homeassistant.helpers.event_decorators import HASS, track_state_change
from homeassistant import const
DOMAIN = 'mute_light'
DEPENDENCIES = []
def setup(hass, config):
return True
@rmkraus
rmkraus / morse_translate.py
Created August 18, 2015 06:31
Morse Code Encoder and Decoder
""" Morse Code translator """
MORSE = ['..-', '---', '....', '.--', '.---', '-', '--.-', '-..', '...',
'-..-', '--', '-.', '.-..', '.-', '-.-', '..', '--..', '-.-.', '.--.',
'--.', '-...', '-..--', '.', '.-.', '..-.', '...-', '/', ' ']
ALPHA = ['u', 'o', 'h', 'w', 'j', 't', 'q', 'd', 's', 'x', 'm', 'n', 'l', 'a',
'k', 'i', 'z', 'c', 'p', 'g', 'b', 'y', 'e', 'r', 'f', 'v', ' ', '']
def translate(lkp, out, encoded, in_delim, out_delim):
import os
import sys
import io
import tarfile
import urllib.request
ARCHIVE_URL = 'http://d.pr/f/YqS5+'