28. August 2020

Manjaro NVIDIA Screen Tearing Fix

Using the information from https://www.blogger.com/blog/posts/1177617571463101591?hl=en&tab=jj the following things are requried:

Change the contents of /etc/X11/mhwd.d/nvidia.conf the Section "Device" from:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
        Option "NoLogo" "1" 
EndSection

to:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
        Option "NoLogo" "1" 
    Option "metamodes" "nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
EndSection

and save the file as 95-mhwd.conf within /etc/X11/.
Next we create a symlink from within /etc/X11/xorg.conf.d/:

cd /etc/X11/xorg.conf.d/
mv 90-mhwd.conf ../90-mhwd.conf.bak  # this is only a symlink but I always feel bad deleting stuff
sudo ln -s ../95-mhwd.conf .

After a new login the screen tearing issues were fixed for me.


27. August 2020

Create systemd user specific service

 This is just a short cutdown from: https://unix.stackexchange.com/questions/496982/restarting-systemd-service-only-as-a-specific-user as it is easier than to google everytime. 

In the case that one wants to run a service as a specific user, if the application allows, by using systemd it is possible. First you have to activate the linger for the user in question: 

loginctl enable-linger username

Now you create the corresponding directory and move your service files into it. In my case this was a noip2.service file. All commands are executed as the normal user.

mkdir -p ~/.config/systemd/user
mv ~/noip2.service ~/.config/systemd/user
systemctl --user daemon-reload
systemctl --user enable noip2.service
systemctl --user start noip2.service

It is important to note, that within the user context there is no multi-user.target. Therefore these have to be changed to default.target.

Sources:

https://wiki.archlinux.org/index.php/Systemd/User#Automatic_start-up_of_systemd_user_instances
https://unix.stackexchange.com/questions/496982/restarting-systemd-service-only-as-a-specific-user
https://gist.github.com/NathanGiesbrecht/da6560f21e55178bcea7fdd9ca2e39b5

OpenVPN --askpass

 Mein OpenVPN Server, fragte nach jedem Systemneustart nach einem Passwort mit folgender Zeile:

Broadcast message from root@<server> (Thu 2020-08-27 17:54:23 CEST):
Password entry required for 'Enter Private Key Password:' (PID 6285).
Please enter password with the systemd-tty-ask-password-agent tool!

Das ist natürlich eher unerfreulich. Vorallem wenn man bedenkt, dass im Falle das man neustartet im lokalen Netz sein muss um den VPN wieder zu starten. Um dieses Problem zu beheben reicht es bereits folgende Option im config-File einzutragen:
askpass [File]
Dann noch eine Datei [File] anlegen in /etc/openvpn/ und mittels chmod 400 <File> die Rechte auf read-only setzen. In der Datei [File] ist nun noch das Passwort einzutragen welches man ansonsten bei systemd-tty-ask-password-agent eingeben würde.

Ursache für das ganze ist folgende: Erstellt man den Private Key mit einem Passwort, benötigt man dieses natürlich um den Key benützen zu können. Daher resultiert die Abfrage.

Quellen:
https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/
https://www.it-swarm.dev/de/15.10/openvpn-fehler-beim-starten-bitte-geben-sie-das-passwort-mit-dem-systemd-tty-ask-password-agent-ein/960924399/