Skip to content

Instantly share code, notes, and snippets.

View thomasstxyz's full-sized avatar

Thomas Stadler thomasstxyz

View GitHub Profile
@thomasstxyz
thomasstxyz / k3s-traefik-ingress-https-redirection.md
Last active December 1, 2022 18:26
Redirect HTTP to HTTPS for the default Ingress controller Traefik for K3s

To enable redirection, you need to deploy a middleware with redirectScheme.

Since this can be referenced from other namespaces, you will create it in the default namespace for ease of sharing.

cat <<EOF > middleware.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
 name: http-redirect
@thomasstxyz
thomasstxyz / tilde-switch.md
Last active April 23, 2023 21:57
Swap tilde ~ key with § on Mac keyboard

Swap tilde key on Mac keyboard

cat << 'EOF' > ~/.tilde-switch && chmod +x ~/.tilde-switch
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
EOF
~/.tilde-switch
# Following commands are supposed to be run interactively.
# This script is not ready for running automated.
apt install -y mariadb-server
vi /etc/mysql/mariadb.conf.d/50-server.cnf
[mysqld]
innodb_file_format = Barracuda
innodb_default_row_format = dynamic
@thomasstxyz
thomasstxyz / FHB-MCCE-INENI-PT-Network-Router-exercise.sh
Last active April 23, 2022 17:34
FHB-MCCE-INENI-PT-Network-Router-exercise
#!/bin/sh
cat << EOF > /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
@thomasstxyz
thomasstxyz / upgrade-postgres-container.md
Created March 13, 2022 16:24
Upgrade docker image postgres from 13 to 14

Guide: Upgrade docker image postgres from 13 to 14

Pull new new images

sudo docker-compose pull

Dump database

sudo docker-compose exec [service_name_of_postgres] pg_dumpall -U [postgres_user] > /tmp/dump.sql