Skip to content

Instantly share code, notes, and snippets.

View danfairs's full-sized avatar

Dan Fairs danfairs

View GitHub Profile
@deverton
deverton / logstash-template.json
Created June 22, 2012 04:49
Logstash Elasticsearch Template
{
"template": "logstash-*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index" : {
"query" : { "default_field" : "@message" },
"store" : { "compress" : { "stored" : true, "tv": true } }
}
},
@karussell
karussell / backup.sh
Created July 10, 2011 20:05
Backup ElasticSearch with rsync
# TO_FOLDER=/something
# FROM=/your-es-installation
DATE=`date +%Y-%m-%d_%H-%M`
TO=$TO_FOLDER/$DATE/
echo "rsync from $FROM to $TO"
# the first times rsync can take a bit long - do not disable flusing
rsync -a $FROM $TO
# now disable flushing and do one manual flushing
@fabware
fabware / application.js
Created June 8, 2011 03:23
socket.io application and haproxy configuration
var express = require('express');
var redis = require('redis');
const serverType = process.argv[2];
const serverHost = process.argv[3];
const serverPort = parseInt(process.argv[4]);
const redisPort = 6379;
const redisHost = '127.0.0.1';
@manveru
manveru / bigcouch_compact.rb
Created March 14, 2011 04:09
compact bigcouch clusters
require 'makura'
require 'rye'
root = Makura::Server.new('http://host:5984')
nodes = root.membership['cluster_nodes']
p nodes: nodes
nodes.each do |node|
node_name = node[/@(\w+)/, 1]
puts "Connecting to #{node_name}"
@shnjp
shnjp / tunnel.py
Created March 5, 2011 06:29
ssh tunnel for Fabric
"""
Fabric tunneling utilities
by [email protected]
class ForwardServer and relates things are refere Robey Pointer's paramiko example.
(http://bazaar.launchpad.net/~robey/paramiko/trunk/annotate/head%3A/demos/forward.py)
usage::
with make_tunnel('[email protected]:10022') as t:
@malcolmt
malcolmt / Malcolm's $PS1 prompt
Created September 17, 2010 19:21
People keep asking about my fancy bash prompt (I've been using it since the mid-90's). So, here it is.
.-(malcolm@djelibeybi 15:19:34) ~
`--> echo $PS1
\n\[\033[35m\].-(\[\033[33m\]\u@\h \[\033[36m\]\t\[\033[35m\]) \[\033[0m\]\w\n\[\033[35m\]\`-->\[\033[0m\]
I should note that in my .bashrc file, I enter the information like this:
# My fancy two-line, colored prompt
e=\\\033
export PS1="\n\[$e[35m\].-(\[$e[33m\]\u@\h \[$e[36m\]\t\[$e[35m\])\[$e[0m\]\w\n\[$e[35m\]\\\`-->\[$e[0m\] "