Skip to content

Instantly share code, notes, and snippets.

@movd
movd / current_connections.md
Last active February 5, 2019 22:52
Grep all current established network connections

Grep all current established network connections

lsof -i | grep -E "(ESTABLISHED)" | grep -v "localhost" | awk '{print $1, $8, $9}'
@movd
movd / emails_from_ubuntu.md
Created June 6, 2019 11:02
Set up msmtp to send emails emails from Ubuntu/Debian Servers

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 / create_docker_compose_basic_auth_string_for_traefik.sh
Last active January 20, 2024 19:27 — forked from TechupBusiness/create_docker_compose_basic_auth_string_for_traefik.sh
Generator to create basic authentication string for traefik (docker-compose.yml and .env)
#!/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 / DeRancilio.md
Created June 26, 2020 20:50
Delonghi Dedica 680 Rancilio Silvia wand modification (originally created by Chris Faulds)

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_socat_forward_service.sh
Last active November 20, 2020 15:20
Create services for TCP6 to TCP4 forwards with socat
#!/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 / watch_for_prometheus_changes.yaml
Created November 6, 2020 11:57
Hot reload Prometheus only on working config
#!/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 / dynv6-record-fixer.sh
Created March 11, 2021 10:44
Run as a cronjob to restore the `cloud.` DNS record that dynv6.com currently keeps on deleting because of a bug in the system.
#!/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)