Skip to main content

Primary links

  • Home
  • AI
  • Kubernetes
  • Incus
  • Ansible
  • Terraform
  • OpenStack
  • Virtualization
  • Linux
  • SmartHome
  • HowTo

Misc

  • Linux
  • Hardware
  • Programming
  • Databases
  • Multimedia
  • Windows

Cloud

  • OpenStack
  • cloud-config
  • nextcloud

Virtualization

  • Virtualization
  • Incus
  • Docker
  • KVM
  • Kubernetes
  • LXC
  • LXD
  • QEMU
  • VMware
  • VirtualBox
  • multipass
  • podman
  • vagrant
  • XEN

Network

  • DNS
  • Firewall
  • Linux
  • OpenvSwitch
  • SSL
  • VLAN
  • VPN
  • iPXE
  • namespaces
  • nmcli
  • tcpdump

Storage

  • CEPH
  • DRBD
  • LVM
  • S3
  • ZFS
  • btrfs

Automation / CI/CD

  • Install
  • Ansible
  • GitLab
  • LLM
  • Preseed
  • Puppet
  • Terraform
  • Ubuntu autoinstall

Monitoring / Visualisation

  • Grafana
  • Icinga
  • Prometheus
  • Monitoring
  • ELK
  • mermaid

Incus Terraform

Enable Incus remote API authentication
http://www.panticz.de/incus

Terraform main.tf

terraform {
  required_providers {
    incus = {
      source = "lxc/incus"
    }
  }
}

provider "incus" {
  # generate_client_certificates = true
  # accept_remote_certificate    = true

  remote {
    name    = "10.0.1.104"
    scheme  = "https"
    address = "10.0.1.104"
    token   = "xxxxxxxxxxxxxxxxxxxxxxxxxx"
    default = true
  }
}

