Skip to content

Instantly share code, notes, and snippets.

@simondean
simondean / setup-statsd.sh
Last active September 9, 2016 14:13 — forked from jasonroelofs/setup-statsd.sh
Turn an Ubuntu 12.04 LTS EC2 into a StatsD/Graphite server
# update apt's package list
sudo apt-get update
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# install node
sudo apt-get install nodejs
# install the Node package manager (npm) for later use
sudo apt-get install npm
sudo npm install express
@t0kieu
t0kieu / HOWTO.md
Created July 25, 2012 13:26 — forked from bjornharrtell/HOWTO.md
How to configure and use JBoss AS 7 with Hibernate Spatial and PostGIS

How to configure and use JBoss AS 7 with Hibernate Spatial and PostGIS

This is in the scenario where you want JBoss to handle the datasource and transactions, for example when using injected @PersistenceContext in a @Stateless resource. I like it especially when writing REST services with JAX-RS (example code included below).

Create dir:

/modules/org/postgresql/main
module(custom_gen).
-export([key/1,
value/1,
key_from_arg/2,
value_from_arg/2
]).
key(_Id) ->
fun() -> <<"custom_key">> end.
@chalmerj
chalmerj / gist:1492384
Created December 18, 2011 04:39
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
@nstielau
nstielau / send_metric_to_statsd.sh
Created May 11, 2011 16:41
Send a metric to StatsD from bash
# Send a metric to statsd from bash
#
# Useful for:
# deploy scripts (http://codeascraft.etsy.com/2010/12/08/track-every-release/)
# init scripts
# sending metrics via crontab one-liners
# sprinkling in existing bash scripts.
#
# netcat options:
# -w timeout If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed.