Skip to content

Instantly share code, notes, and snippets.

View stankiewicz's full-sized avatar

Radosław Stankiewicz stankiewicz

View GitHub Profile
@stankiewicz
stankiewicz / gist:050d63e3bd59d9064638
Created January 18, 2015 18:06
Elastic Search Download and Run
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.zip
unzip elasticsearch-1.4.2.zip
cd elasticsearch-1.4.2
echo "http.cors.enabled: true" >> ./config/elasticsearch.yml
./bin/elasticsearch
@stankiewicz
stankiewicz / gist:506466d68fb2fbb89cd4
Last active August 29, 2015 14:13
Install, Configure Kibana to Localhost ES instance
wget https://download.elasticsearch.org/kibana/kibana/kibana-3.1.2.zip
unzip kibana-3.1.2.zip
cd kibana-3.1.2
touch SimpleCorsHTTPServer.py
#! /usr/bin/env python2
# http://stackoverflow.com/a/21957017/4368212 - poke
from SimpleHTTPServer import SimpleHTTPRequestHandler
import BaseHTTPServer
class CORSRequestHandler (SimpleHTTPRequestHandler):
@stankiewicz
stankiewicz / gist:a43e8d7cd2850ca7691a
Created January 18, 2015 18:49
Sample Sales Data
wget https://www.dropbox.com/s/c4qkctgdxvq41fe/SalesJan2009_final.csv?dl=0
mv SalesJan2009_final.csv* SalesJan2009_final.csv
#!/usr/bin/env python
import sys
current_product = None
current_count = 0
product = None
for line in sys.stdin:
line = line.strip()
product, count = line.split(',', 1)
count = int(count)
if current_product == product:
yarn jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming.jar -file mapper.py -mapper mapper.py -file reducer.py -reducer reducer.py -input /tmp/SalesJan2009_final.csv -output /tmp/my_output/
@stankiewicz
stankiewicz / gist:73ece9b82f0870f4038a
Created January 19, 2015 21:44
Pig Download Path
wget http://ftp.ps.pl/pub/apache/pig/pig-0.14.0/pig-0.14.0.tar.gz
https://chrome.google.com/webstore/detail/sense-beta/lhjgkmllcaadmopgmanpapmpjgmfcfig
POST /megacorp/transactions/
{
"_timestamp" : "2015-01-12T23:37:00.000+01:00",
"Product" : "Product2",
"Price" : 5200,
"Payment_type": "Mastercard",
"Name" : "carolina",
"City" : "Basildon",
"State" : "England",
"Country" : "GB",
GET /megacorp/transactions/_mapping
{
"megacorp": {
"mappings": {
"transactions": {
"properties": {
"City": {
"type": "string"
},
@stankiewicz
stankiewicz / gist:2e5a2c700b20e13e7cea
Created January 20, 2015 13:59
Utworzenie Indeksu z typem transactions
POST /megacorp/_mapping/transactions2
{
"transactions2": {
"_timestamp": {
"enabled": true,
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
"store": true,
"path": "_timestamp"
},