Skip to content

Instantly share code, notes, and snippets.

@lanius
lanius / install_riak.sh
Created May 20, 2011 18:19
Install riak-0.14.2rc8 to Ubuntu 10.04 LTS on Amazon EC2.
# Install riak-0.14.2rc8 to Ubuntu 10.04 LTS on Amazon EC2.
# AMI ID: ami-3202f25b on US East
# see http://uec-images.ubuntu.com/releases/lucid/release/
ERLANG_PKG=otp_src_R13B04
RIAK_PKG=riak-0.14.2rc8
sudo apt-get update
@douglas
douglas / update_git_repos.sh
Created October 14, 2011 15:04
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active September 24, 2024 14:52 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.codehaus.jackson.map.Module;
import org.junit.After;
import org.junit.Before;
import com.google.common.collect.Lists;
@dmytro
dmytro / ssh-multi.sh
Created October 31, 2012 03:46
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@sargun
sargun / gist:5693318
Created June 2, 2013 11:07
New Upstart Script style
description "service"
start on filesystem
stop on runlevel S
respawn
respawn limit 10 5
oom never
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop.
FROM ubuntu:12.04
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-6-jdk curl git-core build-essential bzr
RUN mkdir -p /tmp/downloads
# install go
RUN curl -sf -o /tmp/downloads/go1.1.1.linux-amd64.tar.gz -L https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz
RUN mkdir -p /opt && cd /opt && tar xfz /tmp/downloads/go1.1.1.linux-amd64.tar.gz
# install jenkins
RUN curl -sf -o /opt/jenkins-1.523.war -L http://mirrors.jenkins-ci.org/war/1.523/jenkins.war
@alekstorm
alekstorm / README.md
Last active April 23, 2020 19:00
Ansible callback plugin that posts events to your Datadog event stream as you deploy

Installation

To install, place datadog.py in your callback plugins directory. If you don't yet have one, run:

mkdir -p plugins/callback

Then place the following in your ansible.cfg file:

[defaults]

callback_plugins = ./plugins/callback

@cjmamo
cjmamo / MyConsumer.java
Last active June 6, 2016 02:02
Apache Kafka for Event Sourcing
...
public class MyConsumer {
private static final int SO_TIMEOUT = 100000; // socket timeout
private static final int BUFFER_SIZE = 64 * 1024; // maximum socket receive buffer in bytes
private static final int FETCH_SIZE = 100000; // maximum bytes to fetch from topic
public static void main(String args[]) {
MyConsumer myConsumer = new MyConsumer();