Skip to content

Instantly share code, notes, and snippets.

@jakzal
jakzal / 1 Readme.md
Last active December 13, 2023 21:18
Nextcloud behind Cloudflare on a Raspberry PI
@jakzal
jakzal / 00 - Object-oriented event sourcing.adoc
Last active November 30, 2023 14:17
Object-oriented event sourcing
@jakzal
jakzal / 00 - Deriving state from events.adoc
Last active November 30, 2023 14:17
Deriving state from events
@jakzal
jakzal / Singleton.java
Created March 23, 2023 10:32
Singleton Supplier
package com.kaffeinelabs.function;
import java.util.function.Supplier;
public class Singleton<T> implements Supplier<T> {
private final Supplier<? extends T> factory;
private T instance = null;
private Singleton(final Supplier<? extends T> factory) {
this.factory = factory;
@jakzal
jakzal / DebeziumContainers.java
Created January 9, 2023 13:19
Learn how to run Debezium with PostgreSQL and Kafka with Junit 5
package com.kaffeinelabs.debezium;
import io.debezium.testing.testcontainers.DebeziumContainer;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.KafkaContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.lifecycle.Startable;
import org.testcontainers.utility.DockerImageName;
@jakzal
jakzal / README.md
Created January 12, 2022 14:42
OpenSearch terraform configuration for local development
@jakzal
jakzal / Dockerfile
Last active January 2, 2022 22:10
MiTemperature2 / Home Assistant / MQTT
ARG PYTHON_VERSION=3.10
ARG BASE_IMAGE=python:${PYTHON_VERSION}-slim
ARG MITEMP_TARGET_DIR=/mitemp2
FROM ${BASE_IMAGE} AS builder
ARG MITEMP_TARGET_DIR
ENV PATH=$MITEMP_TARGET_DIR/bin:$PATH
RUN apt-get update && apt-get install -y --no-install-recommends build-essential gcc git libglib2.0-dev && rm -rf /var/lib/apt/lists/*
@jakzal
jakzal / 1-HOWTO.md
Last active November 22, 2023 11:47
Raspberry PI 4 / RaspBee II / Docker / Home Assistant

Raspberry Pi OS installation

Install Raspberry Pi OS Lite 64bit with the Raspberry Pi Imager.

Enable ssh with key authentication, change the host name, set the user password, the WiFi password. etc.

Configuration

  1. Boot the Pi.
@jakzal
jakzal / CertificateExtension.java
Created July 23, 2021 12:32
JUnit extension to generate certificates
package com.kaffeinelabs.test.extension;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.stream.Collectors;