Skip to content

Instantly share code, notes, and snippets.

{"level":"info","ts":"2025-08-11T10:23:06.328173949Z","msg":"Cluster status","logger":"instance-manager","logging_pod":"cnpg-2","controller":"instance-cluster","controllerGroup":"postgresql.cnpg.io","controllerKind":"Cluster","Cluster":{"name":"cnpg","namespace":"gorilla-test"},"namespace":"gorilla-test","name":"cnpg","reconcileID":"976148ef-3b32-4d00-98ae-862ff0822143","logging_pod":"cnpg-2","currentPrimary":"cnpg-1","targetPrimary":"cnpg-1","isReplicaCluster":false}
{"level":"info","ts":"2025-08-11T10:23:06.33031657Z","msg":"This is an old primary instance, waiting for the switchover to finish","logger":"instance-manager","logging_pod":"cnpg-2","controller":"instance-cluster","controllerGroup":"postgresql.cnpg.io","controllerKind":"Cluster","Cluster":{"name":"cnpg","namespace":"gorilla-test"},"namespace":"gorilla-test","name":"cnpg","reconcileID":"976148ef-3b32-4d00-98ae-862ff0822143","logging_pod":"cnpg-2","currentPrimary":"cnpg-1","targetPrimary":"cnpg-1"}
{"level":"info","ts":"2025-08-11T10:23:06.3304867
@svenakela
svenakela / dashboard.yaml
Created November 4, 2024 20:43
Home Assistant Gauges for Current Measurement
type: vertical-stack
cards:
- type: vertical-stack
cards:
- type: gauge
entity: sensor.p1ib_current_l1
max: 25
segments:
- from: 0
color: "#2980B9"
darktable 4.8.1
Copyright (C) 2012-2024 Johannes Hanika and other contributors.
Compile options:
Bit depth -> 64 bit
Debug -> DISABLED
SSE2 optimizations -> ENABLED
OpenMP -> ENABLED
OpenCL -> ENABLED
Lua -> ENABLED - API version 9.3.0
darktable 4.8.1
Copyright (C) 2012-2024 Johannes Hanika and other contributors.
Compile options:
Bit depth -> 64 bit
Debug -> DISABLED
SSE2 optimizations -> ENABLED
OpenMP -> ENABLED
OpenCL -> ENABLED
Lua -> ENABLED - API version 9.3.0
@svenakela
svenakela / cards.yaml
Created February 17, 2024 21:42
Home Assistant 3 phase gauges
- type: horizontal-stack
cards:
- type: gauge
entity: sensor.p1ib_current_l1
max: 25
segments:
- from: 0
color: '#2980B9'
- from: 3
color: '#48C9B0'
@svenakela
svenakela / terraform.tf
Created November 16, 2023 11:47
Deploy Azure Container Group (Docker) in Private Vnet With Public Access, all in Terraform
# Running a docker container in Azure private virtual network (vnet) with public access
# The container must be in a manually created vnet if you want to do peering to another
# private network. In this config the subnet gives permission to use blob storage for
# the containe group.
#
# Public IP - Load balancer - Backend pool ---- vnet
# | | |
# LB rule | subnet ----- Container group - Docker app
# | | | |
# Probe | Security Group |
@svenakela
svenakela / np48h-apexcharts.yaml
Last active July 6, 2025 07:48
Home Assistant apexcharts-card 48 h Nordpool
# Example screenshot:
- type: custom:apexcharts-card
graph_span: 48h
header:
title: Elpris (kr/kWh)
show: true
experimental:
color_threshold: true
all_series_config:
stroke_width: 1
// Cap everything
"My kid is a stupid jump rat"
.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.substring(1))
.join(' ');
// MLA Style - All words <= 3 chars are lowercase, except first and last word.
// MLA style word matching that always should be lower case. There are combinations as well, like "as long as" and "even if", that should be non cap to be perfect
@svenakela
svenakela / BodyContentLenghtTest.java
Created March 15, 2019 10:40
Get the content length of a body and add it the CONTENT_LENGTH header with Spring's Reactive WebClient
import java.nio.charset.StandardCharsets;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.http.HttpHeaders;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
public class BodyContentLenghtTest {
@svenakela
svenakela / CollectionDuplicateTest.java
Last active May 2, 2019 12:58
Finding duplicates in a list
package barky;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Assertions;