<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>EINVAL: Valid solutions for invalid problems</title>
    <link>https://blog.einval.eu/</link>
    <description>Recent content on EINVAL: Valid solutions for invalid problems</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 14 Jul 2020 14:21:09 +0200</lastBuildDate>
    
	<atom:link href="https://blog.einval.eu/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Game review: Hard West</title>
      <link>https://blog.einval.eu/games/hard-west/</link>
      <pubDate>Tue, 14 Jul 2020 14:21:09 +0200</pubDate>
      
      <guid>https://blog.einval.eu/games/hard-west/</guid>
      <description>&lt;p&gt;A solid clone of the modern XCOM games with a few twists making
it fresh.&lt;/p&gt;
&lt;p&gt;Hard West takes place in a world based on the wild west with
fantastical elements added on top.  I enjoyed this setting a lot,
especially the lovecraftian mysteries left with no clear explanation.&lt;/p&gt;
&lt;p&gt;The main innovation to the gameplay is the way probability works.
It&amp;rsquo;s not random at all!  Each character has a specified amount of
&lt;em&gt;luck&lt;/em&gt; which serves as a health or armor against the probability
(sic!).  If an enemy has 100 luck (it&amp;rsquo;s hidden for the enemies but can
be guessed) and I have 95% chance to hit, I&amp;rsquo;ll surely miss but it&amp;rsquo;ll
subtract 95 from their luck, leaving them with 5, allowing me to hit
even a 10% shot.  Luck regenerates after getting hit: the more
unlikely the hit was, the more luck is gained back.  I&amp;rsquo;ll spare you
the exact math but I checked and the overall probability distribution
seems to be correct.  It&amp;rsquo;s just predictable in this case.  This system
never feels unfair and allows for some really interesting tactics such
as depleting the enemy&amp;rsquo;s luck with weak accurate weapons and finishing
them off with a powerful yet inaccurate weapon.&lt;/p&gt;
&lt;p&gt;Luck also serves as a fuel for special abilities forcing us to choose
between offense and defense.  The abilities are diverse and add flavor
to the combat.&lt;/p&gt;
&lt;p&gt;Apart from the tactical combat, there is also an overworld map which
works very differently in each campaign, keeping it from getting stale
to the very end.  In one campaign we&amp;rsquo;re conquering the natives while
in another we&amp;rsquo;re investigating a local mystery while fighting the
madness creeping in.  All of this with a common overarching story.&lt;/p&gt;
&lt;p&gt;For me the best summary of Hard West would be &amp;ldquo;an arcade XCOM&amp;rdquo;, and
that&amp;rsquo;s a good thing.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Game review: Return of the Obra Dinn</title>
      <link>https://blog.einval.eu/games/obra-dinn/</link>
      <pubDate>Tue, 14 Jul 2020 01:18:58 +0200</pubDate>
      
      <guid>https://blog.einval.eu/games/obra-dinn/</guid>
      <description>&lt;p&gt;A great take on the &amp;ldquo;murder mystery&amp;rdquo; concept taking action on a ghost
ship.&lt;/p&gt;
&lt;p&gt;The whole game boils down to deducing two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The identity of each character.&lt;/li&gt;
&lt;li&gt;The way they died.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It&amp;rsquo;s done by analyzing the ship documents and witnessing the last
moments of each crew member.  I find it refreshing that &lt;em&gt;I&lt;/em&gt;, the
player, am the one conducting the investigation.  The game won&amp;rsquo;t
connect the discovered dots for me.&lt;/p&gt;
&lt;p&gt;The whole thing is one of the most atmospheric gaming experiences I&amp;rsquo;ve
had.  The ship documents look old and authentic.  The graphic style is
unique and distinctive, personally I liked it, some probably won&amp;rsquo;t.
Despite the simplistic graphics, the environment is very detailed.
The music and sound design are fitting and add to the experience.&lt;/p&gt;
&lt;p&gt;The story isn&amp;rsquo;t particularly interesting, it only serves as
a background for the investigation.  It&amp;rsquo;s not necessarily a bad thing.&lt;/p&gt;
&lt;p&gt;Highly recommended for puzzle game enthusiasts.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>Stock Firefox keyboard controls</title>
      <link>https://blog.einval.eu/2020/05/stock-firefox-keyboard-controls/</link>
      <pubDate>Sat, 16 May 2020 00:33:38 +0200</pubDate>
      
      <guid>https://blog.einval.eu/2020/05/stock-firefox-keyboard-controls/</guid>
      <description>&lt;p&gt;Most keyboard aficionados use various keyboard-related addons in their
web browsers, such as Vimium.  From my observation, one of the most
used features of such addons is keyboard-based link selection with so
called &lt;em&gt;hints&lt;/em&gt;, which usually looks like this (example from &lt;a href=&#34;https://key.saka.io/&#34;&gt;Saka
Key&lt;/a&gt;):&lt;/p&gt;
&lt;a href=&#34;link-hints.png&#34;&gt;
  &lt;img src=&#34;link-hints.png&#34; alt=&#34;&#34;&gt;
&lt;/a&gt;
&lt;p&gt;To select a link, one would enter the number shown alongside it.
Some addons offer also further filtering of these hints through
entering text appearing in the link description.&lt;/p&gt;
&lt;p&gt;While useful, I&amp;rsquo;ve come to often prefer an alternative available in
Mozilla Firefox by default.  Apart from the well-known &lt;code&gt;Ctrl+F&lt;/code&gt;
search, there are two &amp;ldquo;smaller&amp;rdquo; search modes available with &lt;code&gt;/&lt;/code&gt; and
&lt;code&gt;&#39;&lt;/code&gt;.  The former is basically the same as &lt;code&gt;Ctrl+F&lt;/code&gt; with more sparse
UI.  On the other hand, &lt;strong&gt;&lt;code&gt;&#39;&lt;/code&gt; searches only in the links&lt;/strong&gt;, ignoring
all the other text.  To click a link found this way one would press
&lt;code&gt;Enter&lt;/code&gt;.  If there are multiple similar links, it&amp;rsquo;s possible to cycle
through the narrowed down links with &lt;code&gt;Tab&lt;/code&gt;.  It&amp;rsquo;s very similar to the
&amp;ldquo;secondary&amp;rdquo; link hints feature I mentioned in the previous paragraph,
but built-in.&lt;/p&gt;
&lt;p&gt;I highly recommend trying it out as it&amp;rsquo;s a great but often overlooked
feature of Mozilla Firefox.&lt;/p&gt;
&lt;p&gt;EDIT: I omitted a very important part of using this link search
feature.  It can be chained.  For example it&amp;rsquo;s possible first to
search for an article name, and then for the phrase &amp;ldquo;comments&amp;rdquo; to
select the comments link under a specific article.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Emacs as a Shell</title>
      <link>https://blog.einval.eu/2020/04/emacs-as-a-shell/</link>
      <pubDate>Thu, 30 Apr 2020 17:08:21 +0200</pubDate>
      
      <guid>https://blog.einval.eu/2020/04/emacs-as-a-shell/</guid>
      <description>&lt;p&gt;When I log into a new server, one of the first things I do is install
a minimal Emacs package&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;.  Of course assuming nobody minds if the
server is not strictly mine, I&amp;rsquo;m not a monster.&lt;/p&gt;
&lt;p&gt;Emacs serves me as a de facto shell when setting up whatever there is
to set up.  By &amp;ldquo;shell&amp;rdquo; I mean a broader meaning of this word than just
a command prompt: it&amp;rsquo;s the central program I use to interact with the
system.  Regardless of the system and its current configuration, I can
expect Emacs to be predictably the same program suitable for both
configuration file editing and advanced file management thanks to the
built-in &lt;code&gt;dired&lt;/code&gt; module.  One could say I use it like many people use
Midnight Commander (&lt;code&gt;mc&lt;/code&gt;) though I consider it much more powerful for
various reasons.  Let me show you what it looks like:&lt;/p&gt;
&lt;a href=&#34;emacs-example.png&#34;&gt;
  &lt;img src=&#34;emacs-example.png&#34; alt=&#34;Emacs example&#34;&gt;
&lt;/a&gt;
&lt;p&gt;Let&amp;rsquo;s walk through this screenshot slowly as it&amp;rsquo;s pretty packed.
First of all, Emacs can be split freely, both horizontally and
vertically.  In this case I have 3 splits&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;.  The first one contains
a config file being edited while the other two show the mentioned file
manager called &lt;code&gt;dired&lt;/code&gt;.  Text editing is pretty self-explanatory while
&lt;code&gt;dired&lt;/code&gt; is the central piece of my &amp;ldquo;Emacs as a shell&amp;rdquo; workflow, so
let&amp;rsquo;s focus on it for now.&lt;/p&gt;
&lt;p&gt;As you may want to follow along, to open &lt;code&gt;dired&lt;/code&gt; press &lt;code&gt;C-x d&lt;/code&gt;
(i.e. &lt;code&gt;ctrl+x&lt;/code&gt; followed by &lt;code&gt;d&lt;/code&gt;; not &lt;code&gt;ctrl+d&lt;/code&gt;!) and enter a path to
open.&lt;/p&gt;
&lt;h2 id=&#34;viewing-files-with-dired&#34;&gt;Viewing files with dired&lt;/h2&gt;
&lt;a href=&#34;dired/1.png&#34;&gt;
  &lt;img src=&#34;dired/1.png&#34; alt=&#34;dired&#34;&gt;
&lt;/a&gt;
&lt;p&gt;This &lt;code&gt;dired&lt;/code&gt; window shows two files; to be specific, symlinks along
with their targets.  The rest of it look very similar to the familiar
&lt;code&gt;ls(1)&lt;/code&gt; output and for a good reason: &lt;code&gt;dired&lt;/code&gt; uses it as the source of
this data.  We can leverage this fact and customize the &lt;code&gt;ls(1)&lt;/code&gt;
--switches used by pressing &lt;code&gt;C-u s&lt;/code&gt;:&lt;/p&gt;
&lt;a href=&#34;dired/2.png&#34;&gt;
  &lt;img src=&#34;dired/2.png&#34; alt=&#34;dired switches editing&#34;&gt;
&lt;/a&gt;
&lt;p&gt;By default &lt;code&gt;dired&lt;/code&gt; uses &lt;code&gt;-al&lt;/code&gt;.  Let&amp;rsquo;s add &lt;code&gt;-L&lt;/code&gt; to make it show the
symlink targets in place of symlinks (though admittedly it already
shows after an arrow).&lt;/p&gt;
&lt;a href=&#34;dired/3.png&#34;&gt;
  &lt;img src=&#34;dired/3.png&#34; alt=&#34;dired switches applied&#34;&gt;
&lt;/a&gt;
&lt;p&gt;The symlinks are now resolved completely, we can now see the metadata
of files themselves and so on.  We could also instead add some switch
affecting the file sorting order like &lt;code&gt;-t&lt;/code&gt;.  I&amp;rsquo;ll leave it as an
exercise for the reader.&lt;/p&gt;
&lt;p&gt;This is one of the things about Emacs I appreciate the most: it often
doesn&amp;rsquo;t try to hide the complexity behind its workings.  It embraces
it, enriches it and exposes it to the user in an accessible manner.
If I said &lt;code&gt;dired&lt;/code&gt; is like &lt;code&gt;ls(1)&lt;/code&gt; on some wild Emacs-flavored
steroids, I wouldn&amp;rsquo;t be far from the truth.&lt;/p&gt;
&lt;h2 id=&#34;managing-files-with-dired&#34;&gt;Managing files with dired&lt;/h2&gt;
&lt;p&gt;Okay, listing files is easy but I mentioned managing files, not just
listing.  Let&amp;rsquo;s start with renaming: the best way to rename a file in
&lt;code&gt;dired&lt;/code&gt; is to press &lt;code&gt;C-x C-q&lt;/code&gt; (which toggles the read-only mode in
most contexts in Emacs) which enables us to… edit the file listing
like a text file.  Considering Emacs is a text editor after all, we
can use all its text editing goodness here.&lt;/p&gt;
&lt;a href=&#34;dired/edit.png&#34;&gt;
  &lt;img src=&#34;dired/edit.png&#34; alt=&#34;&#34;&gt;
&lt;/a&gt;
&lt;p&gt;There it is, I&amp;rsquo;ve changed &amp;ldquo;blog&amp;rdquo; into &amp;ldquo;blargh&amp;rdquo;.  To save the changes,
&lt;code&gt;C-x C-s&lt;/code&gt; can be used which is once again a general Emacs keybinding
for saving whatever we&amp;rsquo;re editing.  There are more nice details about
this editable mode but it&amp;rsquo;s a topic for another whole blog post.&lt;/p&gt;
&lt;p&gt;For more complex file operations &lt;code&gt;dired&lt;/code&gt; uses various, usually
capital, letters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C&lt;/code&gt; for copying&lt;/li&gt;
&lt;li&gt;&lt;code&gt;R&lt;/code&gt; for an alternate way of moving/renaming&lt;/li&gt;
&lt;li&gt;&lt;code&gt;S&lt;/code&gt; for creating symlinks (and &lt;code&gt;Y&lt;/code&gt; for relative symlinks)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;D&lt;/code&gt; for deleting&lt;/li&gt;
&lt;li&gt;&lt;code&gt;x&lt;/code&gt; for secondary deleting of specially marked files (&amp;ldquo;flagged&amp;rdquo; in
the &lt;code&gt;dired&lt;/code&gt; lingo)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We can either operate on the currently focused file or mark more of
them with &lt;code&gt;m&lt;/code&gt;:&lt;/p&gt;
&lt;a href=&#34;dired/marks.png&#34;&gt;
  &lt;img src=&#34;dired/marks.png&#34; alt=&#34;&#34;&gt;
&lt;/a&gt;
&lt;p&gt;There are two types of marks in here: the &amp;ldquo;regular marks&amp;rdquo; and &amp;ldquo;flags&amp;rdquo;.
They are differentiated by the letter on the left&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;: &amp;ldquo;*&amp;rdquo; or &amp;ldquo;D&amp;rdquo;.  The
&amp;ldquo;*&amp;rdquo; marks are used for most of the operations I listed before while
&amp;ldquo;D&amp;rdquo; are used by the mentioned &lt;code&gt;x&lt;/code&gt; deletion operation.&lt;/p&gt;
&lt;p&gt;Okay, so we&amp;rsquo;ve marked some files we want to move elsewhere, what now?
Let&amp;rsquo;s press &lt;code&gt;R&lt;/code&gt;:&lt;/p&gt;
&lt;a href=&#34;dired/move.png&#34;&gt;
  &lt;img src=&#34;dired/move.png&#34; alt=&#34;&#34;&gt;
&lt;/a&gt;
&lt;p&gt;Now we need to enter the target path.  But we already have a second
&lt;code&gt;dired&lt;/code&gt; window open just beside this one, why won&amp;rsquo;t it guess we want
to move the files there?  The answer is surprisingly simple: because
we didn&amp;rsquo;t ask it to guess.  Let&amp;rsquo;s press the down arrow.  A little of
context: up arrow would navigate the history of previous inputs,
Bash-style.  Using the down arrow can be seen as guessing the future
input.&lt;/p&gt;
&lt;a href=&#34;dired/move2.png&#34;&gt;
  &lt;img src=&#34;dired/move2.png&#34; alt=&#34;&#34;&gt;
