Skip to content

Instantly share code, notes, and snippets.

View conikeec's full-sized avatar
:electron:

Chetan Conikee conikeec

:electron:
View GitHub Profile
@conikeec
conikeec / build.sbt
Created February 18, 2012 07:23 — forked from durgeshm/build.sbt
Finagle 1.9.7 with Scala 2.9.1
scalaVersion := "2.9.1"
resolvers += "durgeshm repo" at "http://durgeshm.github.com/releases/"
libraryDependencies ++= Seq(
"com.twitter" %% "finagle-core" % "1.9.7",
"com.twitter" %% "finagle-http" % "1.9.7")
@conikeec
conikeec / pipeTo.scala
Created February 19, 2012 02:20 — forked from rkuhn/pipeTo.scala
Futures and Resizers
import akka.dispatch.Future
import akka.pattern.pipe
import akka.actor.Actor
case class Work(s: String)
case class Result(s: String)
object MyActor {
// put here to avoid closing over actor’s state
def doWork(work: String): String = {
import akka.zeromq._
import akka.util.Duration._
import akka.util.duration._
import akka.actor._
import akka.actor.Actor
import akka.actor.Props
import akka.actor.ActorLogging
import akka.serialization.SerializationExtension
import java.lang.management.ManagementFactory
import java.text.SimpleDateFormat
@conikeec
conikeec / HBase_Setup
Created February 23, 2012 05:42
HBase Setup
bootstrap resources
-------------------
echo "deb http://archive.canonical.com/ lucid partner" > /etc/apt/sources.list.d/partner.list
echo "deb http://archive.cloudera.com/debian lucid-cdh3 contrib" >> /etc/apt/sources.list.d/cloudera.list
echo "deb-src http://archive.cloudera.com/debian lucid-cdh3 contrib" >> /etc/apt/sources.list.d/cloudera.list
echo "sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true" | debconf-set-selections
echo "hdfs - nofile 32768" >> /etc/security/limits.conf
echo "hbase - nofile 32768" >> /etc/security/limits.conf
echo "hdfs soft/hard nproc 32000" >> /etc/security/limits.conf
@conikeec
conikeec / HBase_Whirr_Setup
Created February 23, 2012 05:48
HBase_Whirr_Setup
cd ~/whirrsetup
svn co http://svn.apache.org/repos/asf/incubator/whirr/trunk whirr-trunk
cd whirr-trunk
Host Requirements for Building Whirr
------------------------------------
Apache Whirr Build Instructions
REQUIREMENTS
@conikeec
conikeec / README.txt
Created February 23, 2012 06:50 — forked from andreisavu/README.txt
An Apache Whirr recipe that can be used to start a single virtual machine running HBase on EC2
Hi :)
Here are some quick instruction on running the hbase-ec.properties recipe.
1. Download Whirr 0.7.0 RC0 from here. We are going to publish this as an official release soon.
http://people.apache.org/~asavu/whirr-0.7.0-candidate-0/whirr-0.7.0.tar.gz
2. Extract the archive
@conikeec
conikeec / Whirr_080_Setp_LATEST
Created February 23, 2012 09:33
Whirr_080_Setp_LATEST
http://whirr.apache.org/docs/0.7.0/whirr-in-5-minutes.html
thrift repo : http://people.apache.org/~rawson/repo
git clone https://github.com/apache/whirr.git
git checkout -b branch-0.7 -t origin/branch-0.7
git clone git://github.com/apache/whirr.git && cd whirr && git co branch-0.7
mvn install
@conikeec
conikeec / gist:1981301
Created March 5, 2012 21:43
Apache Whirr Setup (Outright)
git clone https://github.com/apache/whirr.git
cd whirr
mvn install
mvn package assembly:assembly
/*
After successful build
Navigate to the target folder to uncompress the release to your selected folder of choice
*/
@conikeec
conikeec / gist:2142635
Created March 20, 2012 23:47 — forked from nono/gist:1600053
autocomplete with tire
#encoding: utf-8
require 'tire'
require 'json'
require 'active_support/core_ext/object/to_query'
require 'active_support/core_ext/object/to_param'
conf = {
settings: {
number_of_shards: 1,
number_of_replicas: 0,
@conikeec
conikeec / avgkvsz.scala
Created March 28, 2012 03:22 — forked from tsuna/avgkvsz.scala
Get average size of a KeyValue from HBase using asynchbase in Scala with the Finagle compatibility layer
import java.util.ArrayList
import scala.collection.JavaConversions._
import com.stumbleupon.async.{Callback, Deferred}
import org.hbase.async.{HBaseClient, KeyValue, Scanner}
import com.twitter.util.{Future, Promise, Return, Throw}
/** Converts a Deferred into a Future. */
implicit def futureFromDeferred[A](d: Deferred[A]): Future[A] = {
val promise = new Promise[A]