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

Kubernetes

Changelog
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md

Dump Kubernetes Objects

Duplicity with S3

Install

sudo apt install -y duplicity python-boto

SSH

duplicity incr --log-file /tmp/duplicity.log /etc/  scp://foo@10.0.1.123//media/etc

S3

vi ~/.boto
[Credentials]
aws_access_key_id = KEY_ID
aws_secret_access_key = SECRET_ACCESS_KEY

# create backup to s3
duplicity full --log-file /tmp/duplicity.log /etc/ s3://s3.example.com/backup/host.examp.eocm/etc/

duplicity list-current-files s3+http://bucket/folder

WebDav

export FTP_PASSWORD="pass1234"
duplicity full \
  --log-file /var/log/duplicity.log /etc \
  webdavs://'user@example.com'@b24-foo.bitrix24.de/company/personal/user/1/disk/path/backup/

Links
http://duplicity.nongnu.org/duplicity.1.html
https://www.privacy-handbuch.de/handbuch_39e1.htm
https://www.digitalocean.com/community/tutorials/how-to-use-duplicity-with-gpg-to-back-up-data-to-digitalocean-spaces

ISP / DSL speedtest Internet connection measurement CLI

Install

curl -sL  https://packagecloud.io/ookla/speedtest-cli/gpgkey | sudo apt-key add -

cat < /etc/apt/sources.list.d/ookla_speedtest-cli.list 
deb https://packagecloud.io/ookla/speedtest-cli/ubuntu/ $(lsb_release -cs) main
deb-src https://packagecloud.io/ookla/speedtest-cli/ubuntu/ $(lsb_release -cs) main
EOF

sudo apt update

sudo apt-get install -y speedtest

Links
https://www.speedtest.net/apps/cli
https://www.speedtest.net/

LXD: Create container with profile (connect to VLAN)

create profile

lxc profile copy default mgmt-dev
# lxc profile list
lxc profile device set mgmt-dev eth0 nictype macvlan
lxc profile device set mgmt-dev eth0 parent mgmt-dev-v4432
lxc profile show mgmt-dev

create container with profile

lxc launch ubuntu:18.04 bionic-mgmt-dev -p mgmt-dev
lxc ls

Enable container nesting

lxc config set bionic-mgmt-dev security.nesting true

Configure IP

cat < /var/lib/lxd/containers/bionic-mgmt-dev/rootfs/etc/netplan/50-cloud-init.yaml
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: no
      addresses: [10.0.0.123/24]
      gateway4: 10.0.0.254
      nameservers:
        addresses: [10.0.0.253, 10.0.1.253]
        search: [lxd, dev]
EOF

Start container

lxc exec bionic-mgmt-dev bash

Ubuntu: Instlal lldpd (Link Layer Discovery Protocol)

sudo apt-add-repository universe
sudo apt install -y lldpd

# optional: enable Cisco CDP protocol
cat < /etc/default/lldpd 
DAEMON_ARGS="-c"
EOF
service lldpd restart

# get info
lldpctl

# get interface / switch / port
lldpctl | egrep "Interface|SysName|PortID"

lldpctl | egrep "Interface|SysName|PortID" | awk -F  ' *: *' '{print $2}' | awk -F  ',' '{print $1}' | paste - - - | \
  egrep "^e" | awk '{print "'"$NODE"'",$1,$2,$4}' | column -t | sort -u -k 1,2

LLDP: Identify switch port to which the server is connected

Show LLDP neighbors

networkctl lldp

lldpctl
http://www.panticz.de/lldpd

for NIC in $(find /sys/class/net -type l -not -lname "*virtual*" -printf "%f\n" | sort); do
    echo "NIC: ${NIC}"
    echo "NIC MAC: $(ethtool -P ${NIC})"
    timeout 300 tcpdump -nn -v -i ${NIC} -s 1500 -c 1 "ether[20:2] == 0x2000"
done

Get host port, switch, switch port assignment

LLDP_JSON=$(lldpctl -f json)

NICS=$(echo ${LLDP_JSON} | jq -r '.lldp.interface[] | select(.[].port.id.type != "mac") | keys[]')
# echo ${NICS}

for NIC in ${NICS}; do
    # echo ${HOSTNAME}
    # echo ${NIC}

    SWITCH_NAME=$(echo ${LLDP_JSON} | jq -r ".lldp.interface[].${NIC} | select(.chassis != null) .chassis | keys[]")
    # echo ${SWITCH_NAME}

    SWITCH_PORT=$(echo ${LLDP_JSON} | jq -r ".lldp.interface[].${NIC} | select(.chassis != null) .port.id.value")
    # echo ${SWITCH_PORT}

    SWITCH_VLAN=$(echo ${LLDP_JSON} | jq -r ".lldp.interface[].${NIC} | select(.chassis != null) .vlan.\"vlan-id\"")
    # echo ${SWITCH_VLAN}

    echo "${HOSTNAME},${NIC},${SWITCH_NAME},${SWITCH_PORT},${SWITCH_VLAN}"
