Inspiring

Posted Monday, July 6, 2009 at 14h07 in Personal

Although it can come across as cliche and hackneyed, the story of the underprivileged youth working their way up in society can still be quite inspiring as it is here.

You know you’re a geek when…

Posted Friday, June 19, 2009 at 15h08 in Personal

… you look at a digital clock, see 4:04, and think, “Oh no! My clock is broken!” And then right after, “Lol, that’s so funny, I should blog about it…”

My latest Amazon.com loot

Posted Thursday, June 4, 2009 at 16h55 in Personal

I have no idea how people in the past survived without being able to purchase the following items from a single online store (with free shipping):

  • 2 x 2 TB OEM hard drives
  • Thermos 16 ounce travel mug
  • Case of 6 x Method green tea + aloe foaming hand soap
  • 1 set of Gorham flatware
  • D-Link gigabit + 802.11 g/n/u router
  • 6 pairs of socks

Hard drive died? Stick it in the freezer!

Posted Saturday, May 9, 2009 at 04h43 in Computers

Okay, so I’ve known about this idea for a while but never had a chance to try it out until now. The basic idea is if your hard drive suddenly fails and your computer can no longer read it, putting it in a freezer for a few hours might fix it so that you can use it long enough to copy your data over to a backup drive before it fails again.

Sound crazy? I thought so too. But consider how the main cause of hard drive failure is usually overheating. This could damage the hard drive in a number of ways, one of which is thermal expansion of certain metal parts. Putting the hard drive in a freezer would cause thermal contraction, which might be just enough to counteract the damage caused by the overheating. Another explanation (and I think this is more probable) is that freezing the hard drive lowers the resistance of the substrates used to store and transmit data. This in turn allows the hard drive to access sectors that previously appeared to be dead.

The most important thing, though, is that I can tell you it actually worked for me. The 40 GB 2.5″ hard drive on one of my old laptops died earlier. I got a blue screen, and after restarting, the system said it couldn’t find the operating system. I then rebooted to a Windows CD, and the installation program couldn’t find any hard drive to install on. That convinced me my hard drive was in fact dead. So, I put it in the freezer (use a zip lock bag to prevent condensation) for a few hours, put it back in my laptop, turned it on, and windows booted up again like nothing had happened. Now, at this point I expected to only get a few minutes of use out of it. But so far, I’ve spend the last 3 hours copying files onto various locations on my network, and the hard drive is still spinning away happily.

So yes, it’s true! Putting dead hard drives in the freezer can indeed bring them back to life! After my files are done copying I’ll put the laptop enclosure back together and see how long this baby can run before it goes out again. (Of course, I won’t be saving any data to this laptop. I’ll just be using it to play movies and anime while I work on my other computers.)

On the Topic of A.I.G. Bonuses

Posted Wednesday, March 25, 2009 at 16h03 in Rants

It’s natural to feel wronged when you see your savings get cut in half or more due to a widespread economic downturn caused by irresponsible greed on Wall Street. It’s natural to feel misled and to seek out a scapegoat. It’s wrong to accuse and lynch workers in the financial industry– those who had very little to do with the cause of the economic downturn– simply because they make a lot of money.

The fiasco with the A.I.G. bonuses and the outrage expressed by the nation and its president are an example of the incredible ability and crippling need of the human mind to justify blame and, in some cases, deflect responsibility for the personal and corporate financial negligence that led to this financial crisis. Does anyone actually know the job responsibilities of the A.I.G. employees who received those bonuses? Do people even care whether or not their daily activities were related at all to credit default swaps? It is blind and foolish to assume that just because someone made a few million dollars in bonuses last year, that person is an evil criminal that leeches money from hard working tax payers.

Perhaps one reason it is so easy to villainize the executives we read about in the news is because we don’t personally know many such people. To most of us, the idea of making $1 million a year seems so incredulous that anyone who does it must somehow be cheating, breaking the rules, or doing something unethical. Perhaps part of that rationalization stems from a selfish desire that balks at the idea of anyone being many times more successful than oneself.

While the so-called moral outrage at the A.I.G. bonuses may provide good ratings for news outlets, any benefit that may arise from such emotional beatings of the chest are imaginary or psychological at best, and at worst, will only result in a distracted president and delayed solutions to the current economic quagmire.

Domain Renewal Scam

Posted Monday, March 23, 2009 at 11h37 in Rants

Few things upset me more than greedy companies taking advantage of consumer ignorance. I own about 30 domain names, and therefore I get a lot of domain name spam– both emails and letters in the mail. Some of the letters in the mail attempt to pass themselves off as bills from the company that owns your domain. The wording makes it appear as if your domain is registered through them and will expire unless you pay them a fee (usually something like $30 for a 1 year renewal, which makes it even more ridiculous because the typical rate is around $10 per year). They make the letter look as official as possible, and while it does say in the (very) fine print that it isn’t really an invoice, a lot of gullible consumers aren’t going notice that, especially since they send these letters out a month or so before your domain is really about to expire. (Publicly accessible whois records allow anyone to obtain the owner name and address, expiration date, and registrar of any public domain name.)

