Skip to content

Instantly share code, notes, and snippets.

@jgeurts
jgeurts / install-graphite-ubuntu-12.04.sh
Created July 14, 2012 16:36 — forked from tkoeppen/install-graphite-ubuntu-10.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
@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@thattommyhall
thattommyhall / client.coffee
Created June 22, 2011 10:57
Connecting to ZMQ firehose
tail = (channel, callback) ->
socket = require('zeromq').createSocket('sub')
socket.connect("tcp://IP_ADDRESS:5555")
socket.subscribe(channel)
socket.on 'message', (ch, data) -> callback(JSON.parse(data.toString('utf8')))
tail 'channame', (row) -> console.log(row)
@thattommyhall
thattommyhall / clean_tmp.sh
Created June 10, 2011 13:13
Remove files older than 7 days from /tmp
find /tmp -mtime +7 -type f -exec rm -rf {} \;
@thattommyhall
thattommyhall / hive_info.rb
Created May 16, 2011 16:35
Get filecount, total size, average filesize for Hive tables
current = ''
file_count = 0
total_size = 0
output = File.open('output.csv','w')
IO.popen('hadoop fs -lsr /user/hive/warehouse').each_line do |line|
split = line.split(/\s+/)
#permissions,replication,user,group,size,mod_date,mod_time,path
next unless split.size == 8
@thattommyhall
thattommyhall / mongodb upstart.sh
Last active January 12, 2017 22:04
Automatically run --repair if necessary when starting MongoDB via Upstart
limit nofile 20000 20000
kill timeout 300
env MONGO_DATA=/var/lib/mongodb/
env MONGO_LOGS=/var/log/mongodb/
env MONGO_EXE=/usr/bin/mongod
env MONGO_CONF=/etc/mongodb.conf
pre-start script
@jjb
jjb / gist:950975
Created May 1, 2011 23:16
Using whenever with capistrano and bundler in multiple environments
We couldn’t find that file to show.
@tmpvar
tmpvar / context.stop.patch
Created April 23, 2011 14:22
magic sauce to avoid jsdom memory leaks
diff --git a/src/node_script.cc b/src/node_script.cc
index ce7761d..1730671 100644
--- a/src/node_script.cc
+++ b/src/node_script.cc
@@ -57,6 +57,9 @@ class WrappedContext : ObjectWrap {
WrappedContext();
~WrappedContext();
+ void Dispose();
+