Skip to content

Instantly share code, notes, and snippets.

@umbrant
umbrant / server.py
Created Mar 3, 2013
Simple multi-threaded python server that offers up a file with a delay per line
View server.py
import socket
import time
import threading
import SocketServer
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
def handle(self):
data = open("file", "r").readlines()
for line in data:
@umbrant
umbrant / hdfs-player.js
Last active Sep 26, 2017
Bookmarklet to play audio files right from the Namenode web UI!
View hdfs-player.js
javascript:(function(){
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
@umbrant
umbrant / env.source
Created Nov 27, 2013
Source this file from the top-level directory of a Hadoop source tree built with "-Pdist"
View env.source
export HADOOP_COMMON_HOME=$(pwd)/$(ls -d hadoop-common-project/hadoop-common/target/hadoop-common-*-SNAPSHOT)
export HADOOP_HDFS_HOME=$(pwd)/$(ls -d hadoop-hdfs-project/hadoop-hdfs/target/hadoop-hdfs-*-SNAPSHOT)
export PATH=$HADOOP_COMMON_HOME/bin:$HADOOP_HDFS_HOME/bin:$PATH
@umbrant
umbrant / hardtest.sh
Last active Aug 29, 2015
Program to benchmark hardlink creation using rsync
View hardtest.sh
#!/usr/bin/env bash
function p {
echo `date --rfc-3339=ns` "$@"
}
BASEDIR=`pwd`/hardtest
SOURCEDIR=$BASEDIR/dfs
SNAPDIR=$BASEDIR/dfs-snap
You can’t perform that action at this time.