Skip to content

Instantly share code, notes, and snippets.

@rothgar
rothgar / create-workloads.sh
Created December 15, 2021 19:46
Create random Kubernetes deployments
#!/bin/bash
set -o pipefail
# total amount of pods to create
TOTAL=${1:-500}
# deploy size
export BATCH=${2:-100}
export NAMESPACE=${KUBE_NAMESPACE:-default}
@rothgar
rothgar / alias
Created July 2, 2021 20:58
Infinidash command
# put this in $HOME/.aws/cli/alias
[toplevel]
infinidash = !f() {
if [ -z "$1" ]; then
cat $HOME/.aws/help.txt
elif test "$1" = "deploy"; then
curl -s -L https://raw.githubusercontent.com/keroserene/rickrollrc/master/roll.sh | bash
elif test "$1" = "help"; then
cat $HOME/.aws/help.txt
@rothgar
rothgar / move-window-down-workspace.sh
Created January 16, 2021 00:08
Move window down workspace
#!/bin/bash
CURRENT_DESKTOP=$(wmctrl -d | grep '*' | awk '{print $1}')
wmctrl -r :ACTIVE: -t $(( ${CURRENT_DESKTOP}+1 ))
# my profile is configured for us-west-2
export AWS_DEFAULT_REGION=us-west-1
export AWS_REGION=us-east-1
aws ec2 describe-instances --query 'Reservations[].Instances[].Placement.AvailabilityZone' --output text
us-east-1c
unset AWS_REGION
aws ec2 describe-instances --query 'Reservations[].Instances[].Placement.AvailabilityZone' --output text
us-west-1c
unset AWS_DEFAULT_REGION
@rothgar
rothgar / chime-tampermonkey.js
Last active August 13, 2020 20:50
Chime Keyboard shortcuts
// ==UserScript==
// @name Chime Keyboard Shortcuts
// @namespace http://app.chime.aws
// @version 0.1
// @description Simple keyboard shortcuts for chime
// @author [email protected]
// @match https://app.chime.aws/meetings/*
// @grant none
// @run-at document-end
// ==/UserScript==
@rothgar
rothgar / streamyard-tampermonkey.js
Last active December 3, 2021 16:40
Streamyard Keyboard Shortcuts
// ==UserScript==
// @name Streamyard Keyboard Shortcuts
// @namespace http://streamyard.com
// @version 0.1
// @description Simple keyboard shortcuts for streamyard
// @author [email protected]
// @match https://streamyard.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
@rothgar
rothgar / index.html
Last active July 31, 2020 22:08
Kube spin
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
#wheel {
animation-name: spin;
animation-timing-function: ease-in-out;
animation-iteration-count: 1;
@rothgar
rothgar / time-me.sh
Created December 5, 2019 07:14
pod timer
#!/bin/bash
# run with time time-me.sh
# Checks how long it takes to schedule 100 nginx pods
kubectl scale deploy nginx --replicas 101
replicas=0
while [ $replicas -lt 101 ]; do
replicas=$(kubectl get deploy nginx -o template --template={{.status.availableReplicas}})
@rothgar
rothgar / searches
Created May 10, 2019 16:40
chrome://settings/searchEngines
# Search for container images on docker hub
Docker Hub, dhub, https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=%s&starCount=0
# Search for emoji
emojipedia, emoji, https://emojipedia.org/search/?q=%s
# search Amazon
amazon, amz, http://www.amazon.com/s?k=%s
@rothgar
rothgar / 😁.gif
Last active April 25, 2019 05:23
😁
😁.gif