Sacha Chats with Magnar Sveen

Sacha Chua continues her series of chats with Emacs luminaries by interviewing Magnar Sveen. Sveen, of course, is the producer of the highly regarded Emacs Rocks! videos as well as the author of such Emacs packages as Expand Region, Multiple Cursors, S, and Dash. As usual with Chua’s chats, they discuss how Sveen came to Emacs, how he uses it in his day-to-day work, and how he’s customized it to his liking. Finally, they go over some of the highlights of his configuration files.

It’s nice to meet the man behind those great videos. Sveen is an engaging guy and has lots of interesting things to say. He notes that his configuration is always evolving and subject to sudden change. I can testify that that’s true. Some time ago I went through his configuration looking for things to steal. During the chat he described some aspects of it that I hadn’t seen before. I’m especially interested in flx-ido, ido-vertical-mode, and guide-key.

Most of that is in his init.el so if you haven’t looked around his configuration before, it’s undoubtedly worth going through the many subsidiary files as well for more ideas. You can find everything in his public GitHub. There’s a lot of good material there so have a look.

The video is a bit over 57 minutes so plan accordingly. If, like me, you’re a Sveen fan, you won’t want to miss it.

Posted in General | Tagged | Leave a comment

From the Department of You Can’t Make This Stuff Up

How could they think this was acceptable?

Posted in General | Tagged | Leave a comment

Real Time Internet Monitoring

If you’re like me, you probably enjoyed the spectacle of Tom Matzzie live-tweeting an overheard off-the-record conversation between Ex NSA Director Michael Hayden and a reporter. The hilarity was terminated when a colleague of Hayden called him to warn of the eavesdropping.

I snickered at the irony but didn’t think much about it. Now Bruce Schneier remarks that what this really demonstrates is that the government is monitoring the Internet in real time. The tweets, of course, are public so it doesn’t rise to the level of abuse of the NSA’a extra-legal activities but it still shows that those public feeds are being monitored and in real time.

Schneier says that he doesn’t think that this means that the NSA is monitoring the Internet; he believes it more likely that some PR organization assisting the NSA with the Snowden revelations was monitoring social media for names connected to the NSA. I’m not so sanguine but it doesn’t really matter if it was the NSA or some other government-connected entity. The government should have better things to worry about. Getting healthcare.gov running would be a good start.

Posted in General | Tagged | Leave a comment

The Third Way

If you’ve been paying attention lately you’ve probably noticed the raging dispute concerning how many spaces are appropriate at the end of a sentence. If you learned to type on an actual typewriter you were taught the hard and fast rule that the correct answer is two. If you’re a typography geek you almost certainly believe—equally strongly—that the correct answer is one.1

The typography geeks claim that using two spaces evolved because of monospaced typewriter script but that it doesn’t make any sense with proportional fonts and that, in fact, typographers have never adhered to the two space rule. Most people appear to accept that explanation even if they insist on two spaces out of a long ingrained habit.

You’d think that would be the end of it but the two-space partisans have pushed back challenging the conventional history and claiming that the one space rule was all about publishers trying to save some paper. According to this telling of the story, the real historical practice was to have slightly larger spaces between sentences and that the one space rule is less than 60 years old.

The current state of the battle is neatly captured by xkcd is this amusing cartoon

third_way.png

As it turns out, the third way actually exists. In the Troff typesetting system it’s traditional in preparing the input to end each sentence with a period followed by a newline. In Groff, this allows one to specify how much space to put between sentences. For example, both my books were typeset with 1.5 spaces between sentences. If the production people had complained too loudly (they really do like one space), I could have simply adjusted a single parameter to get the desired spacing. Thus, at least in some circumstances, the third way is the best way.

Footnotes:

1

Even these conventions are not as rigid as some believe. See the Wikipedia sentence spacing article on the history of sentence spacing practice. The French, for example, favored a single space even in typewritten text and up until the late 1990s many printers used 1.5 spaces. Although partisans on both sides are emphatic that their choice renders text more legible, scientific studies don’t support this.

Posted in General | Tagged | 3 Comments

Full Screen Magit Status

Ever since he posted it last December, I’ve been a huge fan of Magnar Sveen’s hack to display magit-status in full screen and then restore the previous window configuration upon quitting. It’s nice because you can commit a file and then have everything back the way it was.

Yesterday, it stopped working. After a little sniffing around, I discovered that the problem was that magit-quit-window was renamed to magit-mode-quit-window. If you used the code that Sveen posted it’s probably still working for you but I used some revised code suggested in a comment by Brad Wright. The idea is to call the normal termination routine and then restore the window configuration.

I used slightly different code

(defadvice magit-quit-window (after magit-restore-screen activate)
  (jump-to-register :magit-fullscreen))))

from Wright’s but the fix is the same with either version. Simply change the magit-quit-window to magit-mode-quit-window and everything will work again.

Posted in General | Tagged , | Leave a comment

Common Lisp Features

A couple of years ago, Lisp luminary Nikodemus Siivola rescued and reposted Abhishek Reddy’s Features of Common Lisp page. It serves as a nice introduction to what makes Common Lisp such a great development environment. It doesn’t, of course, cover every feature and it doesn’t examine the ones it does cover in depth. Still, it’s a useful resource for someone who wants to see what the excitement is about.Even if you’re an experienced Lisper, you may find it interesting. It’s well worth a look.

While you’re at it, you might also want to have a look at Siivola’s Common Lisp FAQ. I’ve mentioned that a couple of times before and highly recommend it.

Posted in Programming | Tagged , | Leave a comment

Building Password Lists

