This file contains hidden or 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
#!/usr/bin/env python | |
"""A simple python script template. | |
""" | |
import os | |
import sys | |
import argparse |
This file contains hidden or 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
-- here is my stream | |
drop stream test_stream cascade; | |
create stream test_stream (speed int, ts int, tail char(10)); | |
create continuous view v1 as select ts, tail, speed from test_stream; | |
create continuous view v2 as select tail, keyed_max(ts, speed) from test_stream group by tail; | |
-- put some data into it | |
insert into test_stream values (100, 1, 'YY'); |
This file contains hidden or 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
brew install sbt | |
cd /tmp | |
wget http://apache.spd.co.il/kafka/0.8.0/kafka_2.8.0-0.8.0.tar.gz | |
tar -zxvf kafka_2.8.0-0.8.0.tar.gz -C /usr/local/ | |
cd /usr/local/kafka_2.8.0-0.8.0 | |
sbt update | |
sbt package |
This file contains hidden or 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
hour,avg_neg,avg_neutral,avg_pos | |
0,0.489045047812703,0.572904921392379,0.510954952187297 | |
1,0.45979209657117,0.55928348584548,0.54020790342883 | |
2,0.452954920632673,0.564895009665459,0.547045079367327 | |
3,0.4886087921913,0.473499704794948,0.5113912078087 | |
4,0.486929135727515,0.470766998533493,0.513070864272485 | |
5,0.516430239594934,0.633499700744954,0.483569760405066 | |
6,0.476850687564712,0.605231004647229,0.523149312435288 | |
7,0.485249046873756,0.504506815590507,0.514750953126244 | |
8,0.485469075837924,0.53258626109772,0.514530924162076 |
This file contains hidden or 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
hour,avg_neg,avg_neutral,avg_pos | |
0,0.489045047812703,0.572904921392379,0.510954952187297 | |
1,0.45979209657117,0.55928348584548,0.54020790342883 | |
2,0.452954920632673,0.564895009665459,0.547045079367327 | |
3,0.4886087921913,0.473499704794948,0.5113912078087 | |
4,0.486929135727515,0.470766998533493,0.513070864272485 | |
5,0.516430239594934,0.633499700744954,0.483569760405066 | |
6,0.476850687564712,0.605231004647229,0.523149312435288 | |
7,0.485249046873756,0.504506815590507,0.514750953126244 | |
8,0.485469075837924,0.53258626109772,0.514530924162076 |
This file contains hidden or 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
// mongodb 2.4.8 | |
// fragmented | |
// initial setting of random rand of 5000 | |
> use sbtest | |
switched to db sbtest | |
> db.stats() | |
{ | |
"db" : "sbtest", |
This file contains hidden or 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
import sys | |
import os | |
sys.path.append("/usr/lib/spark-yarn/python") | |
os.environ["SPARK_HOME"]="/usr/lib/spark-yarn/" | |
from pyspark import SparkContext |
This file contains hidden or 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
# this script installs jupyter on Rackspace CBD | |
# 2015 kcg | |
# the trick here is to install python 3.3 with pip and not ruin the default python install | |
# then simply run jupyterhub | |
# this is designed to be run as a postinstall script when provisioning a cluster. | |
if [ $HOSTNAME == "GATEWAY-1" ] | |
then | |
# pre-requisites |
This file contains hidden or 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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:a90804b68c0c02c405e62b261bc333673f0be01d2a735136d4799cd5e506f42d" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains hidden or 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
// a list of useful queries for profiler analysis. Starting with the most basic. | |
// 2.4 compatible | |
// | |
// output explained: | |
// | |
{ | |
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred | |
"op" : "query", // the operation type | |
"ns" : "game.players", // the db and collection |