Skip to content

Instantly share code, notes, and snippets.

View mbonaci's full-sized avatar

Marko Bonaći mbonaci

View GitHub Profile
/**
* Simple userland CPU profiler using v8-profiler
* Usage: require('[path_to]/CpuProfiler').init('datadir')
*
* @module CpuProfiler
* @type {exports}
*/
var fs = require('fs');
var profiler = require('v8-profiler');
@mbonaci
mbonaci / esexport.py
Created April 12, 2016 19:52
Elasticsearch export by time range using Python scroll API
#!/usr/bin/env python
# encoding: utf-8
'''
Elasticsearch export using Python ES client's scroll feature
@author: mbonaci
@copyright: 2016 Sematext. All rights reserved.
@license: Apache 2.0
@contact: [email protected]
'''
@mbonaci
mbonaci / pom.xml
Last active September 11, 2015 12:27 — forked from codahale/pom.xml
Take this and save it as pom.xml in your project directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!-- none yet -->
$transp: rgba(255,255,255,0);
$colors:
lighten(steelblue, 20%),
lightblue,
skyblue,
steelblue,
darken(steelblue, 10%),
darken(steelblue, 10%),
darken(steelblue, 10%),
@mbonaci
mbonaci / MissingRequirementError
Created May 1, 2015 08:13
scala.reflect.internal.MissingRequirementError: class org.apache.spark.sql.catalyst.ScalaReflection in JavaMirror with primordial classloader with boot classpath
15/05/01 10:11:38 INFO SparkContext: Running Spark version 1.3.1
15/05/01 10:11:38 WARN Utils: Your hostname, mbo-sia resolves to a loopback address: 127.0.1.1; using 10.0.2.15 instead (on interface eth0)
15/05/01 10:11:38 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address
15/05/01 10:11:38 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
15/05/01 10:11:39 INFO SecurityManager: Changing view acls to: mbo
15/05/01 10:11:39 INFO SecurityManager: Changing modify acls to: mbo
15/05/01 10:11:39 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(mbo); users with modify permissions: Set(mbo)
15/05/01 10:11:39 INFO Slf4jLogger: Slf4jLogger started
15/05/01 10:11:39 INFO Remoting: Starting remoting
15/05/01 10:11:40 INFO Remoting: Remoting started; listening on addresses :[akka.tcp://[email protected]:47877]
@mbonaci
mbonaci / installScalaSbt.sh
Last active July 6, 2021 17:07
Install Scala 2.10.4 and Sbt 0.13.8 on Ubuntu 14.04 (Spark)
sudo wget www.scala-lang.org/files/archive/scala-2.10.4.deb
sudo dpkg -i scala-2.10.4.deb
# in case of unmet libjansi-java dependency fire:
# sudo apt-get install -f
sudo apt-get install curl
wget https://dl.bintray.com/sbt/debian/sbt-0.13.8.deb
sudo dpkg -i sbt.deb
@mbonaci
mbonaci / gist:3d44fa3155d1a6cd2fe2
Created March 13, 2015 02:57
Replace Scala version part of artifactId in all poms
find . -name 'pom.xml' | grep -v target | xargs -I {} sed -i -e 's|\(artifactId.*\)_2.10|\1_2.11|g' {}
@mbonaci
mbonaci / gist:298722017ce751448ca3
Created March 12, 2015 19:28
Starter pom.xml for Apache Spark 1.2.1 with Scala 2.10.4
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sia</groupId>
<artifactId>spark</artifactId>
<version>0.0.1-SNAPSHOT</version>
<inceptionYear>2015</inceptionYear>
<properties>
<scala.version>2.10.4</scala.version>
</properties>
@mbonaci
mbonaci / gist:e92a2bc690e002f461c1
Created February 28, 2015 14:16
log4j.properties: ERRORs to the console, INFO to a file (Spark)
# Set everything to be logged to the console
log4j.rootCategory=INFO, console, file
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.threshold=ERROR
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
log4j.appender.file=org.apache.log4j.RollingFileAppender
@mbonaci
mbonaci / designer.html
Created November 21, 2014 00:29
designer
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../code-mirror/code-mirror.html">
<link rel="import" href="../cool-clock/cool-clock.html">
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>