How Last.fm Uses IRC

Richard Jones, one of the co-founders of Last.fm, has a writeup describing how Last.fm uses IRC. I'd really like to see IRC used for more stuff like this, including communication in general. (In the comments, one guy describes how him and his friends use their own private IRC server for communication.) It's sad that a lot of people don't even know what IRC is, let alone use it. If you're one of those people, check out The IRC Prelude and the Wikipedia page. If you're using Windows, check out the free mIRC client (I use irssi on Linux) and if you don't feel like installing anything, check out the awesome web-based client Mibbit.

The Importance of Breathing Through Your Nose

Have you ever wondered about the importance of breathing through your nose vs breathing through your mouth? While searching the Internet for an answer to why the cold air seems to freeze up my chest and make breathing very difficult, I stumbled across The Science of Breath. The section on Nostril vs Mouth-breathing had this to say about cold air:

And, moreover, such incorrect breathing admits cold air to the organs, thereby injuring them. Inflammation of the respiratory organs often results from the inhalation of cold air through the mouth.
...
Not only do the nostrils serve this important purpose, but they also perform an important function in warming the air inhaled. The long narrow winding nostrils are filled with warm mucous membrane, which coming in contact with the inhaled air warms it so that it can do no damage to the delicate organs of the throat, or to the lungs.

