středa 29. dubna 2026

vynuceni opravy detekce monitoru na NVIDIA karte

 

for i in `pgrep -u $USER gnome-shell`  ; do echo $i: ; cat /proc/$i/environ | tr '\0' '\n' | grep -E 'DISPLAY|XAUTHORITY' ; done

pripadne:

ps -C gnome-shell -o pid=


#
# asi pri vypnutem monitoru:
#
export DISPLAY=:1
export XAUTHORITY=/run/user/$(id -u $USER)/gdm/Xauthority
xrandr --query
xrandr --output DP-0 --off
sleep 2
xrandr --output DP-0 --auto

čtvrtek 5. února 2026

hybrid SDD/HDD raid 1

 Viz https://www.tansi.org/hybrid/

The key is the option "write-mostly" passed to hdd.

 

mdadm --metadata=0.90 --create -n 2 -l 1 /dev/md1 /dev/ssd -W /dev/hdd

For an existing array, add a new ssd (after ssd failure)

mdadm --manage /dev/md0 --add /dev/sda1

--write-mostly is a per-member setting stored in the md metadata for that member device (and also maintained in-kernel while the device is in the array). It should survive on the hdd.

quote: You can enable "write-mostly" for a RAID component in the following way:

echo writemostly >  /sys/block/md0/md/dev-hdd/state

and disable it this way:

echo -writemostly >  /sys/block/md0/md/dev-hdd/state

(nicmene, po pridani noveho ssd disku se ve vypisu vlastnosti /dev/hdd write mostly ukazovalo. Teprve az po echo writemostly > ...)

sobota 29. listopadu 2025

Ubuntu 24.04 postfix + SASL/saslauthd Fix

(napsal GeminAI podle strucnych poznamek)

Quick Fix: saslauthd Failures in Ubuntu 24.04 LTS

Upgraded to Ubuntu 24.04 LTS and saslauthd won't start, preventing Postfix authentication? The daemon is failing because it cannot reliably create its PID file in the default location while also being configured to place the socket inside Postfix's chroot (/var/spool/postfix/...).

The solution is to use a systemd override to force saslauthd to place its PID file in the same, accessible directory as its socket, and ensure it runs with the necessary group permissions.

🛠️ The Systemd Fix

  1. Open the Override Editor:

    sudo systemctl edit saslauthd.service
    
  2. Add the Configuration Stanza:

    Paste this into the editor to specify the correct PID location and the required sasl group:

    [Service]
    Group=sasl
    PIDFile=/var/spool/postfix/var/run/saslauthd/saslauthd.pid
    
  3. Restart Services:

    Save the file, then restart to apply the fix:

    sudo systemctl restart saslauthd
    sudo systemctl restart postfix
    

This simple configuration adjustment resolves the conflict, allowing saslauthd to start successfully and communicate with Postfix inside its chroot.

čtvrtek 27. listopadu 2025

Fixing OpenDKIM Signing After Upgrading Ubuntu 18.04 LTS → 24.04 LTS

 (prispevek zformuloval GPT chatbot na zaklade mych velmi strucnych poznamek)

After a long-planned upgrade from Ubuntu 18 LTS straight to Ubuntu 24 LTS, I discovered that outgoing e-mail was no longer being signed with OpenDKIM. What followed was a small adventure involving masked services, silent failures, and a missing package. Here is the full story for anyone who runs into the same issue.

1. First symptoms: DKIM signing stopped working

Right after the upgrade, outgoing mail lost its DKIM signatures.
A look into /var/log/mail.log showed a clear clue:

postfix/smtpd[153304]: warning: connect to Milter service inet:localhost:8892: Connection refused

Port 8892, where OpenDKIM normally listens, was not responding:

# ss -tuln | grep 8892 (no output)

So the DKIM milter was simply not running.

2. Trying to start OpenDKIM — and finding it masked

My next step was obvious: check the service.

# systemctl start opendkim Failed to start opendkim.service: Unit opendkim.service is masked.

Status confirmed it:

# systemctl status opendkim opendkim.service Loaded: masked (Reason: Unit opendkim.service is masked.) Active: inactive (dead)

Why the upgrade masked the service is unclear, but unmasking is straightforward:

# systemctl unmask opendkim # systemctl start opendkim

This time the service started—at least according to systemd.
But DKIM signatures were still missing.

3. Adding debug logging

To see what was going on, I enabled more verbose logging by adding to /etc/opendkim.conf:

SyslogSuccess yes LogWhy yes

After that:

# systemctl restart opendkim

The service looked healthy, no visible errors... but still no signs of DKIM signing.

4. The surprising discovery: OpenDKIM wasn’t installed (!?)

Running locate gave the final hint:

# locate opendkim opendkim:

It essentially returned nothing.
At this point it became clear: the service files were present, but the actual OpenDKIM binary was not installed (a side effect of the distribution jump).

A quick explicit install solved everything:

# apt install opendkim

And — voilà — DKIM signing immediately started working again.

5. Conclusion

Upgrading directly from Ubuntu 18 → 24 can leave some services in a strange state. In my case:

  • opendkim.service was masked after the upgrade

  • The service files survived, but the binary package was missing

  • Postfix failed to talk to the milter (Connection refused)

  • Installing OpenDKIM manually restored full functionality

úterý 29. července 2025

multi-hop gateway in wireguard (hub and spoke)

https://www.procustodibus.com/blog/2022/06/multi-hop-wireguard/#internet-gateway-as-a-spoke 

routovani default routy skrz wireguard mezi peerama:

on the client, 172.20.24.15 set 

wg0.conf
[Interface] ... Address = 172.20.24.15/32
[Peer] ... AllowedIPs = 0.0.0.0/0 

ip route add wg_server_ip via 192.168.122.1 dev eth0
ip route add default via 172.20.24.10 dev wg0 

 

on the gateway, 172.20.24.10 

iptables -t nat -A POSTROUTING -s 172.20.24.0/24 -o vlan2 -j MASQUERADE
(a mozna i neco z toho:
iptables -t nat -A POSTROUTING -o oet1 -j MASQUERADE
iptables -A FORWARD -i oet1 ...? ) 

(list:  iptables -t nat -S POSTROUTING )

on the hub (wg server) 172.20.24.1 

wg:
wg set wg2 peer rdwrtQdE7Z0SqZcJmoydFD74vXLLTnf+gk9go5pDWRw= allowed-ips 0.0.0.0/0 (namisto 172.20.24.10/24) (klic je klienta gateway) 

routing:
echo "123 wgfrompeer" >> /etc/iproute2/rt_tables #tim se nastavi jen jmeno
ip route add default via 172.20.24.10 dev wg2 table 123
ip rule add iif wg2 table 123 priority 100

(list:  ip route show table 123 , ip rule show )

 

firewall:
# neco z tohodle:
sysctl -w net.ipv4.ip_forward=1 (to uz je zrejme jako default)
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wg2 -s 172.20.24.0/24 -j ACCEPT
iptables -I FORWARD -i wg2 -o wg2 -j ACCEPT

středa 5. března 2025

File browser and file dialogs take a long time to open

 https://askubuntu.com/questions/1341909/file-browser-and-file-dialogs-take-a-long-time-to-open-or-fail-to-open-in-all-ap

 

Fast solution: 

pkill gvfsd-trash

Brute force permanent solution:

mv /usr/libexec/gvfsd-trash{,.bak}