Tag Archives: tech

how i saved my windows xp installation with knoppix

so its true. the difference between a ‘digital native‘ and a ‘digital immigrant’ is the amount of information that they contribute to the world. I absolutely hate having to wade through google searches to find an answer to my problems, so I try to post here about some of my tech adventures (even though it might be nerdy) hoping that one day a spider would come and crawl/index it and provide answers to people for the same questions I couldn’t find answers to!

So I tried to upgrade the ATI Radeon drivers on my Windows machine for my old video card (thinking it would improve performance! hah! no.) but I could not get Direct3d to work for my ol’ Radeon 9500. After the 26 or so re-boots fiddling with the hardware, the hardware connections and the hardware drivers, something finally happened to my Windows XP OS partition. It got fried.

I tried to boot up, but after the BIOS loaded I would get the error:

Windows XP could not start because the following file is missing or corrupt: \WINDOWS\SYSTEM32\CONFIG\SYSTEM
You can try to repair this file by starting the Windows Setup program from original floppies or boot from CD-ROM.
Select 'r' at first screen to repair

I did searches all over the internets to fix my problem, that of a corrupt WindowsXP SYSTEM registry, which caused my XP installation to not boot. Microsoft has a whole knowledge base article about this exact issue! Well, thats fine… just load up your version of XP from a CD (or floppy) and hit ‘r’ to repair, just like it says. Wait, except I have a SATA drive… and there is no native SATA drivers for those on the Windows XP CD! So Windows XP install CD does not see a valid drive with Windows on it to repair!


I love this install of Windows, this drive has been with me since pre-Service Pack 1 days. Lots of tweaks (which caused the problem?) and lots of customization has made it unlike any other windows install I’ve used over the years. I wasn’t about to just re-image the drive after backing up the data.

So I gave Knoppix a try. For those that don’t know what it is, it is a Linux Live CD (meaning you run Linux from RAM and swap space) and supposedly contains lots of windows repair utilities. Booting it up, it had no problem seeing the SATA drives, booted into the OS and everything was fine. I was using the newest version, version 5.1.

I found the backup system registry ‘hive’ files at /System Volume Information/_restore/[Text String] and copied them to the desktop. Renamed them to be the operational one, but the Knoppix disk would not let me write back to the hard drive!

There is a problem with NTFS. The NTFS file system is a Microsoft proprietary OS whose protocols have been reverse engineered by the open source community. There are a couple different ways to make the NTFS formatted hard disk available.

mount -t ntfs /dev/hda1 /mnt/c

Which is the approximate default command in the /etc/fstabBut this command only allows the NTFS disk to be read, since the mount command (even with the -rw option) doesn’t allow NTFS partitions to be written to. Everywhere on the internets talks about this, that there could be problems with corruption if users were allowed to write directly to the file system using the mount command. So I couldn’t fix the registry hive this way.

So I went into alternate mounting techniques to allow the partition to be written to. Supposedly there is a program called CaptiveNFS (captive-ntfs) that is available on older versions of Knoppix, but wasn’t availiable on 5.1. So I downloaded Knoppix 3.6, only to find out that CaptiveNFS wasn’t supported any longer and did not work with Windows XP SP2. Shucks, again.

The problem, of course, was information overload.

Of course, Knoppix 5.1 came with utilities to write to an NTFS partition, it is noted as being the distro that allows users to recover windows partitions! There are two utilities: ntfschdsk, ntfsmount that do what I need: check the disk for corruption (and auto-correct things if it can) and mount the NTFS partition to write.

Running ntfschdsk I received:

CHKDSK is verifying indexes (stage 2 of 3)
Deleting index entry .DEFAULT in index $I30 od file 30.
73 percent completed.

So at least one entry was corrupt on the disk. Not a problem though, remount the partition with ntfsmount command. Then went into the previous registry save state and copied the following files DEFAULT, SAM, SECURITY, SOFTWARE, SYSTEM from /System Volume Information/_restore/[Text String] (where Text String is some naming auto-archiving naming convention) to the /windows/system32/config directory, overwriting the corrupted hive files.

Reboot the machine, the machine reads in the non-corrupted backup Registry Hives. Instant (instant being over the course of 3 days) success!

Hopefully, someone finds this post on the 5th page of google searches and finds what they need.

Originally written 12/10/2007 – finally posted 03/10/2008!

The Internets Is Scary Sometimes

Sometimes, you think that you are covered on the internets (all of them!), but then I get an email like this to my primary account:

As a courtesy, we are notifying you that XXXXXX users have found the following accounts for you:

   Flickr tmarthal on Flickr
   Digg tmarthal on Digg
   MySpace birddog on MySpace
   Picasa marthaler on Picasa

If you would like to make these accounts private, please
change the privacy settings on the original network and
XXXXXX will update its search results to reflect your changes.

To find your friends on XXXXXX, signup now.

I removed the company that sent the email, not sure that I want to encourage this type of email and account harvesting.

The point is, that someone, somewhere has correlated my different accounts on my various networks to my single email signon. Someone, somewhere knows my that the articles dugg on digg are associated with the pictures that I post on flikr! So, when I don’t post anything, they can check my pictures to find out what I was doing!

They missed twitter, delicious, slashdot, facebook and this blog though! And all of my troll accounts! Thats tood to know that there is some anonymity!

Spring Framework Sample Main Method

So my desk-mate* and I were having a conversation about an upcoming coding project, and he remarked how nice it was for someone, somewhere to post a complete sample on their blog for the spiders to index, so that he can find it. So I thought I would also, pay it forward and hopefully someone in like 2012 comes by and needs a sample main method using the spring spring framework for application level dependency injection.

