Custom css

Fixing Generic Wayland Icons for Applications in KDE Plasma

If you run KDE Plasma on Wayland, you may have run into a small but persistent annoyance: some applications show up with a generic Wayland logo in the Alt-Tab switcher and the taskbar instead of their proper icon.

Why this happens

On Wayland, windows identify themselves to the compositor using an app_id. KWin tries to match this identifier against installed .desktop files to figure out which icon to display. The match is done against either:

  • The .desktop file's base name (without the .desktop extension), or
  • The StartupWMClass= field inside the file

If KWin can't find a match, you get the default Wayland logo as a fallback. This commonly happens when an application's .desktop file is named one thing (say, my-cool-app.desktop) but the binary reports a different app_id to the compositor (say, com.example.CoolApp). The two never meet, and you get a blank icon.

Step 1: Find out what your window actually reports

Focus the misbehaving window, then run this in a terminal:

qdbus org.kde.KWin /KWin queryWindowInfo

You'll get a block of output describing the currently active window. The important lines are desktopFile and resourceClass. For example:

desktopFile: jetbrains-idea
resourceClass: jetbrains-idea
resourceName: idea

The resourceClass value is what KWin uses to look up the icon. Note it down.

Step 2: Rename the .desktop file to match

Find the existing .desktop file for the application and rename it so its basename matches the resourceClass from step 1. Desktop files live in one of two places:

  • ~/.local/share/applications/ for user-installed entries
  • /usr/share/applications/ for system-wide entries

If the misbehaving file is system-wide, don't edit it in place — copy it to ~/.local/share/applications/ with the correct name instead. User-level files take precedence over system ones, so your renamed copy will win.

cp /usr/share/applications/wrong-name.desktop \
   ~/.local/share/applications/correct-name.desktop

Replace correct-name with whatever resourceClass you got from queryWindowInfo.

Step 3: Refresh the KDE cache

Plasma caches the desktop file database, so nudge it to pick up your new file:

kbuildsycoca6

Use kbuildsycoca5 if you're still on Plasma 5. Then restart the application and Alt-Tab away — the icon should now render correctly.

Fixing Weirdly Spaced Numbers in Red Panda Console on Firefox (Linux)

If you're using Red Panda Console in Firefox on Linux and the message value viewer looks like this — with characters spaced out in a strange, almost proportional way:

 

...you've hit a font fallback issue. Here's what's going on and how to fix it.

The cause

Red Panda's message viewer uses the Monaco Editor, which requests "Droid Sans Mono" as its primary monospace font.

When Firefox can't find the requested font, it falls back through its own chain and lands on Noto Sans Mono, which has known rendering quirks at small sizes on Linux — producing the spaced-out glyphs you see.

Chromium doesn't have this problem because it uses a different font matching strategy.

You can confirm the issue by opening DevTools → Inspector → Fonts tab on one of the affected elements. If it shows "Noto Sans Mono" as the rendered font, this fix applies to you.

The fix

We can use fontconfig to rewrite font requests on the fly — pointing both Droid Sans Mono and Noto Sans Mono requests at a font that renders cleanly, like JetBrains Mono.

First, make sure JetBrains Mono is installed:

sudo apt install fonts-jetbrains-mono

Then create ~/.config/fontconfig/fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="pattern">
    <test name="family">
      <string>Droid Sans Mono</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>JetBrains Mono</string>
    </edit>
  </match>

  <match target="pattern">
    <test name="family">
      <string>Noto Sans Mono</string>
    </test>
    <edit name="family" mode="assign" binding="strong">
      <string>JetBrains Mono</string>
    </edit>
  </match>

  <alias>
    <family>monospace</family>
    <prefer>
      <family>JetBrains Mono</family>
      <family>Hack</family>
      <family>DejaVu Sans Mono</family>
    </prefer>
  </alias>
</fontconfig>

Rebuild the font cache:

fc-cache -fv

Verify the aliases are working:

fc-match "Droid Sans Mono"
fc-match "Noto Sans Mono"

Both should return JetBrainsMono-Regular.ttf.

Restart Firefox completely and reload Red Panda — the message viewer should now render with clean, properly-spaced monospace text.

Why <match binding="strong"> and not <alias>

An <alias> only applies when the requested font is missing. Since Noto Sans Mono is actually installed, an alias for it would be ignored. <match> with binding="strong" forces the substitution even when the requested font exists — which is exactly what we need to override Firefox's fallback choice.

Side effects to be aware of

