Skip to content

Instantly share code, notes, and snippets.

View jespada's full-sized avatar

jespada jespada

View GitHub Profile
@emaxerrno
emaxerrno / Installing zookeper and monitoring it
Created August 20, 2012 19:52
Zookeeper on ubuntu and monitoring
#!/bin/sh
echo "assumes java 7 is instlaled openjdk versio"
#pre dependencies
sudo apt-get install git-core pkg-config libtool automake make g++ connect-proxy unzip python
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
#install zeromq
git clone git clone git://github.com/zeromq/libzmq.git
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mrtazz
mrtazz / graphline.sh
Created July 20, 2012 12:42
shell function to quickly check a graphite graph
#
# shell function to print graphite graphs as sparklines in the terminal
# needs https://github.com/holman/spark
#
function graphline() {
GRAPHITEHOST="graphite.example.com"
if [ ! -n "$1" ]; then print "Usage: $0 metric [minutes]"; return 1; fi
if [ ! -n "$2" ]; then MINUTES=10 ; else MINUTES=$2; fi
curl -s "${GRAPHITEHOST}/render?from=-${MINUTES}minutes&target=${1}&format=raw" | cut -d"|" -f 2 | spark ;
}
@igrigorik
igrigorik / gist:3148848
Created July 20, 2012 05:24
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
@grantr
grantr / sensu_standalone_check.rb
Created July 13, 2012 19:32
standalone sensu check chef definition
# installs a standalone sensu check
# sensu_standalone_check "unicorn_master" do
# command "#{node.sensu.directory}/plugins/processes/check-procs.rb"
# arguments "-f #{deploy_to}/shared/pids/unicorn.pid"
# end
define :sensu_standalone_check, :interval => 60, :enable => true, :owner => "root", :mode => 0644 do
include_recipe "sensu::_config"
@legumbre
legumbre / foo.md
Created June 29, 2012 00:14
resolving merge conflicts with magit-ediff

Use magit-ediff to resolve merge conflicts

Use magit-ediff or 'e' on an unmerged item to resolve merge conflicts with ediff. Magit will set up an ediff with three buffers A, B and C. A and B are the original (conflicting) files, and C is the conflicted merge.

Use 'n'/'p' to move to the next/previous conflict, use 'a'/'b' to choose which changes (those in a A or B) should be the ones to keep in the merged file.

You can always just switch to buffer C and edit what the merged version should look like.

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@lusis
lusis / A.md
Created June 1, 2012 04:45
dirt simple basic config for talking to an external elasticsearch server

The thing that trips most people up is that the parameters to the web cli (--backend elasticsearch://blah:9300/blah) do NOT set the output destination.

The web app is its own process with its own args. It knows nothing about the agent config file.

Remember that you could simply use the same jar like so:

java -jar logstash.jar web --backend elasticsearch://elasticsearch:9300/clustername

and run the web interface without the agent process.

@bhenerey
bhenerey / ideal ops.md
Created May 23, 2012 19:40
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan