This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
yum install -y epel-release | |
yum makecache | |
yum install -y @development git cmake ruby zlib-devel openssl-devel libevent-devel ncurses-devel libssh-devel msgpack-devel | |
git clone https://github.com/nviennot/tmate.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use pup for HTML parsing | |
# https://github.com/ericchiang/pup | |
# | |
# remove lines that start with < (html formatted) | |
# or # comments | |
curl-to-bash() { | |
curl -s "${1}" \ | |
| pup -p code \ | |
| grep -v -E '^[[:space:]]*#|^[[:space:]]*<' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import board | |
from time import sleep | |
import displayio | |
from adafruit_display_shapes.rect import Rect | |
from adafruit_matrixportal.matrix import Matrix | |
# --- Display setup --- | |
matrix = Matrix(bit_depth=6, width=32, height=32) | |
display = matrix.display |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Streamyard Keyboard Shortcuts | |
// @namespace http://streamyard.com | |
// @version 0.1 | |
// @description Simple keyboard shortcuts for streamyard | |
// @author justinleegarrison@gmail.com | |
// @match https://streamyard.com/* | |
// @grant none | |
// @run-at document-end | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Taken from https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55 | |
# initialize array | |
COMMANDS=('uptime') | |
# add systemctl command if it's installed | |
command -v systemctl >/dev/null && COMMANDS+=('systemctl list-units --state=failed') | |
# add more commands | |
COMMANDS+=('dmesg | tail' | |
'vmstat 1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ping once per minute. Every minute for a day | |
ping -i 60 -c 1440 google.com | grep loss | awk -F ',' '{print $3}' | |
# print avg latency (ms) per hour. One ping per minute | |
ping -i 60 -c 60 google.com | awk '{print $8}' | sed -n '/^time/p' | awk -F '=' '{print $2}' | awk '{ sum += $1 } END { if (NR > 0) print sum / NR }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CURRENT_DESKTOP=$(wmctrl -d | grep '*' | awk '{print $1}') | |
wmctrl -r :ACTIVE: -t $(( ${CURRENT_DESKTOP}+1 )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |