Plurrrr

home

Changing margin and paper size

Yesterday I learned how to change the margin of the PDF file Pandoc generates. But I forgot about the paper size. I live in the Netherlands and A4 is the common format here. First, I wanted to know how to check the current paper size of a PDF file. This can be done on the macOS command line as follows:

mdls freecodecamp.pdf |
    grep -i page

This reports the number of pages, the height (792 for US letter) and width (612 for US letter). The values are in PostScript points; 1" equals 72 points or 8.5" × 11" for US letter.

How to change this? Well, it turns out that with one Pandoc variable one can control both the margin and the paper size:

-V geometry="margin=1in,a4paper"

So the command for generating the PDF via Pandoc in a Docker container and viewing the output in the Preview application on macOS becomes:

docker run --rm \
-v "$(pwd):/data" \
-u $(id -u):$(id -g) \
pandoc/latex freecodecamp.md \
-V geometry="margin=1in,a4paper"\
-o freecodecamp.pdf &&
open freecodecamp.pdf

Checking the dimensions with mdls reports 841.89 points × 595.2760009765625 points which matches the dimensions of an A4 page.

History with time stamps

In the evening I wanted to know at what time exactly I had run a specific command on the command line of macOS. Could I get the history of commands entered on the command line with each a time stamp? The answer is yes, with fc (Fix Command):

fc -li 1

This lists (-l) the history from the start (1) with time stamps in ISO8601 format (-i). Note that without the 1 you get the last maximum 16 commands.

Now I could grep the output of this command. But wait, fc comes with a match option (-m):

fc -li -m 'docker*' 1

This lists all events in the history that starts with docker and shows the ISO8601 time stamp.

Effective Python Third Edition

Today my copy of Effective Python Third Edition arrived. The book by Brett Slatkin has 125 specific ways to write better Python.

Effective Python, third edition
Effective Python, third edition.

I browsed the book a bit and it looks very good! I like how the program listings have colors. After I have finished the Python Certification course on freeCodeCamp I want either start in this book or continue with the 2nd edition of Fluent Python by Luciano Ramalho. I have reread the first two chapters of the latter. Quite some time ago I managed to study the book until about halfway. But I want to redo this.

Changing the margin with Pandoc

Yesterday I learned how to generate a PDF file with the official Pandoc LaTeX Docker image on macOS. The resulting PDF looked good, but has a huge margin around the body of text. Today I created a header.tex file with the following contents to be passed on to LaTeX:

\usepackage{geometry}
\geometry{margin=1in}

Next, I ran the following command:

docker run --rm \
  -v "$(pwd):/data" \
  -u $(id -u):$(id -g) \
  pandoc/latex freecodecamp.md \
  -H header.tex \
  -o freecodecamp.pdf &&
  open freecodecamp.pdf

And with this command the margin was shrunk to 1"; much better.

Generating a PDF file with Pandoc and Docker

Last week I started with the Python Certification course on freeCodeCamp. I keep handwritten notes on paper which I transfer later to a Markdown file using vim.

I wanted to convert this Markdown file to a PDF file using Pandoc. Because I have already Docker running on my Mac mini I checked if there was an official Docker image.

I first tried the Pandoc minimal image. I ran into an issue: Permission denied. Adding -v /tmp:/tmp to the command solved this issue, but now it reported 'pdflatex' not found. This version was too minimal!

So, next I tried the aptly named latex image as follows:

docker run --rm \
  -v "$(pwd):/data"\
  -u $(id -u):$(id -g) \
  pandoc/latex freecodecamp.md \
  -o freecodecamp.pdf &&
  open freecodecamp.pdf

This downloaded the image (only the first time), generated the PDF and opened the PDF file in the Preview application on macOS.

The Lovebirds (2020)

A couple (Issa Rae and Kumail Nanjiani) experiences a defining moment in their relationship when they are unintentionally embroiled in a murder mystery.

In the evening Esme and I watched The Lovebirds. The movie was OK and I rate it a 6 out of 10.

Little Brother (2026)

A famous real estate agent's life is disrupted when his eccentric little brother unexpectedly reappears.

In the evening Jaiden, Alice, and I watched Little Brother. The movie was OK and I rate it a 6 out of 10.

The Blair Witch Project (1999)

Three film students vanish after traveling into a Maryland forest to film a documentary on the local Blair Witch legend, leaving only their footage behind.

In the evening Jaiden, Alice, Esme, and I watched The Blair Witch Project. I had seen the movie many years ago but still liked it and rate it a 7 out of 10.

Nosferatu (2024)

A gothic tale of obsession between a haunted young woman and the terrifying vampire infatuated with her, causing untold horror in its wake.

In the evening Jaiden, Esme, and I watched Nosferatu, a movie requested by Jaiden. I liked the movie a little and rate it a 6 out of 10.

Cloverfield (2008)

A group of friends venture deep into the streets of New York on a rescue mission during a rampaging monster attack.

In the early evening Jaiden, Esme, and I watched Cloverfield. I had picked the movie because Jaiden had picked Backrooms recently, hoping that she would like the movie, which she did. Even Alice watched parts. I liked seeing the movie once more and rate it a 7 out of 10.

10 Cloverfield Lane (2016)

A young woman is held in an underground bunker by a man who insists that a hostile event has left the surface of the Earth uninhabitable.

After watching Cloverfield, Esme and I took Lina the cat with us to get some candy from a nearby supermarket. On the way to the store Esme carried Lina in a bag. On the way back the skies turned dark and it looked like it was going to rain soon. Lina didn't want to be carried anymore and hissed at Esme so she let the cat walk on a leash. The last part to the house, Lina ran. A few rain drops were falling.

After this break Jaiden, Esme, and I watched 10 Cloverfield Lane, another movie I had picked for Jaiden. And she liked this one even more. I also liked to watch the movie again and rate it a 7 out of 10.

Children of Strife

Centuries ago, a maverick terraforming team played God with a distant planet. Out of their vanity and spite, something terrible and unexpected arose.

Generations later, tormented scientist Alis is among the crew of the research vessel that rediscovers this lost outpost. But Alis wakes from nightmares of her own making to an all-too-real catastrophe on board. The rest of the crew has vanished – leaving only Cato, the belligerent mantis-shrimp captain, and Kern, the ship’s AI.

Searching for their lost fellows, Alis and Cato must venture into the darkness of the planet below. What did those ancient terraformers unleash? And will their last surviving crewmate become a greater threat than the world itself?

In the evening I started in Children of Strife, Children of Time novels book 4 by Adrian Tchaikovsky.

Backrooms (2026)

After a therapist's patient disappears into a dimension beyond reality, she must venture into the unknown to save him.

Near the end of the afternoon Jaiden, Esme, and I took a bus to Delft to watch Backrooms. Jaiden wanted to see this movie. Originally, we had planned to watch it last Saturday but we forgot to take Jaidens ID with us; you have to be 16 to watch this movie in the Netherlands.

After we had nourished ourselves we went to the movie theatre only to discover that our ticket was not valid. It turned out that I had ordered tickets for the wrong movie theatre! But it was no problem to change the tickets.

The movie: in the beginning it was very shaky footage which was hard to handle for me. But then the movie got more steady and became interesting. In the end, I rate it a 7 out of 10.

In the Grey (2026)

A covert team of elite operatives are living in the shadows. When a ruthless despot steals a billion-dollar fortune, they're sent to take it back-an impossible heist that erupts into a deadly game of strategy, deception and survival.

In the evening Esme and I watched In the Grey. At first I didn't like the movie much: too chaotic. But then it got better and I even rate it an 8 out of 10.

The Pnume

The Pnume are native to Tschai, living underground in a vast network of caverns with their human slave-species, the Pnumekin. Historians of Tschai, the Pnume collect its past with scholarly disinterest; they hear rumors of Adam Reith - a man who claims to come from another planet, named Earth - and they want him for permanent display in Foreverness, museum of Tschai life! Reith must survive the Pnume tunnels, if he is ever to return to Earth.

In the evening I started in The Pnume, part 4 of 4 of Tschai by Jack Vance. The ebook I had downloaded has cover art by David Russell.