Skip to main content Skip to page footer

Linux Related Tips

Computer programs are fun to write, and well written computer programs are fun to read. One of life's greatest pleasures can be the composition of a computer program that you know will be a pleasure for other people to read, and for yourself to read.
Computer programs can also do useful work. One of life's greatest sources of satisfaction is the knowledge that something you have created is contributing to the progress or welfare of society.
Some people even get paid for writing computer programs! Programming can therefore be triply rewarding - on aesthetic, humanitarian, and economic grounds.
Donald E. Knuth

Migrating to UEFI

After almost 19 years of repeatedly updating and occasionaly copying my (formerly SuSE, now) OpenSuSE Linux from one harddisk to another, the point arrived where switching to UEFI was unevitable.

I must admit that I failed in getting grub2 to properly install. As a last resort, I installed a current OpenSuSE on my new disk and discarded anything but the /boot directory – shame on me! Then I copied my old installation. The only thing left was to make an entry for the efi partition in /etc/fstab.

UUID=ABCD-1234 /boot/efi vfat umask=0002,utf8=true 0 0

What I learned afterwards: OpenSuSE places several large files into the efi partition, so if you have a chance, you should make it larger than the minimum 100 MB.

Using an Epson MFP on OpenSuSE Leap

Buying a printer for use with Linux ist unfortunately even in 2019 not a no-brainer. As if it was not hard enough to decide between distinct printing technologies and distinct vendors and to find a balance between printer costs and costs of consumables, you really have to look hard for compatibility. I chose an ink printer this time, and I did not want a device that comes with software that clutters my screen and shows nagging messages and phones home every time I print something, so the choice was somewhat limited.

Epson offers Linux software without support for its printers and multifunction devices. As the scanning software is partially proprietary and does not contain all the source code, you can not be sure that it will run on your next distribution. For printing, it helps to buy a more expensive device that emulates PCL and PostScript. Epson will charge you about a hundred bucks more for this than for its corresponding GDI devices (e.g. for a WF-C5790 instead of WF-C5190). Apparently, Epson uses GhostScript instead of real PostScript, but I did not discover any disadvantages.

For printing, I used the .ppd.gz file from Epson with CUPS. There was no need to tweak anything.

The scanning software for OpenSuSE comes as an RPM, so installation ist quite easy. There ist scan support in your favorite graphics software (GIMP) via SANE, and there comes a standalone tools that produces multi-page PDF. What did not work out of the box for me was changing the scanning resolution. Strange enough, the fix is easy:

Edit the Epson:...drc File for your scanner in the .sane/xsane subfolder of your home directory. Find the line post "resolution-bind" and change the 1 to 0. This is all there is.

Installing the G'MIC plugin for Gimp on OpenSuSE Leap

G'MIC features lots of fancy filters. You should perhaps not try them, it steals all of your spare time.

  • Download the Linux 64 Bit Zip file from gmic.eu. Note: I use KDE, so this is fine.
  • Unzip
  • Copy gmic_gimp_qt to your Gimp plugin folder (see here for finding out where the folder is).
  • Run gmic_gimp_qt from the command line. If it complains about being a filter for Gimp, everything is fine. If instead it complains about missing libraries, you should install them. My machine lacked libfftw3_threads.so.3. I installed it with YaST.
  • Restart Gimp. G'MIC QT is the last entry in the Filter menu.

Installing the Resynthesizer Plugin for Gimp on OpenSuSE Leap

This is probably too trivial to write about, but I'll do it anyway. The resynthesizer is an amazing tool for removing irregularities from pictures, e.g. people, skin defects and so on.

 

  •           Get the sources: git clone github.com/bootchk/resynthesizer
  • Enter the resynthesizer directory you have created and run autogen: ./autogen.sh
  • Take care for missing dependencies: I had to install gimp-devel with YaST and re-run autogen.
  • Run make: make
  • Become root and run make install.

You should be done, but I wasn't. I had to copy the Python scripts from the global Gimp plugin directory to my private Gimp plugin directory. You may lookup the plugin directories by editing settings within Gimp, clicking on the arrow at Folders (left, at the bottom), then plugins. My command was, at last:

cp /usr/local/lib64/gimp/2.0/plug-ins/* ~/.gimp2-8/plug-ins/

Then I had to restart Gimp. Oh, and before you ask: I had deleted pluginrc in my Gimp folder.

Undoing Unzip

Unzipping something into an already existing directory structure is not that easy to undo. Here is a way that works for me:

  • List the zip archive contents to a file:
    unzip -Z archive >remove.sh
  • Remove anything left of the file names from the file. I used emacs, marked the area and then used delete-rectangle. Alternatively, you may use a spreadsheat and the function Data/Text in Columns (I hope it is named like this in English, in german it is called Text in Spalten) with blank space as separator. Then you may delete the first columns.
  • Write rm to the left of the file names.
  • Invert the order of the lines. with emacs, you have to mark all the text and then say reverse-region. This leads to the directories being listed beneath the files contained therein.
  • Find lines ending with a slash. These are the directories. If you know that there will be nothing inside them except your unzipped files, you may change the rm at the beginning of the line to rmdir. If not, you will want to delete this line.
  • Save your file, make it executable and execute it.
    Spreadsheet users may save their file as csv with blanks as field separator.

Some words of caution:

  • Files overwritten by your unzip action are gone.
  • Making typos may have desastrous consequences
  • If you think that you may be still alive tomorrow, making an occasional backup of your data is a good idea, anyway.

Having NumLock switched on by default

From OpenSuSE 42.2 on, you have to use KDE system settings to permanently enable NumLock, /etc/sddm.conf and /etc/sysconfig/keyboard are not working.

Fighting with Akonadi (Kontact/KMail)

For years I have been using Kontact, unfortunately my satisfaction diminished. Recently, Kontact often shows "retrieving folder contents" for a long time, getting duplicated mail headings is quite common, etc.

What I have done so far:

  • Increased cache settings in ~/.local/share/akonadi/mysql.conf, unfortunately with no obvious effect.
  • Did akonadictl restartakonadictl fsck, and akonadictl vacuum often. Sometimes Kontact would work for a while.
  • Ran akonadiselftest. This was helpful in discovering that I had to do mysql_upgrade on the akonadictl database (after all, I am upgrading my Linux installation since SuSe 7.3), as a system table was apparently missing.
  • Upgrading mysql did work the following way:
    • Find out the socket for mariadb. I found a link in ~/.local/share/akonadi/socket-gustav (gustav being my computer's name), following this link revealed the socket in the folder /tmp/akonadi-[...] with the name mysql.socket.
    •   Run mysql_upgrade on this socket: mysql_upgrade --socket=/tmp/akonadi-[...]/mysql.socket

    Unfortunately, this was not enough.
  • Exported settings and Calendar, unistalled Akonadi, Kmail, Korganizer, Kontact. Wiped configuration files from the platter. Installed again. This seems to help.
    Drawback: PIM Exporter does not export your account settings or mail filters. You have to document and reproduce your work elsewhere.

Silencing the Windows key (EnduraPro keyboard)

My old IBM Model M keyboard finally ceased to work so I had to look for an adequate replacement. Besides the better Cherry models, e.g. G81-3000, there are yet more sophisticated keyboards from several vendors. To keep the original feeling, and as improvement leaves a better feeling than replacement, I decided to buy an EnduraPro keyboard directly from Unicomp. The EnduraPro features a pointing stick. This should raise productivity as the right hand has not to leave the keyboard for mouse movements that often. For a few bucks more I could also get some special caps for the windows keys – see photograph. The keyboard arrived within five days. If you consider importing one for yourself, you should take customs duty into account, too.

During the first days, I often got annoyed because I hit the right windows key when AltGr was intended. I first thought it was because the Model M had had no windows keys at all. But looking at keyboards at work I found out that I was wrong: All keyboards I have to deal with have (left to right) space bar, AltGr, Windows key, menu key, the EnduraPro has Windows key, AltGr, menu key. Nasty. If you do some programming, you need the AltGr key over and over again. No wonder I kept hitting the windows key.

The windows and AltGr keys are not equally wide, so simply swapping them is not an option. So I decided to map the right windows key to something less distracting than calling the system menu. I had to learn that on my OpenSuSE Leap KDE desktop, tips for using xmodmap just do not work. KDE system settings did the trick. In KDE system settings, you can only choose between several common remappings, you are not as free as with xmodmap, so I mapped ‘compose’ onto the right windows key.

For MS Windows, there is a registry entry to remap keys – see here. This is not comfortable, but it works and you do not have to install any additional software. Besides, it works on any current windows version. I decided to make the right windows key useless there. This does not help against hitting the right windows key by accident, but at least focus is not lost.