Skip to content

Instantly share code, notes, and snippets.

View geoHeil's full-sized avatar
💭
🚀

geoHeil geoHeil

💭
🚀
View GitHub Profile
@geoHeil
geoHeil / QUGIS_dev.rb
Created April 11, 2018 14:53
gis Homebrew
class Qgis3DevUnlinkedFormulae < Requirement
fatal true
satisfy(:build_env => false) { !qt4_linked && !pyqt4_linked && !txt2tags_linked }
def qt4_linked
(Formula["qt"].linked_keg/"lib/QtCore.framework/Versions/4").exist?
rescue
return false
end
@geoHeil
geoHeil / foo.scala
Last active April 4, 2018 09:12
spark term frequency
// Copyright (C) 2017 Georg Heiler
package ir
import java.io.File
import com.databricks.spark.corenlp.functions._
import com.typesafe.config.ConfigFactory
import net.ruippeixotog.scalascraper.browser.JsoupBrowser
import org.apache.spark.sql.functions._
@geoHeil
geoHeil / foo.xml
Created April 1, 2018 08:40
xml demo of data
<?xml version="1.0" encoding="UTF-8"?>
<measCollecFile>
<measData>
<managedElement userLabel="abc"/>
<measInfo measInfoId="11111">
<granPeriod duration="1" endTime="2018-01-01:00:00:00"/>
<repPeriod duration="1"/>
<measTypes>1 2 3 4 5 6 </measTypes>
<measValue measObjLdn="abc/asdf.=3">
<measResults>1024 36.733 25.5 56 4.933 8 </measResults>
install
cdrom
lang en_US.UTF-8
keyboard de
network --bootproto=dhcp --ipv6=auto --activate
rootpw --plaintext vagrant
firewall --disabled
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone Europe/Vienna
@geoHeil
geoHeil / atlas.sh
Last active December 13, 2017 15:45
playing with the latest atlas version
git clone https://github.com/geoHeil/atlas.git
cd atlas
git checkout dockerAtlasChangeUrl
# --------------------------------------------------
# docker playground
cd dev-support/atlas-docker/
docker build -t atlas_docker .
docker run -it -p 21000:21000 atlas_docker
# open your browser and go to
http://localhost:21000
# connect to utility node
hostname -f
# output: c
sudo vi /etc/ambari-agent/conf/ambari-agent.ini
# configure hostname=ip-172-31-25-199.eu-west-1.compute.internal
# reload / restart
systemctl restart ambari-agent
systemctl status ambari-agent
systemctl start ambari-agent
@geoHeil
geoHeil / Vagrantfile
Last active January 5, 2018 08:46
Cloudbreak vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# Base Box
config.vm.box = "centos/7"
# Base IP address range used for VMs. Pretty sure not to be already used on the local network.
$BASE_RANGE = ENV.fetch("BASE_RANGE", "10.200.0.")
cloudbreak_ip = $BASE_RANGE + ENV.fetch("CB_IP", "3")
@geoHeil
geoHeil / foo.scala
Last active December 10, 2017 07:58
configuration ficus
import com.typesafe.config.{ Config, ConfigFactory }
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ValueReader
import net.ceedubs.ficus.readers.namemappers.implicits.hyphenCase
object ConfigurationUtils {
def loadConfiguration[T: ValueReader](): T = {
val config: Config = ConfigFactory.load()
config.as[T]
val f1: DataFrame = g.find("(a)-[e1]->(b)")
.withColumn("level", lit("f1"))
.withColumnRenamed("a", "src")
.withColumnRenamed("b", "dst")
.select("src", "dst", "level")
val f2: DataFrame = g.find("(a)-[e1]->(b);(b)-[e2]->(c)").withColumn("level", lit("f2"))
.withColumnRenamed("a", "src")
.withColumnRenamed("c", "dst")
.drop("b")
.select(f1.columns.map(col _): _*)
val friends: DataFrame = g.find("(a)-[e]->(b)")
friends.show
friends.groupBy('a).agg(mean($"b.fraud").as("fraud"))
.withColumn("id", $"a.id")
.withColumn("name", $"a.name")
.withColumn("fraud_src", $"a.fraud")
.drop("a")
.show