Saturday, January 22, 2005

How to re-create a website in 10 hours

I decided it was time that our Classical Christian School, Providence Christian Academy, had a new website design. I knew very little about html and nothing about css style sheets when I started. I'm quite pleased with the result. I still want to add some pictures to the site, but other than that I think it looks pretty good. Please let me know what you think. I would love to hear any suggestions for improvements.

I began the re-design by downloading CityDesk, grabbing one of the example templates, and playing with the included style sheet. It took two nights, about 10 hours, to redesign the site even while learning css.

I was talking to Weiqi about this over lunch a few days back and he was asking about CityDesk. I'm using the free edition which allows you to manage up to 50 files. CityDesk does not have a great html editor, what it does have is the ability to build a template that can be applied to all of your pages so that they all look alike and can be easily changed. It also makes it easy to publish the website. What I wish it had was CVS like history for your pages. If I hit the 50 page max for the free edition, I'll probably just write a perl script to do what the template in CityDesk does for me and use CVS. As a matter of fact, I'm tempted to do that now just so I can have the ability to keep history information. Then it would just be a matter of getting a ftp client that can publish the site easily (I'm sure there are plenty to pick from.)

Saturday, January 15, 2005

The Top 100 Things I'd Do If I Ever Became An Evil Overlord

I think I read this years ago, but Rob pointed it out to me again on Friday.

Monday, January 10, 2005

Concurrency Revolution

Herb Sutter has a very good article in C/C++ User's Journal on the Concurrency Revolution. As he sees it, multithreaded development is the next big 'thing' since OO development. He talks about how chip manufacturers are looking at other ways to speed up processing since increasing clock speed has suddenly hit a wall.

Friday, January 07, 2005

chkdsk often on NTFS

chkdsk is not something I ever do unless there is a problem. However, I ran chkdsk on one of my machines at work on accident.

[You might ask how that is possible. Well for my last post I wanted to make sure I spelled the command correctly (remember I don't run the command very often) and hit return after I did the command completion.]

Anyway, I was surprised to see that it found problems that needed to be corrected. So I ran it on my laptop for fun, and it also needed to fix some problems. I also ran it on my home machine and it also needed some problems fixed.

So, it appears that chkdsk should be ran fairly often to find and fix problems.

Go ahead and run it yourself and let me know if it finds anything on your machine that needs to be fixed.

Thursday, January 06, 2005

Rescue contents of a sick hard drive

How to rescue the contents of a sick hard drive without spending any money. Or why you need a copy of Knoppix laying around. Knoppix is a bootable linux CD that runs completely off the CD.
Rob's daughter's laptop would only boot part way into Windows XP and then halt. Windows recovery couldn't fix the problem and it looked like the hard drive was dieing (chkdsk was failing, etc.) So the next thing we tried was booting Linux using Knoppix. Once Knoppix booted up we did the following:

1. Attempted to mount the drive... that failed with something about bad drive type.

2. Attempted to use partimage to backup the drive... that failed with similar error.

3. Ran badblocks on the drive and got intermittent indications of bad blocks.
(Then Jonathan stepped in and did the following.)
4. He used raw dd to copy the contents of the drive over the network to another machine running Knoppix.
   for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18; do

dd if=/dev/hda of=/mnt/other/rob_dd.img.$i skip=`echo $i * 2097152 bc` count=2097152;
done


(2097152 is 1GB divided by 512bytes - the sector size)

5. He then concatenated the files together.
   for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18; do

cat /mnt/other/rob_dd.img.$i >> /mnt/other/rob_dd.img;
rm /mnt/other/rob_dd.img.$i;
done


6. Next, mount the file as a drive using Linux's loopback device. The gory details of using Linux's loopback device are explained by this link. Since the drive only had one partition which started at sector 63, the offset was 63 * 512 bytes => 32256 bytes.
   mount -o loop,offset=32256 -t ntfs  rob_dd.img /mnt/rob_dd


7. cd /mnt/rob_dd

8. Copy all the data you want from the "drive".

Wednesday, January 05, 2005

Tuesday, January 04, 2005

Opening winmail.dat

I just received an attachment as winmail.dat. This free util was able to open it. Just drag the winmail.dat onto the wmparser icon and it presents a simple GUI for viewing the contents. In my case I was able to extract the embedded Microsoft Word document.