This config rewrites every request for Noto Sans Mono system-wide to JetBrains Mono. For code and most UI use cases this is an upgrade, but if you rely on Noto Sans Mono's broader CJK coverage for specific apps, you may want to narrow the rule or drop the Noto Sans Mono match entirely.

How to rescue BTRFS partition with corrupted log

Fixing a Btrfs Mount Problem with btrfs rescue zero-log

If you’re using a Btrfs filesystem and it suddenly refuses to mount (often after an unexpected shutdown, power loss, or crash), one common cause is a corrupted log tree. A practical and relatively safe recovery step is to clear that log using:

Code:

sudo btrfs rescue zero-log /dev/<device>

If mounting fails: check dmesg

If the filesystem still refuses to mount after running btrfs rescue zero-log, the next step is to inspect the kernel messages. Btrfs usually logs detailed error information there, even when the mount command itself is vague.

Attempt the mount

sudo mount /dev/<device> /mnt

Inspect kernel messages with dmesg

Immediately after a failed mount attempt, run:

dmesg

Install AWS VPN Client for openSUSE Tumbleweed

Code:


curl https://d20adtppz83p9s.cloudfront.net/GTK/latest/awsvpnclient_amd64.deb -o awsvpnclient_amd64.deb
sudo zypper in alien
alien --to-rpm awsvpnclient_amd64.deb
sudo alien --to-rpm awsvpnclient_amd64.deb
curl https://ftp.lysator.liu.se/pub/opensuse/distribution/leap/15.4/repo/oss/x86_64/liblttng-ust0-2.12.0-1.30.x86_64.rpm -o liblttng-ust0-2.12.0-1.30.x86_64.rpm
sudo zypper in ./liblttng-ust0-2.12.0-1.30.x86_64.rpm
sudo zypper in ./liburcu6-0.12.1-1.30.x86_64.rpm
sudo zypper in ./awsvpnclient-3.4.0-2.x86_64.rpm
curl https://gist.githubusercontent.com/dbouras/d390bc3511280aaf717fbb976e20447e/raw/a5208723c531dc65f561b074224b2ccdba3585a1/configure-dns -o configure-dns
sudo cp ./configure-dns /opt/awsapiclient/Service/Resources/openvpn/
sudo nano /etc/systemd/system/awsvpnclient.service

https://gist.github.com/dbouras/d390bc3511280aaf717fbb976e20447e#file-configure-dns

add

Code:


Environment="DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true"

to the [Service] section of the file: /etc/systemd/system/awsvpnclient.service

Source: https://gist.github.com/miguelgmalpha/5c9e78d16312d156b0ec1d1c1bb09c1c?permalink_comment_id=4386699#gistcomment-4386699

Code:


sudo systemctl start awsvpnclient
sudo systemctl enable awsvpnclient
cd /opt/awsvpnclient/
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
export GTK_CSD=0
./AWS\ VPN\ Client
$

Raspberry Pi OS: How to install packages from one system on another system

 To reinstall packages from one instance of Raspberry Pi OS to another (for instance because you are upgrading):

Code:

dpkg --get-selections > pkgs.list
Copy file to new installation
dpkg --set-selections < pkgs.list
apt-get dselect-upgrade
Source: https://forums.raspberrypi.com/viewtopic.php?p=2110754&sid=fa176deb33007ae82766162b8cf35379#p2110754

Install Selfoss RSS Reader on Raspbian GNU Linux 10 (buster) with lighttpd and mariadb

This guide will install the Selfoss RSS reader on a Raspberry Pi

Install mariadb, php and lighttpd:

Code:


sudo apt install php-mysql php-gd php-cgi php-http lighttpd mariadb-server mariadb-client

Secure the mariadb installation by running:

Code:


sudo mysql_secure_installation

Login to the mariadb console:

Code:


sudo mysql -u root -p

In the console create the database and grand privileges to the database user:

Code:


create database selfoss;
grant all on selfoss.* to selfoss@localhost identified by 'SECURE_PASSWORD';
\q

Replace 'SECURE_PASSWORD' with a secure password.

Enable fastcgi for php in lighttpd:

Code:


sudo /usr/sbin/lighttpd-enable-mod fastcgi fastcgi-php

Change the max_execution_time to 60 in /etc/php/7.3/cgi/php.ini by running this command:

Code:


sudo sed -i 's/max_execution_time = .*/max_execution_time = '60'/' /etc/php/7.3/cgi/php.ini

Download and extract selfoss:

Code:


wget https://github.com/SSilence/selfoss/releases/download/2.18/selfoss-2.18.zip --directory-prefix=/tmp
sudo mkdir /var/www/html/selfoss
sudo unzip /tmp/selfoss-2.18.zip -d /var/www/html/selfoss/
sudo chown -R www-data:www-data /var/www/html/selfoss/
sudo chmod g+w /var/www/html/selfoss/data/cache /var/www/html/selfoss/data/favicons /var/www/html/selfoss/data/logs /var/www/html/selfoss/data/thumbnails /var/www/html/selfoss/data/sqlite /var/www/html/selfoss/public

Take a copy of the default configuration file:

Code:


sudo cp /var/www/html/selfoss/default.ini /var/www/html/selfoss/config.ini

Modify the config.ini to have this database configuration:

Code:


db_type=mysql
db_host=localhost
db_database=selfoss
db_username=selfoss
db_password='SECURE_PASSWORD'
db_port=3306
db_prefix=

Replace 'SECURE_PASSWORD' with the secure password you created when creating the database in the database console.

Edit /var/www/html/selfoss/.htaccess uncomment "RewriteBase /selfoss"

Edit /etc/lighttpd/lighttpd.conf: in server.modules uncomment "mod_rewrite" Also add these rewrite rules:

Code:


url.rewrite-once += (
"^/selfoss/favicon.ico$" => "/selfoss/public/favicon.ico",
 "^/selfoss/favicons/(.*)$" => "/selfoss/data/favicons/$1",
 "^/selfoss/thumbnails/(.*)$" => "/selfoss/data/thumbnails/$1",
 "^/selfoss/([^\?]*.(js|ico|gif|jpg|png|css|asc|txt|eot|woff|ttf|svg))(\?.*)?$" => "/selfoss/public/$1",
 "^/selfoss/index.php(.*)$" => "$0",
 "^/selfoss/([^\?]*)(\?(.*))?" => "/selfoss/index.php?$3",
 "^/selfoss/public/" => "$0",
 "^/selfoss/(.*)" => "/selfoss/index.php$1"
)

Setup a cron job to automatically update feeds by running:

Code:


sudo crontab -e

Add this line to the crontab and save and quit:

Code:


*/15 * * * * curl --silent --show-error -m 3300 -k https://127.0.0.1/selfoss/update >>/var/log/selfoss_update.log > /dev/null

Restart lighttpd:

Code:


sudo service lighttpd restart

Open selfoss in your web browser by going to http://{host-ip-address}/selfoss The first run may give a timeout error whilst it sets up the environment. From then on it should work fine.

Cisco UCS XML API events

Working with the emulator for the Cisco UCS Manager there are certain events that can not be triggered because changes to inventory requires a restart.

If a blade is remove from a chassis an event of the following format will occur.

    <methodVessel cookie="">
        <inStimuli>
            ...
            <configMoChangeEvent cookie="" inEid="276132176">
                <inConfig>
                    <computeBlade dn="sys/chassis-10/blade-6" fltAggr="65536"
                        operQualifier="removed" operState="removed" presence="missing"
                        status="modified" />
                </inConfig>
            </configMoChangeEvent>
            ...
        </inStimuli>
    </methodVessel>

The operQualifier and operState attributes indicates what occurred while the presence attribute confirms that it is now missing.

If a blade is added to the chassis the first event that tells that will be of this format:

    <methodVessel cookie="">
        <inStimuli>
            ...
            <configMoChangeEvent cookie="" inEid="276132831">
                <inConfig>
                    <computeBlade availability="unavailable" checkPoint="shallow-checkpoint"
                        discovery="in-progress" dn="sys/chassis-10/blade-6" fltAggr="0"
                        fsmDescr="blade discovery 10/6(FSM:sam:dme:ComputeBladeDiscover)"
                        fsmFlags="sam:dme:ComputeBladeDiscover:check-point,sam:dme:ComputePhysicalFwUpgrade:config-board-ctrl-fw"
                        fsmPrev="DiscoverBmcPresence" fsmProgr="1"
                        fsmStageDescr="checking CIMC of server 10/6(FSM-STAGE:sam:dme:ComputeBladeDiscover:BmcPresence)"
                        fsmStamp="2014-02-10T17:06:12.513" fsmStatus="DiscoverBmcPresence"
                        fsmTry="1" operQualifier="" operState="discovery" presence="equipped"
                        status="modified" />
                </inConfig>
            </configMoChangeEvent>
            ...
        </inStimuli>
    </methodVessel>

The presence attribute confirms that it is now equipped. From there on it is then possible to query for more information.

Fixing Generic Wayland Icons for Applications in KDE Plasma If you run KDE Plasma on Wayland, you may have run into a small but persisten...