Dual boot with UEFI

Install Windows first. The setup creates an EFI partition, most likely as /dev/sd?2. We’re gonna need that later. Then turn off fast boot. Enter

powercfg -h off

on the command prompt. Make sure that you have local admin rights. Fast boot is incompatible with dual boot. You’ll get blue screens with repair options otherwise. While at it, set the system clock to UTC. Create this DWORD registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal

and set it to “1”.

Then install linux and mount /dev/sd?2 from above to boot. Then create a new file named arch.conf in /boot/loader/entries:

title   Arch Linux
linux   /vmlinuz-linux
initrd  /initramfs-linux.img
options root=UUID=$(blkid /root/partition) rw audit=0

The paths are relative to /boot, so vmlinuz-linux should be /boot/vmlinuz-linux. Next edit /boot/loader/loader.conf:

console-mode auto
default arch
timeout 5

Assuming that you’re using systemd-boot, run bootctl install and bootctl update, reboot and be happy!

Synergy and SDDM

For SDDM to connect to a synergy server on archlinux, edit /usr/share/sddm/scripts/Xsetup and add:

/usr/bin/synergyc <server IP or server hostname>

There’s just a little problem if you have more than one monitor. The default Xorg config mirrors all screens. That’s no problem, since KDE sets it all up properly. Unfortunately synergyc doesn’t register the changes, so you have to restart it. Since by then synergyc is running as root, you can’t kill it as user. But fear not, there’s a workaround:

  • Allow the user to execute /usr/bin/killall synergyc as root without password (see https://tollana.d-tor.org/notes-to-self/?p=620)
  • Kill all synergy instances in an autostart script and start a user instance preferably in the systemd user session:
#!/bin/bash 
sudo /usr/bin/killall synergyc
systemctl --user restart synergyc
  • make it executable, put it somewhere the user can access it and auto-start it. In KDE: System Settings -> Startup and Shutdown -> Autostart -> Script File
  • make sure that you have synergyc.service in $HOME/.config/systemd/user
[Unit]
Description=Synergy Client Daemon
After=network.target

[Service]
ExecStart=/usr/bin/synergyc --no-daemon <Server IP or Hostname>
Restart=always
RestartSec=3

[Install]
WantedBy=default.target

This works with KillUserProcesses=yes in /etc/systemd/logind.conf.

SUDO Rule Preference

sudo has a last match policy, NOT best match! So, if %wheel is allowed to execute everything as anybody with password, but you want a member of %wheel to execute a specific command without password, the rule for the password-less command has to be ordered after the general rule:

%wheel ALL=(ALL) ALL 
wheelmember ALL=(ALL) NOPASSWD: /usr/bin/mycommand

It says so in man 5 sudoers:

When multiple entries match for a user, they are applied in order. Where there are multiple matches, the last match is used (which is not necessarily the most specific match).

Nevertheless, it was counter-intuitive for me. I expected first or best match, but not last match… Another quirk: When using visudo “:w” won’t update the sudoers file. You have to “:wq”.

Formatting cells in LibreOffice

As I just learned, data is not always converted automatically to the new format, e.g. when it’s a number and you want it to be a date. In that case you have to replace the content with itself after setting the new format.

This can be done with “Find and Replace…”: Search for .* and replace it with & (Ampersand, the whole regex match). Make sure that you have “Regular Expression” checked!

Bold font in KDE konsole

To get a bold font in Konsole, do this:

  • First, create a new Profil
  • Edit the profile to use DejaVu Sans Mono, Size and Style doesn’t matter
  • Save it and close Konsole
  • Edit $HOME/.local/share/konsole/<Profile Name>
  • Add or replace the Font Entry under Appearance with
Font=DejaVu Sans Mono,9,-1,0,75,0,0,0,0,0,Bold
  • Now edit $HOME/.config/konsolerc and add
[Desktop Entry] 
DefaultProfile=<Profile Name>
  • Replace [Favorite Profiles] with
[Favorite Profiles] 
Favorites=

Kill all instances of Konsole, start it and never touch that stuff again!

Archlinux and an AMD-GPU

I finally decided to get rid of my ancient nvidia graphic board and bought a Sapphire Radeon R5 230 with 2GB RAM for 46,40 €uros. The vendor chose GLS as delivery service, so no tracking number. Of course it didn’t arrive at the announced day. I had to ask the vendor and eventually picked it up in a not so close boutique.

Well, once I had it, assembly wasn’t much of a problem. Configuring X was. Took me five hours to get it right!

First, I had to figure out which driver to use, which isn’t as easy as it seems. Turns out to be radeon, not amdgpu. Without any configuration the radeon kernel module is loaded, which is right, by the way, but X can’t figure out what driver to use. By default it uses amdgpu if installed. Well, wrong choice.

Create a configuration with

# X -configure

and change the Driver from amdgpu to radeon. Then remove the vnc module in Section “Module” and the Screens in Section “ServerLayout”. X identifies 2 Devices, one for VGA output, and one for DVI, or so I thought. Actually, the card has another output: HDMI for TV-out, which happens to be the default. Very clever! Disable it by adding this to the kernel command line:

video=HDMI-A-1:d

Now set the option ZaphodHeads to “VGA-0,DVI-0” in both device Sections. That should get you up and running. SDDM still doesn’t work, but startx will. SDDM requires some xrandr magic in Xsetup, which I haven’t figured out yet.

Anyway, it was worth it! No more annoying delays when playing videos while writing text in LibreOffice! In total the system feels much faster now.

You can marvel at the whole config here.

400MBit bei Vodafone

Samstag, der 9.6.2018

  • An der technischen Hotline war man in der  gewillt und in der Lage, mir den 400Mbit-Tarif zu buchen. Die habe ich am Samstag, den 9.6.2018 angerufen. Eigentlich wollte ich nur wissen, warum ich mich mit meinen Zugangsdaten nicht einloggen kann, oder warum mir die Webseite sagt, dass es meine Kundennummer entweder nicht gibt oder doppelt vorhanden ist. Es stellte sich heraus, dass ich mich einfach neu anmelden muss, aber dazu später mehr. Die normale Hotline  hat mich bezüglich meiner anfrage an die technische Hotline verwiesen (0800/5266624), wo mir kompetent geholfen wurde. Nicht bezüglich des Logins, aber bezüglich meiner Anfrage.
  • Nachdem wir herausgearbeitet hatten, dass ich mich nur einfach neu anmelden muss, weil ich eigentlich ein KD-Kunde bin, habe ich die nette Dame darauf angesprochen, dass ich eigentlich nur 400 Mbit anstatt 100 Mbit möchte. Sie hat mir Neukunden-Bedingungen angeboten, die ich natürlich sofort angenommen habe. Ich bräuchte allerdings ein neues Modem, da mein 8 Jahre alter Trümmer den aktuellen Docsis-Standard nicht verstünde. Nach kurzer, sehr fachmännischer Diskussion stellte sich heraus, dass auch das neue Modem den Bridge-Modus beherrscht. Soweit so gut. Der Vertrag fängt zwar neu für 2 Jahre an zu laufen, aber warum nicht. Ohne mit der Wimper zu zucken habe ich ja gesagt.
  • Nebenbei habe ich einen Aktivierungs-Code für meinVodafone beantragt, da ich schon wusste, dass ich ihn brauchen würde. Man konnte mir zwar die Bestellbestätigung per Email zustellen, aber nicht den Code…

Dienstag, der 12.6.2018

  • Das Modem wurde an meinen Nachbarn geliefert. In der Mittagspause habe ich es abgeholt, aber wohl wissentlich noch nicht angeschlossen, sondern erst nach Feierabend
  • Natürlich kam es so, wie es kommen musste. Das Teil war nicht mehr im Bridge-Modus, sondern als Router konfiguriert. So weit, so scheiße.
  • Also habe ich bei der technischen Hotline angerufen (s.o.) und darum geben, das Drecksteil in den Bridge-Modus zu schalten. Das geht natürlich seit Montag (welches Jahr und/oder Monat bleibt offen) nicht mehr, aber man könne mir den Aktivierungs-Code sogar per E-Mail zusenden! Hoffnungsvoll habe ich mein Adresse buchstabiert und 90 Minuten gewartet, wie angesagt. Dreimal darf man raten, was ich nicht bekommen habe. Enttäuscht bin ich erstmal ins Bett.

Mittwoch, der 13.6.2018

  • Aufgestanden, Kaffee gekocht und festgestellt, dass ich nur noch eine IPv6-Adresse habe. IPv4 nur noch über NAT. Egarl, Karl, dann stellen wir das Modem halt auf Durchzug. Ich brauch ja nur CIFS von valhalla, und der Trümmer spricht IPv6.
  • Also die MAC-Adresse für die Ports 1-65535/TCP eingetragen, und dann noch UDP, mehr Protokolle kennt der Bremsklotz nicht. ICMP oder IPSEC scheinen nicht zu existieren. Nochmarl egarl, Karl. UDP hinzugefügt, und… Drecksschüppenscheiße! Die MAC-Adresse wäre wohl doppelt vergeben, sagt das bekackte Interface. Natürlich! Es soll Netzwerkkarten geben, die sowohl UDP und TCP-Pakete gleichzeitig empfangen können! Vielleicht sogar noch anderen Verkehr!

Die Lösungen

Alle angeschlossenen Veranstaltungen haben IPv6, also kein Problem. Also erstmal alles Richtung valhalla über VodaFuck routen. Das geht mit:

[Match] 
Name=ext 

[Network] 
DHCP=v4 
IPv6Token=::dead:b0a1 

[DHCP] 
RouteMetric=4096 
RouteTable=199 

[IPv6AcceptRA] 
RouteTable=199 

[RoutingPolicyRule] 
To=2a01:4f8:201:60ce::/64 
Table=199

Table 199 == kd. Das IPv6Token setzt die IP-Adresse auf prefix::Token, egal was das Router-Annoucement sagt.  Die Policy routet alles nach Hetzner über das Vodafone-Interface. Dann muss man nur noch die OpenVPN-Config auf IPv6 umstellen und dem Server an eine bestimmte Adresse binden:

port 1194
local 2a01:4f8:201:60ce::2 
proto udp6

Dazu noch proto udp6 auf client-Seite und der Tunnel steht. Soweit, so gut.

CIFS

CIFS ist zwar einfach, aber man muss wissen, wie. Dazu muss man die IPv6-Adresse in “Windows” umrechnen. Natürlich funktioniert eine literale Adresse in eckigen Klammern nicht. Dieser Scheiß hier funktioniert tatsächlich… Fenster ist immer für eine Überraschung gut!

Sonstiges

Habe bestimmt eine Menge vergessen, aber das kommt dann hier 🙂 Bin gespannt, wann der Aktivierungs-Code in der Post ist.

Dann wäre da noch…

Meine launige Mail an die geschätzten Kollegen:

An: Serverteam Verteiler
CC: <Noch ein Kollege>
Gesendet: Mi 13.06.2018 16:50

Moinsen,

Erlebnisbericht VodaToll:
Voller erwartungsvoller Erwartung habe ich gestern Abend den niegelnagelneuen, schwarz glänzenden Bremsklotz von Vodafone angeklemmt und bekam sofort eine Verbindung! Hmm, zu schön um wahr zu sein, da muss es doch einen Haken geben, und siehe da, es gibt ihn! Wäre ja auch zu schön gewesen, wenn der Trümmer weiterhin im Bridge-Modus (also einfach nur Modem) geblieben wäre. Nein, sämtliche Einstellungen, die ich vor Jubeljahren mal vorgenommen habe, sind zurückgesetzt worden.

Aber kein Problem. Ich hab ja die Nummer der technischen Hoteline. Nur gefühlte 24 Sprachmenüs und drölf Minuten toller Fahrstuhlmusik später hatte ich tatsächlich einen richtigen Menschen am Rohr! Konnte es kaum glauben! Habe sehr freundlich darum gebeten, mein Modem doch wieder in besagten Brückenmodus zu versetzen, aber das war schwieriger als einem Frosch das Kuchenbacken beizubringen. Hätte vielleicht doch lieber bei der Behörde zur Verhinderung der Überschreitung der Lichtgeschwindigkeit anrufen sollen, die hätten das vielleicht hinbekommen.

Laut Aussage der sehr hilfsbereiten Dame am anderen Ende der Schnur ginge das seit genau diesem Montag nicht mehr, und jetzt sei nun mal Dienstag. Da könne sie nichts machen, aber ich könne das ja selbst auf MeinVodafone anbeklacken. Klar doch, sach ich, würde ich ja gerne, hab aber keinen fünfundzwölfstelligen Aktivierungscode, den ich brauche, um mir Zugang zu verschaffen. Kein Problem, sacht sie, den könne sie mir sogar per elegdönischer Post innerhalb von 90! Minuten zuschicken. Nachdem ich meine Schuhgröße, Mädchenname der Mutter, Schwanzlänge, Bauchnabeldurchmesser und die Emaille durchgegeben habe, hat sie einen Knopf gedrückt und mir versprochen, dass ich den geheimen Geheimcode in anderthalb Stunden in meinem Briefkasten hätte. Wenn nicht, möge ich doch bitte mein Dosenfleisch durchschauen…

Drei Mal dürft ihr raten, was nicht passiert ist… Naja, mal sehen, was der nächste Tag so bringt. Vielleicht kömmen ja mit einem Firmware-Update auch die eingestellten Einstellungen wieder.

Das Firmware-Update kam latürnich, aber nicht mit den erwarteten Einstellungen. Heute Morgen durfte ich dann feststellen, dass ich nicht nur nicht im Bridge-Modus war, sondern außerdem auch keine IPv4-Adresse mehr hatte, dafür aber endlich IPv6, was mit meinem alten Bremsklotz noch schwieriger war, als mir den geheimen Geheimcode zuzusenden oder die Lichtgeschwindigkeit zu überschreiten. Das Ganze nennt sich dann DS-Lite. Man bekommt eine private IP-Adresse (RFC 1918), die dann irgendwo im VodaToll-Netz genattet wird, und dazu ein /64-IPv6-Netz geroutet. Kein Problem, da ich über den Telekomiker-Anschluss noch via IPv4 erreichbar bin.

Die 400 Mbit liegen auf jeden Fall an. Das sind nicht nur "bis zu", sondern wirkliche 400 Mbit. Wenigstens etwas. Bin gespannt, ob ich diese Woche noch den Aktivierungskot per Schneckenpost bekommen. Noch viel gespannter bin ich darauf, ob ich mich damit wirklich einloggen kann, und was gebeurt, wenn ich es wage, den Bridge-Modus einzuschalten!

Alles weitere demnäxt in dieser Sendung!

-- 
Bis später!
Arno.

 

NVIDIA: Failed to initialize the GLX module

Another fallout from the dbus adventure: After I had othalla up and running again, I noticed that the graphic performance was really bad. Playing movies wasn’t moving at all, it was more like a slideshow.

Xorg.0.log said:

[  4978.363] (EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X 
[  4978.363] (EE) NVIDIA(0):     log file that the GLX module has been loaded in your X 
[  4978.363] (EE) NVIDIA(0):     server, and that the module is the NVIDIA GLX module.  If 
[  4978.363] (EE) NVIDIA(0):     you continue to encounter problems, Please try 
[  4978.363] (EE) NVIDIA(0):     reinstalling the NVIDIA driver.

Strange… Turns out X loaded the xorg glx module from /usr/lib/xorg/modules/extensions instead the right one from /usr/lib/nvidia/xorg. No idea why, but adding:

Section "Files" 
    ModulePath      "/usr/lib/nvidia/xorg"
    ModulePath      "/usr/lib/xorg/modules"
...
EndSection

to xorg.conf before the regular path /usr/lib/xorg/modules fixed it.

 

DBUS Crap

After today’s (2017/06/16) usual pacman -Syu & systemctl reboot the shit hit the fan. SDDM started up fine, but when I tried to login, nothing happened for a while until I got a nice X11-Widget right from the 80’s telling me that something “could not sync environment to dbus”. Yeah, sure! WTF!?

First stop: Google. I’m not the only one. For some reason I can’t just “startkde” any more, but have to use “dbus-launch startkde” in /usr/share/xsessions/plasma.desktop (that’s where SDDM gets the sessions from). Easy enough. KDE loads and seems to work, but it doesn’t really. Any connection attempt to the session bus fails: can’t connect to the ssh-agent even though it’s started, can’t do systemctl –user <something>, pulseaudio doesn’t work and so on… Craptastic!

Maybe it’s some cruft in ~/.config or ~/.session. Move both away, and just to make sure, ~/.cache, too. One swift reboot later it’s work… Fuck, same shit! While skimming through wiki-pages and forum-posts on my mobile, I read the suggestion to try a new user. OK, can’t hurt, can it?

Yes, it kinda can! Of course that works! Well, at least one way out. So, create a new user and port all settings there. Oh what fun! Well, I learned a lot of lessons, like:

  • If you have an USB2 stick plugged in, entering the UEFI-Crap-Thingy what’s now called BIOS doesn’t work (or takes an eternity, maybe I didn’t wait long enough). At least it still boots if you don’t hit DEL or F2
  • The ssh-agent.service for users is hand-crafted (or stolen from somewhere, I don’t remember). You must have $SSH_AUTH_SOCK set in your .bashrc (the latter is sourced by SDDM, BTW) to make it work.
  • Sometimes it ain’t so bad to have Google accounts. After logging in with Chromium, my bookmarks and extensions were back almost immediately.
  • To start a synergy Server, all you have to do is “systemctl –user enable synergys.service”, if you have a working config in /etc/synergys.conf. Starting the client is another beast, though…
  • How to copy and modify the beet database (stored in $HOME/.config/beets/musiclib.blb in my case):
$ ~/.config/beets $ sqlite3 musiclib.blb
SQLite version 3.19.3 2017-06-08 14:26:16 
Enter ".help" for usage hints. 
sqlite> update items set path = replace(path, '<oldhome>', '<newhome>');
  • You don’t have to fire up QtCreator if rdpk starts and exits immediately. If you tell xfreerdp to use pulseaudio and there’s no daemon running, it will do just that…
  • For some reason, letting minidlnad reindex everything is much, much faster than letting it read the database on startup
  • LibreOffice macros are stored in $HOME/.config/libreoffice/4/user/basic/Standard/Module1.xba for now. You can just copy that file to the new $HOME and have fun with it after restarting it

Maybe it was a good thing ™ to get rid of all the baggage, I don’t know… Sure enough, it happened on othalla, too 🙁