Skip to content

Instantly share code, notes, and snippets.

SELECT destinationport,
COUNT(*) AS total
FROM flows
WHERE action = ‘REJECT’
GROUP BY destinationport
ORDER BY total DESC LIMIT 10
SELECT corr(bytes,packets), action FROM flows GROUP BY action
SELECT sum(packets) AS total,
split_part(sourceaddress,’.’, 1) = ‘10’ AS isInternal,
action
FROM flows
GROUP BY 2, action
ORDER BY total DESC LIMIT 10
SELECT destinationaddress,
SUM(bytes) AS totalBytes
FROM flows TABLESAMPLE SYSTEM (10)
GROUP BY destinationaddress
ORDER BY totalBytes DESC LIMIT 10
func communicateJava(input interface{}) (interface{}, error) {
inBytes, err := json.Marshal(input)
inputStr := string(inBytes)
goRequest <- inputStr
respStr := <-javaResponse
var resp interface{}
err = json.Unmarshal([]byte(respStr), &resp)
}
//export Java_Test_start
System.loadLibrary("Hello");
start();
while (true) {
String request = readRequest();
KMeansResult response = kMeans.calculate(request);
String response = response.toString();
writeResponse(response);
}
}
Memory(MB) Avg Duration(ms) Max Duration(ms) Avg Graal + Go(ms) Max Graal + Go(ms)
256 489 3179 992 1011
512 235 1426 486 529
1024 123 652 243 266
1536 85 443 162 173
2048 78 371 143 153
@mustafaakin
mustafaakin / find_blur_photos.py
Created February 18, 2019 20:14
Finding blurred photos by album
import os
import sqlite3
import cv2
import numpy as np
def score(filename):
image = cv2.imread(filename)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
@mustafaakin
mustafaakin / Test.java
Created June 4, 2018 20:31
Graal + AWS Java Lambda + Golang
import org.json.JSONObject;
import org.json.JSONTokener;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
public class Test {
@mustafaakin
mustafaakin / configuration.yaml
Created December 12, 2019 10:56
Configuration for Kubernetes Event Exporteer
route:
# Main route
routes:
# This route allows dumping all events because it has no fields to match and no drop rules.
- match:
- receiver: dump
# This starts another route, drops all the events in *test* namespaces and Normal events
# for capturing critical events
- drop:
- namespace: "*test*"