Skip to content

Instantly share code, notes, and snippets.

var phantom = require('phantom'),
vows = require('vows'),
assert = require('assert');
// nesting tests inside phantom callback so we only
// have to create it once
phantom.create(function(ph) {
var get_page_result = function(url, fn, result) {
ph.createPage(function(page) {
@terrancesnyder
terrancesnyder / headless-virtualbox-cheatsheet.md
Last active December 18, 2015 13:19
Poor mans cloud using headless virtual box and ghost machines

List and Delete a VM

vboxmanage list vms
vboxmanage unregistervm <uuid> --delete

Change Default Machine Folder

@terrancesnyder
terrancesnyder / ubuntu-drive.md
Created June 15, 2013 19:56
Ubuntu add new hard-disk for HDFS drive.

HDFS Drive Install

Determine Drive

sudo lshw -C disk

Partition

public void testKafka() throws Exception {
Properties props = new Properties();
props.put("zk.connect", "zookeeper.cloudfront.io:2181");
props.put("zk.sessiontimeout.ms", "300000");
props.put("serializer.class", "kafka.serializer.DefaultEncoder");
props.put("key.serializer.class", "kafka.serializer.StringEncoder");
props.put("compression.codec", "1"); // gzip
props.put("producer.type", "async");
props.put("batch.size", "248");
props.put("queue.enqueueTimeout.ms", "-1");
https://github.com/tdunning/MiA/blob/mahout-0.7/src/main/java/mia/clustering/ch07/SimpleKMeansClustering.java#L24
@terrancesnyder
terrancesnyder / gist:5565050
Created May 12, 2013 21:52
hbase shell commands
# create our table
create 'impressions', { NAME => 'event', COMPRESSION => 'LZO' }
# see what's inside it
describe 'impressions'
# add some data
put 'impressions', '20130512', 'event:type', 'click'
put 'impressions', '20130512', 'event:ad', '1234'
put 'impressions', '20130512', 'event:campaign', '9283372'
@terrancesnyder
terrancesnyder / charts.js
Created April 4, 2013 01:40
Google Charts for C/I
function drawVisualization() {
// Create and populate the data table.
// sum total distinct rows and then take each group % of share of total distinct
var data = google.visualization.arrayToDataTable([
['Year', 'Group A', 'Group B', 'Group C', 'Group D'],
['Group A', 100, 100, 100, 100],
['Group B', 100, 100, 100, 100],
]);
// Create and draw the visualization.
@terrancesnyder
terrancesnyder / auto
Created March 31, 2013 18:50
Automated install of Ubuntu
http://askubuntu.com/questions/183132/automated-installation-using-preseeding-from-url-failed-from-within-virtualbox
@terrancesnyder
terrancesnyder / install.cmd
Last active December 15, 2015 08:59
VeeWee Windows 7
# install ruby http://rubyinstaller.org/downloads/
http://rubyforge.org/frs/download.php/76798/rubyinstaller-1.9.3-p392.exe
# download and configure devkit for windows @http://rubyinstaller.org/downloads/
https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
cd <DEVKIT_INSTALL_DIR>
ruby dk.rb init
ruby dk.rb review
ruby dk.rb install