data "template_file" "user_data" {
  template = <

<strong>Deploy</strong>
<code>
terraform init
terraform apply -auto-approve

Links
https://registry.terraform.io/providers/lxc/incus/latest/docs
https://github.com/lxc/terraform-provider-incus
https://discuss.linuxcontainers.org/t/issues-with-private-network-and-cloud-init-using-tf-incus-and-images-debian-12-cloud/19196/3

Mosquitto MQTT server

Install
https://www.howtoforge.de/anleitung/so-installierst-du-mosquitto-mqtt-server-unter-ubuntu-22-04/

sudo apt-get install -y curl gnupg2 wget git apt-transport-https ca-certificates software-properties-common
sudo add-apt-repository -y ppa:mosquitto-dev/mosquitto-ppa
sudo apt install mosquitto mosquitto-clients -y

sudo mosquitto_passwd -c -b /etc/mosquitto/passwd foo pass1234
# todo sudo
cat < /etc/mosquitto/conf.d/default.conf
listener 1883
password_file /etc/mosquitto/passwd
EOF
chmod a+r /etc/mosquitto/passwd

sudo systemctl restart mosquitto

Debug MQTT
http://mqtt-explorer.com/
https://snapcraft.io/install/mqtt-explorer/ubuntu#install

sudo snap install mqtt-explorer

Tasmota Smart Meter Interface

ESP8266 / ESP32 Tasmota images and decumentation
https://ottelo.jimdofree.com/stromz%C3%A4hler-auslesen-tasmota/#Downloads
https://www.wispr-shop.de/produkt/wifi-ir-schreib-lesekopf-diy-set/

Smart Meter Interface configruation scripts
https://tasmota.github.io/docs/Smart-Meter-Interface/#emh-ehz-generation-k-sml

>D
>B

=>sensor53 r
>M 1
+1,3,s,0,9600,
1,77070100010800ff@1000,Total consumption,kWh,total_in,2
1,77070100020800ff@1000,Total feed-in,kWh,total_out,2
1,77070100100700ff@1,Power,W,power_curr,0
#

Tasmota Diagramme
https://github.com/ottelo9/tasmota-sml-script/

Tasmota Script Language Support
https://marketplace.visualstudio.com/items?itemName=StefanoBertini.tasmota-script-support#Automatic-script-upload

Firmware
https://github.com/ottelo9/tasmota-sml-images/releases

Run Ansible from Terraform

Prerequisites
- Terraform instalation
- Ansible instalation
- OpenStack application credentials (~/.config/openstack/clouds.yaml)
- OpenStack security group with allow ingress traffic to TCP 22 (SSH) from terraform node

main.tf

terraform {
  required_providers {
    openstack = {
      source = "terraform-provider-openstack/openstack"
    }

    ansible = {
      source = "ansible/ansible"
    }
  }
}

provider "openstack" {
  cloud = "test-application-credentials"
}

data "openstack_compute_keypair_v2" "keypair_1" {
  name = "test-keypair"
}

data "openstack_networking_network_v2" "network_1" {
  name = "test-network"
}

data "openstack_networking_secgroup_v2" "secgroup_1" {
  # Ensure that the security group allow ingress to TCP 22 (SSH) from terraform node
  name = "test-secgroup" 
}

data "openstack_networking_port_v2" "port_1" {
  device_id  = openstack_compute_instance_v2.instance_1.id
  network_id = openstack_compute_instance_v2.instance_1.network.0.uuid
}

# data "template_file" "user_data" {
#   template = <

<strong>test-playbook.yml</strong>
<code>
---
- name: Deploy webserver(s)
  hosts: www
  # remote_user: ubuntu
  gather_facts: no
  become: true
  pre_tasks:
    - name: Wait util host is reachable by SSH
      wait_for_connection:
        timeout: 300

    - name: Gether facts
      setup:
  tasks:
    - name: Install nginx
      apt:
        update_cache: yes
        name:
          - nginx

Deploy

terraform init
terraform apply -auto-approve

Ansible Provider
https://github.com/ansible/terraform-provider-ansible
https://registry.terraform.io/providers/ansible/ansible/latest/docs

Links
https://www.redhat.com/en/blog/providing-terraform-with-that-ansible-magic

Incus

OPTINAL: Uninstall LXD

snap remove lxd

Incus installation
https://github.com/zabbly/incus
https://linuxcontainers.org/incus/docs/main/installing/

curl -fsSL https://pkgs.zabbly.com/key.asc | gpg --show-keys --fingerprint

mkdir -p /etc/apt/keyrings
curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc

# Add incus stable repository
sh -c 'cat < /etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc

EOF'

apt-get update
apt-get install -y incus bash-completion #incus-tools

# OPTIONAL: add default ubuntu user to incus group
sudo usermod -aG incus-admin ubuntu
newgrp incus-admin

# fixme
# incus completion fish

Prerequisits (ZFS filesystem)

# ZFS (optional)
sudo apt install -y zfsutils-linux
sudo lvcreate --name storage --size 100G ubuntu-vg
sudo zpool create rpool /dev/ubuntu-vg/storage
sudo zpool set autotrim=on rpool
sudo zfs create rpool/incus

Install Incus with Ansible

Designate as authenticator for Lets Encrypt

Prerequisites
Install OpenStack CLI client (OSC)
http://www.panticz.de/osc

OpenStack Application credentials
~/.config/openstack/clouds.yaml

Generate Lets Encrypt certificate

sudo apt install -y certbot

pyenv activate osc
pip install python-designateclient certbot-dns-openstack zope

# list available zones
openstack zone list

# Create letsencrypt directory
mkdir ~/letsencrypt

# Request wildcard certificate
DOMAIN=example.com
certbot -a dns-openstack certonly \
    --agree-tos \
    --register-unsafely-without-email \
    --work-dir ~/letsencrypt/work \
    --config-dir ~/letsencrypt/etc \
    --logs-dir ~/letsencrypt/log \
    --dns-openstack-propagation-seconds 60 \
    -d *.${DOMAIN}
#    -d *.example.com,example.com

# List certificates
ls -l ~/letsencrypt/etc/archive/*/*

DEBUG (second terminal)

watch -n1 openstack recordset list example.com

Links
https://docs.binero.com/guides/designate-as-authenticator-for-lets-encrypt.html
https://letsencrypt.org/docs/challenge-types/

Create OpenStack DualStack or IPv6 only VM

# Create router
openstack router create test-router1 \
  --centralized \
  --ha \
  --external-gateway public

# Show available tenant IPv6 subnet
openstack subnet pool list --share | grep tenant-subnet-pool-v6

# Create network
openstack network create test-network1

# DUAL-STACK: Create IPv4 subnet (skip for IPv6 only)
openstack subnet create test-subnet1-ipv4 \
  --network test-network1 \
  --subnet-range 10.11.12.0/24

# DUAL-STACK: Attach IPv4 subnet to router (skip for IPv6 only)
openstack router add subnet test-router1 test-subnet1-ipv4

# Create IPv6 subnet
openstack subnet create test-subnet1-ipv6 \
  --network test-network1 \
  --ip-version 6 \
  --subnet-pool tenant-subnet-pool-v6 \
  --prefix-length 64 \
  --ipv6-ra-mode dhcpv6-stateless \
  --ipv6-address-mode dhcpv6-stateless

# Attach IPv6 subnet to router
openstack router add subnet test-router1 test-subnet1-ipv6

# OPTINAL: allow access from outside
SECURITY_GROUP=test-secgroup
openstack security group create ${SECURITY_GROUP}

# DUAL-STACK: allow access to Floating FIP from outside (skip for IPv6 only)
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv4 --protocol icmp --ingress --remote-ip 0.0.0.0/0
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv4 --protocol icmp --egress --remote-ip 0.0.0.0/0
openstack security group rule create ${SECURITY_GROUP} --ethertype IPv4 --protocol tcp --dst-port 22 --remote-ip 0.0.0.0/0

OpenStack VPNaaS with multiple subnets

LEFT (DEV env)

mermaid - diagram renderer markdown

Mermaid Live editor
https://www.mermaidchart.com/play
https://mermaid-js.github.io/mermaid-live-editor/edit

Documentation
https://mermaid.js.org/syntax/flowchart.html
https://jojozhuang.github.io/tutorial/mermaid-cheat-sheet/

Integration in MkDocks
https://squidfunk.github.io/mkdocs-material/reference/diagrams/

Examples

flowchart TB

	%% Colors %%
		linkStyle default stroke-width:3px
		classDef white fill:white,stroke:#000,stroke-width:2px,color:#000
		classDef yellow fill:#fffd75,stroke:#000,stroke-width:2px,color:#000
		classDef green fill:#93ff75,stroke:#000,stroke-width:2px,color:#000

	%% Databases %%
		DOCS("<img width="40">"):::white
		NOTES("<img width="40">"):::white
		TASKS("<img width="40">"):::white

	%% Documents Database %%

		DOCS ---- DOCTYPE("<img width="25"> Type"):::yellow
		DOCS ---- DOCCREATEDBY("<img width="25"> Created By"):::yellow

			%% Documents to Tasks %%

				DOCS --- DOCTASKS("<img width="25"> Tasks"):::green
				DOCTASKS --- TASKS

			%% Documents to Notes %%

				DOCS --- DOCNOTE("<img width="25"> Notes"):::green
				DOCNOTE --- NOTES

		DOCS ---- DOCSTATUS("<img width="25"> Status"):::yellow
		DOCS ---- DOCCREATEDTIME("<img width="25"> Created Time"):::yellow

	%% Links %%
		click DOCS "https://redgregory.notion.site/c154907e263f48fe979a792588f3875a?v=2aabab98f87f479da4b9a66d86d61b50"
		click NOTES "https://redgregory.notion.site/89bb914e098041e2bee59b8f3aa09e73?v=9d216b2217c041d3a16c9460062847f2"
		click TASKS "https://redgregory.notion.site/82b9e09f12b747f4b92604598d38084b?v=3b53f53088f344d99bda1e2682e52f54"



    n5@{ icon: "azure:virtual-router"} <--> n6["foo"]

mermaid CLI
https://github.com/mermaid-js/mermaid-cli

mmdc -i input.mmd -o output.svg

Alternative
https://diagrams.mingrammer.com/docs/getting-started/examples

Docker Pi-hole

Install as Docker container
https://github.com/pi-hole/docker-pi-hole/blob/master/examples/docker_run.sh

mkdir  /mnt/data/pihole
chmod 777 /mnt/data/pihole

PIHOLE_BASE=/mnt/data/pihole

docker run -d \
    --name pihole \
    -p 53:53/tcp \
    -p 53:53/udp \
    -p 8081:80 \
    -e TZ="Europe/​Berlin" \
    -v "${PIHOLE_BASE}/etc-pihole:/etc/pihole" \
    -v "${PIHOLE_BASE}/etc-dnsmasq.d:/etc/dnsmasq.d" \
    --dns=127.0.0.1 \
    --dns=1.1.1.1 \
    --restart=unless-stopped \
    --hostname pi.hole \
    -e VIRTUAL_HOST="pi.hole" \
    -e PROXY_LOCATION="pi.hole" \
    -e FTLCONF_LOCAL_IPV4="127.0.0.1" \
    pihole/pihole:latest


printf 'Starting up pihole container '
for i in $(seq 1 20); do
    if [ "$(docker inspect -f "{{.State.Health.Status}}" pihole)" == "healthy" ] ; then
        printf ' OK'
        echo -e "\n$(docker logs pihole 2> /dev/null | grep 'password:') for your pi-hole: http://${IP}/admin/"
        exit 0
    else
        sleep 3
        printf '.'
    fi

    if [ $i -eq 20 ] ; then
        echo -e "\nTimed out waiting for Pi-hole start, consult your container logs for more info (\`docker logs pihole\`)"
        exit 1
    fi
done;

Login
http://ha:8081/admin/login.php

Links
https://github.com/pi-hole/docker-pi-hole/?tab=readme-ov-file#running-pi-hole-docker

Pagination

  • First page
  • Previous page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • …
  • Next page
  • Last page
Profiles GitHub StackOverflow LinkedIn Xing
Contact Imprint
© panticz 2026

Cookie-Einstellungen

Diese Website nutzt eingebettete Inhalte von Drittanbietern (z.B. YouTube, SoundCloud). Beim Laden dieser Inhalte werden Daten an die jeweiligen Anbieter übermittelt. Datenverarbeitungserklärung