&lt;/a&gt;
&lt;p&gt;It&amp;rsquo;s essentially an on-demand version of &lt;code&gt;mc&lt;/code&gt;-style dual-pane file
management with some added flexibility.&lt;/p&gt;
&lt;p&gt;The same trick may also be used to summon the current permissions when
using the equivalent of &lt;code&gt;chmod&lt;/code&gt;, &lt;code&gt;chown&lt;/code&gt; and &lt;code&gt;chgrp&lt;/code&gt; (&lt;code&gt;M&lt;/code&gt;, &lt;code&gt;O&lt;/code&gt; and &lt;code&gt;G&lt;/code&gt;
respectively).&lt;/p&gt;
&lt;h2 id=&#34;shelling-out&#34;&gt;Shelling out&lt;/h2&gt;
&lt;p&gt;File management aside, sometimes I need to perform a file operation
not provided by &lt;code&gt;dired&lt;/code&gt; and need to run an external command instead.
Luckily &lt;code&gt;dired&lt;/code&gt; has a very robust facility run with the &lt;code&gt;!&lt;/code&gt; key.  &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Commands-in-Dired.html&#34;&gt;The
manual describes it really well&lt;/a&gt; but to summarize, let&amp;rsquo;s assume
we&amp;rsquo;ve got three files marked, &amp;ldquo;foo&amp;rdquo;, &amp;ldquo;bar&amp;rdquo; and &amp;ldquo;baz&amp;rdquo;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Entering &lt;code&gt;echo&lt;/code&gt; or &lt;code&gt;echo ?&lt;/code&gt; would run &lt;code&gt;echo foo; echo bar; echo baz&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Entering &lt;code&gt;echo *&lt;/code&gt; would run &lt;code&gt;echo foo bar baz&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;There are also various additional modifiers controlling how the
commands will be run, for example &lt;code&gt;&amp;amp;&lt;/code&gt; or &lt;code&gt;;&lt;/code&gt;, but I use them rarely.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So one can use &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;?&lt;/code&gt; to control how and where the marked files
will be placed in the command.  It&amp;rsquo;s a very terse but expressive way
to run commands on files and one of my first &amp;ldquo;wow moments&amp;rdquo; with
&lt;code&gt;dired&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For commands not run with files as arguments I either use a
non-&lt;code&gt;dired&lt;/code&gt; variant of this command (it&amp;rsquo;s bound to &lt;code&gt;M-!&lt;/code&gt;) or &lt;code&gt;eshell&lt;/code&gt;
which is a simple shell command prompt built into Emacs.&lt;/p&gt;
&lt;p&gt;For long running commands I still use a regular shell, possibly in
&lt;code&gt;tmux&lt;/code&gt;.  Mostly because Emacs is still a single-threaded program and
while it has some async capabilities, I still prefer to keep such
commands separate.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;/h2&gt;
&lt;p&gt;So that would be it.  My workflow and reasons for using Emacs as my
home away from home.  What I&amp;rsquo;ve shown works out of the box, without
any Emacs configuration and only with minimal Emacs knowledge.  I
highly recommend to give it a try as it saved me a lot of time over
the years.&lt;/p&gt;
&lt;p&gt;PS: A note for Emacs veterans: Yes, I am aware of &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/tramp/Quick-Start-Guide.html&#34;&gt;TRAMP&lt;/a&gt; and use
it extensively but there are times when I prefer to work directly on a
remote host, for instance when I&amp;rsquo;d need &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/tramp/Ad_002dhoc-multi_002dhops.html&#34;&gt;multiple hops&lt;/a&gt; to reach
the intended machine as the intended user as they tend to slow things
down (2 hops is the most I&amp;rsquo;m usually willing to do).  It&amp;rsquo;s also much
harder to recommend using it to a beginner.&lt;/p&gt;
&lt;section class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;In the Debian family called &lt;code&gt;emacs-nox&lt;/code&gt; for &amp;ldquo;no X11&amp;rdquo;. &lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:2&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;Technically speaking in Emacs lingo they are called &amp;ldquo;windows&amp;rdquo; while the GUI windows are called &amp;ldquo;frames&amp;rdquo; but that&amp;rsquo;s not relevant here. &lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&#34;fn:3&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;Technically one can mark a file with any character but it&amp;rsquo;s uncommon. &lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</description>
    </item>
    
    <item>
      <title>Amazing Crap</title>
      <link>https://blog.einval.eu/2019/07/amazing-crap/</link>
      <pubDate>Sun, 14 Jul 2019 03:30:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/2019/07/amazing-crap/</guid>
      <description>&lt;p&gt;…or should I say &amp;ldquo;Amazon Crap&amp;rdquo; as I&amp;rsquo;d like to talk about &lt;strong&gt;Amazon Fire
HD 8&lt;/strong&gt;.  I have been using this tablet for about a year now and at
this point I can say it is absolutely crap …and I love it!&lt;/p&gt;
&lt;p&gt;First of all, I&amp;rsquo;m not a tablet person and I never planned to use my
tablet a lot.  &lt;strong&gt;I was looking for a cheapish device between a laptop
and a smartphone&lt;/strong&gt;.  I didn&amp;rsquo;t need it to be beefy, I mostly wanted a
highly portable device with a screen bigger than my phone&amp;rsquo;s to
comfortably read things on it.&lt;/p&gt;
&lt;p&gt;Fire HD 8 caught my attention due to its relatively low price and
supposedly being &lt;strong&gt;good enough for light usage&lt;/strong&gt; as apparently many
very cheap tablets are bad even as paperweights.  Importing it to
Poland was a bit of a hassle but a friend abroad gave me a hand
(thanks again!).&lt;/p&gt;
&lt;p&gt;This tablet &lt;strong&gt;runs a heavily modified and locked down Android
variation called Fire OS&lt;/strong&gt;, not even connected to Google services by
default as Amazon intends it to be used with their own ecosystem.  &lt;strong&gt;I
think this is the most crappy part of Fire HD 8 which ironically makes
it so great&lt;/strong&gt;.  Since the OS is so locked down (being unable to change
my launcher with no heavy hacks was the most painful thing), it limits
my innate need to improve and tinker in things.  I am almost certain
if it would be a regular Android tablet, I would fill it with
applications I don&amp;rsquo;t need, customize the hell out of it and ultimately
make it slow down to a crawl, as is tradition on Android devices when
you tinker with them too much.  Additionally it limits my urge to
connect it to too many services, so even if I were to lose it, it&amp;rsquo;s
&lt;strong&gt;no real security concern as I have virtually no credentials there&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m speaking from experience: a few years ago I used to have a more
powerful tablet at my disposal for a few months.  I quickly got
confused over what I was &amp;ldquo;supposed&amp;rdquo; to do on it and what on my
smartphone.  Since Fire OS is so annoying, it keeps me from overusing
my tablet.  &lt;strong&gt;It rules out any significant overlap between my phone
and tablet usage and so also any need for configuration
synchronization between them&lt;/strong&gt;.  Once again, less is more!&lt;/p&gt;
&lt;p&gt;I use my Fire HD 8 as a big handheld screen for dumb stuff.
Sketching, reading content unfriendly to a Kindle, sometimes watching
movies or playing some games on the go (nothing too heavy but Baldur&amp;rsquo;s
Gate works more than fine).  Browsing the web is tolerable but the
performance clearly encourages me to use a real computer instead,
which I prefer anyway but might otherwise endure due to sheer
laziness.&lt;/p&gt;
&lt;p&gt;Apart from the screen size, there is one more clear benefit over using
a smartphone here: a separate battery.  &lt;strong&gt;I can carelessly use up all
the battery in this non-critical device while keeping my phone
operational&lt;/strong&gt;.  In the hindsight, this is the biggest benefit of a
tablet for me.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Amazon Fire HD 8 is absolutely crap …and I wouldn&amp;rsquo;t have it any
other way!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;EDIT: For clarification, it is very possible to install Google
Services onto a Fire, they just aren&amp;rsquo;t there out of the box.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>One year with Notmuch</title>
      <link>https://blog.einval.eu/2019/06/one-year-with-notmuch/</link>
      <pubDate>Fri, 14 Jun 2019 16:22:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/2019/06/one-year-with-notmuch/</guid>
      <description>
&lt;p&gt;Email… One of the last bastions of non-proprietary communication with
  the freedom to choose both service providers and clients alike. Some
  call it archaic but none can avoid using it to some degree. For years
  I struggled to find an email client I actually liked. I tried all the
  usual suspects: &lt;em&gt;Mozilla Thunderbird&lt;/em&gt;, &lt;em&gt;mutt&lt;/em&gt;, &lt;em&gt;alpine&lt;/em&gt;, and others.
  Even &lt;em&gt;mu4e&lt;/em&gt; didn&#39;t scratch that itch.&lt;/p&gt;
