Skip to content

Instantly share code, notes, and snippets.

View gondoi's full-sized avatar
🏠
Working from home

BK Box gondoi

🏠
Working from home
View GitHub Profile
@stavxyz
stavxyz / red.py
Created December 30, 2013 16:28
redis string from connection_string
import urlparse
from redis import Redis
from waldo.common import config
conf = config.current()
dbstring = conf['connection_string']
dbstring = urlparse.urlparse(dbstring)
dbstring = "redis://" + dbstring.netloc + ":6329"
@andersonvom
andersonvom / checkmate-svr.sh
Last active December 17, 2015 14:09
Stop Checkmate
#
# Function that stops the daemon/service
#
do_stop()
{
if [ ! -e $PIDFILE ]; then
return 2
fi
pid=`cat $PIDFILE`
children=$(ps axo pid,ppid | awk "{ if ( \$2 == $pid ) { print \$1 }}")
@fnichol
fnichol / shell.sh
Created April 23, 2013 16:41
Test Kitchen with bats - A Lightning Guide
SUITE_NAME=default
# create a bats subdirectory under your desired suite
mkdir -p test/integration/$SUITE_NAME/bats
# create an initial "canary" bats test file
# more examples at:
# * https://github.com/fnichol/chef-rvm/tree/master/test/integration/rubies/bats
# * https://github.com/fnichol/chef-ruby_build/tree/master/test/integration/alltherubies/bats
# * https://github.com/sstephenson/bats
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@DavidWittman
DavidWittman / notes.md
Created February 22, 2012 18:54
A Brief Introduction to Fabric

A Brief Introduction to Fabric

Fabric is a deployment management framework written in Python which makes remotely managing multiple servers incredibly easy. If you've ever had to issue a change to a group servers, this should look pretty familiar:

for s in $(cat servers.txt); do ssh $s service httpd graceful; done

Fabric improves on this process by providing a suite of functions to run commands on the servers, as well as a number of other features which just aren't possible in a simple for loop. While a working knowledge of Python is helpful when using Fabric, it certainly isn't necessary. This tutorial will cover the steps necessary to get started with the framework and introduce how it can be used to improve on administering groups of servers.

@danielsdeleo
danielsdeleo / dynamically_add_handler.rb
Created November 12, 2010 17:33
add an exception/report handler from inside a recipe
p = gem_package("nomnomnom-client") { action :nothing }
p.run_action(:install)
Gem.clear_paths
require 'nom_nom_nom'
nomnomnom_servers = []
search(:node, "role:nomnomnom-server") do |server|
nomnomnom_servers << server[:ipaddress]
end