Skip to content

Instantly share code, notes, and snippets.

@poltpolt
poltpolt / netplan2NM.sh
Last active April 10, 2024 13:58 — forked from dbkinghorn/netplan2NM.sh
Change Ubuntu 20.04 server netplan to use NetworkManager instead of networkd
#!/usr/bin/env bash
# netplan2NM.sh
# Ubuntu server 20.04 Change from netplan to NetworkManager for all interfaces
echo 'Changing netplan to NetowrkManager on all interfaces'
# backup existing yaml file
cd /etc/netplan
cp 00-installer-config.yaml 00-installer-config.yaml.orig

Snippet from docker-compose:

secrets:
  - source: "docker_secrets_expand"
    target: "/docker_secrets_expand.sh"
    mode: "0555"
  - db_password
environment:
 DB_PASSWORD:DOCKER-SECRET->db_password
@bvis
bvis / README.md
Last active April 12, 2024 04:21
Docker Env Vars expanded with secrets content

Variables by Secrets

Sample script that allows you to define as environment variables the name of the docker secret that contains the secret value. It will be in charge of analyze all the environment variables searching for the placeholder to substitute the variable value by the secret.

Usage

You can define the next environment variables:

@sts
sts / haproxy_maintenance.conf
Last active January 11, 2023 11:12
HAProxy Maintenance Page
#
# Proof of concept for a HAProxy maintenance mode
#
#
# Control the maintenance page during runtime using the stats socket:
#
# To put the whole site in maintenance mode (for all IPs):
# > add acl #0 0.0.0.0/0
#
# To exclude your own ip, so you are able to test things out: