Fixing Jupyter access denied on Ubuntu 22.04

After the upgrade to Ubuntu 22.04 Jupyter Notebook (on Firefox 99.0.1) would greet me with an Access Denied error. Not exactly conducive to work.

I tried setting access right of the directories (I also thought about access issues given that .local is a hidden directory), but it turns out that creating an explicit configuration helps:

jupyter notebook --generate-config

This creates a file at: ~/.jupyter/

and in this (text) file we’re looking for c.NotebookApp.use_redirect_file, uncomment it, and set it to

c.NotebookApp.use_redirect_file = False

(as explained in the comments; this seems completely fine on a single-user machine).

Let Rhythmbox play MP3 again

Today I noticed Rhythmbox not playing some music files in Debian. After a bit of digging around, I noticed the warning “your gstreamer installation is missing a plugin” in the file properties. From there it wasn’t far to realize that MP3 files did not play in Rhythmbox (any more), and that I probably need a (new) plugin (it’s Debian ‘unstable’ after all, so this was probably introduced by a recent update). sudo apt install gstreamer1.0-fluendo-mp3 and restarting Rhythmbox was all I needed to do.

“I don’t care about cookies” breaks ORCID — easy fix

I have discovered that the Firefox add-on “I don’t care about cookies” breaks ORCID in the sense that the ‘visibility buttons’ on ORCID are not shown when editing the ORCID record. After experimenting a bit, I discovered that it was the said add-on that somehow breaks the page. There’s an easy fix: white-list by visiting the page, right-clicking “I don’t care about cookies” > “disable on”. Done.

A Modified Shapefile for Plotting Swiss Cantons

The GADM database of Global Administrative Areas is the place to go for shapefiles of administrative boundaries. The data are freely available for academic use and other non-commercial use. Unfortunately, the boundaries of the Swiss cantons are a bit buggy. Version 2 has fixed the presence of a 27th canton — part of Lake Geneva, but it includes the entire lake of any lake shared with a neighbouring country as Swiss territory.

The licence of the GADM files is never made explicit, and while it says “Please contribute in whatever way you can by sending us a message to point out errors, or even better, to send an improved file for a country of your interest,” there is no way to send improved files on their website. I never got replies to my messages, so consider this post as my sending an improved file.

The files are on Github. I have modified cantonal boundaries so that they match the national boundaries: only the Swiss part of lakes is included as Swiss territory. I’m not sure the files other than the .shp, .shx, .dbf, .prj are actually needed.

Here’s how to draw a map in R. First we load two libraries:


Then we import the shapefile:

x <- readOGR(dsn = ".", layer = "ch-cantons")

The dsn argument takes the location of the shapefile (dot for current directory); the layer argument takes the name of the shapefile without extensions.

And now we draw the map:

data <- 1:26 # values to plot
x$data <- data # add to SpatialPolygonsDataFrame
col <- rev(heat.colors(26)) # define colours
spplot(x, "data", col.regions=col, main="", colorkey=TRUE)

The cantons are as follows: c("AG","AR", "AI","BL", "BS", "BE", "FR", "GE", "GL", "GR", "JU", "LU", "NE", "NW", "OW", "SG", "SH", "SZ", "SO", "TG", "TI", "UR", "VS", "VD", "ZH", "ZG").


Overcoming Pandoc Issues in Debian

Debian doesn’t include a recent version of pandoc, unless you’re living on the hard edge (a.k.a. experimental). When pandoc threw errors for documents passed to pandoc-citeproc, I suspected that an update would resolve the issue, especially as the same document compiled fine under Windows and older documents also failed to compile. There’s an up-to-date Debian package from the official repository, but not for my architecture. Compiling it is, then. Downloading and compiling posed no problem, but somehow the symlink out of ./cabal/bin failed to work properly, as did creating a symlink to the pandoc installed within/alongside rstudio. I guess there’s a clean solution during the compilation stage, but the quickest workaround was copying the binaries in ./cavbal/bin to /usr/bin. Not pretty, but functional.