Skip to content

Instantly share code, notes, and snippets.

@jakerella
jakerella / kubectl-cheat-sheet.txt
Created November 24, 2021 20:38
A cheat sheet for common kubectl CLI actions
# list all contexts in your kube config
kubectl config get-contexts
# switch to a specific context
kubectl config use-context [context-name]
# add a new context to your kube config
(login to aws on the cli first)
aws eks --region [cluster-region (us-east-1)] update-kubeconfig --name [cluster] --role-arn arn:aws:iam::[ACCOUNT]:role/[ROLE_NAME]
(note, role may be named differently in different accounts)
@jakerella
jakerella / login-aws.sh
Created November 24, 2021 20:33
A script for logging into the AWS CLI using MFA
% login-aws () {
valid_token=0
duration=129600
if [ "$1" = '--help' ] || [ "$1" = '-h' ] || [ "$1" = 'help' ]; then
echo "This script will log you into AWS using an MFA device."
echo "If you have logged in recently (36 hours), then this script will use"
echo "the existing session information. Session information is stored in"
echo "the user's home directory as a JSON file named '.aws_session_token'"
echo "\nBe sure to have the AWS_MFA environment variable set to the arn of"
@jakerella
jakerella / jkq.js
Last active May 3, 2024 01:49
An ultra-light, jQuery-like micro-library for selecting DOM elements and manipulating them.
(function() {
'use strict';
/**
* Core method, similar to jQuery (only simpler)
*
* @param {String|HTMLElement} s The CSS selector to search for or HTML element to wrap with functionality
* @param {HTMLElement} root OPTIONAL An HTML element to start the element query from
* @return {Array} The collection of elements, wrapped with functionality (see API methods)
*/
@jakerella
jakerella / create-load.js
Last active November 19, 2015 19:27
Simple load generation script to test web applications.
/**
* This script helps to artifically generate load on a web application through
* weighted requests to various endpoints. It may not be pretty, but it works
* for me. :) Feel free to use however you want.
*
* NOTE: Please use responsibly, don't run this script against a production server!
*
* @author Jordan Kasper (@jakerella)
* @contributor @robcolburn
* @license MIT
@jakerella
jakerella / Metro-Instructions.md
Last active February 20, 2017 23:23
DC Food, Beverage, Sights, and Metro Instructions

Instructions for Using the Metro in DC

Before you Go...

  • Make sure you have google maps on your phone. When you ask Google Maps for directions, it will give you an option to use public transportation and will tell you how to get there by metro. It will also show a big "M" in a square in locations where you can find a metro station.
  • Have a printed copy of the DC Metro map. It's very handy for when you are unfamiliar with the sytem (big pdf or smaller for printing).
  • Download either the Lyft or Uber app to your phone, and go through the steps to set up your account. You will have to provide a credit card. You may not use these services at all, but when you need them, they are a total lifesaver. More details on this below.

The Metro

@jakerella
jakerella / semver-compare.js
Created September 30, 2014 19:50
Semver Comparison
function test() {
var results = [];
results.push(compareSemver("1.8.3", "1.8.3", "=="));
results.push(compareSemver("1.9.1", "1.11.1", "<"));
results.push(compareSemver("1.5.3", "1.9", "<"));
results.push(compareSemver("1.3.2", "1.10.2", "<="));
results.push(compareSemver("1.3.2", "1.3.2", "<="));
results.push(compareSemver("1.11.1", "1.9.1", ">"));
results.push(compareSemver("1.11.1", "1.11.0", ">"));
results.push(compareSemver("1.10.2", "1.5.2", ">="));
@jakerella
jakerella / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am jakerella on github.
  • I am jakerella (https://keybase.io/jakerella) on keybase.
  • I have a public key whose fingerprint is C9FB 863E 5526 7CFD ED23 AB4D ADF5 8C38 8F44 4B28

To claim this, I am signing this object:

@jakerella
jakerella / alexa.md
Last active March 11, 2023 15:41
Speaking bio and abstracts for submission to conferences, user groups, etc.

Alexa, build me an app

Building an Amazon Echo (Alexa) skill is extremely simple, if a bit cumbersome. If you're not familiar, the Echo is an always-on home automation unit with built-in support for things like playing streaming music, getting weather information, and even turning on your wifi-connected lights. Amazon also allows developers to extend the Echo's functionality with custom "skills". These skills get the benefit of Amazon's full speech analysis engine and works through a simple JSON web API. In this talk we'll cover how we can use Node.js to write a simple skill and what else we need to do to get up and running. You'll learn how to test your new skill with a real voice interface and the basics of the cumbersome setup process on Amazon's developer portal along with some best practices. You don't need to own an Echo to write a skill... although they sure are fun to play with!

300 Characters

Building an Amazon Echo (Alexa) skill is extremely simple, if a bit cumbersome. Skills get the benef