Everyone out there seems to have used the MVC and deploying spring based apps in a web server WAR file. Except for this link: Levarage Spring Web development with Offspring. [Offtopic: it uses classes in the com.offspring.* package, like the band’s website!] It uses a simple bean file and a main method really close to the following snippet to instantiate (that’s my new favorite word) the application using the spring context**:

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.blogger.tmarthal.listener.SampleListenerInterface;

 * simple class showing the a listener interface
 * starting listening
public class simpleParserAndStorage
   * The spring context main method
   * @param args
  public static void main(String[] args)
    if (args.length != 1) {
      System.out.println("Usage: java parser.java ");

    String springContextFile = args[0];
    ApplicationContext context = new ClassPathXmlApplicationContext(springContextFile);

    // the listener just starts listening
    SampleListenerInterface listener = (SampleListenerInterface) context.getBean("listener");

Now, the wiring, or what sort of implementation is the SampleListenerInterface? This is where dependency injection comes in. Depending on the type of thing you are listening for (or what the example is doing) the implementation class is going to change. The main method is going to remain the same, the bean wiring takes place in the xml file, rather than in the application logic.



So, assuming that there is a Interface implementation of SampleListenerInterfaceImpl and SampleListenerHelperInterfaceImpl in the classpath, then the spring framework will call the listen method of the SampleListenerInterfaceImpl class!

Pretty neat. Hopefully someone, sometime stumbles upon this example trying to get into writing a non-WAR spring framework application, and this post will be helpful to them. I wish I found something like this first. 🙂

* no, not my office mate: we share a desk
** i know the code formatting sucks

I’ve got the whole internet in my hands

Following up the xkcd.com “comic”, a sweet idea to map the IP address range and their owners into a 2d map (where all adjacent values are grouped together), some bored people over at an email consulting company mapped out the IP addresses and activities using actual CAIDA ‘whois’ data in a scalable google map. CAIDA (The Cooperative Association for Internet Data Analysis) collected the data as seen in the huge png:


The scalable ‘google maps’ like viewing of the Hilbert Table is here:


I should be all Blog2.0 and post this as a trackback, but they don’t have the option.

It is pretty neat to take data that you normally don’t visualize, in this case the assigned DNS IP ranges of organizations and put them together in a way that can make the lay-person understand something new. In this case, you can see the companies that ‘formed’, or at least were the first to embrace, the internet and register whole top level domains! Meaning, of the 4-256 values in a typical IPv4 these companies have a whole first number to themselves.

For example, The Computer Science Corporation ‘CSC’ owns the whole 20.*.*.* address range. Crazy.

iphone news

What this post boils down to is $100 for 2 months of sweet iphone usage. =)

I can’t say that I’m disappointed, my $499 4GB iPhone purchase was a sunk cost, and I expected some ‘early adopter’ problems. I did not expect news that apple would cost them so aggressively so soon. Today apple released news that they are getting rid of the 4GB iphone models and dropping the price of the 8GB version to $399.

Pretty crazy. But the last two months were worth the hundo! We do throw them out of windows, you know.

And in a suprising move, jobs offers $100 credit back to early iPhone adopters! There is a first time for everything, I guess.

My First iPhone Problem and Post: Google Maps Hardlocking

I had been using my iPhone without a problem since I got it opening day, June 29th at the Manhattan Beach Apple Store. [Thanks fulk dog for waiting in line!] Everything was awesome; contacts, pictures, youtube, Safari integration, everything. No problem activating it, like others have reported.

I didn’t usually let people handle it, I’m crazy like that, because they would have no idea where to start. So I would show them around all of the features; usually open up my Boards of Canada video to display the screen, surf the contacts and show them how to put their number into the phone, and/or show them Safari and my friend Deward’s blog (since it looks super nice in the iPhone browser) depending on if I was on a wireless network or AT&T’s EDGE. Take a picture, show them some pictures from that bar crawl from mid-June. Normal things that you would do with an integrated device that bills itself as a revolution!

So, fast forward to last Saturday night. I let my friend’s sister borrow my iphone just to play around with everything. He is technically apt, so I thought he could navigate the menu with minimal advice (“Just hit the Home button to reset any interface.”). I was wrong. This was in Manhattan Beach, which has notoriously bad network coverage between Highland Ave. and the beach (due to the housing height and density, called “The Beach District”). He hands it back to me after like 5 minutes with “I think I broke it.” No problem I thought, he just couldn’t get back to the home screen. Well, that wasn’t the case.

The iPhone was stuck in the Google Maps application with the /Manhattan Beach, CAirvine/ text, which is an obvious mistyped search into the search bar of Google Maps. I’m not sure if it was the maps application or the lowsy EDGE connection, but it was frozen, half-dimmed with neither of the buttons working: holding down the Home key, or the On/Off toggle at the top did not seem to do anything**. Even plugging the phone into iTunes did not remove the lock. I had to do a Factory Reset via the iTunes interface to remove the Google Maps hardlocked screen. Sucks.

‘Cause after using the phone for 2 weeks, I already had multiple pictures, Wireless settings, and histories built up that were cleared. All of the pictures taken with the camera that were not emailed off the phone are lost, my long ass password for my WPA account had to be re-typed, and my Youtube and Safari bookmarks and history were gone. Luckily, it sync’ed my contacts and everything else. (installing gcaldemon now to test it out…)

I guess that is what you get when you are an early iphone adopter. It is worth it though. 😉

** Supposedly holding down both buttons at once will hardboot the iphone. 20/20 hindsight