Skip to content

Instantly share code, notes, and snippets.

View kravietz's full-sized avatar

Paweł Krawczyk kravietz

View GitHub Profile
@kravietz
kravietz / scram-sha-256.txt
Last active January 21, 2020 14:25
Switch PostgreSQL 10 to new strong SCRAM-SHA-256 password authentication
postgres@tyler:~$ psql
psql (10.5 (Ubuntu 10.5-1.pgdg16.04+1))
Type "help" for help.
postgres=# show password_encryption;
password_encryption
---------------------
md5
(1 row)
# Docker networking is messy and undocumented. Docker will create IP addresses and iptables at random times.
# This can be limited by using totally static IP addresses for network interfaces and avoiding the default network bridge.
# /etc/default/docker
# DOCKER_OPTS="--iptables=false --ipv6 --bip 172.16.0.1/16 --fixed-cidr 172.16.0.0/16 --fixed-cidr-v6 2a01:9000::/68"
# --bip is the host IP address of the docker0 interface
# --fixed-cidr is the CIDR subnet allocated to the docker0 interface (default network bridge)
# --fixed-cidr-v6 is the IPv6 CIDR allocated to docker0
# for IPv6 split your /64 delegated subnet into /68 subnets and allocate them to each docker-compose.yml subnet:
@kravietz
kravietz / minecraft.service
Created March 13, 2020 22:16
Hardened Minecraft systemd service
[Unit]
Description=Minecraft
Requires=local-fs.target network-online.target
After=local-fs.target network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/java -Xmx768M -Xms500M -jar minecraft_server.jar nogui
WorkingDirectory=/home/minecraft
User=minecraft