Skip to content

Instantly share code, notes, and snippets.

@jeroenhe
jeroenhe / update_node.sh
Last active June 19, 2021 20:03
Perform automated update for https://flows.nodered.org/add/node
#!/usr/bin/env bash
RESULT_FILE="/tmp/result.txt"
FILE_WITH_CSRF="/tmp/output.html"
COOKIES_FILE="/tmp/cookies.txt"
MODULE_NAME="node-red-contrib-openhab3"
FLOWS_URL="https://flows.nodered.org/add/node"
# remove any previous cookies
if [ -f "${COOKIES_FILE}" ]; then
@jeroenhe
jeroenhe / check_pass.sh
Created February 3, 2021 12:11
Check whether a linux bcrypt password hash matches with a plain-text password
#!/usr/bin/env bash
read -p "Username >" username
IFS= read -p "Password >" password
salt=$(sudo getent shadow $username | cut -d$ -f3)
epassword=$(sudo getent shadow $username | cut -d: -f2)
match=$(python3 -c 'import crypt; print(crypt.crypt("'"${password}"'", "$6$'${salt}'"))')
echo "salt=$salt"
echo "match=$match"
echo "epassword=$epassword"
@jeroenhe
jeroenhe / Dockerfile
Last active June 3, 2026 06:05
UniFi Network Controller behind a Traefik reverse proxy
FROM traefik:v2.3.2
COPY traefik.yml /etc/traefik/traefik.yml
RUN mkdir /etc/traefik/conf
COPY tls.yml /etc/traefik/conf
COPY http.yml /etc/traefik/conf