30/05/2025

Notes on installing Matlab on Kubuntu 25.04

 I don't use matlab a lot, which means I keep running into the same snags on installing.

No. 1: "error while loading shared libraries and libexpat.so.1: file too short" during install. 
That's a broken links issue that can be resolved by setting the X and K flags during unzipping 
unzip -X -K matlab_R<yourversion>.zip

Source: MATLAB answers

No. 2: Matlab crashed while trying to load the addon explorer, with some complaint about memory issues.
Apparently a Java issue to do with the open files limit (see this discussion). 

I simply increased the system-wide hard limit, but would probably try doing it via ulimit -n first next time.

10/05/2025

Passive aggressive Easter egg of the week

import seaborn as sns
import numpy as np
data = np.random.randint(0,10,(50,5))
sns.violinplot(data,palette='jet')


29/03/2025

How to get the Logitech R400 Presenter to work with Okular

 

The Logitech R400 has been around for a while, it's a solid, affordable presenter (with a slightly crappy laser, though) and you can get a good deal for it online. 

To have it fully work with a PDF presentation on Okular - i.e. use all four buttons - I had to do some simple tweaks.

First, find out what the buttons do by running xev in a terminal. 

(1) and (2) are mapped on 'Prior' and 'Next' and work out of the box. (3) is supposed to toggle presentation mode and alternates between F5 and Escape. (4) is meant to toggle a black screen and transmits a period, '.'

The quickest fix is to just redefine Okular's keyboard shortcuts in the Settings menu. I set the alternate shortcut for 'Switch Blackscreen Mode' to '.' and the one for Presentation to F5. Note that this disables the default 'Reload' shortcut, but Okular usually reloads automatically, so it's not too bad.

The alternative is to remap the presenter input from F5 to eg. F4, which is not conflicting with Okular's default scheme. I googled a bit (see this handy Medium post) and found input-remapper, which is in the Ubuntu repos and comes with a polished  and quite self-explanatory GUI.