&lt;p&gt;I&#39;ve spent the last few years on &lt;em&gt;Thunderbird&lt;/em&gt; as I made a point that
  even if everything else is failing, email &lt;em&gt;must work&lt;/em&gt;, so I tried to
  avoid any unnecessary hackery. In the end my nature got better of me:
  about one year ago I switched to &lt;a href=&#34;https://notmuchmail.org/&#34;&gt;Notmuch&lt;/a&gt; and now I think I&#39;m
  ready to write down my experience.&lt;/p&gt;
&lt;details&gt;
  &lt;p&gt;
    &lt;summary&gt;Spoilers&lt;/summary&gt;
    &lt;p style=&#34;border: 1px solid black; padding: 5px;&#34;&gt;
      I&#39;m not switching back, &lt;em&gt;Notmuch&lt;/em&gt; is great.
    &lt;/p&gt;
  &lt;/p&gt;
&lt;/details&gt;
&lt;p&gt;&lt;em&gt;Notmuch&lt;/em&gt; is at its core an email search engine. It indexes the mails
  and allows to query the resulting database. That&#39;s all it does, there
  is no fetching and sending email or the UI apart from the CLI tool.
  For these things I needed separate tools.&lt;/p&gt;
&lt;p&gt;I chose &lt;a href=&#34;http://isync.sourceforge.net/&#34;&gt;isync&lt;/a&gt; to fetch my email and &lt;a href=&#34;https://marlam.de/msmtp/&#34;&gt;msmtp&lt;/a&gt; to send it. At
  first glance it seems more complex than simply clicking away the
  settings in &lt;em&gt;Thunderbird&lt;/em&gt; but I actually like it better. They are
  configured with plaintext and there is a very clear separation of
  concerns. The config files look like this:&lt;/p&gt;
&lt;details&gt;
  &lt;p&gt;
    &lt;summary&gt;~/.msmtprc&lt;/summary&gt;
  &lt;/p&gt;
  &lt;div class=&#34;highlight&#34;&gt;
    &lt;pre&gt;&lt;span&gt;&lt;/span&gt;defaults
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt

account HomeAccount
host smtp.example.com
from vifon@example.com
auth on
user vifon@example.com
passwordeval pass mail/vifon@example.com

account WorkAccount
host mail.workplace.example.com
port 465
from vifon@workplace.example.com
auth on
tls_starttls off
user vifon@workplace.example.com
passwordeval pass mail/vifon@workplace.example.com

account Gmail
host smtp.gmail.com
from vifon@gmail.com
auth on
user vifon@gmail.com
passwordeval pass mail/vifon@gmail.com

account default : HomeAccount&lt;/pre&gt;
  &lt;/div&gt;


&lt;/details&gt;
&lt;details&gt;
  &lt;p&gt;
    &lt;summary&gt;~/.mbsyncrc&lt;/summary&gt;
  &lt;/p&gt;
  &lt;div class=&#34;highlight&#34;&gt;
    &lt;pre&gt;&lt;span&gt;&lt;/span&gt;IMAPAccount HomeAccount
Host imap.example.com
User vifon@example.com
PassCmd &amp;quot;pass mail/vifon@example.com&amp;quot;
SSLType IMAPS

IMAPStore HomeAccount-remote
Account HomeAccount

MaildirStore HomeAccount-local
Subfolders Verbatim
Path ~/Mail/vifon@example.com/
Inbox ~/Mail/vifon@example.com/Inbox

Channel HomeAccount
Master :HomeAccount-remote:
Slave :HomeAccount-local:
Patterns *
Create Both
Expunge Both
SyncState *


IMAPAccount WorkAccount
Host mail.workplace.example.com
User vifon@workplace.example.com
PassCmd &amp;quot;pass mail/vifon@workplace.example.com&amp;quot;
SSLType IMAPS

IMAPStore WorkAccount-remote
Account WorkAccount

MaildirStore WorkAccount-local
Subfolders Verbatim
Path ~/Mail/vifon@workplace.example.com/
Inbox ~/Mail/vifon@workplace.example.com/Inbox

Channel WorkAccount
Master :WorkAccount-remote:
Slave :WorkAccount-local:
Patterns *
Create Both
Expunge Both
SyncState *


IMAPAccount Gmail
Host imap.gmail.com
User vifon@gmail.com
PassCmd &amp;quot;pass mail/vifon@gmail.com&amp;quot;
SSLType IMAPS

IMAPStore gmail-remote
Account Gmail

MaildirStore gmail-local
Subfolders Verbatim
Path ~/Mail/vifon@gmail.com/
Inbox ~/Mail/vifon@gmail.com/Inbox

Channel Gmail
Master :gmail-remote:
Slave :gmail-local:
Patterns *
Create Both
Expunge Both
SyncState *&lt;/pre&gt;
  &lt;/div&gt;


&lt;/details&gt;
&lt;p&gt;If you don&#39;t like the syntax (it&#39;s not great but it does its job),
  don&#39;t worry, there is little need to touch these files after the
  initial setup, unless you need to add or remove an account.&lt;/p&gt;
&lt;p&gt;In both cases, I&#39;m using &lt;a href=&#34;https://www.passwordstore.org/&#34;&gt;pass(1)&lt;/a&gt; for
  the password storage instead of putting my passwords in plaintext
  there. I find &lt;em&gt;pass&lt;/em&gt; excellent for automated access like this.&lt;/p&gt;
&lt;p&gt;Summarizing: After fetching my inbox using &lt;em&gt;isync&lt;/em&gt;, I have a full
  offline copy of all my mails at &lt;code&gt;~/Mail&lt;/code&gt;. &lt;em&gt;Notmuch&lt;/em&gt; can then index
  it.&lt;/p&gt;
&lt;p&gt;OK, we&#39;re done with the internals. As for the UI, I chose
  &lt;a href=&#34;https://notmuchmail.org/notmuch-emacs/&#34;&gt;notmuch.el&lt;/a&gt;. It&#39;s based on &lt;em&gt;GNU Emacs&lt;/em&gt;, so it&#39;s right up my
  alley. There are other alternatives, including using &lt;em&gt;Notmuch&lt;/em&gt; from
  &lt;em&gt;mutt&lt;/em&gt;/&lt;em&gt;neomutt&lt;/em&gt; or dedicated frontends like &lt;a href=&#34;https://github.com/pazz/alot&#34;&gt;alot&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you&#39;re using &lt;em&gt;Notmuch&lt;/em&gt; as a search engine for a &#34;regular&#34; email
  client like mutt, that&#39;s about it. But I was going to use a client
  centered around &lt;em&gt;Notmuch&lt;/em&gt; so the fun only begins. First of all, since
  it&#39;s essentially a database, &lt;em&gt;Notmuch&lt;/em&gt; has no concept of folders.
  Instead it makes extensive use of tags, similar to the ones known from
  Gmail but with a few very important differences. I didn&#39;t like the
  Gmail tags because they wanted to be both tags and folders
  simultaneously. What do I mean? You needed to create them (one way
  or another) and they still existed even when empty. For me it felt
  like a pretty big cognitive overhead to create a new tag as it would
  linger for probably too long and pollute the namespace. In &lt;em&gt;Notmuch&lt;/em&gt;
  the tag exists only as long as there are messages with this tag. The
  tags are inherently bound to messages and don&#39;t exist as a separate
  concept. These are the main tags I use:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;inbox&lt;/code&gt; (for non-archived mail, archiving consists on only removing
    this tag),&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;new&lt;/code&gt; (for the mail that appeared in the latest fetch and weren&#39;t
    there before),&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;sent&lt;/code&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;unread&lt;/code&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;flagged&lt;/code&gt;,&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;actionable&lt;/code&gt;,&lt;/li&gt;
  &lt;li&gt;many less interesting ones.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some of them are directly tied to the server-side flags (like &lt;code&gt;unread&lt;/code&gt;
  or &lt;code&gt;flagged&lt;/code&gt;), others exist solely in the &lt;em&gt;Notmuch&lt;/em&gt; index and I assign
  them using the pre- and post-hooks that are being run before and after
  I refresh the mail index respectively. For instance, my pre-hook
  consists of:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
  &lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;ch&#34;&gt;#!/bin/bash -e&lt;/span&gt;
