Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / web.config
Created February 14, 2013 01:10
Example WCF config for content type negotation with JSON/XML AND SOAP
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<services>
<service name="Service.HelloWorldService" behaviorConfiguration="wsdl">
<endpoint address="soap" binding="basicHttpBinding" contract="Service.IHelloWorldService" />
<endpoint address="xml" binding="webHttpBinding" behaviorConfiguration="restBehavior" contract="Service.IHelloWorldServicee" />
@terrancesnyder
terrancesnyder / hadoop.sh
Created February 8, 2013 23:12
Example of hadoop bash init.d
#!/bin/bash
#
#
# Starts a Hadoop Master
#
# chkconfig: 2345 90 10
# description: Hadoop master
. /etc/rc.d/init.d/functions
@terrancesnyder
terrancesnyder / hadoop-defaults
Created February 7, 2013 13:36
Default ports for hadoop
http://10.192.25.122:50070/dfshealth.jsp
http://10.192.25.122:50030/jobtracker.jsp
http://10.192.25.122:50060/tasktracker.jsp
@terrancesnyder
terrancesnyder / gist:4730959
Created February 7, 2013 13:35
Convert all files from dos to Unix
find . -name "*" -type f -exec dos2unix {} \;
@terrancesnyder
terrancesnyder / IO write speed test.sh
Created January 10, 2013 22:52
Write test performance
dd if=/dev/zero of=testfile_10MB bs=500485760 count=1
@terrancesnyder
terrancesnyder / gist:4366869
Created December 24, 2012 00:25
Bug with pentaho output servlet
var out = _step_.getTrans().getServletPrintWriter();
out.println("<H1>");
out.println("Hello World!");
out.println("ときょ 東京 コーヒー");
out.println("</H1>");
@terrancesnyder
terrancesnyder / consumer.js
Created November 21, 2012 20:20
NodeJS ZeroMQ Consumer Example used with Issue #110 on ZMQ
var zmq = require('zmq')
, sock = zmq.socket('pull');
// increase swap for high water mark
zmq.options.swap = 1024;
zmq.options.hwm = 0;
// zmq.options.rate = 800000;
sock.connect('tcp://127.0.0.1:3000');
console.log('Worker connected to port 3000');
@terrancesnyder
terrancesnyder / producer.js
Created November 21, 2012 20:19
Producer Example NodeJS (225k/second without a consumer, 185k with a consumer)
var zmq = require('zmq'),
sock = zmq.socket('push'),
_ = require('underscore');
// increase swap for high water mark
zmq.options.swap = 1024;
zmq.options.hwm = 0;
// zmq.options.rate = 800000;
sock.bind('tcp://127.0.0.1:3000', function(err) {
@terrancesnyder
terrancesnyder / script.sh
Created October 24, 2012 21:28
Apache Bench w/ Extract Cookie
ab -v 2 -c 30 -n 100 "http://www.yourdomain.com/" | grep -ohE "Set-Cookie: jspsession=..........................."