December 24, 2008

Windows XP Setup from DOS ("cannot find file")

I had a strange issue today, a blast from the past in fact—trying to install Windows from DOS. Strange situation, I am basically about to replace my parents computer and wanted to re-install Windows on the old computer so I could give it away whilst still being ‘usable’.

Back in the day I made a Ghost image of the computer with a freshly installed Windows XP installation (with SP1 at the time maybe and drivers??) however on restoration of image I get an error message three-quarters of the way through saying something about unexpected end of file. Whatever it was it was annoying. Unfortunately the Windows XP disc is far away (in another country in fact) and the only thing I have is couple of DOS boot disks and the I386 directory (containing installation files) that I rescued before I started this procedure.

So I burnt the I386 directory to a blank CD (from my work laptop) and booted up with the DOS boot disk (basically a boot disk made from either one of the later Windows 95 versions or Windows 98. Whatever, it supported FAT32). Now with my hard disk formatted I tried to run setup (WINNT.EXE) from the CD, but unfortunately I ran into issues; the set-up program complained that it couldn’t find files such "disk1" or "hal.dll".

A quick search on the net brought nothing. So I tried a few more combinations such as copying files to the hard disk and re-running setup. Again, to no avail.

I then re-ran setup and noticed that it read a file called DOSNET.INF. According to a Microsoft TechNet article here, DOSNET.INF contains a list of files to copy that are needed for setup. Back on my work computer I opened the file and noticed an interesting entry under the Directories section. Mine said "d1 = \I386". Further down the file you’ll notice "d1" is mentioned against every file.

[Directories]
d1 = \I386

....

[FloppyFiles.0]
d1,disk1,disk101
d1,ntdetect.com

This didn't seem right so I modified DOSNET.INF so that it read "d1 = \". Personally instead of re-writing another CD with a modified DOSNET.INF file, I copied the I386 files to the hard disk and modified DOSNET.INF there. This worked but as I didn't copy the sub directories set up complained much later on that it couldn’t find ASMS (which one of the subdirectories is named after), but I shoved the CD back in and it worked.

July 19, 2008

Geotagging photos in iPhoto (Mac)

For a while now I've been geotagging parts of my photo collection in preparation for Google's Panormaio site so that they appear in Google Earth. However it's always been a rather complex process--thankfully I don't do it so often! However the most recent time I did this (actually this week), I came across a nice piece of software from Craig Stanton called Geotagger--an easy to use retrospective geotagging app that's for free!
  1. Essentially after running Geotagger;
  2. start Google Earth and centre the map on the location with which you want to associate with your photo(s);
  3. then drag the respective photo(s) from iPhoto (or anywhere for that matter) onto the Geotagger icon in the dock.
You can confirm that the photo is now geotagged by opening the photo in Preview and selecting Tools, Inspector. Mapping the photos with Google Earth can be tricky so you should also download a set of cross hairs courtesy of Stefan Green.

April 02, 2008

Converting CDs to iTunes Audiobooks

In an on-going effort to learn German, I bought a German audio book on CD the other day (a 'Hörbuch'!). However I have no way to listen to CDs on the move (since my discman broke down sometime in the 90s). Anyway, I imported it into iTunes and as expected it appeared as regular music files (within the iTunes Library) and not as an iTunes Audiobook. This is a problem if you're wanting iTunes or your iPod to remember where you're up to within the track after you have switched to your a music playlist or Podcast or whatever. I won't detail it here as a quick search on the net reveals loads of step-by-step instructions on how to do this, but essentially it's just a case of:
1. importing the audio CD into iTunes using the default AAC codec;
2. locating audio files on disk and then renaming the extensions from .m4a to .m4b;
3. and finally re-import the audio files into iTunes (after deleting the original pointers of course).
It seems there's just two main questions to answer; (a) what bit rate to use; and (b) whether or not to join the CD tracks before import. Personally my audio book had music in it, so I opted for a slightly higher (than the consensus) value of 32 kbps.

Update #1: Check out Michael Alderete's blog for info on Optimal iTunes Import Settings for Audiobooks: http://aldoblog.com/audiobooks/itunes/import-settings/

March 05, 2008

Remove DRM from BBC iPlayer downloads

I started using the BBC iPlayer service recently and I must say I'm pretty impressed. The BBC have put a good selection of programmes on their site and the quality is good. You can either stream or download programmes for watching later. The download feature uses Microsoft DRM (and so is only compatible with Windows) and once downloaded content expires after 30 days for unopened content (i.e. not played yet) and usually 7 days for opened content.

I guess they mainly use DRM to ensure expiry of content. After all, DVD sales may go down if users were able to keep shows for ever. Additionally the pirate kings out there will download every episode and burn it onto disc or put it up on some torrent site, therefore eating further into DVD sales. Fair enough.

The problem I have is that I would like watch downloaded content on my daily commute. The only way I could do this would be to install the BBC iPlayer software on my work PC which I can't (I'm forbidden). I heard somewhere that the BBC were looking at providing downloadable, expirable content within the iTunes Store similar to the way the new iTunes Store movie rental service works in the US. This would be good as I use iTunes at the moment and it would give me an excuse to buy an iPod Touch and watch EastEnders on the train (that's a joke, I don't really like EastEnders).

Currently the UK iTunes Store allows you to buy (not rent) individual episodes for no more than a couple of quid (£1.89 I think it is) however I don't like the idea that you're tied to iTunes once you own the content (who knows what will happen in the future especially in my heterogeneous OS environment). Contrary to my previous statement though, I don't mind being tied to iTunes for expirable content as I will be using iTunes for the foreseeable future.

Anyway for the moment the only way to watch downloadable content on another device seems to be to remove DRM.

Removing DRM

A couple of utilities you'll need include drmdbg for extracting the DRM licence keys from your system and FreeMe2 that you'll use together with the extracted keys to remove the actual DRM from the WMV file.

1. Once you have some downloaded content in iPlayer, close iPlayer completely and navigate to iPlayer's deliveries folder. In most cases this will be:

C:\Documents and Settings\All Users\Documents\My Videos\My Deliveries\iplayer_live

2. Move (or copy) downloaded media files (suffixed with '_DOWNLOAD.WMV') into an empty folder. If you did 'move' (as apposed to copy), then you'll probably want to delete any files with the '_DOWNLOAD.SMI' suffix too.

3. Copy drmdbg.exe and FreeMe2.exe into this new folder and then double-click on drmdbg.exe. In most cases after a few moments your individualisation key (like the one below) should be displayed in the top text box.

C:\Documents and Settings\All Users\DRM\Cache\Indiv01.key v11.0.6000.7000

4. Click Multi Scan and Windows Media Player should spawn (if not you may have to play the content manually). The keys will then start being displayed in the bottom text box. Once complete, close drmdbg.

5. If everything went well it should have created new subfolder named DRM2. Move the file DRM2.key within that folder to the current folder and then within Windows Explorer drag each WMV file onto FreeMe2.exe. A command box should display a progress bar similar to the one below. If you see a prompt like "Enter IBX private key or hit enter" then something went wrong with the key extraction process by drmdbg--try another WMV file to see if that works at least.

|###############              | 50%

6. That's it, your new DRM-free files will prefix 'freed-' in the filename.

Update #1 [19 July 2008]: This procedure no longer works! Seems later patches from Microsoft have plugged this hole!

January 25, 2008

Using a Logitech QuickCam Pro 3000 with ZoneMinder

Okay, so I got ZoneMinder installed. Now I want to play with it. I recently purchased an XBox 360 webcam for use with my Mac, but I thought that was a little too good for this. However I did have a Logitech QuickCam Pro 3000 lying around. I remember having to download the drivers for this camera under Windows, so it would be fair to say I had low expectations in getting this working under Linux. In fact quite the opposite--it works very well indeed. As soon as I plugged it in it showed in /var/log/messages. There's even a utility that sets the various options of the QuickCam's Philips chipset called http://www.vanheusden.com/setpwc/ written by Folkert van Heusden.

After plugging it in, the first thing I did was try and find out what settings I needed to have in ZoneMinder. After installing setpwc, it was fairly easy to find out what I needed. There is even a setpwc Debian package that can just be installed via apt-get. However for me this version was 1.1 and the latest as of January 2008 is 1.23. The obvious difference between the two is that with the latest version you can set the resolution. However just to find out the settings for ZoneMinder, 1.1 will do.

These are the settings I used initially in ZoneMinder. You can get to this area just by clicking Add New Monitor on the console page of ZoneMinder (i.e. http://yoursever/zm/) and then clicking on the Source tab:

Device Path: /dev/video0
Device Channel: 0
Device Format: AUTO
Capture Palette: YUV420P
Capture Width: 320
Capture Height: 240
Preserve Aspect Ratio: Unchecked
Orientation: Normal

I knew the device was located on /dev/video0 as that's what was reported in /log/var/messages. You'll have to check the correct device path your camera. Once I clicked Save and returned back to the ZM Console page, I clicked on what I named the source, in my case Cam1 and it worked--I saw the image! It seems that if everything went okay, the source field for the respective camera will turn orange, otherwise red.

Okay, my camera supports 640x480. I used the latest version of setpwc to set the resolution and then edited the source settings to set the correct capture height and width, but once I did that the source field for the camera on the ZM console turned red and I wasn't able to see an image. A few more Google searches and reading ZoneMinder's installation instructions correctly, it seems you have to increase the amount of shared memory. This can be done instantly by issuing the following command:

# echo 134217728 >/proc/sys/kernel/shmall && echo 134217728 >/proc/sys/kernel/shmmax

However upon reboot, this will need to be done again so it's best to edit /etc/sysctl.conf to add kernel.shmmax = 134217728. You can quickly do this by issuing:

# echo kernel.shmmax = 134217728 >> /etc/sysctl.conf

That's it. Job done, camera working.

January 24, 2008

Installing ZoneMinder 1.23 under Debian 4.0r2 Etch

ZoneMinder is an open source CCTV application for Linux. A friend of mine first showed it off to me on his Ubuntu system and since having my own dedicated Linux box and a spare webcam lying around, I decided to install it.

The installation requires a basic LAMP installation and a few Perl modules. I have Debian 4.0r2 Etch with already Apache2, MySQL 5 and PHP4 installed. I started with the following guide on ZoneMinder's website: http://www.zoneminder.com/wiki/index.php/Yadig

Installation was easy to follow except when I came to compile and had a couple of issues locating the correct Perl modules. The guide is written for slightly older versions of everything I had installed. Essentially the only module that seems to not be available from Etch's main repositories was PHP::Serialization. After several unsuccessful hunts on Google, I came across the following CPAN site: http://search.cpan.org/~jbrown/PHP-Serialization-0.27/. This is what I wanted, I downloaded, compiled and installed it and was then able to continue the rest of the ZoneMinder installation.

Step-by-Step installation

1. Run apt-get install with with the required packages. I also accepted any recommended packages by apt-get:

# apt-get install apache2 mysql-server libmysqlclient15-dev php4 php4-mysql g++ make netpbm libssl-dev libjpeg62-dev libmime-perl libwww-perl libarchive-tar-perl libdate-manip-perl libarchive-zip-perl libmime-lite-perl libdbi-perl libdbd-mysql-perl libpcre3-dev

2. Download, compile and install the PHP::Serialization module:

# cd /usr/local/src/
# wget
http://search.cpan.org/CPAN/authors/id/J/JB/JBROWN/php-serialization/PHP-Serialization-0.27.tar.gz
# tar -xzvf PHP-Serialization-0.27.tar.gz
# cd PHP-Serialization-0.27
# perl Makefile.PL
# make
# make test
# make install

3. Download, compile and install ZoneMinder:

# cd /usr/local/src/
# wget
http://www2.zoneminder.com/downloads/ZoneMinder-1.23.1.tar.gz
# tar -xzvf ZoneMinder-1.23.1.tar.gz
# cd ZoneMinder-1.23.1
# ./configure --with-webdir=/var/www/zm --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data
# mysql -u root -p < db/zm_create.sql
# mysql -u root -p
mysql> grant select,insert,update,delete on zm.* to
'zmuser'@localhost identified by 'zmpass'; quit;
# make install

4. Create a Debian init.d script as per instructions here and then restart Apache, MySQL and ZoneMinder:

# /etc/init.d/apache2 restart
# /etc/init.d/mysql restart
# /etc/init.d/zm restart

6. Connect to http://yourserver/zm/ and modify the following two parameters:

  • Under Options, System, set ZM_AUTH_RELAY to none.
  • Under Options, Paths, set ZM_PATH_ZMS to /cgi-bin/zms

7. That's it! Just connect your camera and configure!

Update #1: As mentioned on ZoneMinder's Wiki, you should also increase the amount of shared memory, especially if your camera supports 640x480 as it probably won't be possible to use it at higher resolutions until you've done this. If you do have issues getting 640x480, you can instantly test this by issuing the following command and restarting ZoneMinder:

# echo 134217728 >/proc/sys/kernel/shmall && echo 134217728 >/proc/sys/kernel/shmmax

However upon reboot, this will need to be done again so it's best to edit /etc/sysctl.conf to add kernel.shmmax = 134217728. You can quickly do this by issuing:

# echo kernel.shmmax = 134217728 >> /etc/sysctl.conf

January 12, 2008

Resetting the BIOS Password on a HP/Compaq Evo D510

So I finally gave up running Linux on my Playstation 2. The distribution was old and getting things compiled and running proved problematic--especially with MySQL. I was actually looking at buying one of these: http://www.linutop.com/ -- a nice self contained Linux box that uses very little power. However by the time you add postage and import duty, it can turn out to be quite expensive. Anyway I found a guy selling a load of Compaq D510 Ultra Slim desktops on Ebay for around 100 euros. Apparantly they'd only been used for around 20 hours ;-). I clicked Buy it Now and picked up the machine that weekend. I did get a list of passwords however the BIOS password proved incorrect and the seller didn't know the correct one.

Normally it's not a problem cases like this since the advent of the Internet. You'd expect a few keywords like 'compaq', 'd510', 'bios', 'reset' in the Google search bar would do the trick, however it took me slightly longer than expected so I decided to blog it (hopefully saving you some time!).

In a nutshell, locate the jumper labelled PASSWORD JMP on the motherboard (see image--it's between the PSU and the hard disk) and remove it. Power up the machine once without the jumper and then power it down again before replacing the jumper--the BIOS password should now be cleared. Easy.