Skip to content

Instantly share code, notes, and snippets.

@valtzu
valtzu / k8s-demo-app.yaml
Created September 28, 2022 19:01
Kubernetes demo app
apiVersion: v1
kind: Namespace
metadata:
name: demo-app
---
apiVersion: v1
kind: ConfigMap
metadata:
name: php-src
namespace: demo-app
@valtzu
valtzu / import-ssh-public-key-from-eeprom
Created April 12, 2024 19:00
How to load authorized ssh public key from Raspberry Pi 4B bootloader
#!/bin/bash
# Include this in the image at /usr/lib/systemd/system-generators/
key=/sys/bus/nvmem/devices/rmem1/nvmem
normal_dir=$1
[ -e $key ] || exit 0
n_reverse=$(od -An -N256 -vtx1 -w1 $key | tr -d '\n ')
for (( i=0; i<512; i=i+2 )) ; do n="${n_reverse:$i:2}$n" ; done
@valtzu
valtzu / create-https-boot-flasher-image.sh
Last active April 24, 2024 20:58
Raspberry PI 4B HTTPS BOOT
# Please comment below if you found this useful :)
# Create RSA signing key (that would later be used to create boot.sig served over https)
openssl genrsa -out private-key.pem 2048
openssl rsa -in private-key.pem -pubout -out public-key.pem
# Create TLS cert (ec_key.pem & cert.der should be configured to the webserver of your choice)
openssl ecparam -out ec_key.pem -name secp384r1 -genkey
openssl req -new -key ec_key.pem -x509 -nodes -days 3650 -out cert.der -outform der
@valtzu
valtzu / compose.yml
Created May 11, 2024 09:18
Minimal single-container Kafka setup for docker compose
services:
kafka:
image: confluentinc/cp-kafka:7.6.1
environment:
CLUSTER_ID: 'AAAAAAAAAAAAAAAAAAAAAA=='
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENERS: CONTROLLER://kafka:9093,EXTERNAL://kafka:9092
@valtzu
valtzu / renovate.json
Created June 15, 2024 19:14
Symfony Asset Mapper renovate config
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"enabledManagers": ["custom.regex"],
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^importmap\\.php$"],
"matchStrings": ["'(?<packageName>.+?)'\\s*=>\\s*\\[[^]]*'version'\\s*=>\\s*'(?<currentValue>.+?)'"],
"datasourceTemplate": "npm"