Skip to content

Instantly share code, notes, and snippets.

View bradmontgomery's full-sized avatar

Brad Montgomery bradmontgomery

View GitHub Profile
@elecnix
elecnix / postgres_gmetric.sh
Created July 6, 2009 21:16
Publish PostgreSQL metrics to Ganglia
#!/bin/bash
database=$1
if [ "$database" == "" ] ; then
echo "Usage: $0 <database>" > /dev/stderr
exit 1
fi
if [ ! -r /home/darwin/check_postgres/check_postgres.pl ] ; then
exit 1
--- scripts/rabbitmq-server 2009-10-06 16:45:47.000000000 +0200
+++ scripts/rabbitmq-server.new 2009-11-08 12:30:39.000000000 +0100
@@ -33,9 +33,12 @@
NODENAME=rabbit
NODE_IP_ADDRESS=0.0.0.0
NODE_PORT=5672
+RABBIT_LISTEN_MIN_DEFAULT=4672
+RABBIT_LISTEN_MAX_DEFAULT=4672
SERVER_ERL_ARGS="+K true +A30 \
-kernel inet_default_listen_options [{nodelay,true},{sndbuf,16384},{recbuf,4096}] \
## monit.d/memcached.monitrc
check process memcached
group memcached
with pidfile /var/run/memcached/memcached.pid
start program = "/etc/init.d/memcached start"
stop program = "/etc/init.d/memcached stop"
if failed port 11211 4 times within 5 cycles then restart
if 4 restarts within 5 cycles then timeout
depends on memcached_bin
@toastdriven
toastdriven / rebuild_environment.sh
Last active December 3, 2019 19:12
Rebuild Environment
brew install git
brew update
brew install readline
brew link readline
brew install python
brew install postgres
brew install tmux
brew install pip
brew install nginx
brew install libevent
@jlindley
jlindley / pre-commit
Created November 11, 2010 22:50 — forked from jhsu/pre-commit
pre-commit hook for git, prevents console.log() statements
#!/bin/sh
# Don't allow console.log() statements to be committed.
#
# Add to .git/hooks/pre-commit
#
# Note: jquery.js seems to always include 1 reference
# in a debugging section, that one can be safely
# ignored. 1 reference to console.log is cool
@mikhailov
mikhailov / installation.sh
Created November 23, 2010 15:18
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
set_unless[:rabbitmq][:flow_control_watermark] = 0.6
set[:rabbitmq][:cluster] = [
# Each list of hostnames defines a cluster.
[
'mq3.internal.sazze.com',
'mq4.internal.sazze.com'
],
[
'mq5.internal.sazze.com',
'mq6.internal.sazze.com'
@mikesusz
mikesusz / pre-commit.sh
Created February 1, 2011 16:52
a git pre-commit hook for compass compiling of sass to css
#!/bin/sh
#
# this pre-commit script uses compass to compile and compress stylesheet partials
compass compile wp-content/themes/mytheme/ -s compact --force --no-line-comments
wait $!
git add wp-content/themes/mytheme/style.css
@empty
empty / show_hide_django_filters.js
Created April 15, 2011 18:32
Simple jQuery script to show / hide Django's change list filters.
<script type="text/javascript">
jQuery(document).ready(function($){
$('<div id="show-filters" style="float: right;"><a href="#">Show Filters</a></p>').prependTo('div.actions');
$('#show-filters').hide();
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">Filter &rarr;</a>');
$('#show-filters').click(function() {
$('#changelist-filter').show('fast');
$('#changelist').addClass('filtered');
$('#show-filters').hide();
@ijt
ijt / http_get.go
Last active August 23, 2021 12:37
Example of using http.Get in go (golang)
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)