Skip to content

Instantly share code, notes, and snippets.

View davewongillies's full-sized avatar

Dave Wongillies davewongillies

View GitHub Profile
@davewongillies
davewongillies / Serving Django apps behind SSL with Nginx.md
Last active April 24, 2025 21:36 — forked from aj-justo/gist:3228782
Serving Django apps behind SSL with Nginx

Configuring Nginx to serve SSL content is straight forward, once you have your certificate and key ready:

server { 
    listen 443 default ssl;
    root /path/to/source;
    server_name mydomain;

    ssl_certificate      /path/to/cert;
    ssl_certificate_key  /path/to/key;
@davewongillies
davewongillies / 0_reuse_code.js
Created October 4, 2013 05:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
# run as non privileged user
# add user with this command:
## adduser --system --ingroup www-data --home /opt/apache-tomcat apache-tomcat
@davewongillies
davewongillies / ElasticSearch Quick Guide.md
Last active December 17, 2015 22:39 — forked from timconradinc/gist:5654473
ElasticSearch Quick Guide

ElasticSearch Quick Guide

ElasticSearch for Logstash Overview

There are two ways to send data to ElasticSearch from Logstash. The first is the 'elasticsearch' output and the other is the 'elasticsearch_http' output. In a nutshell, the 'elasticsearch' output is tightly coupled with your elasticsearch cluster, and the 'elasticsearch_http' output isn't.

global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
user haproxy
group haproxy
daemon
listen rabbitmq 0.0.0.0:5672
mode tcp

On Mac OS X:

  • Install puppet 3.0.2, facter 1.6.17 and hiera 1.1.2
  • create /etc/puppet/puppet.conf
  • configure launchd puppet daemon
  • initial puppet run
@davewongillies
davewongillies / graphTemplates.conf
Created December 8, 2012 03:21
Better looking defaults for graphite
[default]
background = white
foreground = black
majorLine = grey
minorLine = rose
lineColors = 0fff00aa,0f337799,0f000077,ff000077
fontName = Helvetica
fontSize = 10
fontBold = False
fontItalic = False
@davewongillies
davewongillies / check_aws_status.rb
Created August 6, 2012 11:09 — forked from jbraeuer/check_aws_status.rb
A Nagios/Icinga plugin to check AWS Service Health Dashboard (using Ruby+Nokogiri)
#! /usr/bin/ruby
#
# A script to check Amazon Webservice's Health Status Dashboard
#
# Jens Braeuer, github.com/jbraeuer
#
# Version 1.0
#
@davewongillies
davewongillies / graphline.sh
Created July 21, 2012 02:18 — forked from mrtazz/graphline.sh
shell function to quickly check a graphite graph
#
# shell function to print graphite graphs as sparklines in the terminal
# needs https://github.com/holman/spark
#
function graphline() {
GRAPHITEHOST="graphite.example.com"
if [ ! -n "$1" ]; then print "Usage: $0 metric [minutes]"; return 1; fi
if [ ! -n "$2" ]; then MINUTES=10 ; else MINUTES=$2; fi
curl -s "${GRAPHITEHOST}/render?from=-${MINUTES}minutes&target=${1}&format=raw" | cut -d"|" -f 2 | spark ;
}
@davewongillies
davewongillies / gist:2773166
Created May 23, 2012 03:50 — forked from chalmerj/gist:1492384
Init script for Graphite carbon-cache
#! /bin/sh
### BEGIN INIT INFO
# Provides: carbon-cache
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: carbon-cache init script
# Description: An init script for Graphite's carbon-cache daemon.
### END INIT INFO