This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BINARY=$1 | |
HOST=$2 | |
PORT=$3 | |
DURATION=$4 | |
echo "Forwarding port..." | |
ssh -t -t -L$PORT:localhost:$PORT $HOST & | |
SSH_PID=$! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* EchoNode.java | |
* | |
* Demonstrates the use of JInterface library to communicate between a Erlang node and a Java node. | |
* | |
* Compile & run: | |
* javac -cp /opt/local/lib/erlang/lib/jinterface-1.4.1/priv/OtpErlang.jar EchoNode.java | |
* java -cp ".:/opt/local/lib/erlang/lib/jinterface-1.4.1/priv/OtpErlang.jar" EchoNode | |
* | |
* Call echoservice from Erlang: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
codeobjects.py | |
An experiment with code-objects and namespaces. | |
Inspired by Jeff Rush's PyCON'09 talk. | |
http://us.pycon.org/2009/conference/schedule/event/7/ | |
Compiles a module at run-time from a string containing the code for the module | |
and installs a new module object in sys.modules ready to be importable! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(couch_file). | |
-behaviour(gen_server). | |
-export([open/1, open/2, close/1, bytes/1, sync/1, append_binary/2,old_pread/3]). | |
-export([append_term/2, pread_term/2, pread_iolist/2, write_header/2]). | |
-export([pread_binary/2, read_header/1, truncate/2, upgrade_old_header/2]). | |
-export([init/1, terminate/2, handle_call/3, handle_cast/2, code_change/3, handle_info/2]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(tweetbed). | |
-author("Harish Mallipeddi <harish.mallipeddi@gmail.com>"). | |
-behaviour(mattress). | |
-export([map/0, reduce/2]). | |
-define(TWITTER_BASE_URL, "http://twitter.com"). | |
-define(TWITTER_USER, "INSERT TWITTER USERID HERE"). | |
-define(TWITTER_PASS, "INSERT PASSWORD HERE"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$erl -pa "../couchdb/src/couchdb" -pa "../erlang_twitter/ebin" | |
Erlang (BEAM) emulator version 5.6.5 [source] [smp:2] [async-threads:0] [hipe] [kernel-poll:false] | |
Eshell V5.6.5 (abort with ^G) | |
1> mattress:run_with(tweetbed). | |
lookup out: [{ok,{"vyom", | |
{user,"6151","Deepak Jois","vyom","Seattle", | |
"Geek, Bibliophile and Philosopher", | |
"http://s3.amazonaws.com/twitter_production/profile_images/14202382/mypictr_Flickr_normal.jpg", | |
"http://deepak.jois.name","false","467", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COUCHDB:="../couchdb/src/couchdb" | |
ERLANG_TWITTER:="../erlang_twitter/ebin" | |
all: clean compile | |
clean: | |
rm -f *.beam | |
compile: | |
erlc -pa ${COUCHDB} -pa ${ERLANG_TWITTER} *.erl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(couch_btree). | |
-export([open/2, open/3, query_modify/4, add/2, add_remove/3, foldl/3, foldl/4]). | |
-export([foldr/3, foldr/4, fold/4, fold/5, full_reduce/1, final_reduce/2]). | |
-export([fold_reduce/6, fold_reduce/7, lookup/2, get_state/1, set_options/2]). | |
-record(btree, | |
{fd, | |
root, | |
extract_kv = fun({Key, Value}) -> {Key, Value} end, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(mattress). | |
-author("Harish Mallipeddi <harish.mallipeddi@gmail.com>"). | |
-export([run_with/1]). | |
-export([behaviour_info/1]). | |
-record(btree, | |
{fd, | |
root, | |
extract_kv, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checkout the LZO-related code from Google Code | |
svn checkout http://hadoop-gpl-compression.googlecode.com/svn/trunk/ hadoop-gpl-compression | |
# build the Java code | |
cd hadoop-gpl-compression | |
ant | |
# move the jar file to $HADOOP_HOME/lib | |
mv build/hadoop-gpl-compression-0.1.0-dev.jar $HADOOP_HOME/lib/ |
OlderNewer