All posts by ZJ Laczik

Zoom function in Calibre e-reader

There does not seem to be one.

Control + mouse scroll will adjust the font size, but not the overall scale of the display. This is especially annoying when at the default zoom level some of the text falls outside the the e-reader window:

Cumbersome, but at least the text will become readable: CSS to the rescue.

  • Right click in the reader window
  • Select ‘Preferences’
  • Select ‘Styles’
  • Add a new scaled body style in the text box
  • Click OK
  • Close the ‘Preferences’ menu
  • Start reading

The CSS properties added are:

body {
  transform-origin: top left;
  transform: scale(1.0);

Why this is not available via the GUI… ?

P.S. The new style is stored in .config/calibre/viewer-webengine.json

Unpack, modify and repack an epub file

Although epub format e-books are simple ZIP archives, care has to be taken in how unzip and zip are used to manipulate them.

mkdir wrk && cd wrk
unzip -O UTF-8 old.epub
nano OEBPS/one_of_the_files.xhtml
zip -rX ../new.epub mimetype META-INF/ OEBPS/

Without using the -O option when unpacking UTF-8 file names are likely to get corrupted. For the repack, use of -X is required and the directory order in the archive has to be as given above, otherwise the epub file will not be recognised by most e-readers.

As an aside, modifications can be easily tested using a web browser. Each page in the e-book is represented as an xhtml document, which can be opened by pointing the browser to file:///home/user/wrk/OEBPS/one_of_the_files.xhtml (for example).

Check server temperature using HP iLO

ssh Administrator@ -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostkeyAlgorithms=+ssh-rsa
</>hpiLO-> show /system1/sensor1
    DeviceID=01-Inlet Ambient 
</>hpiLO-> show /system1/sensor5
    oemhp_CriticalValue=Not Applicable
</>hpiLO-> show /system1/sensor12
    DeviceID=12-Sys Exhaust 

HP iLO ssh access

Even the most recent version of iLO is trying to use cypher algorithms that have been deprecated in OpenSSH:

ssh Administrator@
Unable to negotiate ... no matching key exchange method found.
Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
ssh Administrator@ -oKexAlgorithms=+diffie-hellman-group1-sha1 
Unable to negotiate ... no matching host key type found.
Their offer: ssh-rsa,ssh-dss
Unable to negotiate ... no matching cipher found. Their offer: aes256-cbc,aes128-cbc,3des-cbc

… and the winner is:

ssh Administrator@ -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostkeyAlgorithms=+ssh-rsa -oCiphers=+aes256-cbc

Make your own QR codes

Install the tools:

sudo apt install qrencode zbar-tools

Create the source:

nano text_for_QR_code.txt
MECARD:N:Dr AN Other;TEL:+441234123456;EMAIL:AN Other <>;NOTE:Director;ADR:123 Other Street, London, A1N 2OT, United Kingdom;URL:;

Generate the corresponding QR codes:

qrencode -t PNG -r text_for_QR_code.txt -l H -o QR.png
convert QR_2023.png QR_2023.jpg
qrencode -t ASCII -r text_for_QR_code.txt -l H -o QR_2023.txt
cat QR_2023.txt | sed 's/#/█/g' > QR_2023_utf8.txt

Useful links:



  1. The AnyConnect VPN Client for Linux is available from the OUCS Software downloads page for Linux; see release notes for details.
  2. Unpack the downloaded file using an archive manager or type tar -xzvf filename from a terminal window (replacing filename with the file’s name).
  3. In a terminal window, navigate to the newly created directory beginning ‘anyconnect’, then to the VPN directory.
  4. Start the installation by typing sudo ./


  1. To start the client either: • Select Cisco AnyConnect Secure Mobility Client from the Applications menu.
    • Type vpnui at the command line in the installation directory (for Ubuntu this is /opt/cisco/bin).
  2. Provide then Connect.
  3. Provide your Oxford username in the format and your Single Sign-On (SSO) password.


  1. Select the VPN icon in the system tray.
  2. Select Disconnect.

Advanced settings:

The Cisco AnyConnect VPN client requires an SSL tunnel (TCP port 443) and optionally a DTLS tunnel (UDP port 443).

VPN clients contact the VPN servers in the netblock

VPN clients will be given an IP address from the private IP ranges of or  These private addresses will be mapped to a public IP in the netblock by the use of dynamic PAT.

Further details are available on the OUCS VPN page.

Disable snap and switch from snap to deb packages for Firefox in Ubuntu 22.04

Disable snapd

Remove Firefox (and other) snap packages:

snap list
snap remove firefox

Stop snapd service:

systemctl stop snapd.service
systemctl stop snapd.socket
systemctl stop snapd.seeded.service
systemctl disable snapd.service
systemctl disable snapd.socket
systemctl disable snapd.seeded.service

Remove snap related packages and directories:

apt autoremove --purge snapd chromium-browser* chromium-browser-l10n* gnome-software-plugin-snap* liblzo2-2* snapd* squashfs-tools*
rm -rf /var/cache/snapd
rm -rf /root/snap/
rm -rf /snap /var/snap /var/lib/snap

Install non-snap version of Firefox

Disable snap version

nano /etc/apt/preferences.d/mozilla-firefox
Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1
add-apt-repository ppa:mozillateam/ppa
apt update
apt install firefox
How to Install Latest Firefox as classic Deb in Ubuntu 22.04 | UbuntuHandbook

How to Install Firefox as a .Deb on Ubuntu 22.04 (Not a Snap) - OMG! Ubuntu!

Change X11 window title

A typical use case is when an editor is setting its window title to the full long path name such that the actual important part, the file name, falls off the edge on the right and becomes invisible. Unfortunately the X11 window title is normally set internally by the application and its format is hard coded. A solution is to monitor the editor window title and modify it if its becomes too long.

Continue reading Change X11 window title

Repartition a new USB drive

I want to use my new USB drive exclusively with Linux, so I decided to wipe the factory default partitions and create a new ext4 filesystem on the drive. The drive uses 4096 byte physical sectors and we have to make sure that the new partition is correctly aligned. For some background information on partition alignment, see this link.

Check that we are wiping the correct drive

sudo parted /dev/sdb unit s print free

Note the details in case you want to restore the original partitioning scheme. Information on the factory default can also be found here.

Continue reading Repartition a new USB drive

Atril (evince, document viewer) default directory for Save As

For the XFCE desktop environment Atril is the default PDF viewer and I also use it to open any PDF files from Firefox. It is a great lightweight document viewer which does what I need most of the time. One exception is when after opening a PDF file from Firefox I decide to keep the file and select File Save As. Atril insists on saving the file in $HOME/Documents, which is practically never the directory I want to use…

Continue reading Atril (evince, document viewer) default directory for Save As