notmuch tag -new -- tag:new
mbsync -a &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;true&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;…so first I remove all the &lt;code&gt;new&lt;/code&gt; tags from the previous run and then
  &lt;em&gt;Notmuch&lt;/em&gt; runs &lt;em&gt;mbsync&lt;/em&gt; for me to fetch all the new mail. I assign
  the &lt;code&gt;new&lt;/code&gt; tags by specifying this option in &lt;code&gt;~/.notmuch-config&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
  &lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;[new]&lt;/span&gt;
    &lt;span class=&#34;na&#34;&gt;tags&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;unread;inbox;new;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;My post-hook is much more personalized, so there&#39;s little point in
  posting it whole here, but that&#39;s the place where one would add
  various automated tagging rules. I have there rules like this, that
  make my work more organized:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
  &lt;pre&gt;&lt;span&gt;&lt;/span&gt;notmuch tag +flagged -- tag:new and query:work and &amp;#39;&amp;quot;Assignee: Wojciech Siewierski&amp;quot;&amp;#39;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;In &lt;em&gt;notmuch.el&lt;/em&gt; tagging is done by pressing &lt;code&gt;+sometag&lt;/code&gt; to add some tag
  or &lt;code&gt;-sometag&lt;/code&gt; to remove it. Yes, just a plus or minus and the tag.
  It can be &#34;chained&#34; before confirming with Enter like this: &lt;code&gt;-inbox
        -unread +actionable -flagged&lt;/code&gt;. It feels really natural and doesn&#39;t
  get in the way.&lt;/p&gt;
&lt;p&gt;Considering &lt;em&gt;Notmuch.el&lt;/em&gt; runs inside &lt;em&gt;GNU Emacs&lt;/em&gt;, it allows to use all
  its text processing capabilities when composing mail. It really makes
  a difference for the &lt;em&gt;Emacs&lt;/em&gt; power users and that alone is a major
  argument for using &lt;em&gt;Notmuch&lt;/em&gt; for me. It utilizes the &lt;em&gt;Emacs&lt;/em&gt;
  &lt;code&gt;message-mode&lt;/code&gt; with some additions so most generic info about
  composing email in &lt;em&gt;Emacs&lt;/em&gt; found online applies here. GPG signing,
  composing complex mail (like composing HTML mail with Markdown) or
  attaching files is pretty easy thanks to that. For instance it&#39;s
  possible to use &lt;code&gt;gnus-dired-mode&lt;/code&gt; created for the &lt;em&gt;Gnus&lt;/em&gt; mail client
  (also Emacs-based) to select the attachments directly with the &lt;em&gt;dired&lt;/em&gt;
  file manager (yes, you guessed), it doesn&#39;t even need to know anything
  about &lt;em&gt;Notmuch&lt;/em&gt;, it just knows about &lt;code&gt;message-mode&lt;/code&gt;. What really
  surprised me, &lt;code&gt;message-mode&lt;/code&gt; handles a regular drag&#39;n&#39;drop of the
  attachments from traditional graphical file managers, so if you&#39;re
  leaning that way, more power to you!&lt;/p&gt;
&lt;p&gt;I really came to like the way &lt;em&gt;notmuch.el&lt;/em&gt; handles the HTML email. By
  default it prefers showing the plaintext version of email but if none
  is available or the user requests the HTML version it manually, it
  half-renders it. It&#39;s good enough to handle the links and formatting
  but usually not complete enough to allow all the usual crap HTML mail
  are infamous for in some communities. But if I &lt;em&gt;do&lt;/em&gt; need to render it
  fully, &lt;em&gt;notmuch.el&lt;/em&gt; can save the HTML part of the mail in a temporary
  directory and open it with a web browser. At first it felt
  inconvenient but I came to prefer it to the regular approach: I&#39;ll
  probably need to open a web browser to open some links in this mail
  either way, so I get a head start here.&lt;/p&gt;
&lt;p&gt;When it comes to the regular email UI elements, &lt;em&gt;notmuch.el&lt;/em&gt; is more
  than competent. It can display the mail list both as threads (one
  thread == one list element) and as trees (one thread == one tree, one
  mail == one tree node) and the thread navigation is top tier.&lt;/p&gt;
&lt;p&gt;Is &lt;em&gt;Notmuch&lt;/em&gt; + &lt;em&gt;notmuch.el&lt;/em&gt; perfect? Of course not. My main
  &#34;complaint&#34; is the disconnect between the abstract tags system and the
  actual mailbox structure. I can include the mail folder hierarchy in
  a &lt;em&gt;Notmuch&lt;/em&gt; search query but that&#39;s it. When I want to know the
  actual way my mail are stored, I either inspect the &lt;code&gt;~/Mail&lt;/code&gt; directory
  manually or just start &lt;em&gt;Thunderbird&lt;/em&gt; which I&#39;m still keeping as my
  fallback (remember? Email &lt;em&gt;must work&lt;/em&gt;!). Additionally, the way I use
  email is very centralized. The &lt;em&gt;Notmuch&lt;/em&gt; metadata is stored locally,
  so using it on more than one device is tricky. I have a single
  machine I run &lt;em&gt;Notmuch&lt;/em&gt; on so I didn&#39;t have a chance to try
  &lt;a href=&#34;http://www.muchsync.org/&#34;&gt;muchsync&lt;/a&gt; but it&#39;s definitely more work than just logging in via
  IMAP and being done with it. I have a few rules to handle the Gmail
  mail I archived on my mobile devices:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;
  &lt;pre&gt;&lt;span&gt;&lt;/span&gt;notmuch tag -inbox -- tag:inbox and not folder:/Inbox/ and path:/@gmail.com/&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;…and I don&#39;t bother making Gmail aware of mail being archived in
  &lt;em&gt;Notmuch&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Many will miss the lack of automatic mail checking out of the box but
  for me it&#39;s an improvement. I prefer to check my mail on my own
  schedule, not run to check it just because a notification came.&lt;/p&gt;
&lt;p&gt;That&#39;s roughly how I&#39;ve been using &lt;em&gt;Notmuch&lt;/em&gt; for the last year. All
  in all, it&#39;s a trade-off I&#39;m willing to accept but it&#39;s not for
  everyone. I don&#39;t see myself switching mail clients anytime soon.
  &lt;em&gt;Notmuch&lt;/em&gt; is the best way I found to organize and search my mail, and
  it allows me to utilize my editor of choice. Even if you&#39;re not a fan
  of &lt;em&gt;Emacs&lt;/em&gt;, it&#39;s worth a try with one of the other frontends, I know
  some happy users that did.&lt;/p&gt;
  &lt;/div&gt;

  &lt;style&gt;
   summary {
     cursor: pointer;
   }
  &lt;/style&gt;
</description>
    </item>
    
    <item>
      <title>less can do even more</title>
      <link>https://blog.einval.eu/2018/09/less-can-do-even-more/</link>
      <pubDate>Fri, 14 Sep 2018 02:50:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/2018/09/less-can-do-even-more/</guid>
      <description>&lt;p&gt;After writing &lt;a href=&#34;https://blog.einval.eu/2018/09/less-can-do-more/&#34;&gt;my last post&lt;/a&gt; I took my own advice and reread the
