Jekyll2023-02-18T20:33:51+01:00http://chopmo.dk//Chopmo’s blogJacob TjørnholmExporting journal entries from 750words to org-journal2023-02-18T00:00:00+01:002023-02-18T00:00:00+01:00http://chopmo.dk/2023/02/18/exporting-journal-entries-from-words-to-orgjournal<p>I’ve been a very happy 750words.com user for over a decade. And while I still really love the site, I decided that I wanted to move my journaling to Emacs, which is where I spend much of my day anyway.</p>
<p>So I wrote <a href="https://github.com/chopmo/750-words-importer">a small Clojure utility</a> to convert exported 750words journal entries to org-journal format. I don’t expect this to useful for many people, but let me know if you try it and have problems or ideas for improvements.</p>
<p>Entries are exported from 750 one month at a time, and all the resulting text files should be put in the <code class="highlighter-rouge">input</code> directory. When running the utility with <code class="highlighter-rouge">clj -X journal-importer/main</code>, all resulting entries are written to <code class="highlighter-rouge">output</code> as org files.</p>
<p>The output files can optionally be encrypted with GPG, in case you want to store them in the cloud like I do. Just be sure to have a GPG key generated (see the README) and set <code class="highlighter-rouge">gpg-recipient</code>.</p>Jacob TjørnholmI’ve been a very happy 750words.com user for over a decade. And while I still really love the site, I decided that I wanted to move my journaling to Emacs, which is where I spend much of my day anyway.Disabling Firefox updates on Ubuntu2021-06-22T00:00:00+02:002021-06-22T00:00:00+02:00http://chopmo.dk/2021/06/22/disablingfirefoxupdatesonubuntu<p>Firefox is updated quite frequently which is of course a good thing. However whenever it is updated, it forces you to restart immediately, at least with the addons I have installed, which is just too annoying to me.</p>
<p>I am running Ubuntu with automatic updates enabled, so APT will periodically update FF in the background.</p>
<p>To disable automatic updates of just the firefox package, I discovered that I can hold it back like this:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>sudo apt-mark hold firefox
</code></pre>
</div>
<p>Hopefully I’ll remember to update it manually, or maybe the FF developers will fix the issue at some point (although judging from online resources this is not likely because it’s not seen as a defect).</p>Jacob TjørnholmFirefox is updated quite frequently which is of course a good thing. However whenever it is updated, it forces you to restart immediately, at least with the addons I have installed, which is just too annoying to me.Book review: A world without email2021-04-06T00:00:00+02:002021-04-06T00:00:00+02:00http://chopmo.dk/2021/04/06/a-world-without-email<p><em>A World Without Email: Reimagining Work in an Age of Communication
Overload by Cal Newport, March 2021</em></p>
<p>I was surprised to enjoy this book so much, because I actually like
email a lot. Certainly, I much prefer it to instant messaging or text
messages.</p>
<p>The thing is, the title of this book is really misleading. It is not
actually about email. Instead, it is about a dysfunctional process (or
an absence of process) in the modern workplace, and how email has
helped cultivate it and continues to enable it.</p>
<p>Cal Newport uses the term The Hyperactive Hive Mind to describe
this. What it means is that instead of careful and deliberate advance
planning, more tasks now tend to be coordinated via ad-hoc messages
back and forth between team members, managers and other stakeholders.</p>
<p>Apparently this happens over email in many teams. I feel grateful for
not having experienced that myself. As a software developer it is
second nature to use a kanban board or other project management tools
to plan projects and individual tasks. I can’t even imagine working
without such tools, but many do, at least in other professions. In
fact, on of the major points of the book is that we should be using
things like Trello instead of just coordinating our work via email
threads.</p>
<p>To me, the choice of Email, Slack, Trello or Jira is not what’s
interesting about this book. Much more relevant to me is how we have
come to accept starting a work task based on incomplete information,
knowing that we can just obtain this information as we go along.</p>
<p>It’s simply too easy to ask when unsure. This is true for any modern
communications platform, although they’re certainly not all created
equal. Project tools like Trello, Clubhouse or Twist at least keep
things organised by topic. Slack and Email invite unstructured
back-and-forth with only the channel or subject line to organise the
information.</p>
<p>There’s a clear line back to the discussions we had early in my career
where Scrum was really gaining traction in the software development
world. One of the key points was that nobody should start working on a
task until it is <strong>Ready</strong>. Meaning that it is actually known what
needs to be done, start to finish. As I recall, this was one of the
most important rules, second only to the rule about not interrupting a
team when it is in a Sprint.</p>
<p>This fits perfectly with the message in the book. The terminology is
different, but the point remains the same: Plan ahead and make sure
the task is ready. And once you start working, don’t let yourself get
interrupted. While Scrum focused entirely on teams, Cal Newport makes
the point that this principle is equally applicable for individuals.</p>
<p>–</p>
<p>While reading the book I often thought about how I structure my time,
and how we as a team organize our work (I work in the 9-person product
team at GoMore, a p2p car sharing platform).</p>
<p>As all other product teams, we have a huge backlog of small and big
features we’d like to get done. But as we have matured as a team, we
have become increasingly aware that it is not efficient to just pick
something and get started. Tempting as it often is.</p>
<p>It is possible for sure, and sometimes it <strong>feels</strong> easy in the
beginning. Assemble a small group (designer, frontend, backend, iOS,
Android) and get started after a short kickoff meeting. We know
what we want to build, let’s just figure out the details as we go.</p>
<p>Is that a good approach? Let’s say I start working and get stuck with
my work after half a day because I’m unsure of how to handle some edge
case. What are the costs?</p>
<p>First, I need to disturb someone with my question, usually our
CPO. Let’s say I shoot him an email (in honor of the book…in reality
I’ll probably be impatient and DM him on Slack instead).</p>
<p>But then what?? I need to figure out what to do now that I’m
blocked. So I have to context switch, probably picking up a support
ticket or a small task from our “pool” of minor things to work on. If
I’m lucky there is something within the same project I can pickup to
stay in the same place mentally.</p>
<p>I don’t know when I can get back to the project I should be working
on, because I don’t know when I’ll get an answer from my CPO. So I
don’t know how much time I have. Maybe I’ll have to tread waters for
the rest of the day.</p>
<p>Worst case, I didn’t phrase the question clearly enough and I get a
clarifying question in return a few hours later.</p>
<p>It is pretty obvious that this is not a great way to work, but it’s
not at all uncommon. Whenever someone is working on a problem and they
shoot you a “quick question” on Slack, you should probably both pause
and consider how this could have been avoided. It’s not that I want to
avoid human interaction, although it may come across that way. But as
much as I want to be a helpful team player, I’d much rather spend my
time pairing on actually challenging issues or on creating product
value myself, rather than answering questions that we should (as a
team) have thought of earlier.</p>
<p>So for any project, we should do our best to identify as many unknowns
upfront and find answers that everyone working on the project can
familiarise themselves with. Knowledge should be spread from a single
source of truth, not distributed ad-hoc.</p>
<p>On our team, we try to achieve this by starting any new feature work
with a Feature Brief, which is simply a Google doc, usually 1-3 pages
long.</p>
<p>It first describes the motivation for the feature in a few
sentences. This is just useful as background and may inspire questions
and critique.</p>
<p>Then the most important section: The lists of <em>must have</em> and <em>should
have</em> changes to the product. This describes exactly what we want to
change, divided into a mandatory part that must be completed for the
feature to make sense, and an optional part that we can tackle as time
permits.</p>
<p>As we think about the new feature (<em>before</em> working on it), we come up
with questions and fill in more detailed information on these
items. Often, this extra information is about edge cases or conflicts
with existing items.</p>
<p>For example: A “must-have” of a new feature is that the renter pays a
25% cancellation fee on late cancellation of a car rental. But what if
a 15% coupon discount was applied to the purchase? Is the coupon still
spent or do we charge the entire fee from the credit card payment?
Also, should loyalty points still be earned from the 25% of the
payment we keep? There are tons of details that we just don’t notice
until we’ve spent significant time thinking about the project.</p>
<p>Also, very importantly, the Brief contains a section for Unknowns. So
we make it explicit what we do not yet know and need to clarify before
we can finish the project. We often use comments in the document to
keep track of who is working on clarifying these unknowns at any given
time.</p>
<p>Finally there’s a Notes section with non-essential background
information that is just good to know for anyone working on the
project.</p>
<p>We sometimes color code text by status. Orange for in-progress and
green for done.</p>
<p>The Feature Brief is the single most important document when working
on a new feature. It’s short enough to never be overwhelming, but at
the same time it must (by definition) capture everything essential
about the new feature. The Brief links to external documents like
designs and the project board containing the lower-level “stories” for
each technical change we need to make in a codebase.</p>
<p>–</p>
<p>This turned into more than a book review. Which goes to show why I
liked the book so much. It made me realise what we do right on our
team, and why. And perhaps what we can do even better.</p>
<p>I highly recommend this book, even if you’re like me and secretly like
email. Again, it’s not about email, it’s about how messaging is used
in a team. And of course, since I went on a tangent and started
writing about software development, I only touched on a single aspect
of the book. It contains many more valuable insights and is quite
well-written.</p>
<p>Rating: 5/5</p>Jacob TjørnholmA World Without Email: Reimagining Work in an Age of Communication
Overload by Cal Newport, March 2021Emacs: Show path to point in a big YAML file2021-01-28T00:00:00+01:002021-01-28T00:00:00+01:00http://chopmo.dk/2021/01/28/path-to-point-in-big-yaml-file<p>When working in a big YAML file, I often lose track of where I am, and
especially what the “current” top level key is.</p>
<p>I wrote an Elisp function to show the “path” to the point, ie. the
list of parent keys over the current point in the file.</p>
<p>The path is shown in the message are when the function is invoked:</p>
<p><img src="/images/yaml.png" alt="Editing a YAML file" /></p>
<p>The code can be found <a href="https://github.com/chopmo/dotfiles/blob/master/.emacs.d/customizations/yaml.el">here</a>.</p>
<p>In YAML files it can be invoked with <code class="highlighter-rouge">C-x p</code>.</p>
<p>This is scratching an itch I’ve had for a long time. Both because I
needed the feature and because I wanted to do a bit more advanced
customization of Emacs. Comments welcome, especially on how to improve
the Elisp.</p>Jacob TjørnholmWhen working in a big YAML file, I often lose track of where I am, and
especially what the “current” top level key is.Boganmeldelse: Skyldig i drab2020-10-29T00:00:00+01:002020-10-29T00:00:00+01:00http://chopmo.dk/2020/10/29/bookreviewskyldigidrab<p><strong>Thomas Thurah: Skyldig i drab</strong></p>
<p>Jeg måtte desværre opgive at læse bogen færdig.</p>
<p>Emnet er ellers virkelig interessant. Forfatten har taget kontakt til
12 drabsdømte person der er ved at afsone deres dom, og fortæller
gennem mange interviews om deres inderste tanker og følelser. Om
hvordan de angrer, hvordan de har oplevet selve drabet, deres
anholdelse og rettsag, hvordan de ser sig selv og forener sig med
tanken om at have slået et andet menneske ihjel.</p>
<p>Det er et tungt emne og det behandles meget sagligt og
seriøst. Metodisk og grundigt får vi beskrevet hvad de 12 indsatte
tænker om det ene emne efter det andet. Bogen indeholder også en del
citater fra de mange intereviews.</p>
<p>Desværre kunne jeg slet ikke vænne mig til den måde, bogen er skrevet
på. Der er ufatteligt mange referencer til, hvad der sker tidligere og
senere i bogen, og det finder jeg meget forstyrrende. Bogen er ikke
skrevet som en flydende fortælling, for udover en del (forståelige)
spring mellem citater, analyse og reflektioner, afbrydes vi alt for
ofte af meta-snak om hvad der kommer senere i bogen og hvornår vi
sidst hørte om den og den person. Detaljer, der for mig forekommer
helt unødvendige at skrive om.</p>
<p>En anden ting irriterede mig lige fra starten. Jeg har forståelse for
at det ikke skal være muligt at identificere de 12 personer, og derfor
er deres navne og køn lavet om. Men igen og igen bliver de omtalt som
“han eller hun”, eller personens navn bliver brugt i stedet. Det
virker unødvendigt besværligt at skulle forestille sig hver person som
enten mand eller kvinde (det nævnes i indledningen at der er både mænd
og kvinder), og jeg forstår ikke hvorfor forfatteren ikke bare har
valgt et køn og navn til hver af de indsatte.</p>
<p>Enkelte passager i bogen er meget mere velskrevne, typisk
indledningerne til kapitler. Men det holder desværre kun få sider før
vi falder tilbage i en langt mere klodset skrivestil.</p>
<p>Der er simpelthen for mange overflødige ord. Lad mig komme med et par
eksempler:</p>
<ul>
<li>“De næste sider er vanskelige at skrive og alligevel ikke spor, måske
endda overraskende lette.”</li>
<li>“Citatet peger frem mod bogens næste del.”</li>
<li>“Lad mig i stedet for en sammenfatning nævne nogle af de ting, som jeg
finder væsentlige, og beskrive dem mere nuanceret gennem to uddrag fra
samtalerne med de medvirkende, et længere og et lidt kortere”.</li>
</ul>
<p>Denne type tanker og observationer om selve bogen er hvad jeg kalder
meta-snak, og det fylder rigtigt meget. Det er udmattende og gør det
svært at koncentrere sig om at læse en bog, der ellers kunne have
været spændende. Jeg ville ønske, forfatteren bare havde fortalt
historien i stedet for at skrive så meget om processen.</p>
<p><strong>Rating: 2/5</strong></p>Jacob TjørnholmThomas Thurah: Skyldig i drabBoganmeldelse: Amerika. Hvor er du?2020-08-04T00:00:00+02:002020-08-04T00:00:00+02:00http://chopmo.dk/2020/08/04/boganmeldelseamerikahvorerdu<p><strong>Amerika. Hvor er du?</strong></p>
<p><em>af David Trads, 250 sider, udgivet februar 2020 på Forlaget Momenta</em></p>
<p>Enormt velskrevet bog! Den er letlæst uden at være poppet, sproget er direkte og farverigt.</p>
<p>Stemningen bliver ofte sat med citater, sangtekster o.lign, hvilket passer godt ind. Dog er de strengt taget ikke nødvendige da fortællingen i sig selv er meget stemningsfuld.</p>
<p>Bogen favner virkelig bredt. Den handler mest om Trump og om baggrunden for hvorfor han blev valgt i 2016, men Trads beskriver også landets historie, mentaliteten og forskellene mellem staterne virkelig fint.</p>
<p>Fortællestilen svinger mellem at være faktuel og meget personlig, men man er aldrig i tvivl om hvad der er hvad.</p>
<p>Jeg har været i USA nogle få gange og har kun besøgt steder som Austin og San Francisco. Denne bog gav mig faktisk lyst til at opleve “fly-over America”, og den gav mig en langt bedre forståelse for hvordan folk tænker i de dele af landet der hidtil har føltes helt fremmede for mig.</p>
<p>Desuden: En masse facts. Jeg anede ikke at så mange danskere havde emigreret i det 19. århundrede, eller at befolkningssammensætningen er under så dramstisk forandring i USA i disse år. Spændende at høre en vild historie som Trump delvist forklaret af tal og statistik.</p>
<p>Endelig får vi også en del referencer til andre gode bøger, jeg glæder mig til at se nærmere på.</p>
<p>Jeg er sikker på at de fleste danskere stadig har svært ved at forstå hvordan amerikanerne kunne finde på at vælge Trump som præsident for fire år siden. Denne bog giver et overbevisende bud på en forklaring. Min varmeste anbefaling til enhver der vil vide mere om USA og Trump.</p>
<p><strong>Rating: 5/5</strong></p>Jacob TjørnholmAmerika. Hvor er du?Book review: The room where it happened2020-08-03T00:00:00+02:002020-08-03T00:00:00+02:00http://chopmo.dk/2020/08/03/bookreviewtheroomwhere<p><strong>The room where it happened: A White House Memoir</strong></p>
<p><em>by John Bolton, 577 pages, published in March 2020</em></p>
<p>It was interesting to read a book by an author with a political standpoint that is distinctly different from my own. That taught me a lot in itself, and I found it refreshing to see things in a different light.</p>
<p>Also, as is the case for other books I’ve read about the Trump precidency, the crazy anecdotes from inside the White House, while extremely unnerving, are also just fascinating and very entertaning. Bolton is very much an adult, and hearing his description of the chaos surrounding the president was really funny at times.</p>
<p>Unfortunatly, the book was mostly a very dull read. Maybe in part because of the editing that Bolton has been forced to make. The language is repetitive and the storytelling is…we’ll it’s not really there. The text is bone dry.</p>
<p>This book felt even longer than it was.</p>
<p><strong>Rating: 2/5</strong></p>Jacob TjørnholmThe room where it happened: A White House MemoirDanish characters in the US keymap2020-01-25T00:00:00+01:002020-01-25T00:00:00+01:00http://chopmo.dk/2020/01/25/dk-letters-in-us-keymap<h1 id="tldr">TL;DR</h1>
<p>For Danish Linux users who want to use the US keymap but still write
Danish characters, the following commands enable the insertion of
<code class="highlighter-rouge">æøå</code> with the <code class="highlighter-rouge">;'[</code> keys while holding the Left Ctrl key:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>setxkbmap -option -option ctrl:swapcaps us
# Map (in order):
# - caps lock key to control
# - left ctrl key to Mode_switch
# - Semicolon key to support ae with Mode_switch
# - Apostrophe key to support oslash with Mode_switch
# - Bracketleft key to support aring with Mode_switch
xmodmap -e "keycode 66 = Control_L NoSymbol Control_L" \
-e "keycode 37 = Mode_switch NoSymbol Mode_switch" \
-e "keycode 47 = semicolon colon ae AE" \
-e "keycode 48 = apostrophe quotedbl oslash Oslash" \
-e "keycode 34 = bracketleft braceleft aring Aring"
</code></pre>
</div>
<p>In addition to enabling Danish characters as described, this also
swaps the Caps lock and Right Ctrl keys.</p>
<h1 id="details">Details</h1>
<p>Looks like I’ve finally solved one of the last major annoyances in my
Linux setup.</p>
<p>As a programmer I like to use the US keyboard layout because brackets
and other special symbols are much more conveniently located than in
the DK layout.</p>
<p>However, I still need to write in Danish quite often. So I had set up
shortcuts to select a keymap: <code class="highlighter-rouge">Super-u</code> would select the US keymap,
<code class="highlighter-rouge">Super-i</code> would select the DK one.</p>
<p>I’ve never really been happy with this solution though. It requires me
to remember two layouts for all punctuation, and switching between
layouts all the time is annoying.</p>
<p>Also, all I actually need from the DK keymap are the special Danish
letters (æ, ø and å) so it seems silly to switch the entire keyboard
layout just for that.</p>
<p>Today I finally took the time to read the documentation for <code class="highlighter-rouge">xmodmap</code>
and understand how I could get around this issue.</p>
<p>The missing piece for me was the <code class="highlighter-rouge">Mode_switch</code> keysym. Using the
semicolon key (keycode 47) as an example, here is the default US
xmodmap config for it:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>keycode 47 = semicolon colon semicolon colon
</code></pre>
</div>
<p>The key is mapped to four keysyms, enabled with these modifiers
respectively:</p>
<ul>
<li><em>No modifier</em></li>
<li>Shift</li>
<li><code class="highlighter-rouge">Mode_switch</code></li>
<li><code class="highlighter-rouge">Mode_switch</code> + Shift</li>
</ul>
<p>This is exactly what I needed: A modifier key to enable an alternative
use for the key. Not in use by default - the last two keysyms are
identical to the first two and in fact <code class="highlighter-rouge">Mode_switch</code> is not even
mapped to a key I have on my keyboard. But I can change that.</p>
<p>I already had Left Ctrl swapped with Caps Lock, and I very rarely use
Caps Lock as a feature anyway, so I can spare the left Ctrl for the
<code class="highlighter-rouge">Mode_switch</code> instead.</p>
<p>Now, with a working <code class="highlighter-rouge">Mode_switch</code> I can instead configure the
semicolon key with:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>keycode 47 = semicolon colon ae AE
</code></pre>
</div>
<p>This allows me to hold down Left Ctrl, press the semicolon key and get
an æ on the screen.</p>
<p>Similar for the apostrophe and left bracket (<code class="highlighter-rouge">'</code> and <code class="highlighter-rouge">[</code>) keys:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>keycode 48 = apostrophe quotedbl oslash Oslash
keycode 34 = bracketleft braceleft aring Aring
</code></pre>
</div>
<p>This enables me to stay on the US layout and just hold down the left
Crtl key when I need to enter a Danish character.</p>Jacob TjørnholmTL;DREmacs keybindings in i3wm2019-10-16T00:00:00+02:002019-10-16T00:00:00+02:00http://chopmo.dk/2019/10/16/emacskeybindingsini<p>I love using Ubuntu + i3wm, but one annoyance has been the lack of
Emacs keybindings in various apps. For example, using Ctrl-a in the
browser address bar should jump to the start of the line. Also, having
to use the arrow keys instead of Ctrl-n and Ctrl-p when composing
emails has been a pain.</p>
<p>Finally I seem to have found a solution, via Reddit, on the <a href="https://wiki.archlinux.org/index.php/GTK#Emacs_key_bindings">Arch Wiki</a>.</p>
<p><strong>Create file <code class="highlighter-rouge">~/.gtkrc-2.0</code> with contents:</strong></p>
<div class="highlighter-rouge"><pre class="highlight"><code>gtk-key-theme-name = "Emacs"
</code></pre>
</div>
<p><strong>Create file <code class="highlighter-rouge">~/.config/gtk-3.0/settings.ini</code> with contents:</strong></p>
<div class="highlighter-rouge"><pre class="highlight"><code>[Settings]
gtk-key-theme-name = Emacs
</code></pre>
</div>
<p><strong>Run this command:</strong></p>
<div class="highlighter-rouge"><pre class="highlight"><code>$ gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs"
</code></pre>
</div>
<p>In case it’s not clear, I don’t really know how this stuff
works. That’s OK. It’s done now and I will remember in the future that
I wrote about it here.</p>Jacob TjørnholmI love using Ubuntu + i3wm, but one annoyance has been the lack of
Emacs keybindings in various apps. For example, using Ctrl-a in the
browser address bar should jump to the start of the line. Also, having
to use the arrow keys instead of Ctrl-n and Ctrl-p when composing
emails has been a pain.Emacs + Dunst shortcut issue2019-10-14T00:00:00+02:002019-10-14T00:00:00+02:00http://chopmo.dk/2019/10/14/emacsanddunstissue<p>A while ago I started having a problem in Emacs with setting the mark
(Ctrl-Space). It was difficult to pin down exactly what was wrong and
I was not able to reproduce it. Just a sporadic thing that sometimes
caused the command to be ignored.</p>
<p>Then for some reason I suddenly realised that this was because the
shortcut clashes with what Dunst (the notifications daemon) uses
system-wide to dismiss the most recent notification.</p>
<p>So whenever a notification was being displayed, my Ctrl-Space would
dismiss that instead of setting the mark in Emacs. I just hadn’t
noticed the connection.</p>
<p>So the fix was a very simple, just disable the shortcut in dunstrc:</p>
<div class="highlighter-rouge"><pre class="highlight"><code># Close notification.
# close = ctrl+space
</code></pre>
</div>
<p>I can still just dismiss all notification with Ctrl-Shift-Space.</p>Jacob TjørnholmA while ago I started having a problem in Emacs with setting the mark
(Ctrl-Space). It was difficult to pin down exactly what was wrong and
I was not able to reproduce it. Just a sporadic thing that sometimes
caused the command to be ignored.