done

Flash LibreELEC to S905X

Latest version
http://kszaq.libreelec.tv/s905/

wget http://kszaq.libreelec.tv/s905/8.2/8.2.3.1/LibreELEC-S905.arm-8.2-8.2.3.1.img.gz -P /tmp/
gzip -d /tmp/LibreELEC-S905.arm-8.2-8.2.3.1.img.gz -C /tmp
dd if=/tmp//tmp/LibreELEC.USB-SD.Creator.Linux-64bit.bin of=/dev/mmcblk0
1. remove power connector from the box
2. insert sd card to to the box
3. press button inside aux connector and connect power to the box
4. enable ssh service on the box
5. ssh root@your_box_ip (pass: libreelec)
6. installtointernal

Links
https://blog.sengotta.net/libreelec-auf-nexbox-a95x-installieren/
https://kszaq.libreelec.tv/s905/
https://coreelec.org/

kexec (reboot without hardware initialization)

echo "kexec-tools kexec-tools/load_kexec select true" | sudo debconf-set-selections

sudo apt install -y kexec-tools
#sudo kexec -l /boot/vmlinuz-4.15.0-32-generic --initrd=/boot/initrd.img-4.15.0-32-generic --reuse-cmdline
#sudo kexec -e
#systemctl kexec

sudo kexec -l /vmlinuz --initrd=/initrd.img --reuse-cmdline && sudo systemctl kexec
- name: Enable kexec
   lineinfile:
     path: /etc/default/kexec
     regexp: '^LOAD_KEXEC='
     line: 'LOAD_KEXEC=true'
   when: ('dev' in group_names)

Test: boot Ubuntu Bionic mini.iso

wget http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso
sudo kexec -l /mnt/linux --initrd=/mnt/initrd.gz
sudo systemctl kexec

Links
https://liranv.github.io/post/booting-memtest86-uefi/

ironic / bifrost

# load env
. /opt/stack/bifrost/env-vars

# list nodes
ironic node-list

# remove / shutdown existing node
ironic node-set-provision-state foo.example.com deleted

# load node configuration
export BIFROST_INVENTORY_SOURCE=/opt/openstack-prepare-baremetal/bifrost/json/foo.example.com.json

# add new node
ansible-playbook -i inventory/bifrost_inventory.py enroll-dynamic.yaml
ironic node-update foo.example.com add properties/capabilities='boot_mode:uefi'

# deploy
ansible-playbook -v -i inventory/bifrost_inventory.py deploy-dynamic.yaml

# show node details
ironic node-show foo.example.com

# cli
#ironic node-set-maintenance 00000000-0000-0000-0000-112233445566 on
openstack baremetal node maintenance set ${NODE_UUID}

ironic node-delete 00000000-0000-0000-0000-112233445566
ironic node-list

ironic node-set-power-state  00000000-0000-0000-0000-112233445566 on

ironic node-set-maintenance ${NODE} on
ironic node-delete ${NODE}
ansible-playbook -i inventory/bifrost_inventory.py enroll-dynamic.yaml
ironic node-update ${NODE add properties/capabilities='boot_mode:uefi'
ansible-playbook -i inventory/bifrost_inventory.py deploy-dynamic.yaml

# log (on ironic server)
tail -f /var/log/daemon.log

# show node state
ironic node-show  node1

# rebuild
ironic node-set-provision-state ${NODE} rebuild

Terraform

Install
https://www.terraform.io/downloads.html

# sudo apt install -y jq

URL=$(wget https://checkpoint-api.hashicorp.com/v1/check/terraform -qO- | jq  -r '.current_download_url + "/" + .product + "_" + .current_version + "_linux_amd64.zip"')
wget ${URL} -qP /tmp
unzip -d /tmp /tmp/${URL##*/}
mv /tmp/terraform ~/.local/bin/

# or deploy global
# sudo mv /tmp/terraform /usr/local/bin/

terraform  version

Debug
https://www.terraform.io/internals/debugging

# enable
export TF_LOG=DEBUG
# disable
export TF_LOG=ERROR

TF_LOG=debug OS_DEBUG=1 terraform apply

CLI

# deploy
terraform init
terraform plan
terraform apply -auto-approve

# format the Terraform files
terraform fmt

# list workspaces
terraform workspace list

# destroy
terraform destroy -auto-approve

Install with Ansible
[embed_url: https://raw.githubusercontent.com/panticz/ansible/master/roles/terraform/tasks/main.yml]

Pagination

  • Previous page
  • 4
  • Next page
linux
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