Skip to content

Instantly share code, notes, and snippets.

@jonmoter
jonmoter / install_krew.sh
Created Jan 20, 2020
script to install krew and some plugins
View install_krew.sh
#!/usr/bin/env bash
# https://github.com/kubernetes-sigs/krew/
set -ex
krew_version=v0.2.1
if [ -d $HOME/.krew ] ; then
echo "krew already installed"
else
cd "$(mktemp -d)"
@jonmoter
jonmoter / dragon_name.rb
Created Jan 20, 2020
ruby script to generate your dragon name, based on the rules in some meme image
View dragon_name.rb
#!/usr/bin/env ruby
#
# Generate a dragon name based on this meme:
# https://www.facebook.com/creepyshit01/photos/a.1037741526249418/2895913810432171
#
# Usage: ./dragon_name [<first_name>] [<last_name>] [<mothers_name>] [<fathers_name>]
#
# If you don't pass in any of the names, you will be prompted for them.
def prompt_for(text_prompt, min_length = 2)
@jonmoter
jonmoter / dragon_name.rb
Created Jan 20, 2020
ruby script to generate your dragon name, based on the rules in some meme image
View dragon_name.rb
#!/usr/bin/env ruby
#
# Generate a dragon name based on this meme:
# https://www.facebook.com/creepyshit01/photos/a.1037741526249418/2895913810432171
#
# Usage: ./dragon_name [<first_name>] [<last_name>] [<mothers_name>] [<fathers_name>]
#
# If you don't pass in any of the names, you will be prompted for them.
def prompt_for(text_prompt, min_length = 2)
@jonmoter
jonmoter / proxysql-example.yaml
Created Aug 8, 2019
example of how we could route traffic by header
View proxysql-example.yaml
# There's an assumption here that there are multiple Services defined
# for ProxySQL, each with a label of `cluster`. Each Service points to
# its own Deployment, which handles requests for that cluster
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: reviews
spec:
host: proxysql
@jonmoter
jonmoter / keybase.md
Created Jan 5, 2016
Proof that I own the "jonmoter" GitHub account for Keybase
View keybase.md

Keybase proof

I hereby claim:

  • I am jonmoter on github.
  • I am jonmoter (https://keybase.io/jonmoter) on keybase.
  • I have a public key ASBSkJwf4FYMSW0RhA0t8v44fAJLnMrsI43OFwGL-l2biQo

To claim this, I am signing this object:

View git-delete-merged-branches.bash
#!/bin/bash
shopt -s expand_aliases
function prompt_to_continue()
{
read -p "Continue (y/n)? "
if [ "$REPLY" != "y" ]; then
exit 0
fi
}
View cap_deploy_staging_master.txt
======================================================================
Usage: cap <target> deploy [-s branch=<branch or tag>] [-s asset=true]
======================================================================
* executing `staging'
* executing `deploy'
triggering before callbacks for `deploy'
* executing `hipchat:trigger_notification'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
View cap_deploy_staging_master.txt
======================================================================
Usage: cap <target> deploy [-s branch=<branch or tag>] [-s asset=true]
======================================================================
* executing `staging'
* executing `deploy:restart'
* executing multiple commands in parallel
-> "else" :: "touch /home/be/rails/current/tmp/restart.txt"
-> "else" :: "touch /home/be/rails/current/tmp/restart.txt"
servers: ["stage-app.berecruited.com", "stage-web.berecruited.com"]
[stage-app.berecruited.com] executing command
View cap_deploy_dev_micah_master.txt
======================================================================
Usage: cap <target> deploy [-s branch=<branch or tag>] [-s asset=true]
======================================================================
* executing `dev_micah'
* executing `deploy:restart'
* executing "touch /home/be/rails/current/tmp/restart.txt"
servers: ["dev-micah.berecruited.com"]
connection failed for: dev-micah.berecruited.com (Net::SSH::Disconnect: connection closed by remote host)
View git-delete-merged-branches.bash
#!/bin/bash
shopt -s expand_aliases
function prompt_to_continue()
{
read -p "Continue (y/n)? "
if [ "$REPLY" != "y" ]; then
exit 0
fi
}