The author says that many diseases can be attributed to the habit of mouth-breathing and says that smallpox, which killed many men-of-war in foreign countries, did not kill a single "nostril-breather"; it only affected those who breathed through their mouths (though I can't help but wonder how he obtained nostril vs mouth-breather data).

I have observed that I breathe through my mouth most the time. Between the ages of thirteen and eighteen I had asthma that was bad enough to make climbing a flight of six stairs difficult. I suppose the habit of mouth-breathing could have formed when I had asthma: Since my lungs needed to get as much air as possible, I subconsciously developed the habit of always breathing through my mouth. (The asthma disappeared when I stopped eating dairy and started exercising.)

What other implications could mouth-breathing have? Of all the organs in our body, the brain uses the most oxygen. What organ is closest to the brain? The nose! Could breathing through our nose somehow provide our brain with a little extra oxygen, thereby increasing its function? When I breathe through my nose, my head automatically feels better; my brain feels clearer and refreshed with every breath. I don't feel any of that when I breathe through my mouth.

I'm going to start doing daily breathing exercises and make a conscious effort to breathe through my nose. The Summary of Techniques and Exercises section of the aforementioned site has some incredible breathing exercises (try a few!).

Lazy Linux: 10 Essential tricks for admins

Lazy Linux: 10 Essential tricks for admins is an awesome list of cool things you can do with Linux. I learned about trick #3 (collaboration with screen) from an admin at the datacenter where one of my servers is hosted. I remember being thrilled sitting there watching him do stuff on my server while sharing the keyboard to type messages back and forth in vi (think Remote Desktop or VNC, but on the console). Trick #5 (SSH back door) is something I've been using for years at work for remote diagnostics. It is an invaluable trick for getting around firewalls. Very cool stuff!

Most Innovation is Just Reinvention

On the radio this morning someone was explaining how several current technologies very closely resemble older technologies or ideas: Twitter is comparable to the telegram (they're short), Facebook comparable to the first day of school (your interests, social networking, etc), and e-mail comparable to the Pony Express (postal service at extremely high speed). Most innovation is simply the reinvention of things that already exist and truly new ideas or inventions are few and far between.

Installing rTorrent on OS X Leopard (10.5) using Fink

I've been using Transmission as a BitTorrent client on my MacBook Pro for a while now, but after setting up rTorrent on my Linux server earlier today and seeing how awesome it was, I just had to install it on my laptop as well. I absolutely love text-based applications!

The easiest way to install rTorrent is by using Fink or MacPorts. (Both of these tools allow you to download software that has been ported from Unix/Linux to Mac OS X.) I'll use Fink since I'm a fan of Debian Linux and Fink uses the Debian dpkg and apt-get package management tools.

Apparently there is no Fink binary available yet for OS X Leopard (10.5), so it must be compiled from source. These directions (which also contain instructions for setting up rTorrent on earlier versions of OS X) helped explain the overall process presented here. Since you'll need to compile from source, you will need to have Xcode installed (a set of development tools from Apple).

The basic steps for setting up Fink are as follows:

  1. Download the latest Fink source
  2. Open up a terminal (Applications -> Utilities -> Terminal.app) and run the following commands
  3. $ cd /path/to/download/directory
  4. $ tar xvzf fink-x.xx.x.tar.gz
  5. $ cd fink-x.xx.x
  6. $ ./bootstrap
  7. You will now be presented with several questions. Answer using the defaults (press Enter) for everything except the question about whether you want to enable the unstable tree; you must answer Yes to this question (see here if you accidentally missed this step).
  8. When the script finishes, run /sw/bin/pathsetup.sh
  9. For good measure, run apt-get update

Great! Now that Fink is installed, installing rTorrent is really easy:

$ fink install rtorrent

You might be notified that a bunch of extra packages need to be installed (there were 46 needed on my system!) so just choose Yes. After the packages have been downloaded and compiled (this might take a while) rTorrent should be on your system and ready to use.

Getting Started with rTorrent

rTorrent

You can launch rTorrent by simply running rtorrent in a Terminal, but before you get started you should look over the man page (man rtorrent) and then set up a configuration file (~/.rtorrent.rc). There are only four lines in my configuration file (check the man page to see what these do):

port_range = 26000-26999
directory = ~/downloads/torrents/
session = ~/downloads/torrents/sessions/
encryption = allow_incoming,try_outgoing,enable_retry

If you're interested in a lot more options, you might want to grab a copy of the sample .rtorrent.rc config file (why this wasn't included in the package, I don't know) and place it in your home directory.

The rTorrent User Guide has information about all the stuff on the screen as well as various commands to navigate the interface.

Using the wonderful screen utility, rTorrent becomes even more powerful on remote systems. I leave rTorrent running on my server and whenever I remotely SSH into the box I can then reattach the screen session that rTorrent is running inside of and instantly have access to it!

Tim O'Reilly on Working on Stuff That Matters

Tim O'Reilly has a blog post on working on stuff that matters. He makes several insightful points including one about creating more value than you capture. He also talks about the importance of working on something that matters to you more than money and says that "the most successful companies treat success as a byproduct of achieving their real goal, which is always something bigger and more important than they are."

Do one thing every day that scares you

Yesterday my parents badly needed sand because their big driveway was covered in sheer ice. Many people have told me that as long as I was a Lowell resident I could get free sand from a particular Lowell Public Works yard. (It's actually better than regular sand because it's a salt/sand mixture they use on the public roads.) I've seen plenty of municipal plow trucks drive down the long dirt road to the yard but never any non-municipal trucks, so I was always hesitant to check it out. None of us really has the money to spend on bags and bags of sand or salt from Home Depot, so filling my truck with free sand would be really helpful for everyone.

I'm not a Lowell resident anymore (I used to own three rental properties in Lowell but I live in NH now) however my truck still has a Massachusetts license plates. For many years I've imagined the worst possible outcome for driving down that long dirt road to get sand. I imagined armed guards with guns ready to fire upon me for trespassing, getting arrested by the police, etc, etc. Then yesterday, after realizing the worst possible thing that could actually happen (of all the most likely bad things) would be for someone to simply tell me "no, the sand is for city use only", I finally built up the courage to drive down the road to see if I could get some free sand.

The yard was empty. There were no armed guards with guns ready to fire upon me. There were no gates preventing me from passing. In fact, there weren't even any signs that said "No Trespassing" or "Official Use Only" and not a single person in sight to stop me! I drove up to the huge pile of sand, filled my truck, and drove away. That's when it hit me. If I had only built up the courage to do something that had very little risk associated with it, I could have had access to free sand for all my rental properties for the past 6 years! As I drove away from the huge pile of sand, I remembered a quote by Eleanor Roosevelt: "Do one thing every day that scares you."

Comfort makes us feel good; it's relaxing and it allows us to enjoy life. Unfortunately like many narcotics comfort has a nasty side-effect; too much of it leads to the exact opposite: discomfort. It should, therefore, be used in moderation (like everything else in life) and we should not use it as a constant destination. The destination of every moment should be the growth and gratitude of this life.

Staying within our comfort zone limits our ability to grow and learn. Niels Bohr, a Nobel Prize winning Danish physicist who made fundamental contributions to understanding atomic structure and quantum mechanics said, "An expert is a person who has made all the mistakes that can be made in a very narrow field." Nobody is comfortable making mistakes, but if mistakes are such a vital component to advancing our growth then we need to embrace doing things that scare us; we need to embrace doing things that make us feel uncomfortable so that we can live richer, fuller lives, instead of living a life of fear, worry, and uncertainty.

It's no doubt a scary thing to intentionally do something that makes us feel uncomfortable; to intentionally do something where the outcome or consequences are unknown. However, if we recognize that much of the fear comes from our own subconscious playing out the worst possible outcome, the outcome that is probably less likely to happen than lightning striking us from inside an office building, then we can quickly overcome our fears and grow in amazing ways.

Doing something every day that scares you may be quite a challenge but just try to think of all the little things that you don't do every day simply because you're afraid or because you're uncertain of their outcome. Saying hello to the cute girl who works in an adjacent office, taking an alternate route to a frequent destination down roads you've never traveled, selling something you don't use but think you'll eventually need, being extra friendly to a family member who you've never gotten along with, standing up to your boss or manager when you know you're right. I'm sure if you think carefully you can find plenty of harmless things you've avoided simply out of fear of the unknown.

Be more open to new experiences and grab life by the horns. Get out of your comfort zone and face challenges head on. Do one thing every day that scares you. Don't be afraid to learn something new about yourself or to change something about who you think you are as a person. But remember, as Mrs. Roosevelt also said, "Learn from the mistakes of others. You can’t live long enough to make them all yourself."

Very Sore Chest and Arms

It's been three days since I started my new workout routine and even though I haven't done anything (except running) since then, my chest and arms are still incredibly sore. That's a good thing though because it means my muscles have been challenged and will grow back even stronger! I start the routine again tomorrow and will stick with it on a daily basis regardless of how I feel. Another thing I start tomorrow is a routine of waking up early (6AM).

Being Greedy With Bash

Last night at my C/Unix class the professor quickly glossed over an interesting shell scripting technique that allows you to strip stuff off the beginning or end of a variable. I forgot about it until I saw the technique used again while editing a shell script at work today.

I didn't know what the technique was called but I remembered the professor saying something about "greedy clobbering" and, since I cannot search Google for special characters, I Googled "Bash greedy" and luckily found 10 Steps to Beautiful Shell Scripts, which just so happened to contain the technique I was looking for (#5).

There are basically four versions of this technique:

${var#pattern}
Search var from left-to-right and return everything after the first occurrence of pattern

${var##pattern}
Search var from left-to-right and return everything after the last occurrence of pattern (be greedy)

${var%pattern}
Search var from right-to-left and return everything after the first occurrence of pattern

${var%%pattern}
Search var from right-to-left and return everything after the last occurrence of pattern (be greedy)

Here's how it works. Let's say you have a variable that contains the path to a file:

FILE=/home/raam/bin/myscript.sh

Now let's say you wanted to extract the myscript.sh part from that variable. You could do some funky stuff with awk but there is a much easier solution built into Bash:

SCRIPTNAME=${FILE##*/}

Now $SCRIPTNAME will contain myscript.sh!

The ##*/ tells the shell to search left-to-right for everything before and including the slash (*/), be greedy while doing it so that all the slashes will be found (##), and then return whatever is left over (in this case, myscript.sh is the only thing remaining after the last slash).

AFAIK, this is a Bash-specific feature, but I'm not entirely certain and I wasn't sure where I could look to find out. It's amazing how four characters can do so much work so easily. The more I learn about what I can do with Bash, the more I wonder how I ever lived without all this knowledge!

Starting the P90X Workout Routine

A few days ago a friend told me he was starting the P90X workout program. (I remembered seeing an infomercial for P90X and thinking it would be an interesting routine to try, but I knew nothing would convince me to buy something I saw on an infomercial.) I've always used my own self-designed programs or followed 30-day workout routines that I find in health magazines. However, it's a new year and I need a new routine.

When I inquired how much he paid, he said he downloaded the entire thing free. Doh! Why didn't I think of that!? A quick search of mininova.org and a day's worth of downloading later and I have 4gb of videos and the entire P90X program on my laptop.

Having a workout routine (any routine, really) is important to maintaining a consistent level of difficulty and for maintaining consistency. The P90X routine has a lot of variety, including things like yoga, kenpo, and plyometrics, so I'm going to stick with it for the next 90 days. I strongly agree with the methodology it preaches: constant changes in the workouts are necessary to keep your body constantly adapting and growing. I just finished the Back & Chest + Abs routine and all I can say is wow. I can already feel the results just from the first workout!

An Example of Bad HTML Form Usability

While recently reconfiguring a Netgear FVS-124G router I was astounded by the blatant misuse of HTML form elements. In the router configuration there was a list of services that were forwarded to various computers. (I would call it port forwarding but Netgear has its own way of doing things -- another usability mistake.) The router was being configured for a new office so none of the existing dozen-or-so entries were valid and needed to be removed.

Bad Netgear Usability

Since the list used Radio Buttons (wrong) instead of Check Boxes (correct), I was only able to select a single entry at a time, delete it, click Continue on the following confirmation page, and then return to the list to start the process all over again. Sure, the Radio Buttons could be a way to prevent someone from accidentally deleting a whole selection, but that's what confirmation boxes are for.

You'd think someone as big as Netgear would have gotten their act together by now and worked out some of these really silly usability issues. For that matter, they (along with Linksys) should do away with their interface all together and adopt DD-WRT!

Apple finally advancing laptop battery tech?

AppleInsider has an article taking a look at the battery technology used by the new 17" MacBook Pro announced at Macworld today. Apple claims the new battery technology gives the MBP up to 8 hours of battery life -- pretty impressive considering it's the largest laptop Apple sells. Check out the battery video on Apple's website to see exactly how the new battery technology differs (including clips of the manufacturing process). I'm really happy to see that someone is making a real effort to push laptop battery standards. It's one of the areas in technology that really needs improvement.

Instantly Preview Files in OS X using Quick Look

I discovered this feature as I discover many new things in OS X: entirely by accident. While I had a file on my desktop selected, my wrist accidentally hit the space bar on the keyboard. Instantly a quick preview window popped up giving me a preview of the image:

Mac OS X Quick Look

The feature, known as Quick Look, is one of the more than 300 new features in OS X Leopard (10.5). Quick Look also works on text files, documents, PDF files, and even HTML and PowerPoint. This method of previewing files is so much easier than opening them in their native application! (It's more than a preview though, since you can also scroll through the pages for multi-page documents.) Closing the preview window is as easy as pressing Esc, or you can simply select another file with the preview open and it will preview the newly selected file.