Xournal++

Annotating PDFs was long a difficult enterprise on any operating system. In Windows, it used to require an expensive copy of Adobe Acrobat Pro; in Linux, the glorious PDFtk tool has long been around for basic page reorganization tasks, but on-page editing has remained a real headache. I need this functionality particularly to correct digitally submitted student work.

Recently I discovered Xournal++, which does nearly everything I need it to, and then some, on all the major platforms. It is actually intended for notetaking using tablets, but I use it on my laptop and simply add coloured text fields around the content of existing PDF files. It stores a metadata file, so you can return to edit your document later; when done, simply export a second PDF file to return to your student.

The main feature I have not yet been able to find is word processor-type text formatting (cursive; smart quotes). This would be helpful to have when correcting students’ mechanics. Amazingly, it does allow for TeX math input.

posted by paul on 3 jan mmxx at 09:27 EST

Office 365

For a long time, the track changes function in .docx documents could not safely be used in LibreOffice, at least not when collaborating with someone using Microsoft Word, as changes would simply disappear. Fortunately, this has since been solved. Even so, I occasionally experience formatting issues when pinging a document back and forth between the two software suites, notably in footnotes. More generally, when preparing copy for submission to a publisher you don’t want to take any chances: if they ask for a Word-formatted document, you had best do your final checks in Microsoft Office.

For Linux users, Office 365 has long appeared to promise the solution: Microsoft functionality within the browser. If I recall correctly, when it first launched its features were still a little limited. I recently got hold of a licence through work, and they seem to have made large strides: the ribbon looks impressively comprehensive, and even the speech-to-text engine works surprisingly well without any voice training.

For some reason, however, the one reason to turn to Microsoft Office in the first place, collaboration, is crippled by the absence of that key function: track changes is only available in the desktop distribution. This is the more disappointing because I am actively involved in a book project with a team sufficiently large that we desperately need realtime collaboration, and the team’s technical expertise is sufficiently diverse that any solution that does not involve native .docx editing is out. There seem to be a number of commercial solutions on the market, but if Microsoft can’t get it right I’m skeptical (and I could never get the team to splash out on software). Are there any other solutions out there?

posted by paul on 3 jan mmxx at 09:04 EST

netctl

Wireless networking using spartan system managers such as Debian’s /etc/network or Arch’s netctl is one of those typical Linux things where if you haven’t done it in a while you can spend hours either just getting set up or, arguably worse, reconstructing how the whole thing has fallen apart when you don’t recall making any substantial changes that stopped your networking from, well, working. It’s worth investing a bit of time learning how these systems work, however, because the user-friendly GUI alternatives rely in part on the same backends, so roughing it will help you understand the system.

With wireless networking, you’ll typically want your system to autoselect the strongest registered network in range, which is done using wpa_supplicant. Your network manager will be communicating with this utility. In Debian, this means your wireless profiles are configured in /etc/wpa_supplicant/wpa_supplicant.conf and given ID strings there (using the field id_str) that are then recalled in /etc/network/interfaces. Instructions on the Debian Wiki are helpful, only rather than reproducing the id_str field in /etc/network/interfaces it says to reproduce the SSID and PSK fields generated into /etc/wpa_supplicant/wpa_supplicant.conf. In Arch, wpa_supplicant is used behind the scenes only, by netctl-auto; all configuration takes place in files in /etc/netctl/.

When running into issues with Arch’s netctl, of course the first step is to consult https://wiki.archlinux.org/index.php/Netctl. I find that some things are more prominently there listed than others, so here’s a few pointers to keep in mind:

posted by paul on 3 jan mmxx at 08:44 EST

LUKS Encryption and Backup Images

I will have my motherboard replaced tomorrow. What with SSDs now soldered or glued onto the motherboard, I thought it best to clone my full SSD as backup.

My SSD has two partitions:

Cloning the full physical volume is straightforward (superuser privileges are understood for all the following operations):

  1. Boot from a live system so the source partitions are not mounted;
  2. Mount your destination volume, so you can store the clone as a disk image file and have the remainder of the device left for other storage;
  3. Run dd if=/dev/nvme0n1 conv=sync,noerror bs=64K status=progress of=/media/backupdrive/backup.img (where nvme0n1 is the physical volume, not a partition, and backupdrive your mount point).

I was able to leave my newly purchased USB HDD in standard formatting to do this. A 1TB mirror took about two hours I think. Remember though to use a destination drive that is at least as large as the source; unlike with the old 1.44MB disks, you cannot assume that a 1TB disk can be backed up onto a 1TB disk.

The puzzle was to mount the partitions below the image to verify that the mirror was successful. Here you’ll want to take the following steps:

  1. Mount the external HDD (ideally on a system that does not have the source partitions mounted, as their UUIDs will be identical);
  2. Run losetup -P /dev/loop0 /media/backupdrive/backup.img; this will automatically create loop devices /dev/loop0p1 and /dev/loop0p2 for your partitions on a recent system;
  3. To access the encrypted partition, run cryptsetup luksOpen /dev/loop0p2 imgroot, which will prompt for the passphrase and mount the partition under /dev/mapper/imgroot;
  4. Mount the mapper device as you would mount any regular partition: mount /dev/mapper/imgroot /media/imgroot.

Now you can inspect the integrity of your backup at your leisure. To unmount, remember to observe the proper sequence:

  1. Unmount the mapper device;
  2. cryptsetup luksClose the mapper device;
  3. losetup -d /dev/loop0
  4. Unmount the external HDD.

Now if the need should ever arise, I should be able to boot from archiso and simply dd if=/path/to/backup.img conv=sync,noerror bs=64K status=progress of=/dev/nvme0n1 to restore my partitions.

posted by paul on 13 june mmxix at 11:31 EST

Troubleshooing Avahi Address Resolution

As noted in my Arch setup monsterpost, I have learned to set up a new network printer as follows:

# lpadmin -p imageRUNNER1133 -L “HiWi-Raum\ Mediävistik” -E -v dnssd://Canon%20imageRUNNER1133%20series._pdl-datastream._tcp.local/ -m cel-ir1133-pcl-en.ppd

Unfortunately, when I got back from vacation the network printer threw an “unable to locate printer” error whenever I sent it a print job. As I had been using Avahi address resolution, I suspect that’s where the problem is, but the Avahi daemon appears to be running fine.

To get around the issue, I’ve reverted to IP-based addressing, thus:

# lpadmin -p imageRUNNER1133 -L “HiWi-Raum\ Mediävistik” -E -v ldp://134.76.138.69/ -m cel-ir1133-pcl-en.ppd

It is also worth noting, perhaps, that there’s a tool called system-config-printer that allows for easy graphical printer setup.

posted by paul on 10 sep mmxviii at 09:35 EST