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

Export server volume as image

SERVER_IDS="
dd799bc6-ded0-4f20-8f24-3e5af5250fd3
46562d71-ba00-47b7-872a-cd759abd014c
5e517453-c87f-4426-b705-96ffc9afe4ce
"

function save_image() {
    IMAGE_ID="${1}"
    IMAGE_NAME="${2}"

    echo "IMAGE_ID: ${IMAGE_ID}"
    openstack image set --private ${IMAGE_ID}    

    echo "Save image as ${IMAGE_NAME}.qcow2 ..."
    openstack image save ${IMAGE_ID} --file ${IMAGE_NAME}.qcow2

    openstack image show ${IMAGE_ID} -c size -f value
    ls -l ${IMAGE_NAME}.qcow2
    md5sum ${IMAGE_NAME}.qcow2 > ${IMAGE_NAME}.qcow2.md5sum

    openstack image show ${IMAGE_ID} -f json > ${IMAGE_NAME}.json

    echo "Delete image ${IMAGE_NAME}"
    openstack image delete ${IMAGE_ID}
}


for SERVER_ID in ${SERVER_IDS}; do
    echo "SERVER_ID: ${SERVER_ID}"
    SERVER_JSON=$(openstack server show ${SERVER_ID} -f json)

    SERVER_NAME=$(echo ${SERVER_JSON} | jq -r .name | tr " " "_")
    echo "SERVER_NAME: ${SERVER_NAME}"
    SERVER_STATUS=$(echo ${SERVER_JSON} | jq -r .status)
    echo "SERVER_STATUS: ${SERVER_STATUS}"
    SERVER_IMAGE=$(echo ${SERVER_JSON} | jq -r .image)
    echo "SERVER_IMAGE: ${SERVER_IMAGE}"

    openstack server show ${SERVER_ID} -f json > ${SERVER_ID}.json

    if [ "${SERVER_IMAGE}" != "N/A (booted from volume)" ]; then
        FLAVOR_ID=$(echo ${SERVER_JSON} | jq -r .flavor | cut -d "(" -f2 | cut -d")" -f1)
        FLAVOR_DISK=$(openstack flavor show ${FLAVOR_ID} -c disk -f value)
        echo "FLAVOR_DISK: ${FLAVOR_DISK}"

        IMAGE_NAME="${SERVER_ID}_image_$(date -I)"

        echo "Create image ${IMAGE_NAME} ..."
        IMAGE_ID=$(openstack server image create --wait --name ${IMAGE_NAME} ${SERVER_ID} -c id -f value)

        save_image "${IMAGE_ID}" "${IMAGE_NAME}"
    fi

Node-RED

https://nodered.org/

Termux (run Node-RED on Android)
https://nodered.org/docs/getting-started/android
https://github.com/termux/termux-app

# Install termux
https://github.com/termux/termux-app/releases/download/v0.118.0/termux-app_v0.118.0+github-debug_armeabi-v7a.apk

pkg upgrade
pkg install openssh
whoami
passwd

ssh u0_a114@192.168.178.222 -p 8022
~ $ echo  "ssh-rsa xxxxx" >> ~/.ssh/authorized_keys 

apt update
apt dist-upgrade
apt install -y vim
apt install -y coreutils
#apt install -y nodejs
#apt install -y termux-api
npm install -g node-red

node-red &

npm i node-red-node-ui-table node-red-dashboard

http://192.168.178.222:1880/

Links
https://nodered.org/docs/getting-started/android

Home Assistant

Install Home Assistant as Docker container
https://www.home-assistant.io/installation/linux#platform-installation

docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -e TZ=Europe/Berlin \
  -v homeassistant:/config \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable

# volume path
# /var/lib/docker/volumes/homeassistant

Configure
http://127.0.0.1:8123

Install HACS

sudo docker exec -it homeassistant bash
wget -O - https://get.hacs.xyz | bash -

HACS addons
https://github.com/thomasloven/lovelace-auto-entities - auto-entities (Automatically populate lovelace cards with entities matching certain criteria)
https://github.com/siku2/hass-srf-weather - SRF Weather Home Assistant Integration

Addons / Plugins
LocaTuya: https://github.com/rospogrigio/localtuya/

custom_zha_quirks
https://smarthomescene.com/reviews/tuya-zigbee-single-clamp-energy-meter-review/

sudo docker exec -it homeassistant bash
mkdir /config/custom_zha_quirks
cd /config/custom_zha_quirks
#wget https://raw.githubusercontent.com/zigpy/zha-device-handlers/dev/zhaquirks/tuya/ts0601_din_power.py
wget https://github.com/zigpy/zha-device-handlers/files/11401270/ts0601_din_power.zip
unzip ts0601_din_power.zip 
rm -r __pycache__ ts0601_din_power.zip

cat<>/config/configuration.yaml
zha:
  enable_quirks: true
  custom_quirks_path: /config/custom_zha_quirks
EOF

# Restart Home Assistant
Developer Tools > Restart > Restart Home Assistant

Docker update

