Skip to content

Instantly share code, notes, and snippets.

View miklosbagi's full-sized avatar
🇭🇺
¯\_(ツ)_/¯

Miklos Bagi miklosbagi

🇭🇺
¯\_(ツ)_/¯
View GitHub Profile
@miklosbagi
miklosbagi / docker-compose-grpc-health-check.md
Last active May 28, 2024 08:07
Docker Compose gRPC Health

Minimal linux version for all of those gRPC services that don't provide health port.

Example with gripmock

  gripmock:
    image: gripmock/gripmock
    ports:
      - "${STUB_GRPC_PORT}:${STUB_GRPC_PORT}"
 - "${STUB_ADMIN_PORT}:${STUB_ADMIN_PORT}"
@miklosbagi
miklosbagi / docker-compose.yml
Last active May 22, 2024 16:31 — forked from yarchiT/docker-compose.yml
localstack aws s3 bucket docker configuration
services:
localstack:
image: localstack/localstack
ports:
- "4566-4599:4566-4599"
- "8080:8080"
environment:
- SERVICES=s3 # we only need s3 bucket
- DEBUG=1
- DATA_DIR=/tmp/localstack/data # we need this to make our volume work
@miklosbagi
miklosbagi / 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').
docker buildx build --platform linux/amd64,linux/arm64 .
networks:
nexus:
services:
# pre container is used to set the correct permissions on the nexus-data and config dirs
pre:
image: alpine:3.19
volumes:
- ./data:/data
- ./config:/config
@miklosbagi
miklosbagi / uuid_gen.sh
Created February 14, 2023 19:14
UUID gen
od -x /dev/urandom | head -1 | awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}'
@miklosbagi
miklosbagi / keybase.md
Created January 18, 2023 09:59
Keybase proof

Keybase proof

I hereby claim:

  • I am miklosbagi on github.
  • I am miklosbagi (https://keybase.io/miklosbagi) on keybase.
  • I have a public key ASCKgmujYDy14kcwYYJg0uyxLRtahnJHrw98eggqBX9FtQo

To claim this, I am signing this object:

@miklosbagi
miklosbagi / currency_list
Created November 28, 2022 18:06 — forked from champsupertramp/currency_list
World Currency list in PHP Array
array (
'ALL' => 'Albania Lek',
'AFN' => 'Afghanistan Afghani',
'ARS' => 'Argentina Peso',
'AWG' => 'Aruba Guilder',
'AUD' => 'Australia Dollar',
'AZN' => 'Azerbaijan New Manat',
'BSD' => 'Bahamas Dollar',
'BBD' => 'Barbados Dollar',
'BDT' => 'Bangladeshi taka',
@miklosbagi
miklosbagi / robo-root-xore.sh
Created December 8, 2020 16:49
Xiaomi Roborock rootpw decrypt (UART)
#!/bin/bash
[ -z "$1" ] && { echo "Give me the Xiaomi string (e.g. ZNDRTERCGVDD@XES)"; exit 1; }
key="55"; d=""; hex=`echo -n "$1" | od -An -tuC`
for c in $hex; do xor=$(($c^$key)); printf "\\$(printf '%03o' "$xor")"; done; echo