EINVAL: Valid solutions for invalid problems

Skeletons in the Closet

After my previous post I continued to dig deeper into the Emacs skeleton system. Not all of it was beneficial for my sanity, so strap in and let me explain some more cursed parts of it!

Emacs Skeletons: The Missing Manual

The venerable Emacs skeleton system, while powerful, lacks documentation in some areas. For example the topic of subskeletons is only touched on with little to no examples. This post attempts to alleviate it to some degree. A basic Elisp familiarity is assumed.

Running shell commands from Emacs Dired

dired-do-shell-command (bound to ! in dired) can handle multiple marked files in a few different ways. They are quite intuitive but I always wished for a cheatsheet with all the options, so here I am, creating one.

Multiple cursors considered… suboptimal

The famous “considered harmful” would be a vast overstatement, but I see them as a solution preventing better solutions. I’m going to talk about the GNU Emacs flavor of them so not all problems and alternatives will apply to other text editors.

VPNs are hard

, updated on

Almost every developer ends up using a VPN for work sooner or later. Apart from figuring out how to authenticate, it’s seemingly a simple matter. VPNs—usually associated with privacy—can unfortunately be a source of serious privacy leaks just as easily. Let’s talk about what we may want to check after connecting to a corporate VPN.

Replacement office chair casters

, updated on

One more problem I didn’t even know I had: bad office chair casters.

A regular consumer's review of Dell S2721DGFA

Stock Firefox keyboard controls

, updated on

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 hints, which usually looks like this (example from Saka Key):

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.

Emacs as a Shell

, updated on

When I log into a new server, one of the first things I do is install a minimal Emacs package1. Of course assuming nobody minds if the server is not strictly mine, I’m not a monster.

Emacs serves me as a de facto shell when setting up whatever there is to set up. By “shell” I mean a broader meaning of this word than just a command prompt: it’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 dired module. One could say I use it like many people use Midnight Commander (mc) though I consider it much more powerful for various reasons. Let me show you what it looks like:

Amazing Crap

, updated on

…or should I say “Amazon Crap” as I’d like to talk about Amazon Fire HD 8. 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!

First of all, I’m not a tablet person and I never planned to use my tablet a lot. I was looking for a cheapish device between a laptop and a smartphone. I didn’t need it to be beefy, I mostly wanted a highly portable device with a screen bigger than my phone’s to comfortably read things on it.

One year with Notmuch

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: Mozilla Thunderbird, mutt, alpine, and others. Even mu4e didn't scratch that itch.

I've spent the last few years on Thunderbird as I made a point that even if everything else is failing, email must work, so I tried to avoid any unnecessary hackery. In the end my nature got better of me: about one year ago I switched to Notmuch and now I think I'm ready to write down my experience.

less can do even more

After writing my last post I took my own advice and reread the less(1) manpage. Surprisingly I found some new really handy tricks that were very helpful not even an hour later!

First of all, the pair matching. If the topmost displayed line (that’s the important part!) contains an opening bracket {, we can press this very key to find the matching closing bracket (}). It is displayed by placing the line with the matching } at the bottom. Similarly now we can press } to find the matching { 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 {} in my example but the same “trick” works for () and []. We can also match a custom pair (sadly, only single-character) by pressing ctrl+alt+f followed by the opening character and then the closing character, to go to the closing character and ctrl+alt+b followed by the same thing to go back to the opening character. So even though there is no key for matching <> we can use ctrl+alt+f < > to match them.

less can do more

less is probably one of the most used programs in the UNIX world. It’s so ubiquitous we usually barely notice it. For clarity, I mean this less, not this one. Despite its ubiquity, very few people actually take time to learn its less obvious but still very useful features. Let’s change that!

First of all, the & key. It prompts for a search pattern and then acts like a filter, showing only the matching lines, not unlike grep. Unlike grep though, you can change this filter without closing less and it’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.

My experience with Firefox Quantum

, updated on

About three months ago, after many years of using Chromium exclusively, I came back to Mozilla Firefox. Actually I was forced to switch because the hardware acceleration in Chromium was crashing my GPU driver (don’t even ask…) but after a few days I was perfectly happy with this forced change.

When I switched to Firefox, it was already much snappier than I remembered from my last time. I was really impressed with what the Firefox Quantum team did but up until this point it was still just a good replacement for Chromium. Even a great replacement but still not a clear improvement. Not anymore! Alluding to its original name—PhoenixFirefox was reborn from its ashes and is better than ever.

Secondary login credentials

Sometimes I need to access my files on my servers using SSH/SCP from a not fully trusted device and/or application (think: a smartphone). 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’t support SSH keys or we do not want to use them for some reason?

There is a trick supposedly used by sysadmins in the olden days, before sudo was around. I assume you’re at least aware of the /etc/passwd file that contains the basic information about all the system users. Information such as the username, historically hash of the password1, the user and group ID (UID and GID). It looks like this: