single quotes in Zettlr (with Espanso working)

If you use Espanso to automatically replace straight apostrophes (') with typographic apostrophes (’), make sure to disable Magic Quotes in Zettlr’s settings (for single quotes, in autocorrect options) to avoid conflicts and prevent duplicate apostrophes.

A light alternative to VirtualBox

VirtualBox is a advanced and graphically friendly choice to work with virtual machines. But it is also very heavy (in storage and RAM usage).

A light alternative then can be, in linux QEMU/KVM + virtual machine manager.
It is no so friendly and intuitive as VirtualBox, but it is very small and fast, and the final result (getting a virtual SO within your linux distro) is absolutely the same. With the advantage to have more RAM free.

Removing an embedded macro from an old ODT

You may occasionally find that an old ODT file contains an embedded macro that you cannot get rid of through LibreOffice Writer’s graphical interface.

Nor does saving the document as DOCX or RTF and then converting it back to ODT necessarily solve the problem.

In this case, you can try the following workaround.

  1. Extract content.xml from your ODT file (e.g. using Ark, the KDE archive manager).
  2. If you cannot work with the file because all its contents are on a single line, you can format the XML using this command:
xmllint --format content.xml -o content.xml
  1. Search for the macro-related event binding, typically in a block like this:
<text:execute-macro>
    <office:event-listeners>
        ...
    </office:event-listeners>
</text:execute-macro>
  1. Delete the relevant block and save content.xml.
  2. Replace the original content.xml in the ODT archive with the modified version (remove the old one first).

That’s it!

Important: Make a backup copy of your original ODT file before starting.

Between auto and noauto in fstab

In Linux, /etc/fstab is a crucial file: if you set a partition to auto, the system attempts to mount it during boot. If the partition is unavailable, this may delay the boot process or, in some cases, prevent the system from starting properly.

However, you may still want the system to mount that partition whenever it is available, even if it is not essential for the system to run.

A possible solution is to set the nofail option for that partition in /etc/fstab: this way, the system attempts to mount it if possible, but continues booting even if the mount operation fails.

It is also a good idea to add the following option to avoid waiting too long for the device to become available:

x-systemd.device-timeout=2s

markdown superscript

There are several ways to use superscript in markdown, none of them unanimously accepted.

A good choice seems this code $^2$ : better than <sup>2</sup>,

  • because of its brevity,
  • and because it can be rendered from good markdown editors/viewers such as Zettlr, Typora or MarkFlowy.

How to find in a MySQL table the heaviest rows

You can try this code, to find the the heaviest rows in a given column of a table:

SELECT id, LENGTH(your column) AS byte_size
FROM your-table
WHERE LENGTH(your column) > 500 [you can adapt this number to your needs]
ORDER BY byte_size DESC;

This can helpful if you want free your table of useless data, moving them i.g. to external txt or md files.

php+bash script problem

If you call a bash script from a php one, be sure that you have the correct permissions. To grant them, you could have to do this command:

setfacl -m u:www-data:rwx /the/path/where/you/have/to/exec/bash