Skip to content

Instantly share code, notes, and snippets.

View louiszuckerman's full-sized avatar

Louis Zuckerman louiszuckerman

View GitHub Profile
- Fork the "upstream" project
- Clone your fork
- Make a branch for the feature or bug fix & checkout the new branch
- Commit your changes to your new feature branch
- Push your new feature branch to your fork on github
- Open a pull request from your feature branch to master
- If there's an issue for this feature/bug, give a link in the PR, and mention issue ID in subject
- Additional commits to your new branch will be automatically added to the PR
- Upstream master can move away
- On your local copy: add upstream remote, git fetch, merge from upstream/master into your feature branch
@louiszuckerman
louiszuckerman / output.txt
Created June 26, 2013 15:37
glfsjni mvn -Plinux64 install
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] glfsjni-project
[INFO] glfsjni
[INFO] glfsjni-linux64
[INFO]
[INFO] ------------------------------------------------------------------------
@louiszuckerman
louiszuckerman / gist:5725311
Created June 6, 2013 21:52
Queue to manage ajax requests (made for angularjs $resource objects)
/*
Example usage:
ajaxEnqueue(Resource.get, {id: 1}, function(val) {console.log("API returned "+val)"})
Where Resource is an angular $resource object.
This queue will throttle AJAX requests so that only a limited number (ajaxParallel) are in flight at a time.
@louiszuckerman
louiszuckerman / gist:4658921
Last active December 11, 2015 20:59
kibana on passenger in a subdirectory of an existing apache virtual host
# These instructions are derived from the Passenger documentation,
# http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rack_to_sub_uri
# And tested with kibana git master on 1/28/13
# First, create a symlink from the existing virtualhost's
# document root to your kibana installation's public/static
# directory. for example,
# ln -s /path/to/kibana/public /var/www/kibana
# kibana 0.2.0 and earlier will have a /static directory
# instead of /public
@louiszuckerman
louiszuckerman / as-terminate
Last active August 15, 2017 22:43
easy ssh access and pruning for EC2 instances in AutoScaling groups. depends on AWS CLI.
#!/bin/bash
if [ "$1" == "-h" ]; then
cat <<END
AWS AutoScaling Termination Helper:
terminate an instance in an auto scaling group
Usage: $0 {group-name}
END
@louiszuckerman
louiszuckerman / gfid-resolver.sh
Last active November 29, 2023 10:01
Glusterfs GFID Resolver Turns a GFID into a real path in the brick
#!/bin/bash
if [[ "$#" < "2" || "$#" > "3" ]]; then
cat <<END
Glusterfs GFID resolver -- turns a GFID into a real file path
Usage: $0 <brick-path> <gfid> [-q]
<brick-path> : the path to your glusterfs brick (required)
@louiszuckerman
louiszuckerman / gist:3908490
Created October 17, 2012 21:46
Logstash grok parser for custom varnishncsa log format
I pass these options to the varnishncsa daemon (this line is from my /etc/init.d/varnishncsa)...
DAEMON_OPTS="-a -F "\''%h "%{X-Forwarded-For}i" %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" %{Varnish:time_firstbyte}x %{Varnish:handling}x'\'" -c -w ${LOGFILE} -D -P $PIDFILE"
I parse that with the following grok pattern...
VARNISHNCSALOG %{IPORHOST:remoteip} %{QUOTEDSTRING:xforwardedfor} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{NOTSPACE:request} HTTP/%{NUMBER:httpversion}" (?:%{NUMBER:status}|\(null\)) (?:%{NUMBER:bytes}|-) "(?:%{NOTSPACE:referrer}|-)" %{QUOTEDSTRING:agent} %{BASE10NUM:berespms} %{WORD:cache}
@louiszuckerman
louiszuckerman / gist:3795948
Created September 27, 2012 19:28
savn -- brings version controlled order to chaotic system configurations
#!/bin/bash
# This script is meant to make it easy for a system administrator to archive and restore important system files.
# Design:
# A central repository holds archived config files for all servers, with a directory for each server. Individual
# servers check out their subdirectory to a local working copy. Files are archived by hard-linking into the local
# working copy and then committing to the central repo.
# Prerequisites:
@louiszuckerman
louiszuckerman / gist:3209901
Created July 30, 2012 20:30
Semiosis' logstash upstart job
description "Logstash producer"
start on runlevel [2345]
stop on runlevel [016]
respawn
script
cd /opt/logstash
export HOME=/opt/logstash
@louiszuckerman
louiszuckerman / gist:2377958
Created April 13, 2012 16:03
Logstash load average monitor
input {
exec {
command => "echo `date +'%z %Y-%m-%d'``uptime`"
type => "loadaverages"
interval => 10
}
}
filter {
grok {
type => "loadaverages"