Skip to content

Instantly share code, notes, and snippets.

@movd
movd / dynv6-record-fixer.sh
Created Mar 11, 2021
Run as a cronjob to restore the `cloud.` DNS record that dynv6.com currently keeps on deleting because of a bug in the system.
View dynv6-record-fixer.sh
#!/usr/bin/env bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
DYNV6_APIBASE="https://dynv6.com/api/v2/zones"
DYNV6_TOKEN=${DYNV6_TOKEN}
DYNV6_CNAME_RECORD=${DYNV6_CNAME_RECORD}
dynv6_zone_name=""
check_dependencies() {
# look for required binaries (taken straight from dehydrated)
@movd
movd / watch_for_prometheus_changes.yaml
Created Nov 6, 2020
Hot reload Prometheus only on working config
View watch_for_prometheus_changes.yaml
#!/usr/bin/env bash
ls /etc/prometheus/*.yml \
| entr bash -c "promtool check config /etc/prometheus/prometheus.yml \
&& curl -X POST 'http://localhost:9090/-/reload'"
@movd
movd / create_socat_forward_service.sh
Last active Nov 20, 2020
Create services for TCP6 to TCP4 forwards with socat
View create_socat_forward_service.sh
#!/usr/bin/env bash
# Forward list of ports from TCP6 to TCP4
if ! [ -x "$(command -v socat)" ]; then
echo 'Error: socat is not installed.' >&2
exit 1
fi
ports=(80 443)
@movd
movd / DeRancilio.md
Created Jun 26, 2020
Delonghi Dedica 680 Rancilio Silvia wand modification (originally created by Chris Faulds)
View DeRancilio.md

This very detailed guide was originally written by Chris Faulds and used to be available at cfdesign.work/derancilio. Unfortunately, his website is no longer online. Thanks to the Wayback Machine the article is still readable. But since the presentation is a bit wonky, I decided to mirror his awesome tutorial is this gist.

Chris has spent a huge amount of time writing an in-depth instruction on how to take the machine apart, which may also come in handy for other repairs for the Dedica 680/685. Again all credits go to him. Thanks a lot for the great work!

DeRancilio Index Banner

Delonghi Dedica 680 Rancilio Silvia wand modification

Monday 1st August 2016

@movd
movd / create_docker_compose_basic_auth_string_for_traefik.sh Generator to create basic authentication string for traefik (docker-compose.yml and .env)
View create_docker_compose_basic_auth_string_for_traefik.sh
#!/usr/bin/env bash
command -v docker >/dev/null 2>&1 || { echo >&2 "I require Docker but it's not installed. Aborting."; exit 1; }
echo "Basic auth for traefik >= v1.7"
read -p "User: " USER
read -p "Password: " PW
# Pull httpd:alpine image (small and includes httpasswd)
docker pull httpd:alpine >/dev/null 2>&1
@movd
movd / emails_from_ubuntu.md
Created Jun 6, 2019
Set up msmtp to send emails emails from Ubuntu/Debian Servers
View emails_from_ubuntu.md

Setting up email with SMTP on Ubuntu/Debian Servers

I used to sift trough my shell history and bookmarks every time I set up a new testing server in order to be able to send mails. So this should help...

Be aware don't use ssmtp anymore. It's unmaintained and has been removed from Debian and Ubuntu will most definitely follow suit.

Install msmtp

@movd
movd / current_connections.md
Last active Feb 5, 2019
Grep all current established network connections
View current_connections.md

Grep all current established network connections

lsof -i | grep -E "(ESTABLISHED)" | grep -v "localhost" | awk '{print $1, $8, $9}'