Skip to content

Instantly share code, notes, and snippets.

http://hortonworks.com/blog/discovering-hive-schema-in-collections-of-json-documents/
@gabhi
gabhi / gist:088927912e1c5cad3e77
Created February 1, 2015 02:50
cassandra spark cluster example
start cassandra;
start spark;(./sbin/start-master.sh)
run following in cqlsh
CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };
CREATE TABLE test.kv(key text PRIMARY KEY, value int);
INSERT INTO test.kv(key, value) VALUES ('key1', 1);
INSERT INTO test.kv(key, value) VALUES ('key2', 2);
@gabhi
gabhi / gist:16370155eb7c1ec5f42b
Created January 29, 2015 17:41
Walmart java api example usage
import com.walmart.openapi.DataFeedManager;
public class MainApp {
public static void main(String[] args) throws Exception {
DataFeedManager dataFeedManager = new DataFeedManager("<insert your api key here>");
DataFeedManager.FeedIterator feedIterator = dataFeedManager.getFeedIterator(
DataFeedManager.FeedsType.BESTSELLERS, "3944");
int counter = 0;
while (feedIterator.hasNext()) {
counter = counter + 1;
JAR location: /home/hadoop/contrib/streaming/hadoop-streaming.jar
Main class: None
Arguments: -files s3://bigdataapp/wcmapper.php,s3://bigdataapp/wcreducer.php -mapper wcmapper.php -reducer wcreducer.php -input s3://aws-publicdatasets/common-crawl/parse-output/segment/1341690169105/textData-00112 -output s3://bigdataapp/wctest -inputformat SequenceFileAsTextInputFormat
Action on failure: Continue
@gabhi
gabhi / gist:06e60618c961c5681ab2
Created January 26, 2015 05:44
big data links
http://www.fightswithbytes.com/2013/04/05/sample-wordcount-streaming-job-using-php-on-commoncrawl-dataset/
@gabhi
gabhi / gist:9bd2dbdd54d27bd80134
Created January 20, 2015 22:24
one liner for heroku push
git add .; git commit -m "Demo";git push heroku master;
@gabhi
gabhi / gist:4cf34e2598d0e335c5cd
Last active August 29, 2015 14:13
node js unzip request example
var express = require('express')
var app = express()
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
app.get('/', function(req, res) {
var zlib = require('zlib');
@gabhi
gabhi / gist:3d969611835a5694a980
Created January 14, 2015 19:59
spring rest oauth
http://porterhead.blogspot.com/2014/05/securing-rest-services-with-spring.html
@gabhi
gabhi / 01.repl.txt
Last active August 29, 2015 14:13 — forked from ceteri/01.repl.txt
$ ./bin/spark-shell
14/04/18 15:23:49 INFO spark.HttpServer: Starting HTTP Server
14/04/18 15:23:49 INFO server.Server: jetty-7.x.y-SNAPSHOT
14/04/18 15:23:49 INFO server.AbstractConnector: Started [email protected]:49861
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 0.9.1
/_/