Archive for the ‘Software/Programming’ Category

Knoppix To the ddrescue

Monday, June 16th, 2008

A Good Disk Gone Bad

I have an external USB drive that seemed to get a bit overheated, and dropped a couple of sectors. That was bad, since I couldn’t access it from Windows XP, and chkdisk didn’t help.

chkdisk could find the bad sectors but couldn’t repair them.

So I turned to Linux to help fix the problem.

What I Needed

First I needed to pick up another USB external drive. Did that from newegg.com (they had the best prices at the time, and free shipping).

Then I created a Knoppix live CD. I had recently read an article on this, and a couple of the guys from the office recommended it too. I suppose I could have hooked the drives to my Red Hat Linux box, but I wanted to try something new anyway.

I went to the Knoppix download page and pulled down the ISO, which I burned to CD.

From doing research on the web, I found an open source utility called TestDisk. The readme for TestDisk was most helpful, and mentioned that TestDisk, dd_rescue also came on the Knoppix Live CD. It also mentioned a faster and perhaps better implementation of a disk rescue called ddrescue, from Antonio Diaz.

I downloaded ddrescue, built it on my Linux box, and stowed it on my C: drive on my Windows box, just in case.

Getting Started

My original effort was to boot Knoppix and use the dd_rescue program that came with the Live CD. It was slow. Over a 20 hour period it had only done about half of the disk.
I needed my Windows box back for certain things, so I aborted the process.

When I came back to it several days later, I tried the ddrescue instead.

ddrescue works in two passes. On the first pass, it grabs all the good sectors.

./ddrescue -n /dev/old_disk /dev/new_disk rescued.log

The second pass grabs the error stuff, reading the info from the rescued.log

./ddrescue -r 1 /dev/old_disk /dev/new_disk rescued.log

This went much faster, and since I had to be out all day, I just let it run. The next morning, it had completed, and I ran the second pass — took maybe 15 minutes.

I’m Back, Baby!

And so, after all of that, I have my stuff back on my new drive. I’ll format the old one and use it for temporary things, things that i can afford to lose if it goes flakey again…..

Knoppix — check it out.

Technorati Tags: , , , ,

Firebug-Web Development Evolved

Thursday, January 18th, 2007

If you do any web development at all, using Firefox, check out the new Beta 1.0 version of Firebug, a web development extension for Firefox.

The older Firebug was good — the new one is tremendously improved…..

Firebug-Web Development Evolved

Creating PDFs with fillable form fields using OpenOffice

Saturday, October 7th, 2006

Recently, I had to put an application form on a website, so that folks wanting to apply could download it, print it out and fill it in. Because PDF is almost universal these days, I did the following:

  1. I scanned in the application and had the scanner software create PDF output.
  2. I posted the PDF onto the website.

That all worked well until one person asked if there were any way to fill in the fields in the PDF itself, instead of having someone print it off, and fill in the fields by hand.

After some research, I came up with the following method. It works for me but, as always, your mileage may vary……

  1. I scanned in the application as .tif files, one per page.
  2. I opened OpenOffice Writer and used the “Insert Picture” selection to input each of the two pages.
  3. Then, using the “Form Controls” toolbar, I dropped text boxes onto the application.
  4. After some fiddling around, I managed to resize the text boxes to an appropriate size for each field.
  5. There were several checkboxes on the original application and I used a checkbox control for these, dropping them on the application the same way.
  6. I then exported the document into PDF format.

When I opened the document in Adober Reader 7, it gave me the little bar that allowed me to highlight the fields. As I attempted to type in the first field, it gave me the typical warning about not being able to save my changes. I continued on and was able to print out a decent version of the application.

I hope this is helpful to anyone in the same position.

Apache, SSL and Self Signed Certificates

Thursday, February 23rd, 2006

From time to time I need to create a self-signed certificate for Apache and SSL. This is mostly for development and playing around and I don’t want to spend money purchasing a certificate for that.

The following is an excellent HOWTO on setting up a secure site with Apache, OpenSSL and a self-signed certificate……

Apache, SSL and Self Signed Certificates

It deals with Apache 1.3, but if you’re knowledgeable enough to know what an SSL certificate is and why you would want/need one, then you can probably figure out the little bit extra that you need to know to set it up for Apache 2.0. I did (wink, wink)