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

CrptoSeal Shuts Down

The U.S. Government’s overreaching has claimed another victim. The CryptoSeal VPN service has pulled the plug. These are good guys who did everything possible to provide a secure, private VPN service. They didn’t keep logs and could provide authorities only with user billing information.

In the aftermath of the Lavabit case they felt that the FBI or other government entity would use a pen register warrant as leverage to demand the site’s SSL encryption key thereby rendering all the site’s users vulnerable. As a result they have shut down their service and destroyed all customer records.

I’m of two minds about this. On the one hand their customers have been inconvenienced but are safe. In this regard, they are heroes; they shut down their business rather than be a party to what they consider crimes against innocent people by an out of control government. On the other hand, they are advancing the government’s cause by eliminating one more means for people who value their privacy to use the Web in a secure and confidential manner. That’s a tragedy that should concern us all.

This case shows, once again, how important it is to insist that the government knock off their thuggish behavior and start respecting citizens’ rights. They will, of course, scream “terrorist” and “think of the children” and all the other nonsense they always spout when they get caught with their hands in the cookie jar but it’s time to demand an end to their extralegal activities.

Posted in General | Tagged | Leave a comment

Update on OS X Emacs Battery Status

Yesterday, I wrote about the problems I had with Emacs when I updated to OS X Mavericks. The problem was that the call to display-battery-mode failed. For OS X, Emacs uses pmset to get the battery status data. With Maverics, pmset was returning a string that began with “Now drawing from ‘(AC|Battery) Power’” but in previous versions returned “Currently drawing from ‘(AC|Battery) Power’.” Since Emacs was looking for the latter string, the output was corrupted and the call to display-battery-mode failed.

It was pretty easy to track this down using Edebug. The problem is that the regular expression used to search the pmset output is a constant string and not configurable. That means that fixing the problem pretty much boils downs to

  1. Fixing battery-pmset, where the problem occurs, to look for “Now” as well as “Currently” or
  2. Making a local copy of battery-pmset that looks for “Now.”

While I was pondering what to do, Bernd Berndsen wrote to tell me that a change had already been pushed to the development branch. Since this is not a critical issue for me, I’m content to wait to the next update. If it’s more important to you, the easiest thing to do is either to edit and recompile battery-pmset on your local version of Emacs or install the latest development branch. Follow the “development branch” link to see the change you need to make.

I’m not privy to Apple’s thinking on this, of course, but the change seems gratuitous to me. Yes, “Now” is slightly better wording than “Currently” but they had to know that it was apt to break programmatic processing of pmset‘s output. If anyone knows why the change was made, please leave a comment.

Posted in General | Tagged | 2 Comments

Mavericks and Battery Status

I just upgraded my iMac and MacBook Pro to the new OS X, Mavericks. The upgrade went flawlessly—everything should work as well—and my iMac came up without a problem. I spend most of my time in Emacs, of course, so it was the first thing I checked out. No problems.

A bit later, my MacBook finished upgrading and again it came up without a problem but Emacs got an error very early in loading init.el and there wasn’t much indication of what was wrong. I was a bit confused because the same init.el is pulled from a Git archive for both machines so why was it working on the iMac but not the MacBook?

I drag in platform and system specific configuration with the code

;; Just keep on going if the requisite file isn't there.
;; Manipulations in second load is for "gnu/linux" → "linux"

(load (car (split-string (system-name) "\\.")) t)
(load (car (reverse (split-string (symbol-name system-type) "/"))) t)

The MacBook is named manfred so I tried loading manfred.el manually and got the error. The manfred.el file is pretty simple

;; -*- mode: Emacs-Lisp -*-
;; Time-stamp: <Sunday, October 28, 2012  16:21:00 EDT (by jcs)>
;; Emacs configuration specific to manfred

(set-frame-height (selected-frame) 53)
(display-battery-mode 1)

so the problem was obvious. Apparently the Mavericks battery interface changed from Mountain Lion so the display of battery status was failing.

I’ll probably take a look at the code to see what I can do but displaying battery status on the mode line is not a high priority so it’s not an urgent problem. The point of this post is to alert other Mac users who upgrade to Mavericks about the problem. It’s only a problem if you display battery status, of course, so probably only affects Laptop users.

Posted in General | Tagged | 1 Comment

The Aaron Swartz Legacy

I’ve written before about Aaron Swartz’s last project, software to enable whistle blowers to communicate with news organizations anonymously. The New Yorker was the first to implement the system. Those with information about government misdeeds finally had a secure way of passing their information on to journalists.

Wired’s Kevin Poulsen, who collaborated with Swartz on the project, has headed the program until now. On October 15th the Freedom of the Press Foundation took over the project and renamed it SecuredDrop.

The project has received an extensive security review by well known experts, including Bruce Schneier, that should help assuage prospective whistle blower’s fears.

This is a great project that we should all support. The Freedom of the Press Foundation announcement has more details.

