Paper Receipts at Drive-Thrus

You may have noticed those signs at your local fast food store offering cash or a free meal if you fail to get a receipt after you pay. Once they’re pointed out, you see them everywhere. Of course, this has nothing to do with making sure customers get a receipt for their records.

I’ve long known that the reason for this policy is to prevent store employees from canceling cash orders before they’re recorded and pocketing the customer’s payment. But I always assumed the problem was merely a case of petty employee theft and was more of a nuisance than anything else. Boy was I wrong.

Brian Krebs over at Krebs on Security has a post that shows how serious the scam can be. The post tells the story of a Jimmy John’s sandwich shop that lost almost $100,000 from the fraud and had to close temporarily.

This isn’t a megacorporation that can afford to write off fraud at that scale. It’s a mom and pop franchise that’s probably operating on the slimmest of margins. Part of the problem was that the owners didn’t have one of those signs incentivizing customers to make sure they got a receipt. They’ve remedied that, of course, but it was a $100,000 lesson.

The takeaway from this story is that even a very low tech scam can result in significant losses.

Posted in General | Tagged | Leave a comment

Advice Combinators

A really powerful Emacs feature for those who know a bit of Elisp in the ability to advise functions. Historically, the defadvice macro allowed the specification of code to run before, after, or around a function call. It’s really handy for modifying the action of a function without changing the function itself or getting into the details of how a function works. I have advice for 7 functions in my init.el, an indication that it’s more useful than you might think.

The defadvice macro has been obsoleted by the newer and more flexible advice-add and add-function macros. You’ll usually want to use advice-add because it works in more situations. The new macros support a finer grained specification of where the advice is to be applied.

Kaushal Modi over at A Scripter’s Notes has an excellent post that explains all the methods of specifying where the advice will operate. These methods are called “advice combinators”. Modi has what are essentially railway diagrams that illustrate the operation of each of the combinators. They’re an easy way of understanding what each of them does. He also has a summary table that describes in words how each of them works.

You should also take a look at the built-in add-function documentation that shows the new function that is created for each of the combinators.

Modi’s post is the best explanation of using advice that I’ve seen. You should definitely take a look at his post to see what’s possible.

Posted in General | Tagged | Leave a comment

Am I Being Watched?

If you’re paranoid, the answer is “of course”. If you aren’t paranoid, the answer is “of course”. Here’s a humorous tweet that provides the proof:

Posted in General | Tagged , | Leave a comment

Emacs and the Lindy Effect

Vivek Haldar has an observation about the expected lifetime of Emacs:

The Lindy Effect postulates that the longer some (nonperishable) entity has existed, the more likely that it will continue to exist. It’s a bit more technical so follow the link to Wikipedia if you want the details.

Nothing lasts forever, of course, so even the mighty Emacs will eventually fade away but not, if you believe in Lindy’s law, anytime soon. It make sense if you think about it: the fact that Emacs has lasted as long as it has means that it’s meeting the needs of its users and continuing to adapt to new needs so its chances for continued support from its current users and its being embraced by new users is good.

Posted in General | Tagged | Leave a comment

Highlighting

This week there were two excellent posts on highlighting in Emacs. The first was Marcin Borkowski’s post, Highlighting and de-highlighting things. He covers most of highlighting commands but not their default keybindings.

When I first saw Borkowski’s post I thought I’d write about it if only to have a handy guide to the commands. Before I could do that, Mickey Petersen published his post on the same subject matter. That post, Highlighting by Word, Line and Regexp covers a few more commands and includes their bindings. Mickey also explains how to make a set of highlightings persist in a file.

It turns out that even Irreal has plowed this ground but it was so long ago (over a decade) that I’d forgotten all about it. One nice thing about that post is that I provided a table of keybindings at the end but I didn’t cover all the commands. Below is a new table based on Mickey’s list of bindings. The purpose of many of them is obvious from the command name but take a look at Mickey’s post for what all these commands do. If you can remember the Meta+s h part, the commands are pretty mnemonic but, of course, if you use them regularly they’ll get burned into your muscle memory.

Key Sequence Command
Meta+s h . highlight-symbol-at point
Meta+s h l highlight-lines-matching-regexp
Meta+s h p highlight-phrase
Meta+s h r highlight-regexp
Meta+s h u unhighlight-regexp
Meta+s h w hi-lock-write-interactive-patterns
Meta+s h f hi-lock-find-patterns
Posted in General | Tagged | Leave a comment

Red Meat Friday: This Seems About Right

It appears Irreal’s disdain for journalists and politicians is not sui generis:

Posted in General | Tagged | Leave a comment

Sudo via Touch ID on the Mac

A couple of years ago, I wrote about using Touch ID to enable sudo on the Mac. Someone just posted a link to the original article on Six Colors. It turns out to be incredibly simple—a single line added to the sudo file—and I really did mean to enable it but I didn’t add it to my TODO log so of course I forgot about it. The new mention reminded me and this time I added it before I had a chance to forget. I’m happy to report that it works fine (I’m running the current version of Monterey).

None of this would be worth writing about again—especially since it’s Mac specific—except that I tried it out with Emacs. First I used it from a vterm session and it worked just as you’d expect. Then I tried reopening the sudo file with Ctrl+x Ctrl+f /sudo::/etc/pam.d/sudo and, again, it popped up the dialog telling me to use Touch ID or enter my password.

Since, as many of you know, I’m a bit paranoid about security, I have a long and complicated password on my laptop so having to enter it is a bit of a pain. Using Touch ID instead is a real win for me. If you’re a Mac user—especially a Mac Emacs user—you should spend the 30 seconds it takes to enable Touch ID. You won’t be sorry.

Posted in General | Tagged , | Leave a comment

Rich Stevens

One of my heroes, perhaps my greatest hero was Rich Stevens. The other day, someone posted a link on reddit to a Salon article about Stevens published a year after his death. It made me remember my huge debt to him.

Throughout my career, I’ve been known as a networking guy and most of what I know about the field I learned from reading Stevens’ books. If you’re interested in networking and haven’t read the 3 volumes of TCP/IP Illustrated, your education is incomplete. When you finish the series, you will have a thorough knowledge not just of the theory, and the API calls involved but of how things actually work. You’ll understood the actual code behind the protocols because that’s what the books are about. As you read the BSD networking code, you’ll see the results in the form of TCPDUMPs of the resulting packets on the wire.

But more important, I learned two other things from him. The first was an appreciation for the aesthetics of beautiful typesetting; of how to produce beautiful documents and books. Stevens’ mechanism for that was the Unix Troff typesetting system and he inspired me to learn and use it myself if only in a pale imitation of his mastery. I’ve since moved on to using LaTeX through Org-mode but the principals remain the same.

Second, he showed me what great technical writing is supposed to look like. My two books are explicitly modeled on his. Again, I never achieved his mastery but he gave me a goal to strive for.

I remember, vividly, the day I learned he’d died at the shockingly young age of 48. Fortunately, his wisdom lives on through his books and his Website that’s still maintained. If you want some great advice on producing great looking documents, take a look at what he has to say about it on his Website.

Posted in General | Tagged , , | Leave a comment

Elfeed-tube

As regular readers know, I’m a huge fan of RSS and of using elfeed to read and curate my feeds. If you’re an Emacs user and not using elfeed, you’re really missing out. It’s the absolute best feed reader I’ve ever used.

You may not know it but you can add YouTube channels to your elfeed feeds. If you follow one or more channels on YouTube, elfeed is a nice way of keeping up with them without a lot of fuss. Things just got a lot better.

Karthink has a new package, elfeed-tube, that makes following YouTube channels even better and easier. The package is so versatile that I won’t even try to cover everything it does; you should head over to the elfeed-tube GitHub repository for a long and thorough description of everything it’s capable of.

I found the link to elfeed-tube on reddit. The comments were uniformly positive, saying among other things, that the package “just worked” out of the box. This looks like a really great package for Emacs users who follow YouTube channels.

Posted in General | Tagged | Leave a comment

How To Create A Missing Directory

If you’ve been around Emacs for a while, you probably know that Emacs has you covered if you call find-file (Ctrl+x Ctrl+f) and specify a path with a missing directory. You simply get asked if you want to create the missing directory and give your assent with a simple Return Return.

That’s pretty simple and convenient but Bozhidar Batsov is committed to eliminating as much friction as possible and doesn’t want to have to do anything to create those missing directories. He just wants it to happen. Of course, being Batsov, he made it happen. It turns out to be pretty easy and he gives two solutions for doing it.

Almost every time I get the missing directory error it’s because I mistyped the path. That means that automating the creation of missing directories would almost always be a fail for me. But that’s me. Others, like Batsov, view it as a win. If you fall on Batsov’s side of the question, take a look at his post to see how easy it is to do.

The final, obvious, oft repeated, but mandatory observation is how easy Emacs makes it to fine tune it to each individual user’s workflow.

Posted in General | Tagged | Leave a comment