Five Lessons From Being Hacked

Every since having Irreal suffer a malware exploit, I’ve been on the lookout for articles that will help me avoid another successful attack. I’ve already posted about several of these and today’s post is another. Since these posts have become a sort of series, I am introducing a new tag, Malware, to label them. As soon as I can get to it, I will revisit the previous posts in the series and add the tag to them as well. That way, anyone else unfortunate enough to suffer a similar attack will have a resource to help them recover and prevent reoccurrences.

Today’s article is from Christian Grobmeier’s blog. Grobmeier recently had his site exploited and shut down by his hosting provider. Like me, he eventually got his site cleaned up and back on-line. His post is about the 5 lessons he learned from the ordeal. One of those lessons—perhaps the most important one—is the same lesson that I learned: keep your blogging software up to date. Related to that is to use static web pages. I got that same advice from some of my wise commenters but have so far resisted it because I love org2blog and the workflow that it enables. Stubborn but foolish, I know.

Another excellent recommendation is to run a script everyday that checks for any changed files. That would certainly have alerted me early on to my exploit.

I’ll let you go over to Grobmeier’s site to see the other suggestions and flesh out the ones I’ve discussed. It’s a good post and worth a read if you have a site that you are maintaining on your own (that is, not something like Blogger where you don’t have to worry about security) even if you haven’t (yet) suffered an exploit. I recommend it.

Posted in General | Tagged | 1 Comment

Arguments against call/cc

Pascal Constanza has a post that points us to an article by Oleg Kiselyow that argues against the call/cc function. Regular readers know that I am an admirer of call/cc so I’m not sure I agree with the idea that call/cc is a bad thing. To be fair, the article doesn’t really say that. Rather, the article argues against the idea that call/cc should be a language primitive that is used to build other control operators.

That said, the article does make good points—especially about memory requirements—and is worth a read by any Scheme lover. I still think that call/cc is a useful and powerful construct but I’m inclined to agree that it probably shouldn’t be put forth as the basis for all other control constructs in Scheme.

Posted in Programming | Tagged | Leave a comment

Some Common Lisp Tip Tweets

Jean-Philippe Paradis over at HexstreamSoft has a very nice set of tweets on Common Lisp tips. For example, 【Meta+xslime-cheat-sheet opens a new frame with useful slime commands and their shortcuts. As Paradis remarks, this is virtually unknown—I sure didn’t know about it.

Another interesting tip uses the ldiff function to return the head sublist from member instead of the tail. Another thing I didn’t know. There’s a lot of good material in these tweets and well worth the time of any Lisper.

He also has some opinions that you may or may not agree with but, again, they’re interesting and he mostly gives his reasons for holding them. All and all a very nice resource.

Posted in Programming | Tagged | Leave a comment

Upgrading to Emacs 24.2

Just a quick note to announce that I just upgraded my Mac (OS X Lion) to Emacs 24.2 from source. The upgrade went without any problems so if you’re on a Mac, there’s no reason to wait.

From the top level Emacs source directory do

./configure --with-ns
make install
sudo mv nextstep/Emacs.app /Applications

and relaunch Emacs. That’s all there is to it.

Posted in General | Tagged | Leave a comment

Impatient Mode

You may have seen some of the posts about Chris Wellons’ Emacs HTTP Server, an HTTP server that operates from within Emacs. Now Brian Taylor has built on that to provide Impatient Mode, an Emacs package that renders an Emacs buffer to your browser on the fly.

Taylor’s post has a video showing Impatient Mode in action. If you’re into instant gratification, you might enjoy using Impatient Mode—it’s a nice application of Wellons’ Emacs HTTP server. It’s probably not going to change your life but it’s a neat hack and can certainly be useful in certain situations. Take a look at Taylor’s post to see if it might be useful to you.

Posted in Programming | Tagged | 1 Comment

The magic-mode-alist

Most Emacs users know how to associate a file type with a major mode by using the auto-mode-alist variable to associate a file extension with a major mode. I recently learned of another way thanks to Xah Lee who posted a note on associating files with a major mode.

It turns out that you can use the beginning of a file to associate it with a major mode in much the same way that the Unix file command determines the type of file from the first few bytes of the file. To do this you add a cons of a regular expression matching the beginning of the file and the major mode to invoke to the magic-mode-alist variable. Lee gives this example to invoke nxml-mode for html files:

(add-to-list 'magic-mode-alist '("<!DOCTYPE html .+DTD XHTML .+>" . nxml-mode))

Emacs checks the magic-mode-alist variable before checking auto-mode-alist so the beginning of file check takes precedence. You can also specify a function instead of the regex to deal with situations too complex for a regular expression.

Lee’s post has a nice summary of all the ways Emacs can associate a major mode with a file so you should give it a look.

Posted in General | Tagged | Leave a comment

Readable S-Expressions

Why do people keep doing this? They should stop. Now. Really.

There is nothing wrong with parentheses. Lispers like them and deal with them without difficulty.

There is nothing wrong with Lisp syntax. Lispers like it and deal with it without difficulty.

There is nothing awkward about S-expressions. They are not hard to read and, really, those who find the prefix notation confusing or fail to understand its advantages should find another way to earn a living.

If you think Lisp should to be like Python, just use Python. The Lispers and Pythonistas will both be thank you.

If you’re going to quote Paul Graham, don’t use his words to make a point that he certainly wouldn’t agree with.

Afterward:

Reading this over, it may seem a little harsh. Certainly Wheeler is entitled to work on any project he likes and to scratch anything that itches but I don’t see the point of this project. It tries—unsuccessfully, I think—to fix things that Lispers don’t see as broken and produces a syntax that starts with the clean and elegant Python and makes it ugly. Actually, I think Pythonistas should be more offended than Lispers at the result.

To paraphrase DMR, if you want Python, you know where to find it.

Posted in Programming | Tagged | 1 Comment

Emacs

It’s everywhere!

Posted in General | Tagged | Leave a comment

The Emacs Manual in Info

This is definitely a note to myself. Doubtless everyone knows this but for some reason I can never seem to remember it so I am recording it in a post. If you’re an Emacs user and your initials are not RMS, you probably have occasion to consult the Emacs manual. When I find myself in that position I most often just bring it up in my browser. That’s easy because I have it book marked but it’s also a little silly since Emacs has the manual built in.

Of course you can always do 【Ctrl+h i】 and then pick the Emacs manual entry but there’s a better way. You can bring up the manual directly with 【Ctrl+h r】. That’s almost no savings in labor but somehow it seems much quicker and easier. At least it would be if I could remember it.

Posted in General | Tagged | 3 Comments

Lena

I ran across this astounding story of Singapore researchers at Singpore’s Agency for Science, Technology and Research generating a digital image with 100,000 DPI resolution. This is close to the theoretical maximum resolution and is therefore a significant achievement.

What impressed me, though, is the backstory of the image itself. The picture is of Lena Söderberg, a Swedish model who was a 1972 Playboy centerfold. This picture is a standard digital image that researchers use for experimenting with new digital algorithms and has been used for 40 years. The picture was originally chosen when researchers needed an image to scan for a paper. They looked through the standard stock images but everything seemed boring. At that point, somebody walked in with the current issue of Playboy and the researchers tore off the top third of the image so that it would fit on the drum of the scanner and an icon was born.

In 1997, Lena attended the 50th Anniversary of the Society for Imaging Science and Technology conference and met many of the scientists who have been using her picture for 4 decades. She’s now happily married with 3 children and works for the government. It wasn’t until 1988 that she first learned what had happened to her picture. She’s said to have been pleasantly amused. At the conference she commented to a Wired reporter, “They must be so tired of me … looking at the same picture for all these years!”

None of this is important, of course, but it is a charming story that gives us a glimpse into the real person behind a standard and well known test image. You can read more about Lena’s story by following the above links.

Posted in General | Leave a comment