Unix learning tips from Miguel de Icaza

Miguel de Icaza – a very well known programmer in Linux circles – shares a few tips to having a better experience in Unix environments.  Here is a summary of what he recommends:

  • Read, learn, and memorize the “Unix Programming Environment” book by Kernighan and Pike.
  • Read and learn the “Unix for the impatient” book by Abrahams and Larson.
  • Learn Emacs.
  • Use Midnight Commander, which Miguel is the author of.  Here is a handy manual.
  • Keep a copy of the “Unix Power Tools” book nearby.
  • Learn touch typing.

These are all solid recommendations.  I’d suggest to use Vim instead of Emacs, but that’s more of a personal preference – learn one or the other.  And I can’t agree more on the touch typing.  That is indeed the most important skill that you will ever learn.  Right next to the camp fire starting.

At this point you might be thinking “I am awesome”, “the world is my oyster” and “Avatar 3D was not such a bad movie”.

But unless you touch-type, you are neither awesome, nor you are in a position to judge the qualities of the world as an oyster or any James Cameron movies.

You have to face the fact that not only you are a slow typist, you do look a little bit ridiculous. You are typing with two maybe three fingers on each hand and you move your head like a chicken as you look at you alternate looking at your keyboard and looking at your screen.

Do humanity a favor and learn to touch type.

Bayes theorem history

A fascinating read on the Bayes theorem history:

The German codes, produced by Enigma machines with customizable wheel positions that allowed the codes to be changed rapidly, were considered unbreakable, so nobody was working on them. This attracted Alan Turing to the problem, because he liked solitude. He built a machine that could test different code possibilities, but it was slow. The machine might need four days to test all 336 wheel positions on a particular Enigma code. Until more machines could be built, Turing had to find a way for reducing the burden on the machine.

He used a Bayesian system to guess the letters in an Enigma message, and add more clues as they arrived with new data. With this method he could reduce the number of wheel settings to be tested by his machine from 336 to as few as 18. But soon, Turing realized that he couldn’t compare the probabilities of his hunches without a standard unit of measurement. So, he invented the ‘ban’, defined as “about the smallest change in weight of evidence that is directly perceptible to human intuition.” This unit turned out to be very similar to the bit, the measure of information discovered using Bayes’ Theorem while working for Bell Telephone.

If the whole thing is too much for you, at least read the “Bayes at War” section.

The purpose of an operating system

I came across a good reminder of the operating system’s purpose in this Slashdot comment:

The point of an OS is to make the software independent of the underlying hardware. Windows lost that independence a LONG while ago (Windows NT / 95). Linux still has it because of the underlying design of the whole thing.

The same comment also brought back some memories of the times when I was working as a system administrator at what is now known as PrimeTel.

Move a Windows server – you can be in for a world of hurt unless you want to fresh-deploy it every time. Move a Windows-client, historically you’d be prepared for blue-screens because you have the “wrong” processor type (Intel vs AMD – requires disabling some randomly named service via the recovery console, for example), reinstalling the vast majority of the drivers (probably from a 640×480 safe mode) and even then can’t be guaranteed to get anything back and working – not to mention activation, DRM, different boot hardware (e.g. IDE vs SATA), etc.

Move a Linux server – unless your OWN scripts do something incredibly precise and stupid with an exact piece of hardware, it will just move over. At worst, you’ll have to reassign your eth ports to the names you expect using their MAC address (two seconds in Linux, up to 20 minutes in Windows and a couple of reboots).

It’s been a few years since I did that.  But I remember vividly how we used to move servers from one piece of hardware to another, and since we used a mixture of Windows and Linux servers, the difference was obvious.  With everything else being equal, we could migrate a dozen of Linux servers in two-three hours, moving them in parallel.  Windows machines took days and had to be approached with very little concurrency.

Mind + computer > mind

Obviously, isn’t it?  Well, my brother posted this garbled piece of text, which is supposed to show you how awesome your mind is.

7H15 M3554G3 53RV35 7O PR0V3 H0W 0UR M1ND C4N D0 4M4Z1NG 7H1NG5, 1MPR3551V3 7H1NG5! 1N 7H3 B3G1NN1NG 17 WA5 H4RD BU7 N0W, 0N 7H15 LIN3 Y0UR M1ND 1S R34D1NG 17 4U70M471C4LLY W17H0U7 3V3N 7H1NK1NG 4B0U7 17, B3 PROUD! 0NLY C3R741N P30PL3 C4N R3AD 7H15.
R3-P057 1F U C4N R35D 7H15… !!!

And I agree, it is. But I think that mind with some extra computing power is even better. It took me just a few seconds to instruct my computer how to do a readable translation for me. Much less time than it takes me to read the garbled text.  For those of you with a Linux command line nearby:

$ cat message.txt | tr 715340 TISEAO

For those of you without a shell nearby and not an amazing mind, here is a “deciphered” version of the text:

THIS MESSAGE SERVES TO PROVE HOW OUR MIND CAN DO AMAZING THINGS, IMPRESSIVE THINGS! IN THE BEGINNING IT WAS HARD BUT NOW, ON THIS LINE YOUR MIND IS READING IT AUTOMATICALLY WITHOUT EVEN THINKING ABOUT IT, BE PROUD! ONLY CERTAIN PEOPLE CAN READ THIS.
RE-POST IF U CAN RESD THIS… !!!

Why you should teach yourself WordPress taxonomies

Alex King has a blog post describing the major differences between using custom fields and taxonomies in WordPress.  If you are familiar with the WordPress database, and if you think about it for a couple of minutes, you’ll probably realize why taxonomies are a better choice than custom fields for those situations where you can use both.

The reason to favor a custom taxonomy in these situations has to do with the WordPress database structure. Queries by taxonomy are well optimized as this is a primary front-end presentation feature in WordPress core. Conversely, querying by custom field key and value is slow. The value column in the custom field table is not indexed – you are basically doing a search through data that is not intended for that purpose.

The problem is that too many people, even those who are very well familiar with WordPress database structure, never really think about it.  And since custom fields are an older way of solving problems, many go for them without proper consideration.