Outage Status Update and After Action Report

I’m happy to report that I can again log into the administrative page. I’ve released everything in the moderation queue and cleaned up a bit of a mess that I left while I was trying to figure out how to repush the posts that where already on the site but unreachable.

My hosting provider sent its customers an email explaining the situation and the actions that they took. It turns out that they were blocking connection attempts to the WordPress administrative page both to protect the accounts and also to lessen the stress on their servers. I suspected that they were filtering the logins to the admin page because I ran a packet trace on one of my attempt to log in and noticed that

  1. The initial TCP 3-way handshake completed in less that half a millisecond.
  2. Not a single GET request to the admin page was answered, even partially.

If the logins were failing because of too much traffic (a DOS attack, in effect), I would have expected to see the TCP handshake to show retransmissions and be slow. I would also have expected at least some of the GETs to succeed, if only partially.

In any event, the excitement is over for the time being although my hosting provider says that the attack is ongoing but that they have put less drastic measures in place. I want to take a moment to give my provider, IX Hosting, a shout out. They were very proactive in their reaction to this attack, first be recognizing there was a problem and then by blocking all access to the WordPress admin page when it became clear that the attacks were coming from thousands of IP addresses and that trying to block the attacking sites would not suffice.

When I first noticed the problem, I was able to engage a support tech on an IM chat immediately without having to open a support ticket or anything else. By and large things run smoothly with IX Hosting and when I do have issues, they are always dealt with in a timely, efficient, and friendly manner. If you’re looking for a reasonably priced home for your blog or other type of site, give them a look. I’ve been very happy with them.

Posted in General | Leave a comment

A Simple Explanation of One-Way Functions and Their Application to Passwords

John Graham-Cumming has a very nice 4-part series on one-way functions and their application to passwords. The explanation is completely non-mathematical and should be understandable by anyone. By the end of the third post, Graham-Cumming has explained how a simple one-way function works, how it can be defeated, and how salting can make it (relatively) safe again. The fourth post completes the picture by discussing key stretching, again in a non-mathematical manner, as a way of increasing security by making a cracker work much harder to find a password.

Doubtless most Irreal readers already understand this material but it’s the perfect explanation for your non-technical friends (or boss). Well worth a read.

Posted in General | Tagged | Leave a comment

My Solution to the Elisp Challenge

Here’s my solution to the recent Elisp challenge. It’s easy to be seduced by the notion of rotating one sequence to see if it’s equal to the other. That would work but the rotation is pretty expensive and the solution is O(n2). A simpler way is to concatenate one string with itself and then check if the other string is a substring. Here’s that solution in a nice, concise bit of Elisp:

(defun cyclep (s1 s2)
  (and (= (length s1) (length s2)) (search s1 (concat s2 s2))))

Note that the length check is necessary for more than just a speed optimization as it eliminates cases like “ab” “abc”.

The efficiency of the solution depends on how search works. If it is O(n) then so is cyclep. Sadly search uses a brute force method and is O(n2). On the other hand, I remember from long ago that the Microsoft C strstr function, which does essentially what search does, was actually faster than Boyer-Moore and other fancy O(n) implementations. That’s because it used a machine instruction to find the first character of the substring and then just did the expected byte-by-byte check after that. The Elisp search function uses a similar strategy but, of course, it doesn’t use the machine instruction to accelerate finding the beginning of candidate substrings.

Posted in Programming | Tagged , | Leave a comment

Paredit and Multiple Cursors

Brian Zwahr has an outstanding Emacs Rocks! type video up on using Paredit and Multiple Cursors together. This is excellent. He shows how to combine simple functions from each into a really powerful tool. Like Sveen’s masterpieces, the video is short (4:07) so there’s no reason not to enjoy it right now.

I really love multiple cursors. Ever since I first saw Sveen demonstrate them in his Web Rebels talk last year, I’ve been awed by how powerful a tool it is. Zwahr’s combining it with paredit, another favorite of mine, just makes both tools better. You really need to watch this video.

Posted in General | Tagged | Leave a comment

