Skip to content

Instantly share code, notes, and snippets.

@tanpinsiang
tanpinsiang / install-graphite-ubuntu-12.04.sh
Created August 21, 2012 09:51 — forked from jgeurts/install-graphite-ubuntu-12.04.sh
Install Graphite 0.9.10 on Ubuntu 12.04
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
cd
sudo apt-get update
sudo apt-get upgrade
@tanpinsiang
tanpinsiang / setup-statsd.sh
Created August 21, 2012 17:31 — forked from KyleAMathews/setup-statsd.sh
Turn an Ubuntu 12.04 Amazon EC2 Micro instance into a StatsD/Bucky/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils make
sudo apt-get install git-core
# download the Node source, compile and install it
cd /opt
git clone https://github.com/joyent/node.git
cd node
git checkout v0.6
./configure
@tanpinsiang
tanpinsiang / setup-statsd.sh
Created August 21, 2012 17:31
Turn an Ubuntu 12.04 Amazon EC2 Micro instance into a StatsD/Bucky/Graphite server
#############################################################################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 12/19/2011
# MORE INFO:
# - http://blog.adku.com/2011/10/scalable-realtime-stats-with-graphite.html
# - https://github.com/gosquared/graphite-cookbook
# - http://coreygoldberg.blogspot.com.es/2012/04/installing-graphite-099-on-ubuntu-1204.html
#############################################################################################
@tanpinsiang
tanpinsiang / install-graphite-ubuntu-11.10.sh
Created August 21, 2012 17:34 — forked from Iristyle/install-graphite-ubuntu-11.10.sh
Install Graphite 0.9.9 on Ubuntu 11.10 on EC2 with NGinx, uwsgi, supervisord, statsite, nagios agent
#!/bin/bash
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# Forked from: http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Ubuntu 11.10 Oneiric Ocelot
# Forked from https://gist.github.com/1287170
# Modified to use NGinx + uwsgi instead of Apache, as well as memcached and supervisord, incorporating ideas from
# http://blog.adku.com/2011/10/scalable-realtime-stats-with-graphite.html
@tanpinsiang
tanpinsiang / setup-statsd.sh
Created August 21, 2012 17:34 — forked from jasonroelofs/setup-statsd.sh
Turn an Ubuntu 10.10 EC2 into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
@tanpinsiang
tanpinsiang / gist:3485659
Created August 27, 2012 04:48 — forked from annem/gist:3183536
Download, compile, and install the Broadcom BCM 2835 library for the Raspberry Pi
cd;
// wget http://www.open.com.au/mikem/bcm2835/bcm2835-1.5.tar.gz; // My Pi can't figure out this URL
wget http://67.192.60.197/mikem/bcm2835/bcm2835-1.8.tar.gz
tar xvfz bcm2835-1.8.tar.gz;
cd bcm2835-1.8;
./configure;
make;
sudo make install
@tanpinsiang
tanpinsiang / README.md
Created August 30, 2012 15:24 — forked from bergie/README.md
MQTT pub/sub example

This is a simple example of the MQTT protocol with Node.js. The client code has also been tested with a combination of C++ servers and clients.

From 7341a316c38a61cc745ce04e618916677007883b Mon Sep 17 00:00:00 2001
From: Timothy Brom <[email protected]>
Date: Wed, 29 Feb 2012 11:29:55 -0500
Subject: [PATCH] Fixed error about strexh and strexb using the same register
---
example/libs_stm/inc/core_support/core_cm3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/example/libs_stm/inc/core_support/core_cm3.c b/example/libs_stm/inc/core_support/core_cm3.c
@tanpinsiang
tanpinsiang / gist:4256415
Created December 11, 2012 06:52
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
var express = require('express');
var oauth = require('oauth');
var app = express.createServer();
var key = "[api-key]";
var secret = "[api-secret]";
var request = new oauth.OAuth(null, null, key, secret, '1.0', null, 'HMAC-SHA1');
app.get('/api-request', function(req, res){
request.get(
"http://127.0.0.1:8000/api/1.0/data.json",