Skip to content

Instantly share code, notes, and snippets.

View gauravarora's full-sized avatar

Gaurav Arora gauravarora

View GitHub Profile
@gauravarora
gauravarora / logstash-template-2
Created May 28, 2014 06:59
logstash-template-2
{
"template": "logstash-*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
},
"mappings": {
"_default_": {
"_all": { "enabled": false },
"_source": { "compress": true },
@gauravarora
gauravarora / gist:5e84f6c95ab83e563502
Last active August 29, 2015 14:01
logstash-template
{
"logstash":
{
"order": 0,
"template": "logstash-*",
"settings":
{
"index.refresh_interval": "5s"
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost:8080/_search?q=*
#
# is rewritten to:
#
@gauravarora
gauravarora / gist:3898113
Created October 16, 2012 08:49
Cygwin git branch and dirty state
# See http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/
# for more color options etc
# For git dirty state and branch
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
#export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '