Monday, August 11, 2008

100 Pushups: Week 5 (take 3), Day 1

Last week was a bust. I just had too much going on, and either forgot about doing pushups or didn't have time. So I'm repeating week 5 again this week. And it's not looking too good so far:

Column 3

Level 1: 40/40
Level 2: 32/32
Level 3: 30/30
Level 4: 15/25
Level 5: 28/min 40

Not a very good performance. Hopefully Wednesday will be better.

Tuesday, August 5, 2008

100 Pushups: Week 5 (again), Day 1

Column 3

Level 1: 40/40
Level 2: 32/32
Level 3: 30/30
Level 4: 25/25
Level 5: 40/min 40

I did wait longer than 60 seconds before level 5.

Friday, August 1, 2008

Subversion, Vendor Branches, and svn-load

A while back, Ross Burton wrote an excellent tutorial for using vendor branches in subversion. I used this tutorial, or one like it, about a year ago when adding a vendor branch to one of my own projects, jpilot-icalendar.

A few days ago, I needed to update jpilot-icalendar with a new vendor version. I couldn't remember exactly how to do that, so I googled "subversion vendor branches" and found Ross's tutorial. As I was going through the steps, I discovered that svn_load_dirs was no longer installed on my system. I assumed this was a casualty of my recent hard drive failure and started looking for the package it belonged to so I could reinstall it. After a bit of digging, I found to my horror that svn_load_dirs had been removed from the Debian subversion-tools package. There was mention of an svn-load command, which "should function as a drop in replacement."

I couldn't find any documentation on svn-load, so I setup a test subversion repository to test it. I am happy to report that it does seem to be a drop in replacement for svn_load_dirs, at least to the extent that I used it.

Here is how I originally imported the vendor source:


$ svn import libical-0.23 \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/current \
-m "Importing libical-0.23"

$ svn copy \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/current \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/0.23 \
-m "tagging libical-0.23"

$ svn copy \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/current \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/trunk/libical \
-m "bringing libical-0.23 into main branch"


Then I updated to libical-0.24-RC4:


$ svn_load_dirs \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical \
-t 0.24-RC4 current libical-0.24

$ svn merge \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/0.23 \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/current \
libical


That brings me up to a few days ago, when I wanted to upgrade to libical 0.31. Here is how I did that:


$ svn-load \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical \
-t 0.31 current libical-0.31

$ svn merge \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/0.24-RC4 \
https://jp-icalendar.svn.sourceforge.net/svnroot/jp-icalendar/vendor/libical/current \
libical


As promised, the svn-load command was a drop-in replacement for svn_load_dirs.

Edited 08/02/2008 11:11AM EST:Fixed layout again, after reading this handy guide.

100 Pushups: Week 5, Day 3

Column 2

Level 1: 16/16
Level 2: 16/16
Level 3: 14/14
Level 4: 14/14
Level 5: 12/12
Level 6: 12/12
Level 7: 10/10
Level 8: 40/min 35

Wednesday, July 30, 2008

100 Pushups: Week 5, Day 2

Column 2

Level 1: 17/17
Level 2: 17/17
Level 3: 16/16
Level 4: 16/16
Level 5: 14/14
Level 6: 14/14
Level 7: 12/12
Level 8: 40/min 35

I did wait longer than 45 seconds before level 8, but not for the others.

Monday, July 28, 2008

100 Pushups: Week 5, Day 1

Column 2

Level 1: 35/35
Level 2: 28/28
Level 3: 25/25
Level 4: 22/22
Level 5: 35/min 35

Steve Spiers, the creator of the hundredpushups site has been sending periodic updates to the people who have signed up to take the challenge. In his last update, he mentioned that week 5 is a tough one, which I find to be a bit of an understatement.

I was able to do 50 pushups during my last test (yesterday morning), so technically I should be in column 3 this week. But I was barely able to eke out the numbers in column 2, and only by resting a little longer than the 60 seconds in the plan. These numbers just seem a little ambitious to me.

Then again, I am pushing 40. Maybe a younger person wouldn't find it so challenging.

At any rate, I'm not giving up. I will probably repeat week 5 next week though. I don't think I'm going to be able to do week 6 if I'm struggling with week 5.

Friday, July 25, 2008

Hard Drive Failure