Now, when I receive these types of letters, I just rip them apart and toss them in the trash. However, I can imagine non-tech savvy people falling for this. My mom, for example, recently received one such letter but thankfully was smart enough to call me about it. I don’t remember exactly which company it was from, but if you google “domain renewal scam” you’ll come across a bunch of reported cases involving companies such as Domain Registry of America and Liberty Names of America.

A.I.G. sues the U.S.

Posted Thursday, March 19, 2009 at 23h55 in News

If you can get past the utter despair this story casts on the state of the economy, maybe you can appreciate the hypocritical irony in the idea of A.I.G. using government bailout money to sue the government.

Music at the 81st Annual Academy Awards

Posted Saturday, March 7, 2009 at 12h35 in Entertainment, Media, Music

Did anyone else notice that the awards music at the 81st Annual Academy Awards sounded an awful lot like the opening to “Belle” from Disney’s Beauty and the Beast? You know, the part where it goes, “Little town, it’s a quiet village. Every day, like the one before…” Out of curiosity I superimposed audio clips from the two sources, one thing led to another, and I ended up making this video. [download avi]

Get the Flash Player to see this player.

Some things to note. The awards music at the Oscars is in E flat, while the Broadway recording of Beauty and the Beast’s “Belle” is in D, and the song in the actual movie is in D flat. I used Adobe Audition to transpose the awards audio down a half step so the music is in D flat while keeping the same tempo, since the original tempo matched the tempo in “Belle” pretty well. For the “remix” of the awards music in the second half of the video, the tempo was a bit faster, so I had to slow it down some. In the end, I added some animation from the movie, but remember I was using the Broadway cast recording, so the lip syncing didn’t match up precisely.

Grub settings

Posted Saturday, February 21, 2009 at 00h05 in Computers

My hard drive on one of my computers died recently, so I ended up reinstalling several OSes (Ubuntu, WinXP MCE, and Win7). I use grub to dual boot, or in this case, triple boot, and in the past it’s always worked fine. Now suddenly the Windows OSes wouldn’t start, and so I dug around and found out that even though my new drive was on hd2 (as evidenced by the fact I was able to mount my Windows partitions on hdC, and you know how fstab starts with “A” and grub starts with “0″), grub still saw the hd2 as hd0. So, after modifying /boot/grub/menu.lst and changing hd2 to hd0 for the Windows configs, everything was spiffy.

Cron permissions on Princeton’s servers

Posted Monday, February 9, 2009 at 14h08 in Personal

So I’m trying to create a subscriptions feature for the new Manna website that I’ve been overworking myself on for the past several months. Seriously, if I applied my hourly rate from my last job to the number of hours I’ve spent on that site, I’d have made about… $28,000. Yikes, I just calculated that and even I’m surprised. Anyway, back to the topic. The website has user generated content– blogs, wall (think facebook), photos– and I wanted to allow users to subscribe to content from other users. The steps involved:

  1. Creating a database for subscriptions data (easy)
  2. Creating a front-end for users to add/modify/delete subscriptions (time consuming but straightforward)
  3. Checking new content against the subscriptions table and sending out emails accordingly.

For this last step, there were two methods I could take:

  • Write a hook for the classes that save new content to the database
  • Write a stand alone script that periodically checks new content in the db, and add the script to a cron job

I started with the first option, but soon realized that because users can set a future “publish date” for their items, the hook idea wouldn’t work, since it can only take action at the time that the content is created or modified. The idea is for subscribers to be notified whenever content is “published,” which does not have to coincide with when they are created.

So, I had to pursue the second option. The funny thing about Princeton’s server is that the user account does not have access to its own database. (Right now you should be saying, “wtf?!”) Apparently the user accounts are stored on one server, and httpd, mysql, and other web services are run off another server. The user accounts on the first server have access to the second server via a pseudo clone account, which gives you a home directory and lets you edit files, etc. However, only accounts native to the second server (i.e. apache) have access to the database. That means any script you add to your cron (which is stored on the first server) will not have permission to access the database, which makes option (2) impossible. Unless, of course, I’m a genius (haha, ok, I’m not, but let me gloat here for once. I’ve just realized I’ve given up over $28k for something I’m basically doing pro bono, and it’s making me feel nauseous, so I’ll take whatever delusional ideas of self grandeur I can that will take my mind off that.) Anyway, my solution was to use wget to make apache run the script instead of the local user, and add the wget to the cron. That way, the script is always run by apache which does have access to the database. Problem solved.