Skip to content

Instantly share code, notes, and snippets.

View robie2011's full-sized avatar

Robert Rajakone robie2011

View GitHub Profile
@robie2011
robie2011 / main.py
Created June 11, 2019 11:13
Python Websocket Example
import websocket
import json
class WebsocketHandlers:
def on_error(ws, error):
print("error")
print(error)
@robie2011
robie2011 / error1.log
Created April 17, 2019 14:39
opencv installation on mac
3.7.3 (default, Mar 27 2019, 09:23:15)
[Clang 10.0.1 (clang-1001.0.46.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 89, in <module>
bootstrap()
File "/usr/local/lib/python3.7/site-packages/cv2/__init__.py", line 79, in bootstrap
import cv2
import os
def get_memory_usage_in_kb():
memory_usage = os.popen("cat /proc/meminfo").read().split("\n")
infos = {}
for s in memory_usage:
if (s.strip() == ""):
continue
@robie2011
robie2011 / manipulate_dashboard.js
Created February 5, 2019 17:19
Example: Manipulate Grafana Dashboard
const fs = require('fs');
const pathModelfile = "./dashboard_model.json"
const pathNewModelFile = "dashboard_new.json"
const obj = JSON.parse(fs.readFileSync(pathModelfile, 'utf8'));
const countFrequencyBand = 20
const frequencyBandSize = 100
const frequencyStart = 100
const generateField = name => {
return [
@robie2011
robie2011 / 0-KafkaStreamDemoStarter.kt
Last active July 4, 2019 03:22
KafkaStream: suppress-function doesn't work
package ch.rajakone.demo
import org.apache.kafka.clients.producer.KafkaProducer
import org.apache.kafka.clients.producer.ProducerRecord
import org.apache.kafka.common.serialization.Serdes
import org.apache.kafka.streams.KafkaStreams
import org.apache.kafka.streams.StreamsBuilder
import org.apache.kafka.streams.StreamsConfig
import org.apache.kafka.streams.kstream.Printed
import org.apache.kafka.streams.kstream.Suppressed
@robie2011
robie2011 / check_file_md5_signature.ps1
Last active September 17, 2018 13:30
SymmetricDS FileSynchronization Example
Set-Location C:\report-collection
$errors = 0
$ok = 0
Get-ChildItem *random* | ForEach-Object {
$_.Name -match '\d+_random_md5_(\w+)\.txt' | out-null
if ($matches[1] -ne (Get-FileHash $_.Name -Algorithm md5).Hash) {
$errors += 1
} else {
@robie2011
robie2011 / basics
Last active November 25, 2017 16:30
imread
imwrite
imhist
imfinfo % fileinfo
imgetfile
imshow(I, [low high]) %show all values =< low and >= high
%convert matrix values to intensity values between 0 and 1
I = mat2gray(A,[AMIN AMAX])
@robie2011
robie2011 / Install
Last active November 28, 2017 10:16
# Chocolately
Run as Admin
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Untested
choco install chrome
choco install keepass
@robie2011
robie2011 / gist:719507778e703f4e4b16
Created July 17, 2014 07:26
Powershell Ordner rekursiv nach Backupdatei scannen und darstellen
gci C:\backup\folder | %{
# Root Kundenordner
gci $_.fullname| %{
#Client folder
gci $_.fullname | %{
#$_.fullname
# Client/Application/Subfolder
if( $_.name.tolower().contains("sicherung")){
@robie2011
robie2011 / outlook_scan_calendar.ps1
Created April 30, 2014 14:15
Scan Outlook Calendar Entries (Powershell)
clear
$StartDatum = "01.01.13"
$EndDatum = "01.09.13"
$users = @{ "max müller" = @(); "peter pan" = @(); "mitz mausi" = @(); "fun farah" = @()}
$LookupCalender = "Calendar Name"
$usersKW = $users.Clone()
$outHash = $users.Clone()