Skip to content

Instantly share code, notes, and snippets.

View krishnakalyan3's full-sized avatar

Krishna Kalyan krishnakalyan3

View GitHub Profile
// Define functions to render linked interactive plots using d3.
// Another script should define e.g.
// <script>
// var plot = new animint("#plot","path/to/plot.json");
// </script>
// Constructor for animint Object.
var animint = function (to_select, json_file) {
function wait_until_then(timeout, condFun, readyFun) {
var args=arguments
// Define functions to render linked interactive plots using d3.
// Another script should define e.g.
// <script>
// var plot = new animint("#plot","path/to/plot.json");
// </script>
// Constructor for animint Object.
var animint = function (to_select, json_file) {
function wait_until_then(timeout, condFun, readyFun) {
var args=arguments
// Define functions to render linked interactive plots using d3.
// Another script should define e.g.
// <script>
// var plot = new animint("#plot","path/to/plot.json");
// </script>
// Constructor for animint Object.
var animint = function (to_select, json_file) {
function wait_until_then(timeout, condFun, readyFun) {
var args=arguments
@krishnakalyan3
krishnakalyan3 / ProcessFunction
Last active October 16, 2018 15:19
Fink Output
## Test Case
@Test
def userSource(): Unit = {
val env = StreamExecutionEnvironment.getExecutionEnvironment
val userEvents:DataStream[UserEvent] = env.fromCollection(Seq(
UserEvent(id = "customer-1", lat = 1.0 , lng = 0.0 , ts = "2018-10-16T00:00:00.01Z"),
UserEvent(id = "customer-1", lat = 2.0 , lng = 0.0 , ts = "2018-10-16T03:00:00.01Z"),
UserEvent(id = "customer-1", lat = 3.0 , lng = 0.0, ts = "2018-10-16T04:00:00.01Z"),
@krishnakalyan3
krishnakalyan3 / podexec.log
Created July 28, 2018 20:57
Execution in Master Pod
➜ spark-helm git:(master) ✗ kubectl exec -it spark-master-r88nn -- /bin/bash
bash-4.4# ls
LICENSE NOTICE R README.md RELEASE bin conf data examples jars kubernetes licenses python sbin yarn
bash-4.4# spark-master-r88nn^C
bash-4.4# ./bin/spark-submit \
> --class org.apache.spark.examples.SparkPi \
> --master spark://35.234.77.43:7077 \
> --executor-memory 1024M \
> --total-executor-cores 3 \
> --name sparktest \
FROM openjdk:8-alpine
MAINTAINER Krishna Kalyan "krishnakalyan3@gmail.com"
# Default Args
ARG APACHE_MIRROR_SERVER=http://www-us.apache.org
ARG SPARK_VERSION=2.3.0
ARG HADOOP_VERSION=2.7
RUN apk update && \
apk add bash curl git python3 wget vim openssl ca-certificates && \
#!/usr/bin/env python3
import xml.etree.cElementTree as ET
import pandas as pd
import sys
import xmltodict, json
from collections import defaultdict
from utils import json_writer
<?xml version="1.0" encoding="UTF-8"?>
<EXPORT version="2018-06-13 07:31:54" type="complete" lang="de" country="DE">
<TREE>
<PRODUCTS activ="1">
<PGR shortcut="" name="cat1" id="1">
<PGR shortcut="" name="cat2" id="2">
<PGR shortcut="" name="cat3" id="3">
<PRO id="11" tnr="111"/>
<PRO id="12" tnr="222"/>
<PRO id="13" tnr="333"/>
@krishnakalyan3
krishnakalyan3 / log_analytics.txt
Last active June 19, 2018 13:15
Azure Log Analytics Queries
search * | where LogLevel_s == 'Information'
search * | where Type == 'DiagnosticsLog_CL' and LogProperties_StatusCode_d == 200
search * | where LogProperties_SourceContext_s == 'Festo.InstalledBase.Core.Controllers.TestController'
search * | top 10 by TimeGenerated | project SourceSystem, Type
# Summarize
# By Log Level Application
search * | where $table == 'DiagnosticsLog_CL'
| project Type, TimeGenerated, LogProperties_RequestPath_s, LogLevel_s
@krishnakalyan3
krishnakalyan3 / log_analytics.txt
Created June 19, 2018 10:11
Azure Log Analytics Queries
search * | where LogLevel_s == 'Information'
search * | where Type == 'DiagnosticsLog_CL' and LogProperties_StatusCode_d == 200
search * | where LogProperties_SourceContext_s == 'Festo.InstalledBase.Core.Controllers.TestController'
search * | top 10 by TimeGenerated | project SourceSystem, Type