&lt;code&gt;less(1)&lt;/code&gt; manpage.  Surprisingly I found some new really handy tricks
that were very helpful not even an hour later!&lt;/p&gt;
&lt;p&gt;First of all, the pair matching.  If the topmost displayed line
(that&amp;rsquo;s the important part!) contains an opening bracket &lt;code&gt;{&lt;/code&gt;, we can
press this very key to find the matching closing bracket (&lt;code&gt;}&lt;/code&gt;).  It is
displayed by placing the line with the matching &lt;code&gt;}&lt;/code&gt; at the bottom.
Similarly now we can press &lt;code&gt;}&lt;/code&gt; to find the matching &lt;code&gt;{&lt;/code&gt; to the closing
bracket in the bottom line, and it gets shown as the topmost line.  At
first it feels strange and confusing but it makes sense after trying
it out.  I used &lt;code&gt;{}&lt;/code&gt; in my example but the same &amp;ldquo;trick&amp;rdquo; works for &lt;code&gt;()&lt;/code&gt;
and &lt;code&gt;[]&lt;/code&gt;.  We can also match a custom pair (sadly, only
single-character) by pressing &lt;code&gt;ctrl+alt+f&lt;/code&gt; followed by the opening
character and then the closing character, to go to the closing
character and &lt;code&gt;ctrl+alt+b&lt;/code&gt; followed by the same thing to go back to
the opening character.  So even though there is no key for matching
&lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; we can use &lt;code&gt;ctrl+alt+f &amp;lt; &amp;gt;&lt;/code&gt; to match them.&lt;/p&gt;
&lt;p&gt;I mentioned I found it useful in real life.  It was when browsing logs
that contained a JSON-like structured data.  When coding I usually run
my tests with &lt;code&gt;./test-suite |&amp;amp; less&lt;/code&gt;, so using the stuff built into
&lt;code&gt;less&lt;/code&gt; was much simpler than opening the same log in a &amp;ldquo;real text
editor&amp;rdquo;.  Nota bene, I could have easily done so by typing &lt;code&gt;g|$vim -&lt;/code&gt;
to go back to the top of the log file (&lt;code&gt;g&lt;/code&gt;) and pipe (&lt;code&gt;|&lt;/code&gt;) everything
up to the end of the viewed text (&lt;code&gt;$&lt;/code&gt;) with &lt;code&gt;vim&lt;/code&gt; (&lt;code&gt;vim -&lt;/code&gt; to make
&lt;code&gt;vim&lt;/code&gt; read its stdin).  I could have omitted &lt;code&gt;g&lt;/code&gt; and replaced &lt;code&gt;$&lt;/code&gt; with
&lt;code&gt;.&lt;/code&gt; to pipe just the visible portion of the log into &lt;code&gt;vim&lt;/code&gt; if that&amp;rsquo;s
the only part I needed at this time.&lt;/p&gt;
&lt;p&gt;I also find the search (&lt;code&gt;/&lt;/code&gt;) flags useful often, for example &lt;code&gt;/^R&lt;/code&gt;
treats the query as a plain text, with no regular expressions, while
&lt;code&gt;/^K&lt;/code&gt; only highlights the matches without changing the current
position in file.  I&amp;rsquo;ll leave learning the rest of the flags as an
exercise to the reader.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>less can do more</title>
      <link>https://blog.einval.eu/2018/09/less-can-do-more/</link>
      <pubDate>Sun, 09 Sep 2018 14:20:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/2018/09/less-can-do-more/</guid>
      <description>&lt;p&gt;&lt;code&gt;less&lt;/code&gt; is probably one of the most used programs in the UNIX world.
It&amp;rsquo;s so ubiquitous we usually barely notice it.  For clarity, I mean
&lt;a href=&#34;https://www.gnu.org/software/less/&#34;&gt;this less&lt;/a&gt;, not &lt;a href=&#34;http://lesscss.org/&#34;&gt;this
one&lt;/a&gt;.  Despite its ubiquity, very few people
actually take time to learn its less obvious but still very useful
features.  Let&amp;rsquo;s change that!&lt;/p&gt;
&lt;p&gt;First of all, the &lt;code&gt;&amp;amp;&lt;/code&gt; key.  It prompts for a search pattern and then
acts like a filter, showing only the matching lines, not unlike
&lt;code&gt;grep&lt;/code&gt;.  &lt;em&gt;Unlike&lt;/em&gt; &lt;code&gt;grep&lt;/code&gt; though, you can change this filter without
closing &lt;code&gt;less&lt;/code&gt; and it&amp;rsquo;s generally very useful if you need to filter
the content as an afterthought, if you decide you really could use a
filter only after producing copious amounts of output.&lt;/p&gt;
&lt;p&gt;Another useful thing is toggling the commandline -options in a running
&lt;code&gt;less&lt;/code&gt;, once again without restarting it.  For example you can press
&lt;code&gt;-S&lt;/code&gt; to toggle wrapping the long lines or &lt;code&gt;-J&lt;/code&gt; to mark the lines
matching the search pattern with an asterisk.  It&amp;rsquo;s worth to keep in
mind that every commandline option can be toggled this way, though
obviously some are more useful this way than the others.&lt;/p&gt;
&lt;p&gt;Last but not least, the marks known from Vim (among the others).  By
pressing &lt;code&gt;m&lt;/code&gt; followed by almost any other key, you can save the
current position in a text and then return to it by pressing &lt;code&gt;&#39;&lt;/code&gt;
followed by the same key.  For instance you can save two distant
places in a file with &lt;code&gt;ma&lt;/code&gt; and &lt;code&gt;mb&lt;/code&gt; and then cross-reference them by
jumping between them with &lt;code&gt;&#39;a&lt;/code&gt; and &lt;code&gt;&#39;b&lt;/code&gt;.  Considering &lt;code&gt;less&lt;/code&gt; is very
often used for reading lenghty manpages with lots of &amp;ldquo;See SOME OTHER
SECTION for details&amp;rdquo;, it&amp;rsquo;s a godsend.&lt;/p&gt;
&lt;p&gt;In general, every user of UNIX-like systems should at least skim the
&lt;code&gt;less&lt;/code&gt; keybindings, as even in such a simple tool there is much to
learn.  Press &lt;code&gt;h&lt;/code&gt; to display them and have a good time reading through
them!  I know I had!&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://blog.einval.eu/2018/09/less-can-do-even-more/&#34;&gt;Part Two&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>My experience with Firefox Quantum</title>
      <link>https://blog.einval.eu/2017/11/my-experience-with-firefox-quantum/</link>
      <pubDate>Tue, 21 Nov 2017 01:20:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/2017/11/my-experience-with-firefox-quantum/</guid>
      <description>&lt;p&gt;About three months ago, after many years of using Chromium
exclusively, I came back to Mozilla Firefox. Actually I was &lt;em&gt;forced&lt;/em&gt;
to switch because the hardware acceleration in Chromium was crashing
my GPU driver (don&amp;rsquo;t even ask&amp;hellip;) but after a few days I was perfectly
happy with this forced change.&lt;/p&gt;
&lt;p&gt;When I switched to Firefox, it was already &lt;strong&gt;much snappier than I
remembered from my last time&lt;/strong&gt;. I was really impressed with what the
&lt;a href=&#34;https://hacks.mozilla.org/2017/11/entering-the-quantum-era-how-firefox-got-fast-again-and-where-its-going-to-get-faster/&#34;&gt;Firefox Quantum&lt;/a&gt; team did but up until this point it was still
just a good replacement for Chromium. Even a &lt;em&gt;great&lt;/em&gt; replacement but
still not a clear improvement. Not anymore! Alluding to its original
name&amp;mdash;&lt;a href=&#34;https://en.wikipedia.org/wiki/History_of_Firefox#Naming&#34;&gt;Phoenix&lt;/a&gt;&amp;mdash;&lt;strong&gt;Firefox was reborn from its ashes and is
better than ever&lt;/strong&gt;.&lt;/p&gt;
&lt;h1 id=&#34;what-i-like&#34;&gt;WHAT I LIKE&lt;/h1&gt;
&lt;p&gt;Firefox 57&amp;mdash;or Firefox Quantum&amp;mdash;starts a new era of Mozilla Firefox,
a truly modern browser. These are my favorite features that make me
feel good I chose Firefox again. Actually most of them were there
already for a few months but now they got polished.&lt;/p&gt;
&lt;h2 id=&#34;1-the-screenshot-tool&#34;&gt;1. The screenshot tool&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;firefox-screenshot.png&#34;&gt;&lt;img src=&#34;firefox-screenshot.thumb.png&#34; alt=&#34;&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The screenshot tool that allows for the easy selection of the webpage
element to share and then to upload that screenshot to the Mozilla
servers (it gets removed after 14 days). Personally I already have a
set of scripts for screenshot sharing but now it&amp;rsquo;s available for
everyone.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It&amp;rsquo;s fast, it&amp;rsquo;s simple and&amp;mdash;most importantly&amp;mdash;it works. I like
it!&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&#34;2-send-tab-to-device&#34;&gt;2. &amp;ldquo;Send Tab to Device&amp;rdquo;&lt;/h2&gt;
&lt;p&gt;I never liked the synchronization of the open tabs in Chromium &amp;mdash; I
usually need to share a single tab from my mobile to desktop or vice
versa, never the whole set. Mozilla gets it &amp;mdash; &lt;strong&gt;it&amp;rsquo;s possible to
send a single tab to the selected device with just a few clicks&lt;/strong&gt;. No
other 3rd party software needed (e.g. Pushbullet). Sometimes some
delays may be experienced but otherwise it works pretty great.&lt;/p&gt;
&lt;p&gt;The browsing on multiple devices feels interconnected yet not
intrusive or overwhelming.&lt;/p&gt;
&lt;h2 id=&#34;3-the-buttons-on-the-right-side-of-the-address-bar&#34;&gt;3. The buttons on the right side of the address bar&lt;/h2&gt;
&lt;p&gt;Related to &lt;span class=&#34;pros&#34;&gt;(1)&lt;/span&gt; and &lt;span
class=&#34;pros&#34;&gt;(2)&lt;/span&gt;: I really like the idea of using the address
bar for some page-related actions like screenshotting, bookmarking,
tab-sending or the reader-mode. Separating them from the regular
addons &lt;strong&gt;makes the whole experience fluid and pleasant&lt;/strong&gt;. Did I
mention it&amp;rsquo;s customizable? Now I did.&lt;/p&gt;
&lt;h2 id=&#34;4-freedom&#34;&gt;4. Freedom&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s not as much of a feature as a fact about the company &amp;mdash; Mozilla
itself.&lt;/p&gt;
&lt;p&gt;The browser market is currently divided between Mozilla, Google,
Microsoft and Apple. Among these companies only Mozilla may be
considered &amp;ldquo;independent&amp;rdquo; and &amp;ldquo;pro-user&amp;rdquo;. There are no hidden agendas,
no profiting off the users&amp;rsquo; data. The browser is free (as in freedom)
and open with no proprietary components. Mozilla has proven on
numerous occasions that it values its users&amp;rsquo; privacy. &lt;strong&gt;I feel much
more confident using the Mozilla cloud services (like the screenshot
hosting) than choosing the services of their competitors.&lt;/strong&gt; I know I
can trust them, that I am a &lt;em&gt;user&lt;/em&gt;, not a &lt;em&gt;product&lt;/em&gt;.&lt;/p&gt;
&lt;h2 id=&#34;5-better-incognito-mode&#34;&gt;5. Better incognito mode&lt;/h2&gt;
&lt;p&gt;I use the incognito mode pretty extensively, mostly out of habit. In
Chromium it was always annoying me that I cannot restore a closed tab
in the incognito window. In my opinion it should be possible for as
long as the whole window still exists. Well&amp;mdash;good news!&amp;mdash;this is
exactly how it works in Firefox, how it always was ever since Firefox
3.5! I missed it!&lt;/p&gt;
&lt;p&gt;Additonally Firefox now treats the incognito windows in a special way:
it tries to block the tracking elements on the visited webpages.
Actually &lt;strong&gt;I dislike the fact that incognito is treated in a special
way because it will reinforce the notion that incognito is a security
feature and not a convenience feature.&lt;/strong&gt; I suspect Mozilla decided the
webpages would start blocking Firefox if it did block the trackers by
default. It&amp;rsquo;s trivial to enable this feature in the non-incognito
mode, so I think it&amp;rsquo;s still a good move in the long run.&lt;/p&gt;
&lt;h2 id=&#34;6-redesigned-ui--the-amazing-performace&#34;&gt;6. Redesigned UI &amp;amp; the amazing performace&lt;/h2&gt;
&lt;p&gt;Last but not least: &lt;strong&gt;The redesigned user interface is gorgeous.&lt;/strong&gt;
It&amp;rsquo;s filled with beautiful yet not distracting animations, polished
icons and dozens of little tweaks and changes.&lt;/p&gt;
&lt;p&gt;What&amp;rsquo;s even more important, the new Firefox feels &lt;em&gt;at least&lt;/em&gt; as
responsive as Chromium. It&amp;rsquo;s blazing fast and surprisingly
memory-efficient.&lt;/p&gt;
&lt;h1 id=&#34;what-i-still-miss&#34;&gt;WHAT I STILL MISS&lt;/h1&gt;
&lt;p&gt;Is Firefox better than Chromium in every way? Not exactly.&lt;/p&gt;
&lt;h2 id=&#34;1-multiple-tabs-selection&#34;&gt;1. Multiple tabs selection&lt;/h2&gt;
&lt;s&gt;
Chromium has an obscure feature making it possible to act on multiple
tabs at the same time. By Ctrl+clicking (or Shift+clicking for a
slightly different behavior) the tabs, we can select all the clicked
tabs and then close or move them all at once!
&lt;/s&gt;
&lt;p&gt;&lt;strong&gt;EDIT: Added in Firefox 64.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id=&#34;2-profile-management&#34;&gt;2. Profile management&lt;/h2&gt;
&lt;p&gt;I use multiple browser profiles heavily. I use them to separate my
work stuff from home stuff or to test things on a clean setup.&lt;/p&gt;
&lt;p&gt;While Firefox have supported multiple profiles since forever,
switching between them is still far from seamless. In Chromium it&amp;rsquo;s
done with a button in the upper right corner (or Ctrl+Shift+M). In
Firefox I have a bunch of scripts running &lt;code&gt;firefox -P &amp;lt;PROFILE-NAME&amp;gt;&lt;/code&gt;.
While I like it for the added control (I found no way to script the
Chromium profiles), it felt awkward at first and I&amp;rsquo;m sure it feels the
same for many other users.&lt;/p&gt;
&lt;p&gt;On the other hand, Chromium aggressively encourages the user to log
into the Google services which effectively change the local browser
profiles into the online Google accounts negating all the privacy
benefits.&lt;/p&gt;
&lt;p&gt;At the end of the day I think &lt;strong&gt;I prefer the Firefox profiles but only
because of Google being Google.&lt;/strong&gt;&lt;/p&gt;
&lt;h1 id=&#34;addons&#34;&gt;Addons?&lt;/h1&gt;
&lt;p&gt;You might have noticed that I still didn&amp;rsquo;t mention the hot topic of
the legacy Firefox addons that were deprecated in favor of the new
so-called WebExtensions. I did so on purpose. It&amp;rsquo;s arguably the most
brave change in Firefox Quantum and while I will miss one or two
legacy addons, I understand this decision and I agree it was
necessary. Let the past be the past.&lt;/p&gt;
&lt;p&gt;Personally I consider Firefox Quantum &lt;strong&gt;a new bright era of modern
Firefox, a worthy browser for a truly free person.&lt;/strong&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Secondary login credentials</title>
      <link>https://blog.einval.eu/2016/11/secondary-login-credentials/</link>
      <pubDate>Sun, 20 Nov 2016 01:53:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/2016/11/secondary-login-credentials/</guid>
      <description>&lt;p&gt;Sometimes I need to access my files on my servers using SSH/SCP from
an untrusted device and/or application. Usually I would create a new
SSH key pair so that I can easily revoke these credentials later if
such need arises. But what if the used application doesn&amp;rsquo;t support SSH
keys or we do not want to use them for some reason?&lt;/p&gt;
&lt;p&gt;There is a trick supposedly used by sysadmins in the olden days,
before &lt;code&gt;sudo&lt;/code&gt; was around. I assume you&amp;rsquo;re at least aware of the
&lt;code&gt;/etc/passwd&lt;/code&gt; file that contains the basic information about all the
system users. Information such as the username, historically hash of
the password&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;, the user and group ID (UID and GID). It looks like
this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;vifon:x:1000:1000:Wojciech Siewierski,,,:/home/vifon:/bin/zsh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The trick is to create a second line for your user &amp;mdash; with the same
UID but a different username.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;vifon:x:1000:1000:Wojciech Siewierski,,,:/home/vifon:/bin/zsh
alsovifon:x:1000:1000:Wojciech Siewierski,,,:/home/vifon:/bin/zsh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Such user has a separate password (among other things) but once you
log in, it functions almost the same as your regular user.&lt;/p&gt;
&lt;p&gt;What do we gain this way? The most important part to me is that &lt;strong&gt;in
case the credentials get compromised, only the password to the
secondary username needs to be changed&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Are there any other differences between our twin users? The following
ones come to my mind:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Groups&lt;/dt&gt;
&lt;dd&gt;Groups in &lt;code&gt;/etc/group&lt;/code&gt; are assigned to usernames, not UIDs. Usually
our user after a login with a secondary username belongs only to its
main group (defined by GID specified in &lt;code&gt;/etc/passwd&lt;/code&gt;). Seemingly as
an added benefit the compromised credentials cannot be used for
instance to manage Docker even if normally the user would be
privileged to do so. I said seemingly&amp;hellip; Well, nothing stops the user
from using &lt;code&gt;newgrp(1)&lt;/code&gt; to change their group to any group associated
with our primary username.&lt;/dd&gt;
&lt;dt&gt;Login shell&lt;/dt&gt;
&lt;dd&gt;Login shell may be changed separately for each username. I didn&amp;rsquo;t
find it particularly useful but maybe you will.&lt;/dd&gt;
&lt;dt&gt;Home directory&lt;/dt&gt;
&lt;dd&gt;The home directory also may be changed separately. Once again, might
come useful but I didn&amp;rsquo;t use it.&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;I definitely do not recommend using this technique on important
servers but it&amp;rsquo;s a workaround that comes in handy here and there.&lt;/p&gt;
&lt;section class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id=&#34;fn:1&#34; role=&#34;doc-endnote&#34;&gt;
&lt;p&gt;These days usually &lt;code&gt;x&lt;/code&gt; is placed in this field which means &amp;ldquo;the
actual hash is in &lt;code&gt;/etc/shadow&lt;/code&gt;&amp;rdquo;. &lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</description>
    </item>
    
    <item>
      <title>About</title>
      <link>https://blog.einval.eu/page/about/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/page/about/</guid>
      <description>&lt;p&gt;Hi. My name is Wojciech Siewierski, sometimes known as &lt;em&gt;vifon&lt;/em&gt;. I am a
software engineer and a UNIX sysadmin from Warsaw, Poland.&lt;/p&gt;
&lt;p&gt;On this blog I&amp;rsquo;m going to write about various
useful/funny/surprising/obscure ways to get things done. Or anything I
will find particularly interesting, really.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;d like to contact me, I can usually be found on
&lt;em&gt;irc.freenode.net&lt;/em&gt; as &lt;em&gt;vifon&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;My PGP key fingerprint: &lt;a href=&#34;
/static/00AC06C0890029F6.asc

&#34;&gt;&lt;code&gt;BAD7 861E F3EF 053F F08D  9D5F 00AC 06C0 8900 29F6&lt;/code&gt;&lt;/a&gt;&lt;br&gt;
My older PGP key that&amp;rsquo;s sometimes still in use: &lt;code&gt;3019 3C49 CB39 CD27 0082  46AD E590 2A52 B247 B8DE&lt;/code&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Links</title>
      <link>https://blog.einval.eu/page/links/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://blog.einval.eu/page/links/</guid>
      <description>&lt;p&gt;Various stuff I use and I&amp;rsquo;m happy with:&lt;/p&gt;
&lt;h3 id=&#34;software&#34;&gt;Software&lt;/h3&gt;
&lt;p&gt;Operating system
: GNU/Linux (mostly &lt;a href=&#34;https://www.ubuntu.com/server&#34;&gt;Ubuntu Server&lt;/a&gt;, &lt;a href=&#34;https://www.debian.org/&#34;&gt;Debian&lt;/a&gt;, &lt;a href=&#34;https://www.gentoo.org/&#34;&gt;&lt;strong&gt;Gentoo&lt;/strong&gt;&lt;/a&gt;, &lt;a href=&#34;https://nixos.org/&#34;&gt;&lt;strong&gt;NixOS&lt;/strong&gt;&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Text editor
: &lt;a href=&#34;https://www.gnu.org/software/emacs/&#34;&gt;&lt;strong&gt;GNU Emacs&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Window manager
: &lt;a href=&#34;https://xmonad.org/&#34;&gt;&lt;strong&gt;XMonad&lt;/strong&gt;&lt;/a&gt;, &lt;a href=&#34;https://github.com/ch11ng/exwm&#34;&gt;EXWM&lt;/a&gt; (Emacs X Window Manager)&lt;/p&gt;
&lt;p&gt;File manager
: &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html&#34;&gt;&lt;strong&gt;dired&lt;/strong&gt;&lt;/a&gt;, &lt;a href=&#34;https://ranger.github.io/&#34;&gt;&lt;strong&gt;ranger&lt;/strong&gt;&lt;/a&gt;, &lt;a href=&#34;http://rox.sourceforge.net/desktop/ROX-Filer&#34;&gt;rox&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Terminal emulator
: &lt;a href=&#34;https://github.com/alacritty/alacritty&#34;&gt;Alacritty&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;IRC client
: &lt;a href=&#34;https://weechat.org/&#34;&gt;&lt;strong&gt;Weechat&lt;/strong&gt;&lt;/a&gt;, &lt;a href=&#34;https://github.com/jorgenschaefer/circe&#34;&gt;Circe&lt;/a&gt; via Weechat Relay&lt;/p&gt;
&lt;p&gt;Web browser
: &lt;a href=&#34;https://www.mozilla.org/firefox/&#34;&gt;&lt;strong&gt;Mozilla Firefox&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Internet search:
: &lt;a href=&#34;https://asciimoo.github.io/searx/&#34;&gt;&lt;strong&gt;searx&lt;/strong&gt;&lt;/a&gt;, &lt;a href=&#34;https://duckduckgo.com/&#34;&gt;DuckDuckGo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Email
: &lt;a href=&#34;https://notmuchmail.org/&#34;&gt;&lt;strong&gt;notmuch&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lockscreen
: &lt;a href=&#34;https://i3wm.org/i3lock/&#34;&gt;i3lock&lt;/a&gt;, &lt;a href=&#34;https://tools.suckless.org/slock/&#34;&gt;slock&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Slideshows
: &lt;a href=&#34;https://tools.suckless.org/sent/&#34;&gt;sent&lt;/a&gt;, &lt;a href=&#34;https://revealjs.com/&#34;&gt;Reveal.JS&lt;/a&gt;, &lt;a href=&#34;https://www.sharelatex.com/learn/Beamer&#34;&gt;Beamer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Calendar
: &lt;a href=&#34;https://github.com/vifon/TrayCalendar&#34;&gt;TrayCalendar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Calculator
: &lt;a href=&#34;https://www.gnu.org/software/emacs/manual/html_node/calc/&#34;&gt;Emacs Calc&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Version control system
: &lt;a href=&#34;https://git-scm.com/&#34;&gt;&lt;strong&gt;Git&lt;/strong&gt;&lt;/a&gt;, &lt;a href=&#34;http://darcs.net/&#34;&gt;Darcs&lt;/a&gt;, &lt;a href=&#34;https://www.gnu.org/software/rcs/&#34;&gt;RCS&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Backups
: &lt;a href=&#34;https://borgbackup.readthedocs.io/&#34;&gt;Borg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Data analysis
: &lt;a href=&#34;https://www.r-project.org/&#34;&gt;R&lt;/a&gt;, &lt;a href=&#34;https://jupyter.org/&#34;&gt;Jupyter &amp;amp; co.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Multimedia
: &lt;a href=&#34;https://www.musicpd.org/&#34;&gt;MPD&lt;/a&gt;+&lt;a href=&#34;https://rybczak.net/ncmpcpp/&#34;&gt;ncmpcpp&lt;/a&gt;, &lt;a href=&#34;https://beets.io/&#34;&gt;beets&lt;/a&gt;, &lt;a href=&#34;https://mpv.io/&#34;&gt;mpv&lt;/a&gt;&lt;/p&gt;
&lt;!-- [7]: https://surf.suckless.org/ --&gt;
&lt;!-- [8]: https://tools.suckless.org/tabbed/ --&gt;
</description>
    </item>
    
  </channel>
</rss>