A little while ago Ars Technica published an interesting article on how password crackers build their lists of trial passwords. The TL;DR is that they scan Wikipedia, Project Gutenberg, news websites, song lyrics, IRC logs, Twitter, and other sources of text that show how people put words together. Then they apply the usual mangling rules to the resulting phrases to generate lists of trial passwords.

Read the article for more details but note that the technique discovered the 51 character password Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn1 (it’s from H. P. Lovecraft’s The Call of Cthulhu). The take away from the article is that it is absolutely critical that your passwords be chosen randomly. The best way to do that is to use a password manager that will generate long random passwords for you. That leaves only your master password which must also be random. The problem is that something like b2qJ)spbgT4LxTtE+piK, while secure, is impossible to remember. The solution is to use something like Diceware to choose 5 or 6 random words (like the famous correct horse battery staple from XKCD). I wrote about a Lisp implementation of Diceware if you want to automate the process but all you really need is a die as explained on the Diceware page.

Note that you can’t just choose any 6 words. The choice has to be random. That’s why you roll dice to choose them. The Lisp program I mentioned above gets cryptographically strong random numbers from /dev/random to choose words from the Diceware list. One thing for sure, passwords or passphrases that appear anywhere on the Web will not be secure.

Posted in General | Tagged | Leave a comment

Running Ping in Emacs

Last year I wrote about my delight in discoverying the Emacs Net Utilities. It’s nice to be able to run a quick ping, traceroute, or even some of the other network utilities right from Emacs. I’ve found, however, that there is a psychological barrier to using them. When you do a ping (or whatever) it opens a new window and leaves it and the corresponding buffer hanging around until you clean them up. That’s not much of a barrier, of course, but it is enough that I found myself using the terminal instead. Silly, I know, but there it is.

Of course, this is Emacs so I can have it my way. I decided to run ping and traceroute alone in the frame using the strategy suggested by Magnar Sveen for Magit. I wanted to see the output and then be able to press 【q】 to destroy the buffer and restore the previous window configuration. It’s hard to see, I know, how this is much easier than simply typing 【Ctrl+x k】 to cleanup but it seems like it is to me and you do end up with everything the way it was before you started, which may or may not be true of just killing the window.

It’s a bit trickier than for magit because there’s no quit function: ping just runs and then leaves the buffer in place. Also, there’s no convenient keymap to hook into. My first try was to wait on a keypress using read-key with a prompt of “Press any key to continue” but that was too ugly. For one thing, you couldn’t temporarily switch away from the buffer or doing anything else requiring keyboard input.

I finally settled on establishing a temporary keymap where 【q】 causes a separate function to be called that kills the buffer and restores the old configuration. Once I figured out what I wanted to do, the code was pretty simple:

(defun net-utils-restore-windows ()
  "Restore windows and clean up after ping."
  (interactive)
  (kill-buffer (current-buffer))
  (jump-to-register :net-utils-fullscreen))

(defadvice net-utils-run-program (around net-utils-big-page activate)
  (window-configuration-to-register :net-utils-fullscreen)
  (let ((buf ad-do-it))
    (switch-to-buffer buf)
    (delete-other-windows)
    (set-temporary-overlay-map
      (let ((map (make-sparse-keymap)))
        (define-key map (kbd "q") 'net-utils-restore-windows)
        map))
    (message "Type \"q\" to restore other windows.")))

This only works with ping and traceroute because the other network utility functions call a different display routine. I could do essentially the same thing for them but I virtually never use them so I didn’t bother.

This isn’t a big thing, of course, but it does reduce my workflow friction a bit so it’s a win for me. And, of course, it demonstrates once again how flexible and extensible Emacs is.

Posted in Programming | Tagged , | Leave a comment

What Foiled Terrorist Plots?

Rick Falkvinge has a great article that makes an obvious point. We can know for sure that government surveillance has foiled exactly zero terror plots. We know this because planning, let alone carrying out, terror plots is a crime but there have been no trials or convictions.

In my first ever post about the NSA scandal, I noted that the NSA’s director, Keith Alexander, claimed that the surveillance had foiled “dozens,” later updated to “over 50,” terror plots. Of course no details were offered. But as Falkvinge says, where are the criminal proceedings?

That brings us back to my original question. Where is the press on all this? The government is clearly lying but there’s nary a word from the main stream press. If it wasn’t for The Guardian (and yes, lately, the New York Times) we wouldn’t know what the NSA was doing and why it matters.

Read Falkvinge’s article. It serves as an excellent reminder of how no government can be trusted to tell us the truth. As I.F. Stone famously said, “All governments are run by liars and nothing they say should be believed.” The NSA scandal neatly illustrates this. Everything they’ve said about Snowden’s revelations have been shown to be lies. Believe them at your peril.

Posted in General | Tagged | Leave a comment

The End of Journalism

Many of you know that I’m not a fan of newspapers or most journalists. When reporters aren’t pursuing an agenda or otherwise abdicating their journalistic responsibilities, they run around chasing trivia and sideshows like the seemingly never ending series of Where’s Waldo articles on Edward Snowden.

On the Snowden matter, one notable exception has been Glenn Greenwald who has pretty much owned the NSA snooping story. Now Greenwald has delivered a stinging rebuke to his fellow journalists. What kindled his anger was a column by Chris Blackhurst, an executive and, until recently, the editor of the UK daily, The Independent. In it, Blackhurst says he wouldn’t have published the Snowden material because, “If MI5 warns that this is not in the public interest, who am I to disbelieve them?” Really? “Who am I to disbelieve them?” It should infuriate even the Where’s Waldo division of the fifth estate that this man calls himself a journalist.

It certainly infuriated Greenwald who explains at length why it’s Blackhurst’s damn job to disbelieve them. Follow the link to experience his righteous anger first hand. If you think you’re being under served by the media, you’re sure to find much to agree with.

Posted in General | Leave a comment