sudo docker pull ghcr.io/home-assistant/home-assistant:stable
sudo docker stop homeassistant
sudo docker rename homeassistant homeassistant.$(date -I)
sudo docker run -d \
  --name homeassistant \
  --privileged \
  --restart=unless-stopped \
  -e TZ=MY_TIME_ZONE \
  -v /PATH_TO_YOUR_CONFIG:/config \
  --network=host \
  ghcr.io/home-assistant/home-assistant:stable

Dashboard
https://www.home-assistant.io/dashboards/

API

Zigbee / SmartHome

Devices
https://zigbee.blakadder.com/search.html

ZHA (Zigbee Home Automation)
https://www.home-assistant.io/integrations/zha/#known-working-zigbee-radio-modules
https://www.home-assistant.io/integrations/zha/

Aubess Power Monitor Switch 16A Switch Module BK7231N (BL0942)
https://www.elektroda.com/rtvforum/topic3912748.html
https://templates.blakadder.com/aubess_power_monitor_switch.html
https://www.elektroda.com/rtvforum/topic3951016.html
https://openbekeniot.github.io/webapp/devicesList.html
https://www.elektroda.com/rtvforum/topic3895572.html#20033093
https://www.elektroda.com/rtvforum/topic3912748.html
https://www.elektroda.com/rtvforum/topic3887748.html#20266899
https://github.com/openshwprojects/OpenBK7231T_App
https://github.com/tuya-cloudcutter/tuya-cloudcutter
https://www.youtube.com/@elektrodatv
https://www.elektroda.com/rtvforum/topic3887748-90.html
https://newreleases.io/project/github/openshwprojects/OpenBK7231T_App/release/1.14.119
https://github.com/openshwprojects/BK7231GUIFlashTool

Tuya
Login: https://iot.tuya.com/
API Explorer: https://eu.iot.tuya.com/cloud/explorer
Service / License: https://www.tuya.com/vas/commodity/IOT_CORE_V2
www.tuya.com/vas/user/service

custom ZHA quirks
https://smarthomescene.com/reviews/tuya-zigbee-single-clamp-energy-meter-review/?unapproved=4798&moderation-hash=ece87e207d73a3452151608ea851834d#comment-4798
https://github.com/zigpy/zha-device-handlers/issues/1973#issuecomment-1668617636

ZG-204ZV HOBEIAN
https://gist.github.com/vinzent/2cd645b848fd3b6a0c3e5762956ec89f#file-zg-204zm-py

homebridge

cat < docker-compose.yml 
version: '2'
services:
  homebridge:
    image: oznu/homebridge:latest
    restart: always
    network_mode: host
    volumes:
      - ./volumes/homebridge:/homebridge
    logging:
      driver: json-file
      options:
        max-size: "10mb"
        max-file: "1"
EOF

sudo docker-compose up -d

Setup
http://localhost:8581

Tuya
https://github.com/0x5e/homebridge-tuya-platform

npm install @0x5e/homebridge-tuya-platform

Yamaha
https://github.com/cgierke/homebridge-musiccast

Links
https://github.com/homebridge/homebridge/wiki/Install-Homebridge-on-Docker

Migrate OpenStack VM with encrypted volume

SERVER_ID=xxxx-xxxx-xxxx-xxxx-xxxx

# VOLUME_ID=$(openstack server show ${SERVER_ID} -c volumes_attached -f value | cut -d "'" -f4)
# VOLUME_TYPE=$(openstack volume show ${VOLUME_ID} -c type -f value)
# openstack volume type show ${VOLUME_TYPE}

# add admin to project
PROJECT_ID=$(openstack server show ${SERVER_ID} -c project_id -f value)
openstack role add --user admin --project ${PROJECT_ID} admin
unset OS_PROJECT_DOMAIN_NAME
unset OS_PROJECT_NAME
export OS_PROJECT_ID=${PROJECT_ID}

# Live migrate VM
openstack server migrate --os-compute-api-version 2.56 --live-migration --wait --host com10-prod ${SERVER_ID}
openstack server show ${SERVER_ID} -c name -c OS-EXT-SRV-ATTR:host

# remove admin from project
unset OS_PROJECT_ID
source /etc/kolla/admin-openrc.sh
openstack role remove --user admin --project ${PROJECT_ID} admin

Allow project to use encrypted volume

openstack volume type set --project ${PROJECT_ID} ${VOLUME_TYPE_ID}

MultiBootUSB

DEVICE=/dev/sdb
VOLUME=MultiBootUSB

# create filesystem on usb pen
sudo mkfs.vfat -n ${VOLUME} ${DEVICE}1

# mount usb
mount ${DEVICE}1 /mnt/

# install grub2 on usb pen
grub-install --no-floppy --root-directory=/mnt ${DEVICE}

# create grub config
cat < /mnt/boot/grub/grub.cfg
menuentry "Ubuntu Live 11.04 64bit" {
        loopback loop /boot/iso/ubuntu-11.04-desktop-amd64.iso
        linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-11.04-desktop-amd64.iso noeject noprompt --
        initrd (loop)/casper/initrd.lz
}

menuentry "Ubuntu Live 9.10 32bit" {
 loopback loop /boot/iso/ubuntu-9.10-desktop-i386.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-9.10-desktop-i386.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}

menuentry "Ubuntu Live 9.10 64bit" {
 loopback loop /boot/iso/ubuntu-9.10-desktop-amd64.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-9.10-desktop-amd64.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}

menuentry "Grml small 2009.10" {
  loopback loop /boot/iso/grml-small_2009.10.iso
  linux (loop)/boot/grmlsmall/linux26 findiso=/boot/iso/grml-small_2009.10.iso apm=power-off lang=us vga=791 boot=live nomce noeject noprompt --
  initrd (loop)/boot/grmlsmall/initrd.gz
}

menuentry "tinycore" {
 loopback loop /boot/iso/tinycore_2.3.1.iso
 linux (loop)/boot/bzImage --
 initrd (loop)/boot/tinycore.gz
}

menuentry "Netinstall 32 preseed" {
  loopback loop /boot/iso/mini.iso
  linux (loop)/linux auto url=http://www.panticz.de/pxe/preseed/preseed.seed locale=en_US console-setup/layoutcode=de netcfg/choose_interface=eth0 debconf/priority=critical --
  initrd (loop)/initrd.gz
}

menuentry "debian-installer-amd64.iso" {
  loopback loop /boot/iso/debian-installer-amd64.iso
  linux (loop)/linux vga=normal --
  initrd (loop)/initrd.gz
}

menuentry "BackTrack 4" {
 linux /boot/bt4/boot/vmlinuz BOOT=casper boot=casper nopersistent rw vga=0x317 --
 initrd /boot/bt4/boot/initrd.gz
}

menuentry "Memory test (memtest86+)" {
 linux16 /boot/img/memtest86+.bin
}

menuentry "BackTrack ERR" {
 loopback loop /boot/iso/bt4-pre-final.iso
 linux (loop)/boot/vmlinuz find_iso/filename=/boot/iso/bt4-pre-final.iso BOOT=casper boot=casper nopersistent rw vga=0x317--
 initrd (loop)/boot/initrd.gz
}          

menuentry "XBMC ERR" {
 loopback loop /boot/iso/XBMCLive.iso

Create application credentials as Openstack admin for federated user(s)

Single user

# user OS_TOKEN
export OS_TOKEN=gAAAAABjtUl_4LZr3iNqI7dOoBYMw-...

# cat ~/.config/openstack/clouds.yaml
clouds:
  dev-admin-token:
    auth:
      auth_url: https://keystone.service.examle.com/v3
    region_name: "eu-south"
    interface: "public"
    identity_api_version: 3
    project_domain_name: "my-foo"
    project_name: "foo"
    auth_type: "v3token"

OS_AC=$(openstack application credential create ${OS_AC_NAME} --unrestricted --os-cloud dev-admin-token -f json)

Multiple user

OpenStack: Authentificaton (Token, Application credendials)

Token authentificaton

unset $(compgen -v | grep OS_)

export OS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

export OS_AUTH_TYPE=v3token
export OS_AUTH_URL=https://keystone.service.example.com/v3
export OS_IDENTITY_API_VERSION=3
export OS_INTERFACE=public
export OS_REGION_NAME=de-b1
export OS_PROJECT_DOMAIN_NAME=test-domain
export OS_PROJECT_NAME=test-project
#export OS_PROJECT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

OpenStack multi cloud / user configurattion
http://www.panticz.de/openstack-clouds-config

Pyton pyenv & virtualenv

List available pyenv versions
https://www.python.org/ftp/python/

pyenv install --list

virtualenv

pip install -U virtualenv --user
mkdir -vp ~/test
cd ~/test
virtualenv .venv
source .venv/bin/activate
pip install -U pip
pip install -U python-openstackclient

Pyenv and virtualenv

sudo apt install -y git build-essential libbz2-dev libreadline-dev libssl-dev zlib1g-dev libsqlite3-dev wget curl libncurses5-dev libncursesw5-dev xz-utils libffi-dev liblzma-dev

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init --path)"\n  eval "$(pyenv init -)"\n  eval "$(pyenv virtualenv-init -)"\nfi' >> ~/.bashrc

exec "$SHELL"  # or re-login

pyenv install 3.8.12
pyenv local 3.8.12
pyenv virtualenv 3.8.12 kolla-ansible-xena
pyenv activate kolla-ansible-xena

pyenv --version
pyenv virtualenvs
pyenv versions

pip install -U pip
pip install -U 'ansible<2.10'
pip install -r requirements.txt
# python setup.py install

Global pyenv configuration

# /etc/bash.bashrc

export PYENV_ROOT=/usr/local/pyenv
if command -v pyenv 1>/dev/null 2>&1; then
  export PATH="$PYENV_ROOT/bin:$PATH"
  eval "$(pyenv init - --no-rehash)"
  eval "$(pyenv virtualenv-init -)"
fi

Deploy pyenv with ansible role
https://github.com/staticdev/ansible-role-pyenv

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