Skip to content

Instantly share code, notes, and snippets.

View JoooostB's full-sized avatar
☁️
Cloudy with a chance of downtime.

Joost Buskermolen JoooostB

☁️
Cloudy with a chance of downtime.
View GitHub Profile
@JoooostB
JoooostB / esp8266-mqtt-doorbell - mqtt:
Last active November 14, 2018 07:02
esp8266-mqtt-doorbell - MQTT
mqtt:
broker: IP
port: 1883
client_id: home_assistant
username: USERNAME
password: PASSWORD
@JoooostB
JoooostB / configuration.yaml
Created November 14, 2018 07:07
esp8266-mqtt-doorbell - sensor:
sensor:
- platform: mqtt
name: "Doorbell"
state_topic: "stat/frontdoor/doorbell"
payload_on: "ringing"
payload_off: "standby"
@JoooostB
JoooostB / transmission_auto_remove.sh
Created January 25, 2019 20:53
Script to automatically remove torrents and delete local data from your Transmission client after seeding for x amount of days (15 by default).
#!/bin/bash
# Enter your username and password for your Transmission instance
USER=username
PASSWD=passw0rd123
# Obtain index ids of completed torrents.
torrent_ids=$(transmission-remote -n $USER:$PASSWD -l\
| awk '$5=="Done"{print $1}')
for index in $torrent_ids; do
@JoooostB
JoooostB / automations.yaml
Created November 14, 2018 07:08
esp8266-mqtt-doorbell - automations:
- alias: Deurbel Notificatie
trigger:
platform: mqtt
topic: stat/frontdoor/doorbell
payload: 'ringing'
action:
- service: notify.pushover
data:
message: "There's someone in front of your door"
title: "Ding Dong!"
@JoooostB
JoooostB / decryptor.py
Created July 5, 2019 09:37
Polybius Square Decryptor - Copenhagen Security Summer Camp - KEA
import re
encrypted = 'ENCODED THINGY HERE'
# Change the cipher accordingly
dict = {
"13": "E",
"33": "T",
"21": "O",
"53": "N",
@JoooostB
JoooostB / traefik-forward-auth.yaml
Created January 26, 2020 16:38
Traefik Forward Auth for Traefik V2 on Kubernetes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: traefik-sso
labels:
app: traefik-sso
spec:
template:
metadata:
labels:
import utime
import struct
import urandom
from ulora import TTN, uLoRa
from machine import Pin
# Refer to device pinout / schematics diagrams for pin details
# (https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436)
LORA_CS = const(18)
LORA_SCK = const(5)
@JoooostB
JoooostB / k8s-postgres-probes.md
Last active June 7, 2022 12:15
Readiness- & Livenessprobes for PostgreSQL on Kubernetes using environment variables

I always end up reinventing the wheel when setting up Readiness- & LivenessProbes for Postgres deployments on Kubernetes, which is why I decided to share it here for others to enjoy too.

As you'd like to use environment variables, make sure to prefix the readiness and liveness commands with bash -c:

readinessProbe:
  exec:
    command: ["bash", "-c", "psql -w -U $POSTGRES_USER -d $POSTGRES_DB SELECT 1"]
  initialDelaySeconds: 15
 timeoutSeconds: 2
@JoooostB
JoooostB / es-docker-hub.yaml
Created October 5, 2022 06:39
ExternalSecret to create Docker Hub- or any other imagePullSecret from AWS Secret Manager
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: es-docker-hub-token
spec:
data:
- remoteRef:
key: /eks/docker-hub-token
secretKey: token
refreshInterval: 1h
@JoooostB
JoooostB / end.gcode
Created December 10, 2022 11:46
Creality Ender 3 V2 GCODE start & end instructions
G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positionning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
M104 S0 ;Turn-off hotend