Create LetsEncrypt wildcard certificate with LEGO and OpenStack Designate

Download LEGO binary
https://github.com/go-acme/lego/releases/

LEGO_VERSION=$(curl -s https://api.github.com/repos/go-acme/lego/releases/latest | grep '"tag_name"' | cut -d'"' -f4)
curl -L "https://github.com/go-acme/lego/releases/download/${LEGO_VERSION}/lego_${LEGO_VERSION}_linux_amd64.tar.gz" | tar -xz

Request certificate

DOMAIN=example.com
 
export OS_CLOUD=os-project1
export DESIGNATE_ZONE_NAME="${DOMAIN}."
export OS_REGION_NAME=de-de1
 
./lego run \
  --email foo@${DOMAIN} \
  --accept-tos \
  --dns designate \
  --domains "*.${DOMAIN}" \
  --domains ${DOMAIN}

List certificates

ls -l .lego/certificates

Convert to p12 file

openssl pkcs12 -passout "pass:" -export -in _.${DOMAIN}.crt -inkey _.${DOMAIN}.key -out _.${DOMAIN}.p12

Debug

JOY-IT JT-DPM8624 modbus control with ESP8266

/home/pako/xserver-xorg-video-ati-6.6.3# fakeroot ./debian/rules binary

mkdir stampdir
>stampdir/stampdir
if [ ! -e stampdir/patches ]; then \
mkdir stampdir/patches; \
ln -s stampdir/patches .pc; \
echo 2 >stampdir/patches/.version; \
fi; \
if [ ! -e stampdir/log ]; then \
mkdir stampdir/log; \
fi; \
if [ ! -e patches ]; then \
ln -s debian/patches patches; \
fi; \
>stampdir/prepare
if ! [ `which quilt` ]; then \
echo "Couldn't find quilt.

gPlugM integration in Home Assistant

Manufacter
https://gplug.ch/produkte/gplugm/

Installation
https://gplug.ch/installationsanleitung/gplugmt/

configuration.yaml
https://gplug.ch/blog/integration-gplugm-in-home-assistant/
https://gplug.ch/blog/integration-gplug-in-home-assistent/

homeassistant:
  customize_glob:
    sensor.gplugm_z_ei:
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00
    sensor.gplugm_z_ei1:
      unit_of_measurement: "kWh"
    sensor.gplugm_z_ei2:
      unit_of_measurement: "kWh"
    sensor.gplugm_z_eo:
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00
    sensor.gplugm_z_eo1:
      unit_of_measurement: "kWh"
    sensor.gplugm_z_eo2:
      unit_of_measurement: "kWh" 
    sensor.gplugm_z_i1:
      unit_of_measurement: "A"
    sensor.gplugm_z_i2:
      unit_of_measurement: "A"
    sensor.gplugm_z_i3:
      unit_of_measurement: "A"
    sensor.gplugm_z_v1:
      unit_of_measurement: "V"
    sensor.gplugm_z_v2:
      unit_of_measurement: "V"
    sensor.gplugm_z_v3:
      unit_of_measurement: "V"
    sensor.gplugm_z_pi:
      unit_of_measurement: "kW"
    sensor.gplugm_z_po:
      unit_of_measurement: "kW"
 
utility_meter:
  energy_in_daily:
    source: sensor.gplugm_z_ei
    cycle: daily
  energy_in_weekly:
    source: sensor.gplugm_z_ei
    cycle: weekly
  energy_in_monthly:
    source: sensor.gplugm_z_ei
    cycle: monthly
  energy_in_yearly:
    source: sensor.gplugm_z_ei
    cycle: yearly

k9s

Install k9s
https://github.com/derailed/k9s/releases

RELEASE=$(curl -s https://api.github.com/repos/derailed/k9s/releases/latest | jq -r .tag_name)
wget -q https://github.com/derailed/k9s/releases/download/${RELEASE}/k9s_linux_amd64.deb -P /tmp/
sudo dpkg -i /tmp/k9s_linux_amd64.deb

Install k9s with Ansible
https://github.com/derailed/k9s/releases

- hosts: localhost
  tasks:
    - name: Install k9s from https://github.com/derailed/k9s/releases
      become: true
      block:
        - name: Get latest k9s version
          ansible.builtin.uri:
            url: "https://api.github.com/repos/derailed/k9s/releases/latest"
            return_content: yes
          register: k9s_version
 
        - name: Set k9s version
          ansible.builtin.set_fact:
            k9s_release: "{{ k9s_version.json.tag_name }}"      
 
        - name: Install k9s binary
          ansible.builtin.apt:
            deb: https://github.com/derailed/k9s/releases/download/{{ k9s_release }}/k9s_linux_amd64.deb

Proton VPN on Ubuntu

Install Proton VPN with Ansible

- name: Install ProtonVPN
  become: true
  block:
    - name: Add protonvpn APT repository
      vars:
        protonvpn_release: 1.0.8
      ansible.builtin.apt:
        deb: https://repo.protonvpn.com/debian/dists/stable/main/binary-all/protonvpn-stable-release_{{ protonvpn_release }}_all.deb
 
    - name: Install ProtonVPN client
      apt:
        update_cache: true
        name:
          - proton-vpn-gnome-desktop

Links
https://protonvpn.com/support/de/official-linux-vpn-ubuntu

OpenStack create VM from ISO image

# create image from iso
openstack image create --file /tmp/ubuntu-24.04.1-live-server-amd64.iso --disk-format iso --progress ubuntu-24.04.1-live-server-amd64.iso
 
# create volume for the final VM
openstack volume create test-vm1-vol1 --size 10 --bootable
 
# create temporary installation VM
openstack server create test-vm1-inst --image ubuntu-24.04.1-live-server-amd64.iso --flavor m1.small --key-name test-keypair --network test-network
 
# attach volume to temporary VM
openstack server add volume test-vm1-inst test-vm1-vol1
 
# show console url from temporary VM
openstack console url show -c url -f value test-vm1-inst
 
# install OS in console
 
# delete temporary VM
openstack server stop test-vm1-inst
openstack server delete test-vm1-inst
 
# create final VM
openstack server create test-vm1 --volume test-vm1-vol1 --flavor m1.small --key-name test-keypair --network test-network
openstack console url show -c url -f value test-vm1
 
# remove iso imagge
openstack image delete ubuntu-24.04.1-live-server-amd64.iso

Links
https://openmetal.io/docs/manuals/tutorials/understanding-iso-images

Incus Ansible deployment

---
- name: Create container
  hosts: incus1.example.com
  # become: yes
  tasks:
    - name: Create incus container
      community.general.lxd_container:
        url: "unix:/var/lib/incus/unix.socket"
        name: u2404
        source:
          type: image
          mode: pull
          server: https://images.linuxcontainers.org/
          alias: ubuntu/24.04/cloud
          protocol: simplestreams
        wait_for_container: true
        wait_for_ipv4_addresses: true
        config:
          limits.cpu: "4"
          boot.autostart: "true"
          cloud-init.user-data: |
            #cloud-config
            package_upgrade: true
            locale: en_US.UTF-8
            timezone: Europe/Berlin
            apt_upgrade: true
            package_upgrade: true
            packages:
              - openssh-server
            # disable_root: false
            ssh_authorized_keys:
              - "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
          cloud-init.network-config: |
          network:
            version: 2
            ethernets:
              eno1:
                dhcp4: true
        profiles: ["disk-default", "nic-dev"]
      register: container
 
    - name: Configure temporary user for initial run
      set_fact:
        remote_user: ubuntu
      delegate_to: localhost
      delegate_facts: True
      when: container.changed- name: Create container
 
 
- name: Configure container
  hosts: u2404.example.com
  gather_facts: no
  remote_user:  "{{ hostvars['localhost']['remote_user'] | default(lookup('env', 'USER')) }}"
  become: yes
  tasks:
    - name: Create a user 'johnd' with a home directory
      ansible.builtin.user:
        name: johnd
        create_home: yes

Links
https://discuss.linuxcontainers.org/t/creating-container-with-ansible/20050/7
https://documentation.ubuntu.com/lxd/en/latest/cloud-init/
https://docs.ansible.com/ansible/latest/collections/community/general/lxd_container_module.html