A few days ago we had an electrical storm, so I powered off my computer. After the storm was over I was unable to boot into linux. It had been shutdown cleanly, no signs of errors, but it refused to boot. I immediately suspected the hard drive, a Seagate 160GB, which had been giving me trouble since I bought it about a year ago. My BIOS has an option to check the SMART status of the installed drives, and can even run a short and long self test. Sure enough, the short self test was failing.

It was my belief that the boot was failing while probing the hardware, and my hope that I could just plug in a new drive, copy my files over, and be done with it. I should have known better of course.

I got a new hard drive, a 500GB Western Digital on sale at Circuit City. It installed without a hitch, and I was able to boot an ubuntu Live CD with both the old drive and the new drive installed. That bothered me a little; if the bad disk was causing the hardware probe to crash, then it should have crashed even when booting from a Live CD. Maybe it was booting from the bad disk that was causing the problem.

I partitioned and formatted the new drive, and copied all the files over from the old drive. Since the old drive had an IDE interface, and the new drive was SATA, I needed to update /etc/fstab and GRUB's menu.lst. After that, I should just be able to install GRUB on the new drive and reboot.

That's where I hit my first real snag. I planned to chroot to the new disk to install GRUB, but that didn't work. The chroot command kept giving me an error, saying it couldn't execute /bin/bash. That didn't make any sense at all, I could execute bash on the new disk without problems. Google was no help with the error, but I did find an alternate method for installing GRUB on the ubuntu forums. I installed GRUB and chalked up the chroot failure as an oddity with the Live CD.

Finally, it was time to boot my new disk. I restarted and got to the GRUB splash screen, which was a good sign. The first entry wouldn't boot, but it was no big deal, just the wrong hard drive number in menu.lst. I edited the entry and booted, and got the familiar ubuntu splash screen. Success! Except that it froze, in exactly the same way it had with the old drive. Dammit.

Now, I've been working with computer hardware long enough that I wasn't surprised by this outcome. And, looking back, I really should have known better. So I tried booting into single user mode, to see if that made any difference. It didn't, of course, but at least I got to see the actual error instead of a frozen splash screen. It was a kernel panic, because the kernel couldn't execute /sbin/init. So it was a corrupted filesystem preventing the boot, not an errant hardware probe.

So, back to the Live CD. Copy /sbin/init to the new hard drive, reboot. Nope. Live CD again, copy everything in /sbin. Everything in /bin too, what the hell. No dice. Maybe google can help. No, not really. Time to bite the bullet and reinstall. *sigh*

Google did help here. I found a howto for getting a list of installed packages, and reinstalling after just such a disaster. So, back to the Live CD, again, and get the list of all installed packages:
$ sudo mount /dev/sdb3 /mnt
$ sudo mount /dev/sdb4 /mnt/home
$ sudo su
# dpkg --root=/mnt --get-selections | grep -v deinstall > /mnt/home/ubuntu-files

Then I ran the installer and installed, taking care not to format my home partition. When that finished, I edited the new /etc/apt/sources.list and enabled the universe and multiverse repositories, then I chrooted into the fresh install to reinstall my packages:
$ sudo mount -t proc none /mnt/proc
$ sudo mount -o bind /dev /mnt/dev
$ sudo chroot /mnt /bin/bash
# apt-get update
# dpkg --set-selections < /home/ubuntu-files
# apt-get dselect-upgrade

That got me most of the way back. I unmounted everything, rebooted, and was eventually greeted by the GNOME login. Finally! Of course, I forgot to add my user account, or change the root password, so I couldn't login. But that was easy enough to fix.

100 Pushups: Week 4, Day 3

Column 2.

Level 1: 25/25
Level 2: 19/19
Level 3: 19/19
Level 4: 17/17
Level 5: 40/min 24

Hoo-ah.

Thursday, July 24, 2008

100 Pushups: Week 4, Day 2

Forgot to post this last night.

Column 2

Level 1: 22/22
Level 2: 17/17
Level 3: 17/17
Level 4: 15/15
Level 5: 25/min 20

Monday, July 21, 2008

100 Pushups: Week 4, Day 1

Column 2

Level 1: 22/22
Level 2: 16/16
Level 3: 16/16
Level 4: 14/14
Level 5: 35/min 22

Friday, July 18, 2008

100 Pushups: Week 3, Day 3

Column 2

Level 1: 25/25
Level 2: 19/19
Level 3: 19/19
Level 4: 17/17
Level 5: 26/min 22

