Skip to content

Instantly share code, notes, and snippets.

@itayw
itayw / gist:2b329865f72e7f3e7227
Created January 20, 2016 20:38
beaker-spark-node-jdbc
FFROM beakernotebook/beaker
MAINTAINER "Itay Weinberger <[email protected]>"
# Install Node.js 5.x, the FROM image is still using 0.12
ENV NODE_VERSION v5.1.0
RUN wget --no-check-certificate https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz && \
tar -C /usr/local --strip-components 1 -xzf node-$NODE_VERSION-linux-x64.tar.gz && \
rm node-$NODE_VERSION-linux-x64.tar.gz
import org.elasticsearch.spark._
val options = Map("pushdown" -> "true", "es.nodes" -> "172.17.0.1", "es.port" -> "9200", "es.field.read.as.array.include" -> "posTimes,pos.coordinates,origDetections", "es.index.auto.create" -> "false")
val df = sqlContext.read.format("org.elasticsearch.spark.sql")
.options(options).load("tracks/track")
df.groupBy("kind").count().show()
//df.show()
//df.groupBy("review.user.screen_name").count().show()
<link rel="stylesheet" href="//cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css">
<script src="//cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js"></script>
<table id="simpletable">
<thead>
<tr>
</tr>
</thead>
</table>
sdb 8:16 0 55.9G 0 disk
├─sdb1 8:17 0 243M 0 part /boot
├─sdb2 8:18 0 1K 0 part
└─sdb5 8:21 0 55.7G 0 part
└─sda5_crypt (dm-0) 252:0 0 55.7G 0 crypt
├─xubuntu--vg-root (dm-1) 252:1 0 39.7G 0 lvm /
└─xubuntu--vg-swap_1 (dm-2) 252:2 0 16G 0 lvm [SWAP]
@itayw
itayw / gist:d453d06dde8a4fa5e9ae
Last active October 18, 2015 09:20
Kibana highlighting
itay@joola-laptop:~/dev/kibana$ cat diff.txt
diff --git a/src/kibana/components/doc_table/components/table_row.js b/src/kibana/components/doc_table/components/table_row.js
index 1595284..e9bf8ed 100644
--- a/src/kibana/components/doc_table/components/table_row.js
+++ b/src/kibana/components/doc_table/components/table_row.js
@@ -153,7 +153,14 @@ define(function (require) {
function _displayField(row, fieldName, breakWords) {
var indexPattern = $scope.indexPattern;
var text = indexPattern.formatField(row, fieldName);
+ text = '';
@itayw
itayw / cef.rb
Last active October 15, 2015 09:42
CEF parsing
require "logstash/codecs/base"
class LogStash::Codecs::CEF < LogStash::Codecs::Base
config_name "cef"
config :signature, :validate => :string, :default => "Logstash"
config :name, :validate => :string, :default => "Logstash"
config :sev, :validate => :number, :default => 6
config :fields, :validate => :array
@itayw
itayw / persistant.yml
Created August 17, 2015 10:16
Joola sample configuration - Redis + Elasticsearch
store:
config:
enabled: true
redis:
enabled: true
dsn: redis://127.0.0.1
datastore:
elasticsearch:
enabled: true
host: localhost:9200
@itayw
itayw / graph.json
Created July 31, 2015 18:01
graph query dsl
{
"index": "echo-*",
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"bool": {
"must": [
var fixedTo = new Date(2015,6,3,13,34,12);
var fixedFrom = new Date(fixedTo);
fixedFrom.setMinutes(fixedTo.getMinutes()-15);
var timeDefaults = {
from: fixedFrom,//'now-15m',
to: fixedTo, //'now',
//mode: 'quick'
};