Skip to content

Instantly share code, notes, and snippets.

View Schm1tz1's full-sized avatar
🇺🇦
#StandWithUkraine

Roman Schmitz Schm1tz1

🇺🇦
#StandWithUkraine
View GitHub Profile
@Schm1tz1
Schm1tz1 / grid_scan_batching.sh
Last active February 10, 2023 11:14
Kafka Performance Testing Scripts (Producer / Batching)
#!/usr/bin/env bash
extract_latency() {
echo $1 | tr ',' '\n' | grep 'avg latency' | sed 's/ ms avg latency//g'
}
extract_throughput() {
echo $1 | tr ',' '\n' | grep 'records/sec' | cut -d "(" -f2 | cut -d ")" -f1 | sed 's/ MB\/sec//g'
}
batch_size_arr=(0 10 100 1000 10000 100000 1000000)
@Schm1tz1
Schm1tz1 / command_item_map.txt
Created January 20, 2023 08:38
openHAB Scripts to get vcontrold values and push via REST API
getTempA;Vitodens_Outside_Temp
getTempWWist;Vitodens_WW_Temp
getTempWWsoll;Vitodens_WW_Temp_Set
getBrennerStatus;Vitodens_Brenner_Status
getBrennerStarts;Vitodens_Brenner_Starts
getBrennerStunden1;Vitodens_Brenner_Stunden
getTempAbgas;Vitodens_Brenner_Abgas_Temp
getTempVListM1;Vitodens_Heizung_Vorlauf_Temp
getTempRL17A;Vitodens_Heizung_Ruecklauf_Temp
@Schm1tz1
Schm1tz1 / low-battery-level-detection-notification-for-all-battery-sensors.yaml
Last active January 2, 2025 19:52 — forked from sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors
blueprint:
name: Low battery level detection & notification for all battery sensors
description: Regularly test all sensors with 'battery' device-class for crossing
a certain battery level threshold and if so execute an action.
domain: automation
input:
threshold:
name: Battery warning level threshold
description: Battery sensors below threshold are assumed to be low-battery (as
well as binary battery sensors with value 'on').
@Schm1tz1
Schm1tz1 / publishVito.sh
Created January 5, 2023 21:30
vclient example to publish Vitodens measurements to MQTT
#!/usr/bin/env bash
vclient \
--host localhost:3002 \
--command getTempA,getTempWWist,getTempWWsoll,getBrennerStatus,getBrennerStarts,getBrennerStunden1,getTempAbgas, getTempVListM1,getTempRL17A \
--json-short \
| mosquitto_pub -h <HOST> -p <PORT> -u <USER> -P <PW> -t Viessmann -s
bootstrap.servers=localhost:9092
key.converter=io.confluent.connect.avro.AvroConverter
value.converter=io.confluent.connect.avro.AvroConverter
key.converter.schema.registry.url=http://localhost:8081
value.converter.schema.registry.url=http://localhost:8081
@Schm1tz1
Schm1tz1 / northwind_data.sql
Created September 28, 2022 15:10
Northwind Example DDL and Data
--
-- PostgreSQL database dump
--
SET search_path TO northwind;
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
@Schm1tz1
Schm1tz1 / debezium.yaml
Last active September 28, 2022 16:01
Debezium Example with CFK
---
apiVersion: platform.confluent.io/v1beta1
kind: Connector
metadata:
name: debezium
namespace: confluent
spec:
class: io.debezium.connector.postgresql.PostgresConnector
taskMax: 1
connectClusterRef:
@Schm1tz1
Schm1tz1 / kcat.yaml
Last active October 21, 2022 11:20
Useful k8s tool pods for testing
apiVersion: v1
kind: ConfigMap
metadata:
name: kcat-config
namespace: confluent
data:
kcat.conf: |
bootstrap.servers=kafka.confluent.svc.cluster.local:9092
security.protocol=SASL_PLAINTEXT
sasl.mechanisms=PLAIN

Building Kafka from the Hardware - up

  • Higher Message Retention ? - Increase disk size
  • Higher Message Throughput ? - Increase network capacity
  • Higher Producer Performance ? - Increase Disk I/O speed
  • Higher Consumer Performance ? - Increase Memory

Critical Configurations (Consumer)

  • queued.min.messages
  • fetch.wait.max.ms
  • socket.blocking.max.ms
@Schm1tz1
Schm1tz1 / kubernetes_clients.sh
Last active March 27, 2025 11:44
Package setup script for a debian-based cluster jumphost
#!/usr/bin/env bash
mkdir ~/bin
curl -L "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -o ~/bin/kubectl
chmod +x ~/bin/kubectl