Wednesday, July 16, 2008

100 Pushups: Week 3, Day 2

Column 2

Level 1: 22/22
Level 2: 17/17
Level 3: 17/17
Level 4: 15/15
Level 5: 21/min 20

Monday, July 14, 2008

100 Pushups: Week 3, Day 1

Column 3

Level 1: 25/25
Level 2: 17/17
Level 3: 17/17
Level 4: 15/15
Level 5: 18/min 25 <-- ouch

That really sucked. I think I need to move down to column 2 next time.

Sunday, July 13, 2008

100 Pushups, Test 2

I took my second pushups test earlier today, and I did... 39 pushups. That's one less than I did on my initial test. That's disappointing, but I'm not going to get discouraged. Since I started the 100 pushups challenge I've really been concentrating on my form, trying to do pushups correctly. When I took my initial test, I was just trying to do as many as I could as fast as possible.

Friday, July 11, 2008

100 Pushups: Week 2, Day 3

Level 1: 15/15
Level 2: 15/15
Level 3: 12/12
Level 4: 12/12
Level 5: 19/min 15

Wednesday, July 9, 2008

100 Pushups: Week 2, Day 2

Level 1: 16/16
Level 2: 13/13
Level 3: 11/11
Level 4: 11/11
Level 5: 20/min 15

Monday, July 7, 2008

100 Pushups: Week 2, Day 1

Level 1: 12/12
Level 2: 12/12
Level 3: 9/9
Level 4: 7/7
Level 5: 15/min 10

Friday, July 4, 2008

100 Pushups: Week 1, Day 3

Level 1: 15/15
Level 2: 13/13
Level 3: 10/10
Level 4: 10/10
Level 5: 15/min 15

Happy Independence Day!

Wednesday, July 2, 2008

100 Pushups: Week 1, Day 2

Level 1: 12/12
Level 2: 12/12
Level 3: 10/10
Level 4: 10/10
Level 5: 16/min 10

Monday, June 30, 2008

100 Pushups

I stumbled across the hundredpushups site the other day while browsing through del.icio.us. I'm no stranger to pushups, having done martial arts and ROTC in college. But that was a long time ago, and I've been mostly sedentary for the past two years. And even at my fittest, I was never able to crank out more than about 65 pushups at once.

So I'm going to give this a try. At least this blog will get regular updates for a while. I figure blogging the challenge will encourage me to keep up with it.

My initial test was 40 pushups, which puts me in column 3. Here's how I did on day 1, week 1:

Level 1: 10/10
Level 2: 10/10
Level 3: 8/8
Level 4: 6/6
Level 5: 13/min 7

Check back on Wednesday for day 2.

Sunday, June 22, 2008

Security: You're doing it wrong

A couple weeks ago, Bruce Schneier blogged about this motivational poster. He thought it was funny, and it is, but it can also have a deeper meaning. I like to think of it as a reminder.

If you're a programmer, when was the last time you thought about how your program could be exploited? What about the sensitive data stored in your database? Or how that data is accessed?

Security is an arms race, a never-ending process of trying to stay one step ahead of the bad guys. The bad guys will never stop looking for exploits, which means you can never stop thinking about the security of your system. The fact is, you're probably doing something wrong, because even if you follow good security practices the rules keep changing.

So yeah, it's funny. But it's also true.

Monday, June 2, 2008

Should you know C?

I've been enjoying the podcasts that Jeff Atwood and Joel Spolsky have been putting out for StackOverflow. In the last two, Jeff and Joel have been discussing whether it is useful for a programmer to know C, even if they do not program in C. Joel believes that knowing C, or more specifically, low-level programming details, is not just useful but essential. Jeff, on the other hand, doesn't seem to think it's very useful, and that programmers can better use their time learning the business domain of their applications. Of course, the fact that Joel knows C, and Jeff doesn't, might have an impact on their opinions.

I agree with Joel on this, but then I also know C so I suppose that's to be expected. Other people have made good supporting arguments, but I'm curious if the naysayers think that web application developers, or even web designers, should know HTML. There are plenty of tools that let you design a web site or manage content without using HTML, so why bother learning the low-level details of how they work?

Sunday, March 23, 2008

Happy Easter!

My wife Cherlon made a Buffy-themed diorama for the Chicago Tribune's peeps diorama contest. She didn't finish in time to submit it, but it turned out really well and was a big hit at Easter.