Setting Up and Using Authinfo With Emacs

Once you start moving more and more of your computing tasks into Emacs, you’re going to need a way of handling passwords. Mail is the canonical example but there are also things like blogging sites, ftp servers and other functions that you want to access from Emacs but that require a password.

With mail, for example, you need a login and password to retrieve your mail from, say, your mail provider’s IMAP server and you may need another set for their SMTP server so you can send mail. One solution is to simply add these to your configuration files but that’s horribly insecure. Of course, as usual, Emacs has us covered. The proper way of doing this is to put all the login/password information into an authinfo file and encrypt it. Emacs will read, decrypt, and parse this file to get the required login/password, requesting the key to decrypt the file if necessary.

Setting this up can be a bit tricky but David Wilson has a nice video that explains how to set up and use the authinfo system. He takes you step-by-step through the process but be sure to read Chris Wellon’s (skeeto) comment on how and why to use an elliptic curve instead of the RSA-based key that Wilson uses.

The video is 38 minutes, 13 seconds so plan accordingly.

Posted in General | Tagged , | Leave a comment

Adding a Third Monitor to EXWM

Twelve or thirteen years ago, I got my first Mac. Fast forward to today and you’ll find that the Irreal bunker is firmly in the Apple ecosystem. One of the things I don’t miss—at all—is struggling with getting X configured. I’m told by reliable sources that things are much easier now but the horror of X configuration was brought back to me by Tory Anderson’s post on how he added a third monitor to his EXWM configuration.

I love the idea of EXWM and wish it were available for the Mac but for now, I’ll have to look on enviously. Anderson runs EXWM and had it set up for his main monitor and his laptop screen. Then he got another monitor and wanted to add it to his EXWM system. His post is a detailed step-by-step tutorial on how to do that.

If you read his post, you’ll see what I mean about X configuration. He had to do some fiddling with his X configuration to get things running. No doubt I’m just being a sissy and making things seem harder than they are but I’ve grown soft living in the Apple walled garden where none of this is necessary. If you’re looking to add another monitor to your setup, you should take a look at Anderson’s post.

Posted in General | Tagged , | Leave a comment

Prot on Embark

Protesilaos Stavrou (Prot) has a new video up in which he discusses Embark and some of his extensions to it. For those unfamiliar with Embark, it’s a package that lets you bind actions to keys in a context sensitive way. That is, the action taken for a given key will be different when the point is on a URL from what it will be if it’s on a file name.

The system’s a bit complicated and hard to describe succinctly but Prot demonstrates its major functionality. Of course, being Prot he’s added a few extensions to make it better match his workflow.

The Embark system reminds me a lot of Ivy but as Prot says, the context sensitivity gives it a more focused feel. Watch the video to see what I mean. It’s 33 minutes, 21 seconds so you’ll need to set aside some time but it’s worth taking a look. As usual, Prot provides links to the relevant code so you can see how he has things set up if you want to replicate his workflow and use it as a starting point for your own.

Posted in General | Tagged | Leave a comment

Group Tags in Org-mode

I know about Org’s group tags but like any things in Emacs, I wasn’t using them so they slipped out of my mind. Until today. Today, I saw this Tweet:

and it reminded me that they can be really helpful in some use cases. The documentation for them is here but the TL;DR is that you can assign a set of tags to a group and then search for items with any of the tags by searching for the group name.

You can obviously get along without them but for some applications they’re the perfect solution. Take a look at the documentation to get the full story.

Posted in General | Tagged , | Leave a comment

Read Meat Friday: A Trojan In Your Editor

Is there a backdoor in your editor? Probably not, even if you’re using IntelliJ, but in a moment of schadenfreude for FOSS folks, the New York Times is reporting that JetBrains software may have been used as vector in the Russian hack.

It’s a good policy not to believe anything you read in the press about technical matters and JetBrains for its part is denying that there’s a backdoor TeamCity—the software in question—but admitted that it’s possible it was exploited somehow to install the trojan. Still, if you’re an IntelliJ user, you’ve got to be wondering what’s in your software.

The problem is, you don’t know because it’s closed source. That’s a problem users of Emacs and other FOSS editors don’t have. It’s easy to minimize the benefits of FOSS because most of us don’t, after all, make changes to—or even read—the source code of most of our applications. And yes, it’s possible for FOSS to be infected too but it’s more difficult and easier to discover.

This episode, whatever its truth, is a useful reminder that having access to the source code of your tools is important. Of course, as Ken Thompson reminds us, that may not be enough, but it’s sure better than using a black box.

Posted in General | Tagged , , | Leave a comment

The Guile Hacker’s Handbook

Jeremy Korwin has an interesting project underway. He’s writing a Guile hacker’s handbook. Guile, of course, is the official GNU extension language. Korwin’s idea is to document what a beginning Guile hacker needs to know to install, and learn the Guile version of the Scheme language.

