Skip to content

Instantly share code, notes, and snippets.

@neiljain
neiljain / brew-upgrade-java-9.bash
Last active August 11, 2018 00:25
Java upgrade to 9 using homebrew
#!/bin/bash
# references
# http://www.lonecpluspluscoder.com/2017/04/27/installing-java-8-jdk-os-x-using-homebrew/
# http://www.lonecpluspluscoder.com/2017/10/08/installing-other-versions-of-the-java-jdk-via-homebrew/
# install homebrew https://brew.sh/
# brew tap caskroom/cask
# Java 8 was previously installed
@neiljain
neiljain / pull.sh
Created June 15, 2017 18:02
pull multiple git repositories
#!/bin/bash
set -x
for repo in */.git
do
(
echo $repo
cd $repo/..
git branch
git pull
@neiljain
neiljain / .bash_profile
Last active April 23, 2022 20:09
git completion and git prompt
# brew install git
# brew install bash
# brew install bash-completion@2
# brew install kube-ps1
# brew install kubernetes-cli
export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d"
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
source /usr/local/etc/bash_completion.d/git-completion.bash
source /usr/local/etc/bash_completion.d/git-prompt.sh
@neiljain
neiljain / rabbtmq_healthcheck.rb
Created January 15, 2017 23:56
RabbitMQ health check using sinatra based on sensu's rabbitmq-alive.rb
#!/opt/sensu/embedded/bin/ruby
require 'sinatra'
require 'json'
require 'rest-client'
class RabbitMqHealthCheck
# /etc/sensu/plugins/rabbitmq-alive.rb
# can CheckRabbitMQ class be used directly instead?
def vhost_alive?
host = 'localhost'