randomNotes

Differences between revisions 20 and 21
Revision 20 as of 2025-04-02 08:48:29
Size: 11572
Editor: nteodosio
Comment:
Revision 21 as of 2025-04-02 09:12:04
Size: 11686
Editor: nteodosio
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:

For Firefox, go to about:config and set 'http://<FQDN>' in the ''network.negotiate-auth.trusted-uris'' option.

This page is just a dump of notes.

Kerberos, client side

Install Ubuntu normally in Virt-manager.

In the connection settings, change DNS to the IP of the Windows server, after verifying you can ping it. Then,

apt install krb5-user realmd
pam-auth-update --enable mkhomedir
realm join -v testdomain.com #The server domain name

If now login ADuser@<FQDN> works, and it should, then you also should be able to log-in in Gnome as that user by quitting the current user's session and then when GDM loads again, choose "not listed" and input ADuser@<FQDN> as the user.

For Firefox, go to about:config and set 'http://<FQDN>' in the network.negotiate-auth.trusted-uris option.

Kerberos, server side

Angry X-( This is incomplete, I'm listing from memory.

Grab the Windows server ISO and install it in Virt-manager. Choose the "desktop experience" installation.

In server manager choose to install AD and install ISS.

Configure ISS, choose only Windows authentication (no annonymous), and delete NTLM, keep only Negotiate. See https://techcommunity.microsoft.com/blog/iis-support-blog/setting-up-kerberos-authentication-for-a-website-in-iis/347882 (archived), stop at step 3 (no need to mess with setspn).

Make sure the server clock is correct and in the correct time zone (else Kerberos will complain about "clockskew".

Calling DBus method with weird arguments

sv

dbus-send does not support it, use

gdbus call ... string "<'value'>"

I.e. Gdbus wants the variant enclosed in <''>, so that should be double-quoted in the shell.

as

"['a', 'x']"

USB stick in Qemu

pmount /dev/sdc1
qemu .... -virtfs local,path=/media/sdc1,mount_tag=host0,security_model=passthrough 

Then in the virtual machine, execute

mount -t 9p -o trans=virtio host0 /mnt

Incremental snap build for huge software

If Chromium's snap build fails locally DO NOT try executing snapcraft again. Not only will it take eons to "removing directory foo" but also the build will not be incremental, it will start the build lifecycle anew.

Instead, do

lxc exec --project snapcraft INSTANCE bach

and run the ninja CLI manually (or whatever it is the step that failed) to proceed the build whence it really stopped.

Then unsquash the original *snap file, pull the modified binary (resulting from the tweaked build) to the host with lxc file pull, replace the file in the unsquashed direcotry and repack the snap (with snapcraft pack instead of mksquashfs if you want to upload it to the store)!

Make the screen reader (orca) speak arbitrary text

I could not find this straightforward question answered or documented anywhere! Tested for GTK3:

ac = widget.get_accessible()
ac.emit("notification", "arbitrary text", 0)

It does not matter what the widget is.

Snapcraft/LXD

Build containers taking too much space

Analyze /var/snap/lxd/common/lxd/storage-pools/default/containers and delete with

lxc delete -f --project snapcraft abc

Slow boot

systemctl disable snap.lxd.activate

Just start it manually when needed.

Ubuntu ARMv7 on ARMv8

v=24.04 #Desired Ubuntu version
lxd init
lxc launch "ubuntu:$v/armhf" "armhf-$v"
lxc shell "armhf-$v"

Setuptools

AttributeError: 'module' object has no attribute 'test_foo'

The setup() of Setuptools for a Python2 package was failing with

287s Traceback (most recent call last):
287s   File "setup.py", line 26, in <module>
287s     test_suite="tests",
287s   File "/usr/lib/python2.7/dist-packages/DistUtilsExtra/auto.py", line 100, in setup
287s     distutils.core.setup(**attrs)
287s   File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
287s     dist.run_commands()
287s   File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
287s     self.run_command(cmd)
287s   File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
287s     cmd_obj.run()
287s   File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 159, in run
287s     self.with_project_on_sys_path(self.run_tests)
287s   File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 140, in with_project_on_sys_path
287s     func()
287s   File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 180, in run_tests
287s     testRunner=self._resolve_as_ep(self.test_runner),
287s   File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
287s     self.parseArgs(argv)
287s   File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
287s     self.createTests()
287s   File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
287s     self.module)
287s   File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
287s     suites = [self.loadTestsFromName(name, module) for name in names]
287s   File "/usr/lib/python2.7/unittest/loader.py", line 103, in loadTestsFromName
287s     return self.loadTestsFromModule(obj)
287s   File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 38, in loadTestsFromModule
287s     tests.append(self.loadTestsFromName(submodule))
287s   File "/usr/lib/python2.7/unittest/loader.py", line 100, in loadTestsFromName
287s     parent, obj = obj, getattr(obj, part)
287s AttributeError: 'module' object has no attribute 'test_dbus'

Not a particularly clear error message, especially since test_dbus.py is a test file inside the tests directory.

With such a message one can't help but suspect that there is something in Setuptools itself, maybe a wrongly set reference directory... But that was not it.

After hours of trying and searching, I found this comment, which made me realize by simply running python test_dbus.py that for Python2 I hadn't installed the package that provided an import, and it would fail with

ImportError: No module named pathlib

Why on earth such a useful and unambiguous error message is replaced by that obscure one is beyond me.

Systemd socket activation failing

I got this in Golang, activation.Listeners would return an empty slice but no error. Grpcurl would bail out with "connection refused" and the socket log would say

Failed to queue service startup job (Maybe the service file is missing or not a template unit?): Invalid argument
Failed with result 'resources'.

The solution was to remove Accept=true from the socket unit file.

Lintian obscure output -> Lintian descriptive output

Now running lintian libspelling_0.2.0-1_amd64.changes ...
W: libspelling-1-doc: stray-devhelp-documentation [usr/share/doc/libspelling-1/libspelling-1.devhelp2]
Finished running lintian.

What is that? Answer:

lintian-explain-tags stray-devhelp-documentation

Query for a specific snap revision

curl -s -H 'Content-Type: application/json' -H 'Snap-Device-Series: 16' 'http://api.snapcraft.io/v2/snaps/info/gnome-42-2204-sdk' | jq --arg arch arm64 -r '."channel-map" | . [] | select(.channel.name == "stable") | select (.channel.architecture == $arch)'

Where was Cmake test defined?

ctest -R test_some_side_corner_item_XYZ --show-only=json-v1

https://stackoverflow.com/questions/60863036/cmake-ctest-where-was-defined-test-xyz

Iterate on build

./debian/rules build
fakeroot ./debian/rules binary
dh_clean

No file selection dialog

sudo apt install xdg-desktop-portal-gtk+ xdg-desktop-portal-gnome-

Skip XDG portal to test snap access

This is a common mistake. The XDG portal provides the file to the snap.

In browser skip it with file:// in address bar.

Canonistack

>10 GB instances are actually available, see openstack flavor list.

List of merge requests on Launchpad

Source.

Meson: Output the tests output instead of sending then to a file

https://github.com/mesonbuild/meson/issues/3462

Which dependency is linking against an unwanted one?

I was getting this problem figuring who was including soup2.4 while I only wanted soup3.0 in a meson project.

Non-meson should be something similar.

Given meson.build in this form:

grep dependency meson.build
    dependency ('libnm', version: '>= 1.2'),
    dependency ('libnma', version: '>= 1.0'),
    dependency ('polkit-gobject-1', version: '>= 0.103'),
    dependency ('accountsservice'),
    ...

$ awk -F\' '/dependency/{dep=$2; "pkg-config --libs " dep | getline; if(/soup-2.4/)print dep}' meson.build
webkit2gtk-4.0

Dbus stuff

For minimal environments, if you get

Failed to execute child process ?dbus-launch? (No such file or directory)

the solution is to put

. /etc/X11/Xsession.d/*dbus*

in your .xinitrc.

GTK

GTK3 to GTK4 *.ui

  •  gtk4-builder-tool simplify --3to4 gtk3.ui > gtk4.ui  fixes a considerable amount of stuff, but not all.

  • <packing> no longer works, use <layout>.

See https://docs.gtk.org/gtk4/migrating-3to4.html for more.

Old GTK, empty space in window

To make sure a widget expands (i.e., takes over empty space),

<packing>
  <property name="expand">True</property>
  <property name="fill">True</property>
</packing>

was not enough in Xenial. It was necessary to add a

<property name="vexpand">True</property>

C.f. https://git.launchpad.net/~nteodosio/update-manager/commit/?id=89be5e7e0ed91225fd2855c4079bb3efb4824dd3

For widget initial size

https://stackoverflow.com/questions/29737096/gtk3-paned-widget-default-homogeneous-sizes https://stackoverflow.com/questions/7796335/how-to-set-minimal-and-current-size-of-the-right-pane-in-hpaned-in-gtk https://stackoverflow.com/questions/45799092/set-widget-initial-size https://docs.gtk.org/gtk3/signal.Widget.screen-changed.html

Gtk-CRITICAL **: assertion 'GTK_IS_WIDGET (widget)' failed

If created with a UI file, make sure the widget has

<property name="visible">True</property>

Chromium

Grepping its source code is slow, hours even with fixed patterns.

Use https://source.chromium.org/search?q=regex instead.

ISO QA testing hints

Minimal install is slower

Minimal install won't save you time; on the contrary: It adds the step of removing what was installed.

Nvidia test case

There are outdated bits, don't block on them.

The point is that, once you fully install and booted. you should have 1) secureboot on 2) working nvidia drivers loaded.

Tests that can be done in a single run

Save time by performing those in a single go:

  • [Run-once] Other Features (i.e. test if keyboard, wireless and timezone configuration during installation is kept after installing)
  • [Mandatory] Install (manual partitioning re-using home partition)
  • [Mandatory] Install (manual partitioning)

nteodosio/randomNotes (last edited 2025-04-02 09:12:04 by nteodosio)