Computers Music Windows

wav2wma – freeware console utility


I provide this Windows console utility that transcodes from WAV files to WMA files. By default it uses the voice codec from Windows Media Audio 9 with a very low bitrate to encode voice content but it is possible to use any other Windows Media Audio codec and with a higher bitrate.

When I tried it after having done the last changes it even turned out to be possible to use mp3 files as input which was not even intentional but might be interesting to know. Do remember, however, that you would in that case be transcoding between two potential lossy formats which is normally not a good thing.

Usage: wav2wma -s source -t target [-c codec] [-b bitrate]
       wav2wma -l

   -s source   Source WAV file
   -t target   Target WMA file
   -c codec    Preferred codec
   -b bitrate  Minimal bitrate [bps]
   -l          List all codecs on the system
   -?          Produces this help


This application is provided free of charge for personal use. If you like it I would appreciate if you would link to my web site (


Computers Gadgets

TomTom bluetooth issues on Qtek 9000

Users of the TomTom navigation solution may experience problem when trying to connect their PDAs to a non-supported bluetooth GPS receiver. At least I had huge problems when trying to get TomTom 5.21 on a Qtek 9000 (a.k.a. HTC Universal or the Jasjar) to connect to my Bluei GPS receiver. I had no issues in bonding the GPS receiver with the PDA but no matter how I tried I couldn't get TomTom to use the serial port provided by the bluetooth stack.

The problem is not that TomTom can't use the GPS. The problem is that TomTom is unable to list the Bluetooth serial port which means that the user is unable to select it. After much trials this is how I managed to do it.

First bind the GPS receiver to the PDA and add a serial port to it. I selected COM4 but you can use whatever port is available to you.

Then the GPS control panel applet must be enabled. The applet provides access to control the serial intermediate driver in Windows Mobile 5 which, for some reason, has been disabled by HTC.

Use any registry editor (I recommend PHM Registry Editor) on the PDA to set the value 0 (zero) to the key Hide in HKLM\ControlPanel\GPS Settings. If the GPS applet does not appear under Settings -> System, then restart your PDA to make the change take effect.

In the GPS applet you will find three tabs. The first tab ('Program') is the serial port which applications on your PDA will connect to in order to get GPS data. I selected COM8 but you can use another port as long as it is available. Under the second tab ('Hardware') you identify the serial port which the GPS is connected to; in other words the serial port selected in the bluetooth manager. The Bluei GPS receiver uses 4800 baud but your GPS receiver may differ so check your documentation. Finally, you will want to check the box under the third tab ('Access').

Once this is done, the serial port selected under the first tab ('Program') showed up in TomTom. The next problem was that TomTom seemed unable to open the serial port by itself. Other GPS applications, however, were able to use the bluetooth GPS and while they were running TomTom could also use the port. So, at this stage I had a clumsy workaround.

To avoid having to run multiple applications I then went back to the GPS applet and disabled the intermediate serial port support by unchecking the box on the third tab and instead changing the serial port setting in the Bluetooth manager to use the same port I had previously set for applications (COM8 in my case).

So much trouble just because the TomTom developers apparently can't enumerate serial ports properly.

Computers Photography Windows

Image resizer freeware


Every now and then I find myself in the situation where I want to resize images to a defined size. To speed up the workflow I have created this simple application that supports drag-and-drop resizing. Just drag an image file onto the application icon and the image will be resized according to the settings.

The application requires .NET Framework 2.0. There is no installer. Just put the executable file wherever you want.

If the application is launched by itself it present the setting dialog, shown below.


The bounding box is the largest possible image that will be the result of the operation. If the “crop to box” option is set, the source image will be cropped to leave an image of the exact size of the bounding box. If, on the other hand, the “fit within box” option is selected the image will be made as large as possible with retained aspect ratio and still fit within the bounding box. The bounding box can be of any size and the cropping, if required, will be done from the centre.

A watermark text can be added to the finished image by enabling the watermark option and typing a suitable string in the edit box. The font or position of the watermark text can not be changed.

Images can be saved to the same folder as the source image or to a defined target folder and will be given a suffix of “_resized”. The application will add extra numbers at the end to avoid overwriting existing files. If required, the metadata associated with the source image can be copied over to the resulting image.

To avoid having to keep the application on the desktop or somewhere else where it is readily available you can do the following:

  • Put the application (resizer.exe) anywhere you want on your hard drive
  • Right-click on any image file and select “Open with…” followed by “Choose program…”
  • Make sure the “Always use the selected program…” checkbox is unchecked and browse for the application file
  • Press OK

Windows will remember the application you selected for the jpeg files and will include the Resizer application on the “Open with…” submenu. The next time you want to resize a file you just have to pick the Resizer option from the “Open with…” submenu.

The resizing is done using bicubic with the highest quality setting. If I get around to it I will implement support for “unsharp mask”.


This application is provided free of charge for personal use. If you like it I would appreciate if you would link to my web site (


Just remove the EXE file and all registry settings under HKCU\Software\Bergek\Resizer.

If you added the application as a short cut under the right-click context menu you can remove the application in the registry under the key HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts \ .jpg \ OpenWithList. As always, be careful when editing the registry.


Computers Windows

IIS authentication freeware

Authenticator is an add-on filter to the Microsoft IIS web server that provides basic authentication against Microsoft Access, Microsoft SQL Server and MySQL Server data sources. This means that the standard client authentication dialogs can be used for authentication without requiring user licenses for accounts in Active Directory in Windows.

The filter has been tested successfully on:

  • Windows XP Professional
  • Windows 2000 Professional
  • Windows 2000 Server
  • Windows Server 2003


This application is provided free of charge for personal use. If you like it I would appreciate if you would link to my web site (


Add the database as a data source as a System DSN in the Data Sources (ODBC) applet in the Control Panel. Database templates are provided for Microsoft Access, Microsoft SQL Server and MySQL Server. Choose the one that suits your purposes the best and add suitable user accounts to the database (check below).

Install the filter on a web site in the IIS snap in and set the security settings on a virtual directory below the web site to disallow unauthenticated access and instead use basic authentication. Although the filter requires the username/password to be sent in clear text it is be possible to use it in conjunction with SSL to encrypt the data over the network. Set the RequireSSL registry value to true if you want to prevent cleartext passwords to be sent over the network. Also, set the realm; the text will be shown in the authentication dialog if supported by the client operating system.

When first loaded by IIS, the code will write default registry settings. Start regedit and make changes under HKLM \ Software \ Bergek \ Authenticator.

Note: As always, be careful when changing the registry as mistakes can, at worst, render the computer unbootable.

  • ConnectionString [SZ] – The connection string used to connect to the data source. In its simplest form it is just “DSN=Authenticator” (with Authenticator configured as the data source name in the control panel), although it can be formatted in various ways. The data source must be added as a System DSN since the user which will access it will most likely be the IUSR_{computer} account.
  • SqlStyle [DWORD] – Controls the SQL style used to query the ODBC data source. Possible values are 0:Microsoft SQL Server, 1:Microsoft Access and 2:MySQL Server. By default MySQL Server syntax is used.
  • RequireSSL [DWORD] – If set, the filter will return HTTP 401 Access denied if a request is made using non-encrypted HTTP. The HTTP 401 response is sent before the client has sent the user credentials which means that they will not be transmitted in cleartext form on the network.
  • MappedLogin [SZ] – A valid user name on the computer. Accesses against the virtual directory will be mapped against this user which must exist and be allowed to access the resource in the web application. The user name should be provided in the form {domain}\{login} but it can be {login} only if the default domain is set in the IIS snap in. If your computer is not in a domain you should write the account as {computer}\{login}
  • MappedPassword [SZ] – The password for the user account selected above. When the filter is first accessed this password will be encrypted and the encrypted version will replace whatever you type here.
  • LogSuccesses [DWORD] – If set to true (non-zero), authentication successes are written to the database.
  • LogFailures [DWORD] – If set to true (non-zero), authentication failures are written to the database.

After having changed the registry settings access requests to the protected web application folder will be matched against the database and IIS will use the mapped user account for all access.

Database settings

Two things must be added to the database in order for a user to be allowed access. First of all a user account must be created in the 'users' table:

  • Login: The login name of the user
  • Password: The password (in clear text) for the login account
  • Enabled: Must be set to true (1)
  • Expires: If set to false (0) the account does not expire
  • Expiration: Determines the expiration time for the account. Only used if Expires is set to true (1)
  • Administrator: Not currently used

In addition to the account itself site, directory permissions must be set for the user. This is done in the 'permissions' table:

  • UserID: The ID of the user in the 'users' table
  • SitePrefix: The IIS instance metapath for the site. For the first site on the system this is typically /LM/W3SVC/1
  • PathPrefix: The URL path prefix for which the user should be granted access (e.g. /secret)

The PathPrefix can be used to allow access only to certain areas of the web site. To give access to the entire site the PathPrefix should be set to a single slash ('/').


Error in the ISAPI filter are most frequently related to the connection between the filter DLL and the database. Please make sure that the latest versions of relevant ODBC drivers are installed on your computer and check the database connection in the Data Sources (ODBC) applet in the Control Panel. Errors are logged to the system event log. Incorrect account information for the mapped account is not shown by the filter but might be logged by the web server or by the system itself.

Errors could also be the result of the account running the web server not having sufficient permission to update the relevant registry keys under HKLM\Software\Bergek\Authenticator.


Remove the ISAPI filter from the IIS snap-in. Restart IIS and then remove the DLL, database ODBC DSN and the registry key HKLM \ Software \ Bergek \ Authenticator.

If you are unable to remove the DLL file, please make sure that the filter has been removed from within the IIS snapin and that the event viewer is not running.


Computers Gadgets

First impressions of Lacie Rugged All-Terrain


After hearing about friends having their computers stolen and losing precious data I finally got around and purchased a new external backup disk, settling on a Lacie Rugged All-Terrain 80GB. DVD backups worked fine until last year when I purchased a Canon EOS 20D and decided to shoot in raw format. Now, instead of having a few GB of data per year to backup I find myself with some 50GB.

I have tried a large number of bus powered USB drives but none of them seemed to work without extra power via a second USB cable. I was happy to notice that the Lacie Rugged All-Terrain 80GB could do with just the power supplied from the USB port on my Shuttle SN95G5v3. It is worth noticing that I also have a Lacie Mobile hard drive from late 2004 which does require extra power when connecting it to the same Shuttle PC. It seems, thus, that this rugged drive requires less power than the older drive but it is uncertain whether newer drives of the Porsche designed series require as much power.

On the negative side I was a little surprised to note the flimsy orange protection around the edges. Contrary to what I thought after having seen images on the Internet, the protective cover is just slipped over the drive. It would feel more solid if Lacie were to at least glue it together.

As would be expected, the drive is quite silent and the sound is barely noticeable. When making an initial backup of 50GB of data I saw a sustained throughput of 12 MB/s.

In short, this external USB drive does what it says. But I would like it better if the orange protector was attached more firmly to the drive itself.

Computers Linux Windows

Linux screen resolution issues in Virtual PC

Virtual PC is great for setting up testbeds but the support for Linux is less than optimal. When installing standard Linux distributions under Virtual PC it may be impossible to set the resolution to anything higher than 800×600 or even to get any image at all.

Edit the sections for Monitor, Device and Screen in the file /etc/X11/xorg.conf to look like this:

Section "Monitor"
    Identifier  "Monitor0"     VendorName  "Monitor Vendor"     ModelName    "General Laptop Display Panel 1280x768"     HorizSync    31.5 - 90.0     VertRefresh  59.0 - 75.0     Option     "dpms" EndSection
Section "Device"
    Identifier  "Videocard0"
    Driver      "vesa"
    VendorName  "Videocard vendor"
    BoardName   "VESA driver (generic)"
    VideoRam    8192
Section "Screen"
    Identifier "Screen0"
    Device     "Videocard0"
    Monitor    "Monitor0"
    DefaultDepth     16
    SubSection "Display"
        Viewport   0 0
        Depth     16
        Modes    "1280x768" "1024x768" "800x600" "640x480"

The above works for Fedora Core 5 under Virtual PC 5.3.582.27. If you are unable to get any image then boot from the rescue CD and use 'nano' or 'vi' to edit the file.

Computers Windows


UsbAutorun is an application that enables autostarting of applications upon insertion of USB memory cards in Windows. Autostarting of applications when inserting new media is generally used for CDs and triggered by a file called autorun.inf in the root of the disk. This function is not supported for USB memories in the base OS although Windows XP sp2 introduced some support for it.

This application is provided as-is and is free for any use provided that it is not resold or included in any commercial offering.


To install this application:

  1. Extract the application (UsbAutorun.exe) to your disk.
    Open a command promt window and change directory to where the application was extracted
  2. Type usbautorun /install
  3. Type usbautorun /password {password} (with a password of sufficiently high entropy)
  4. Type usbautorun


As long as the application is running it will react on device insertions and use the autorun.inf file in the root of the USB memory to start any application indicated in the file. The autorun.inf file needs to have a new segment named UsbAutoRun which gives details on what to do when the USB memory is inserted. It also provides a password which must match the password configured in the computer itself. If the passwords don't match, the application will silently disregard the insertion of the USB memory. Below is an example of an autorun.inf file.



Running usbautorun /install writes data to the registry at HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Run to make the application autostart when the current user is logged on. After it is installed the application must not be moved as the path is written to the registry. For more information on command line parameters, type usbautorun -? at the command promt.

Note: Is is highly recommended to use a password as the ability to run an application on the computer just by inserting a USB memory card otherwise may be misused as a way to spread viruses.


Computers Gadgets

Misbehaving Netgear WGPS606

To avoid having to run cables I have used a Netgear WGPS606 to wirelessly connect computers on my desktop with my broadband connection. When checking the log files on my Linux box I noticed that the Netgear unit was causing my log to fill up with DHCPDISCOVER/DHCPOFFER:

Jun 20 23:21:21 xxx dhcpd: DHCPDISCOVER from <mac>(WGPS606) via eth0
Jun 20 23:21:21 xxx dhcpd: DHCPOFFER on to <mac>(WGPS606) via eth0
Jun 20 23:21:41 xxx dhcpd: DHCPDISCOVER from <mac> (WGPS606) via eth0
Jun 20 23:21:41 xxx dhcpd: DHCPOFFER on to <mac> (WGPS606) via eth0
Jun 20 23:22:01 xxx dhcpd: DHCPDISCOVER from <mac> (WGPS606) via eth0
Jun 20 23:22:01 xxx dhcpd: DHCPOFFER on to <mac> (WGPS606) via eth0

It is all very strange since the MAC address for which the DHCP discover is sent is the wireless NIC. But the wireless NIC has a static IP address and should not need to request a DHCP address in the first place. Furthemore, the DHCP server is on the LAN side of the Netgear box.

Netgear support has been unable to assist so in the end I had to blacklist the WGSP606 using the following few lines in dhcpd.conf:

host wgps606 {
        hardware ethernet <mac>;
        ignore booting;
        ignore bootp;

Apart from this the WGPS606 has been doing a great job for now almost a year.

Computers Windows

How to save a Real audio stream using only freeware

On more than one occassion I have found myself with a need to save a Real audio stream from a web site. Each time I have had to browse through multiple web sites to find a working solution. This is how I managed to do it last time around.

  1. Download and install FlashGet (
  2. Copy audio stream URL (ending with .ram) from the web browser
  3. Create a new download in FlashGet using the URL taken from the previous step
  4. Run the download job to get the Real audio file
  5. Download and install Switch (
  6. Use Switch to convert the Real audio file to the desired format

If required, use an application such as Mp3splt ( to split the file into manageable parts.

All of the above applications are free to download and use.

Computers Windows


SimpleSocket is a COM DLL server that wraps basic UDP send/receive functionality. It is quite simple to use from all major Windows programming environments (C++, C#, VB, VBScript etc).

This application is provided as-is and is free for any use provided that it is not resold or included in any commercial offering.

The DLL must be registered prior to use. Although this can be done in many ways, one simple way is:

  1. Extract the File SimpleSocket.dll to a suitable folder
  2. Press the start button and select “Run…”
  3. Type cmd and press OK
  4. Type regsvr32 followed by the full path to the DLL

Although the exact usage varies depending on programming environment, the following sample should be able to serve as a guide. It includes a sending and a receiving application. Put each of these code segments in a file with the suffix .vbs, then run them both.


Set socket=WScript.CreateObject("SimpleSocket.Udp", "event_")
Sub event_OnReceive(data)
    WScript.Echo "Received: " & data
End Sub

socket.Listen "", 10000


Set socket=WScript.CreateObject("SimpleSocket.Udp")
socket.Send "", 10000, "Data sent from the client"


The following methods are supported

  • Listen {ip}, {port} – Starts listening for incoming data on the ip and port.
  • Abort – Stops listening for data.
  • Send {ip}, {port}, {data} – Sends the data to the peer using the ip and port. The data must be provided in text format.
  • OnReceive – Callback method for asynchronous notification of incoming data.


  1. Press the start button and select “Run…”
  2. Type cmd and press OK
  3. Type regsvr32 -u followed by the full path to the DLL