Skip to content

Instantly share code, notes, and snippets.

View double-z's full-sized avatar

Zack Zondlo double-z

View GitHub Profile
@timusg
timusg / keepalived-eip-switch.erb.sh
Last active October 20, 2016 21:01
keepalived notification script for switch elastic ip, helpful to setup highly available haproxy in ec2/VPC
#!/bin/bash
export EC2_HOME=/usr/local/share/ec2_tools/
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:$EC2_HOME/bin
INSTANCEID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
case "$1" in
MASTER)
logger triggering notify master event
@purpleidea
purpleidea / .bashrc_vagrant.sh
Last active August 1, 2017 10:33
# Vagrant vsftp and other tricks# from: https://ttboj.wordpress.com/2013/12/21/vagrant-vsftp-and-other-tricks/# and# Vagrant clustered SSH and 'screen'# from: https://ttboj.wordpress.com/2014/01/02/vagrant-clustered-ssh-and-screen/# for use inside a ~/.bashrc or similar
# vagrant vsftp and other tricks
# from: https://ttboj.wordpress.com/2013/12/21/vagrant-vsftp-and-other-tricks/
# and
# Vagrant clustered SSH and 'screen'
# from: https://ttboj.wordpress.com/2014/01/02/vagrant-clustered-ssh-and-screen/
# for use inside a ~/.bashrc or similar
# copyright James Shubin, 2013, agplv.3+
### VAGRANT ###################################################################
# avoid needing to always add --provider=kvm
@grigio
grigio / checks.json
Created November 24, 2013 22:14
sensu test
{
"checks": {
"sensu-rabbitmq-beam": {
"handlers": [
"default"
],
"command": "/etc/sensu/plugins/check-procs.rb -p beam -C 1 -w 4 -c 5",
"interval": 60,
"occurrences": 2,
"refresh": 300,
adm1@cookbook$ cat /etc/service/sensu-client/run
#!/bin/bash
EMBEDDED_RUBY=false
CONFIG_FILE=/etc/sensu/config.json
CONFIG_DIR=/etc/sensu/conf.d
EXTENSION_DIR=/etc/sensu/extensions
PLUGINS_DIR=/etc/sensu/plugins
HANDLERS_DIR=/etc/sensu/handlers
LOG_DIR=/var/log/sensu
@spudfkc
spudfkc / git-gclone
Created September 24, 2013 22:05
Clones a repo and sets it up for Gerrit server. Only tested in bash. not super portable, but i find it useful I would recommend putting it in /usr/lib/git-core/
#!/bin/bash
if [ -z $1 ]
then
echo "Must supply a git project."
echo "Usage git gclone <project-url>"
return 1
fi
ORIGIN=$1
@sit
sit / Berksfile
Created May 2, 2013 16:16
Vagrant and Berkshelf configuration for migrating a chef-repo into Berkshelf-managed cookbooks. (It appears berkshelf-vagrant does not do this automatically, despite what https://github.com/RiotGames/vagrant-berkshelf/blob/master/lib/berkshelf/vagrant/action.rb#L17 may suggest.)
# -*- mode: ruby -*-
# vi: set ft=ruby :
site :opscode
# Suck in all cookbooks in local chef-repo
Dir.entries("cookbooks").each do |cookbook_name|
next if cookbook_name.starts_with?('.')
cookbook_dir = "cookbooks/#{cookbook_name}"
next unless File.directory?(cookbook_dir)
@joemiller
joemiller / netpps.sh
Last active January 12, 2024 15:39
shell: quick linux scripts for showing network bandwidth or packets-per-second
#!/bin/bash
if [ -z "$1" ]; then
echo
echo usage: $0 network-interface
echo
echo e.g. $0 eth0
echo
echo shows packets-per-second
@misterbrownlee
misterbrownlee / jenkins-notes.md
Created September 12, 2012 18:10
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@iafonov
iafonov / gist:3349101
Created August 14, 2012 13:07
Chef git templates

Chef git templates

Chef should allow creating cookbooks and chef-repo using templates. It should maintain the ability to create artifacts offline but a special switch could be supplied to knife wich will tell it to clone the remote repository rather than create a hardcoded structure.

Use cases:

knife chef-repo create --template https://github.com/fnichol/chef-bootstrap-repo knife cookbook create ntpd --template https://github.com/test/cookbook-with-minitest-and-berkshelf

Basically knife should clone the repository into folder and remove .git directory.

@kiesia
kiesia / attributes-default.rb
Created July 5, 2012 06:12 — forked from philwo/attributes-default.rb
Chef cookbook for nginx + passenger (compiled from source)
default['nginx']['version'] = "1.2.0"
default['nginx']['passenger']['version'] = "3.0.12"