Update: Freesom → Freedom

Posted in General | Tagged | 2 Comments

List of Free Programming Books

Victor Felder has an excellent list of free programming books over at Github. The list is indexed in several ways so it’s pretty easy to find books in the area you’re interested in. Among other things, I learned that there are a couple of free Lisp books I haven’t looked at.

This is a useful resource and worth bookmarking for the day when you need a pointer to a readily available programming book.

Posted in Programming | Tagged | Leave a comment

Specifying Indent Rules for Emacs Lisp

Eric J.M. Ritz has an excellent post on indenting Elisp code. Say what? Isn’t that what Emacs is for? Yes but there’s a corner case when you’re writing macros.

Here’s a macro that I use to make my Elisp code work on a region if one’s defined or on the whole buffer if not.

(defmacro with-region-or-buffer (args &rest body)
  "Execute BODY with BEG and END bound to the beginning and end of the
current region if one exists or the current buffer if not."
  `(let ((,(car args) (if (use-region-p) (region-beginning) (point-min)))
         (,(cadr args) (if (use-region-p) (region-end) (point-max))))
     ,@body))

As it stands, a call to that macro would get formatted as

(with-region-or-buffer (start end)
                       (blah start end)
                       (more blahs start end))

but that’s not what we want. We’d like it to get formatted as

(with-region-or-buffer (start end)
  (blah start end)
  (more blahs start end))

The easy way to get Emacs to indent it properly is with the declare declaration as shown in the slightly revised version of with-region-or-buffer shown below.

(defmacro with-region-or-buffer (args &rest body)
  "Execute BODY with BEG and END bound to the beginning and end of the
current region if one exists or the current buffer if not."
  (declare (indent 1))
  `(let ((,(car args) (if (use-region-p) (region-beginning) (point-min)))
         (,(cadr args) (if (use-region-p) (region-end) (point-max))))
     ,@body))

It’s really hard to find the documentation for this (at least I always find it hard) so I’m glad to have Ritz’s post for bookmarking purposes. The post has a link to the documentation for declare so you can see what other arguments to the indent declaration are possible.

Update: what’s → what

Posted in Programming | Tagged , | 6 Comments

Emacs Rocks at WebRebels 4

The fourth episode of Magnar Sveen’s cleaned up WebRebels talk is available. This section continues the demonstration of his JavaScript refactoring tools. He’s able to select a code snippet and turn it into a function with a single call. He can even parameterize the process in a way that’s hard to explain in print but easy to understand when you watch it. He’s also added some of the Paredit functionality. Very nice; it’s almost enough to make me start programming in JavaScript.

This episode is just under 2 minutes so you can watch it any time. You can find the code that he’s using at Sveen’s github repository (the js2 refactoring code is here).

Posted in General | Tagged | Leave a comment

NIST and Keccak

I’m a bit of a crypto nerd—though far from a practitioner or expert—so I’m on NIST‘s SHA-3 mailing list. The mailing list’s main purpose was to keep the contestant teams and other interested observers up to date on the competition. The winner was the Keccak team and just about everyone believes it was a good choice.

It’s NIST’s job to turn the Keccak algorithms into the SHA-3 standard. That’s were the trouble began. NIST made (what some call substantial) changes to the Keccak algorithm and reduced its security in service of increasing its speed. The list went crazy and now the technical press has taken note.

I don’t have the expertise to evaluate the arguments going back and forth but it is worth noting that the Keccak team is on board with the proposed changes. Last year that would have been the end of it but now everyone is donning their tin foil hats. After the Snowden revelations concerning the NSA’s successful attempt to weaken other crypto standards, I can’t understand what NIST is thinking.

Well, actually, I can. It’s the typical nerd reaction of, “the facts are on my side so I don’t have to pay attention to what anyone says about this.” The problem is most people—even most people who are going to use SHA-3 in their code—don’t have the wherewithal to make an informed judgment on the merits of the arguments but they sure understand that (1) NIST, by law, must solicit input from NSA and (2) the NSA is not to be trusted. Ever. Thus by forging ahead, NIST risks blowing up the whole SHA-3 process. As Schneier and others have said, there isn’t an urgent need for SHA-3 because the SHA-2 family is apt to be secure for some time. The careful (or paranoid) engineer is very apt to say, “Forget SHA-3, I’ll stick with SHA-512.”

That would be too bad but it’s exactly what NIST is risking by ignoring the public’s suspicion and distrust. It’s fine to dismiss them all as crazies who don’t understand the crypto but NIST has already shown itself susceptible to abuse at the hands of the NSA. Those “crazies” will just pick up their marbles and walk.

Posted in General | Tagged , | Leave a comment

Emacs Rocks at WebRebels 3

Magnar Sveen has posted the third part of his cleaned up WebRebels talk. This section demonstrates some Javascript refactoring. It’s only 58 seconds long so you won’t have to map out a block of time to watch.

Posted in General | Tagged | Leave a comment