Outage Status

I still can’t reach the administrative page so I assume the WordPress attacks are ongoing. That’s annoying but at least I’ve figured out how to push new posts. That still leaves those comments stuck in moderation, of course, but all I do about that is apologize again.

Posted in Administrivia | Leave a comment

My Solution to EmacsGolf 3

Here’s my solution to the EmacsGolf 3 challenge. When I first saw Saul’s post, the first thing that popped into my mind was that this is the classic use case for a keyboard macro. The only problem is that each line is slightly different. Fortunately, Tim Visher showed us the way early in his VimGolf in Emacs series.

We start by beginning a keyboard macro with 【F3】 and then just start typing the first line until we get to Route. Next we enter recursive edit with 【Ctrl+u Ctrl+x q】, type in Route, and exit the recursive edit with 【Ctrl+Meta+c】. Now we backwards kill the last word (textViewRoute), yank it back again, and type in the rest of the line until we get to the second textViewRoute where we yank it back in again. Finally we finish the line, type 【Return】 and end the macro.

We complete the problem by running the macro again for each line but type in the unique word for that line. Here’s the keystrokes for the macro definition:

TextView                ;; self-insert-command * 8
SPC                     ;; self-insert-command
textView                ;; self-insert-command * 8
C-u C-x q               ;; kbd-macro-query
<C-backspace>           ;; backward-kill-word
C-y                     ;; yank
SPC                     ;; self-insert-command
=                       ;; self-insert-command
SPC                     ;; self-insert-command
(TextView)convertView.findView  ;; self-insert-command * 30
ById(R.id.              ;; self-insert-command * 10
C-y                     ;; yank
);                      ;; self-insert-command * 2
RET                     ;; newline

That’s 69 keystrokes for the macro, two for the start and stop macro, 42 for the unique words, and 7 for the macro invocations. That’s a total of 120. It’s hard to see how you can do much better since almost all the keystrokes are just text that must appear1. If you have a better solution, by all means leave a comment.

Update: Oops. We need 8 more keystrokes for the 【Ctrl+Meta+c】 after each recursive edit.

Footnotes:

1 You could, I guess, save another 5 keystrokes by repeating the macro invocation 7 times with 【Meta+7 F4】.

Posted in General | Tagged | Leave a comment

Still More Information on the Outage

Here’s another article on the ongoing attack on WordPress sites that helps explain what’s going on. From the description of the attack, I think Irreal is pretty safe since we don’t use stupid passwords but who knows. When all this is over, I’ll definitely be doing some forensics.

Posted in Administrivia | Leave a comment

More Information on the Outage

Apparently, this is what’s going on that’s causing the problems with Irreal. It looks as if all WordPress sites are getting hit. I’ll post more information as it becomes available. Let’s hope this latest round of silliness ends soon.

Posted in General | Leave a comment

Outage 2

OK, I guess that worked. I had to rename the post file so that it didn’t get stuck in the queue but at least I was able to get it pushed out.

Also, I forgot to mention that there is at least one comment stuck in the moderation queue (for the Elisp Challenge post) that I can’t release because I can’t get to the admin page. My apologies to the commenter. Believe me, I’m not ignoring you—especially since your solution is close to mine.

Posted in General | Leave a comment

Back of the Envelope Calculations

I love this. I’m a big believer in the utility of making back of the envelope calculations. It’s amazing how often it can reveal poor assumptions or that someone is trying to peddle malarkey.

The technique is also extremely powerful. For example, the slides at the link pose the question: “How many piano tuners are there is New York City?” At first it seems like it’s impossible to know or that at least you’d need specialized knowledge but that’s not true. By making some reasonable assumptions—the average piano is tuned once a year, for example—and combining them with a plausible estimate for the number of families in New York, you can reach a reasonable guess for the number of piano tuners. The idea is to get an estimate that is accurate to within an order of magnitude.

If nothing else, doing some of the exercise on the slides may help you with your next job interview when someone asks you how many pizza parlors there are in San Francisco.

Posted in General | Leave a comment