An important part of his exposition, so far, is how to configure and use Emacs as a Guile IDE. He suggests using geiser, a Slime-like interface for Scheme. It’s what I use for writing in Scheme and I really like it. It makes the interactive style of programming that I prefer easy and pleasant.

The book is still in its early stages so it’s not really ready for use but it’s interesting to see how it’s evolving.

Posted in General | Tagged , | Leave a comment

Building A Password Generator in 3 Minutes

Today—the whole week really—has been consumed by yak shaving so this is a short offering. Salah Qadri has a nice 3 minute video (3 minutes, 48 secs actually) in which he builds a reasonably good password generator.

The generator builds a password from upper/lower case letters, numbers, and symbols. The type of character and which one it is used are chosen randomly at each step using the Python random.choice method. One can argue that Qadri should have used the secrets.choice method instead but for occasional one-off passwords random.choice is probably adequate.

My only other nit is that I would have used a more functional approach rather than relying on globals but that’s more a personal preference. If you want to generate random passwords, Qadri’s video has some nice ideas. I like the way he handled choosing a type of character randomly. The code is easy to follow even if you aren’t a Python coder.

Posted in General | Tagged , | Leave a comment

Why You Should Learn Emacs This Year

David Wilson over at the System Crafters YouTube channel is starting off the year with a video that gives you 5 Reasons to Learn Emacs in 2021. He begins by noting that Emacs is not a text editor or at least not just a text editor. That’s not news to Emacs oldtimers, of course. As most of you know by now, I think of Emacs as a sort of lightweight version of a Lisp Machine and the working/development environment that they provided.

Wilson has a Linux laptop so he can run EXWM, which serves as an Emacs based window manager and increases the feeling of running in a Lisp Machine-like environment. All of that is important because it means you can customize your environment to be exactly what you want it to be. The source code is there, the documentation is there and they’re both easily available right from Emacs. There’s no need to be online or to go to an external site.

Wilson also calls out the advantages of Emacs’ keyboard-based UI. You can leave your mouse at home and still have full and easy control of your environment. That is, I suppose, even more true if you’re running EXWM. Of course, if you’re fond of rodents, Emacs supports your mouse just fine.

Finally, there’s Magit and Org-mode. They’re most people’s idea of Emacs’ killer apps and Wilson spends a bit of time on Org and Magit demonstrating a few of their features.

The video is 26 minutes, 38 seconds long so plan accordingly. It’s a nice video and worth spending the half hour on. If you know someone who’s wondering if they should invest in Emacs, this is a good place to point them.

Posted in General | Tagged | Leave a comment

Adtech Fraud at Uber

As most of you know to your sorrow, I really, really hate adtech and frequently rail against it. The harm they do to ordinary users like you and me is manifest. They invade our privacy, follow us around the Internet, accumulate dossiers on us and sell them to anyone willing to pay.

But, it turns out, they’re shafting the advertisers too. Not just little white lie exaggerations but outright criminal fraud. Nandini Jammi has an startling thread that tells the story of how Uber lost over $100M from their advertising budget due to adtech fraud. The \$100M represents \(2/3\) of their advertising budget so it’s a significant amount.

The TL;DR is that one of the Twitter tongs was after Uber to stop advertising with a site they were politically opposed to and when Uber complied by canceling \$15M of advertising, they noticed no difference in their results. Unlike many advertisers, Uber actually has some technical prowess, so they started looking at logs to see what was happening. What they discovered was flat out click fraud. As a result, they canceled all their adtech advertising—over \$100M worth—and found that it still didn’t make any difference in their results.

As the thread says, most executives in charge of booking these advertisements have no idea how to monitor the results or tell if they’re being defrauded. If you’re not employed by adtech, your interests are aligned with those who wish to end it once and for all. There are plenty of problems with having the government trying to fix this but the whole thing would collapse in an instant if the advertisers just told them to go away. In the meantime, you and I can help by blocking as many tracking scripts as we can.

Posted in General | Tagged | Leave a comment

REPLs

Mikel Evins has a lovely post that considers interactive programming and REPLs. As many of you know, I love interactive programming and am a huge fan of it. I like how you can try out bits of code and feel your way to larger functions and finally a program. If you’re not familiar with the concept, take a look at this fascinating video from Kris Jenkins as he writes a Spotify client in Elisp right before your eyes.

Evins begins by examining the idea of a REPL and why they aren’t all the same.There is, he says, a big difference between a Lisp or Smalltalk REPL and one provided by, say, Python. You should consult his post for exactly what that difference is but the TL;DR is that the Lisp REPL allows you to talk to your program as it’s running, even if it enters an error state.

He goes on to lament that many—or perhaps most—programmers today have never experienced this sort of programming and may not even know it exists. That’s too bad, he says, because many of them would find that it makes them happier and more efficient. I certainly agree. I always enjoy programming more when I can do it in an interactive way. Of course, that means writing in a Lisp or Smalltalk so it’s not always possible but it’s great when I can.

Posted in Programming | Tagged , | Leave a comment