The End

August 2, 2011

This blog is now officially archived (no new posts). I have moved to a new home at thirld.com/blog.

Thanks to the wonderful folks at wordpress.com, I am hoping that this site will be around for a long time.


Unix Tip: Make ‘less’ more friendly

February 11, 2011

You probably know about less: it is a standard tool that allows scrolling up and down in documents that do not fit on a single screen. Less has a very handy feature, which can be turned on by invoking it with the -i flag. This causes less to ignore case when searching. For example, ‘udf’ will find ‘udf’, ‘UDF’, ‘UdF’, and any other combination of upper-case and lower-case. If you’re used to searching in a web browser, this is probably what you want. But less is even more clever than that. If your search pattern contains upper-case letters, the ignore-case feature will be disabled. So if you’re looking for ‘QXml’, you will not be bothered by matches for the lower-case ‘qxml’. (This is equivalent to ignorecase + smartcase in vim.)

So how do we take this useful feature and make it permanent, so that we don’t have to remember to type less -i every time? We could create an alias less='less -i'. But there are tools (such as git-log) that invoke less on their own, and they will not know about the ignore-case option. It would be better if we could tell less that we always want that feature on, regardless of startup flags. This article will teach you how to do that.

Read the rest of this entry »


Advanced Dynamic DNS with ddclient

February 4, 2011

If you need remote access to a computer whose IP changes dynamically, ddclient may be the tool for you. Check out this previous article for how to set up ddclient using a free service like DynDNS. Once set up, you will be able to connect to your box using a pretty name like mybox123.dyndns.org, rather than having to keep track of the changing IP. I should mention that there are many other free DNS services besides dyndns.com, and that many home routers can take care of Dynamic DNS for you (i.e., you can set it up on the router, rather than on your computer).

Today, however, we have a more complicated task. This article will teach you how to:

  • make ddclient update multiple host names
  • make ddclient update the IP of multiple interface (e.g., your ethernet and your wireless lan)
  • set up ddclient so that it updates correctly regardless of whether you are on a wired or wireless connection
  • make ddclient use either your interface address (may be local, e.g. 192.168.1.15) or the address that is visible from the internet.

Read the rest of this entry »


Reverse-Engineering Persona

January 24, 2010

If you’ve ever had to write an essay about something seemingly meaningless, you probably know how this works. You pick a thought (the more unlikely the better), connect everything to it (the less obvious the connections the better), and make sure to overlook anything that goes against your “theory.” Does this projection of meaning onto chaos sound like what art critics do?

All is well until you start believing your own words. That is what happened to me, and I am open-sourcing some of them here, for the whole world to point and laugh and maybe even plagiarize. This story is about Bergman’s Persona and a certain Andalusian Dog, so if you haven’t seen those species yet, come back later.

Persona: the metafilm

An unwanted child, an insecure man, an arrogant genius, Ingmar Bergman directed what could very well be the most cryptic movie ever made. Persona is painted in two layers: a foreground that makes sense on a background that mystifies. The upper stratum is Alma’s story of self-acceptance, of coming to terms with her dark side. The backdrop is Bergman’s meditation on cinematography.

Read the rest of this entry »


Quick Linux Tip: Remap “Back” Key to Win Key

January 22, 2010

Thinkpad keyboards are the best laptop keyboards I’ve seen. The function keys are placed in groups of four, with gaps, like on a full-size keyboard. The arrow keys are located lower than the rest of the keys, for easy tactile identification. And best of all, the Insert, Delete, Home, End, and Page Up/Down keys are grouped in the familiar 2×3 box pattern one would expect to see on a desktop keyboard.

The only thing I’m missing is a right Windows key (technically a Super key). A lot of handy Amarok shortcuts use the Win key, such as Win+O for displaying the OSD, or Win+P for firing up the playlist. I’ve also set Win+Plus and Win+Minus to change the volume. With only a left Win key, all of the above-mentioned shortcuts require two hands. So what can I do?

I can remap the “back” key (XF86Back) located above the left arrow key to act as a right Win key. (The back key itself is not that useful — in most sensible applications, one can use Backspace for that purpose.)

First, I open up xev and press the key to find its keycode: 166. Then I use xmodmap to test the changes live:

xmodmap -e “keycode 166 = Super_R”

Finally, I save the setting in my ~/.Xmodmap:

keycode 166 = Super_R

Mission accomplished.


The Singularity Is Near

January 17, 2010

I first stumbled upon Ray Kurzweil’s website some years ago. It immediately turned me off with words like “Fantastic Voyage: Live Long Enough to Live Forever.” It sounded like one of those “How to be happy and get everything you want” books, which rarely accomplish anything but big bucks for the author, and disappointment for the suckers who buy them.

I’ve read The Singularity Is Near now, and my opinion about the book is mixed. I don’t remember what made me look it up in the first place — but I certainly don’t regret reading it.

Kurzweil argues that evolution is an exponential process, and that each new paradigm opens the door towards a faster development of the next one. As evidence, he shows logarithmic plots such as this:

singularity countdown

If this were plotted linearly, most of the “interesting” events (like Homo Sapiens, cities, and the Internet) would be grouped together in a small chunk of recent time, compared to the time it took for life before that to evolve.

Read the rest of this entry »


Chemversation

December 27, 2009

Since the dawn of self-reflection, I have been an inert gas,
Other atoms’ interactions mocking me, as I flew past.
Every time I saw two bonding, I would quickly look away,
My full outer shell reminding, solitude is here to stay.

Looking at those lucky ions, never did I see the facts,
Never did I grasp the science, one who gives, and one who takes.
Can the atoms both be merry if their dipole is so charged?
Or do their nuclei carry hearts that shattered into shards?

I have circled a few atoms, now that I can speak their tongue:
Those with brains looked unimpressive; those with good looks sounded dumb.
Those with both were cold and distant, their electrons long since shared,
Atoms much stronger than this one waiting for their chance with her.

Now you beckon me with riddles, and all of this is so new –
Our polarity is brittle, and I don’t know what to do.
But regardless of what happens, Heisenberg remains unkind:
One of two forever present: thirst of flesh, and thirst of mind.


Follow

Get every new post delivered to your Inbox.

Join 26 other followers