Skip to content

Instantly share code, notes, and snippets.

View st3v's full-sized avatar

Stev Witzel st3v

View GitHub Profile
@st3v
st3v / tls-test.sh
Created November 28, 2019 12:54
TLS test for duffle relocate and irel
#!/bin/bash
set -e
function cleanup {
if [ "$EUID" -ne 0 ]
then echo "Must run as root to be able to update /etc/hosts"
exit 1
fi
rm -f ca1.crt ca1.key ca1.srl registry1.key registry1.crt registry1.csr
@st3v
st3v / tls-test.sh
Created October 18, 2019 17:27
TLS config test for irel
#!/bin/bash
set -e
function cleanup {
if [ "$EUID" -ne 0 ]
then echo "Must run as root to be able to update /etc/hosts"
exit 1
fi
rm -f ca1.crt ca1.key ca1.srl registry1.key registry1.crt registry1.csr
@st3v
st3v / repro_failing.yaml
Last active September 16, 2019 21:45
RabbitMQ docker image read-only configMap mount
---
apiVersion: v1
kind: ConfigMap
metadata:
name: rabbitmq-config
data:
enabled_plugins: |
[rabbitmq_management].
rabbitmq.conf: |
loopback_users.guest = false
@st3v
st3v / main.go
Created June 15, 2016 23:33
Access Eureka with OAuth2 Bearer Tokens
package main
import (
"flag"
"log"
"github.com/st3v/fargo"
"golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials"
@st3v
st3v / main.go
Created May 25, 2015 10:56
Single-line function timing in Go
// based on https://twitter.com/francesc/status/602606902187458560
package main
import (
"log"
"time"
)
func main() {
@st3v
st3v / ssh-host-color
Last active January 31, 2023 00:34
Automatically set background color in iTerm depending on ssh host
#!/bin/bash
#
# ssh into a machine and automatically set the background
# color of Mac OS X Terminal depending on the hostname.
#
# Installation:
# 1. Save this script to /usr/local/bin/ssh-host-color
# 2. chmod 755 /usr/local/bin/ssh-host-color
# 3. alias ssh=/usr/local/bin/ssh-host-color
# 4. export PRODUCTION_HOST="<hostname_production_server>"
@st3v
st3v / .bash_profile
Created February 21, 2013 20:16
Show git branch in prompt
# mac git bash completion
source /usr/local/git/contrib/completion/git-completion.bash
# lucid git bash completion
# source /etc/bash_completion.d/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE="."
GIT_PS1_SHOWUNTRACKEDFILES="."
GIT_PS1_SHOWSTASHSTATE="."
GIT_PS1_SHOWUPSTREAM="auto"
@st3v
st3v / Ruby.sublime-build
Created February 18, 2013 09:57
Sublime Text 2 -- Ruby Build & RVM
{
"cmd": ["~/.rvm/bin/rvm-auto-ruby", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
@st3v
st3v / RubyTest.sublime-settings
Created February 18, 2013 09:56
Sublime Text 2 -- RubyTest & RVM & bundler
{
"erb_verify_command": "erb -xT - {file_name} | ruby -c",
"ruby_verify_command": "ruby -c {file_name}",
"run_ruby_unit_command": "ruby -Itest {relative_path}",
"run_single_ruby_unit_command": "ruby -Itest {relative_path} -n '{test_name}'",
"run_cucumber_command": "~/.rvm/bin/rvm-auto-ruby -S bundle exec cucumber {relative_path}",
"run_single_cucumber_command": "~/.rvm/bin/rvm-auto-ruby -S bundle exec cucumber {relative_path} -l{line_number}",
@st3v
st3v / remove_file.sh
Created February 1, 2013 07:35
Remove file from every commit in the git history
git filter-branch --index-filter 'git rm --cached --ignore-unmatch foobar.txt' -f --prune-empty --tag-name-filter cat -- --all