VHD Attach 1.50 (Beta 1)

Illustration

It has been a while since I released VHD Attach. It worked perfectly for me and, judging from comments on Internet, for quite a few other people.

One thing that gave me most grief is necessity of going through UAC prompts. This beta sorts that limitation by having service do dirty work. To make long story short, it works without acknowledging every action.

Beta can be downloaded here. Final version follows in a month or two.

Mobile BackgroundWorker

One of things that annoy me on .NET Compact Framework is lack of BackgroundWorker component that is available in full .NET Framework.

While some could argue that processors are weak and memory is sparse and thus all threading should be avoided as much as possible, I tend to disagree. If nothing else, you should use background thread every time you make a long query to database or any other action that will keep user in dark for more that a second or two.

Without further ado, here is my BackgroundWorker class. It shares syntax with Microsoft’s component so you should feel like at home. It is available for download here.

It should work on Windows Mobile 5, 6 and 6.5 (and probably above).

How to Replace Broken Screen on HTC S740

Illustration

Due to “careful” behavior toward my HTC S740, screen was broken and I needed to replace it. First step was ordering new screen from eBay.

There is quite a few replacement screens available so that should not be a problem. If you do not have tools be sure to get one with free tools included (case opener, T4 and small Phillips-head screwdriver). Although there are quite a few sets with triangle shaped case opener, I personally went for thin and flat opening tool. It makes job much easier.

Take off battery cover, battery, unscrew four T4 screws behind keyboard and then use case opener tool. Jam it on top ridge of keyboard and circle around it gently. This is probably most difficult part since keyboard will keep sliding back inside.

Disconnect two ZIF cables (top-left and bottom-right) and one antenna cable (bottom-left) from board and gently pull up board. It is held by four pieces of plastic and there is another flat cable behind so be very gentle. Pull backside flat cable out of it’s socket and put whole module on side.

There are four Phillips screws holding keyboard and screen part together. Unscrew them and you will be able to put them apart. This will give you access to screen’s part of assembly.

It is held together by five little T4 screws and one Phillips screw (behind keyboard slider mechanism). Once you unscrew them and open case with case opener, you should arrive to same situation as depicted on picture above.

Illustration

What you see is metal shield behind yet another four Phillips screws. Once you unscrew it, just pull out metal shield (take care of flat cable and button connector above). Camera and volume buttons will fall out itself - just do not lose them. Little bit of stronger tap on the back of screen should be enough to kick it on phone’s front side (notice yet another flat cable). Throughly clean points where screen was held by tape (all of it should be gone).

I could have used double-side adhesive tape to glue new screen in same place, but I opted for cyanoacrylate instead. Put a drop of it at four red-dotted locations and quickly put screen on it. Hold it together for minute or so in order to allow enough time for glue to activate.

After you are sure that everything is as it should be (watch keyboard alignment and tryout all keys), just put everything back in same order.

[2010-03-04: General clean-up of text.]

[2010-03-14: You can now download all pictures I took. Unfortunately they are not step-by-step instructions but they might prove to be useful.]

DNS Problems With FreeNAS

Illustration

It may come as a surprise to quite a few guys that know me, but I use FreeNAS as my main file server. I used version 0.6 for quite a while but I switched to 0.7 few weeks ago.

At one point in time I noticed that one of my scripts is not working anymore. That script checked my external IP address and displayed it on character LCD. I could not say when exactly it stopped working since I didn’t checked it for a while.

Little bit of digging discovered that I had problems with host name resolving:

host ^^example.dyndns.org^^
0.0.0.0 connect: Address family not supported by protocol family
0.0.0.0 connect: Address family not supported by protocol family
example.dyndns.org A record not found, try again

Then I remembered. Few days after upgrading server to new FreeNAS edition, I also changed configuration from DHCP to static IP. That meant that DNS servers were not set anymore. All I needed to do is to manually set DNS addresses and script would be working once more.

Only problem - no manual setting of DNS is available. Since I know a thing-or-two about command line interface, I went to add missing entries to /etc/resolv.conf from there. Unfortunately, that file gets overwritten after every reboot.

Since I didn’t want to depend on power grid to keep my server alive, I devised a cunning plan. If you go into System -> Advanced menu, there is option to set commands to be executed after every reboot. I just added new postinit command:

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

That line just appended DNS server definition to file. Once that line is there, all DNS resolving works once more.

Problem solved.

P.S. After all this effort, I found place where DNS can be setup in more user friendly manner. To my surprise it is under System -> General menu.