Skip to content

Instantly share code, notes, and snippets.

View jonmoter's full-sized avatar

Jon Moter jonmoter

View GitHub Profile
@jonmoter
jonmoter / install_krew.sh
Created January 20, 2020 03:41
script to install krew and some plugins
#!/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 January 20, 2020 01:30
ruby script to generate your dragon name, based on the rules in some meme image
#!/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 January 20, 2020 01:30
ruby script to generate your dragon name, based on the rules in some meme image
#!/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 August 8, 2019 17:21
example of how we could route traffic by header
# 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 January 5, 2016 21:55
Proof that I own the "jonmoter" GitHub account for Keybase

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:

@jonmoter
jonmoter / git-delete-merged-branches.bash
Created February 10, 2015 22:58
Delete merged git branches
#!/bin/bash
shopt -s expand_aliases
function prompt_to_continue()
{
read -p "Continue (y/n)? "
if [ "$REPLY" != "y" ]; then
exit 0
fi
}
======================================================================
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'
======================================================================
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
======================================================================
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)
#!/bin/bash
shopt -s expand_aliases
function prompt_to_continue()
{
read -p "Continue (y/n)? "
if [ "$REPLY" != "y" ]; then
exit 0
fi
}