Troubleshooting AIM/ICQ connectivity issues

April 26, 2008

Lately I’ve been having connectivity issues on both AIM and ICQ. (I couldn’t remember the last time I was actually logged on.) If you don’t care about the debugging story, skip to the conclusions below.

Read the rest of this entry »

What to do?

March 22, 2008

Okay, the reason I haven’t posted in a long while is that it’s incredibly inconvenient.

Any suggestions on how to make WordPress friendlier, or on which is the best code-blogging platform?

How to create a big FAT32 partition

October 4, 2007

(Well, this is at least one way to do it… I’m sure there are easier and faster ways.)

Windows XP and up doesn’t let you create a FAT32 partition that’s bigger than 32GB. It can handle them, but not create them.
One obvious way to do it, is… use Linux.

  1. Install Linux in VMware. I used Slackware 12.0 on VMware Workstation 5.5.5.
  2. Add a physical hard disk that uses the disk you’d like to partition. To figure out the exact disk number (i.e. PhysicalDisk5), use diskmgmt.msc.
  3. If you don’t have patience to figure out how to make SCSI work in Linux (as I didn’t), change the disk to an IDE disk:
    • Close VMware and edit the .vmx and .vmdk files manually (with Notepad or any other editor).
    • In the .vmx file, remove the line scsi0.present = “TRUE”
    • In the .vmx file, change any occurrence of scsi0:0 to ide1:1 (this will make the disk IDE Secondary Slave – make sure you have a Secondary Master).
    • In the .vmdk file, change the line ddb.adapterType = “lsilogic” to ddb.adapterType = “ide”
  4. Boot into Linux and login as root.
  5. Run fdisk /dev/hdd (this assumes your HD is IDE Secondary Slave; otherwise, use the correct device name).
  6. Press p to list partitions; delete them all by repeatedly using d; create one partition spanning the whole disk by pressing n and using the default for each question.
  7. Change the type to FAT32 by pressing t, and for the partition type hex code, enter c
  8. Make sure you did nothing wrong, and press w to write the partition table to the disk. This is irreversible!
  9. Back in the root prompt, format the new FAT32 partition by using: mkdosfs -F 32 /dev/hdd1

That’s it – you now have a big FAT32 partition. Make sure you don’t mount it in both Windows and Linux at the same time, because they won’t be sync’ed. (To unmount in Windows, choose “Change Drive Letter and Paths” in diskmgmt.msc, and remove all drive letters and NTFS mount points.)

“Save” and “Save As” don’t do the same thing in Microsoft’s “Orca”

August 4, 2007

“Orca” is an editor for MSI files that comes with the Microsoft Windows Installer SDK.

Some program wouldn’t install on my system, claiming it can’t run on “Server” editions of Windows.
I edited the MSI file with Orca to remove the offending condition. I used File -> Save As to save the edited MSI under a different filename.

When I ran the installer again, it skipped the “Bad Windows edition” message, and instead gave me a worse error: “Error 2356”.
Digging in the SDK revealed the matching error message: “Could not locate cabinet in stream: [2].”

After a while of searching for the possible cause, I uncovered this in the Orca help, under “Special Considerations when editing Databases”:

Embedded Streams and Storages
When a database is saved using the Save As… or Save Transformed As… command, embedded binary streams (such as embedded cabinet files) are not saved to the new database unless they are part of a data row. Embedded sub-storages (nested install files) are never saved to the new database.

The solution? Make a renamed copy of the original MSI, edit with Orca, and save using File -> Save.

crc32 in Python

July 10, 2007
from zlib import crc32

In debug and log messages, put the data at the end, not the middle.

May 27, 2007

In messages where a big string may be inserted, prefer “something something %s” over “something %s something”.

In this example, %s is a long hex-string representing an array’s contents.


[DECODE] [DEBUG] Was passed array ‘%s’ for processing


[DECODE] [DEBUG] Was passed array for processing: ‘%s’


[DECODE] [DEBUG] Function myDecodeFunc called with myArray = ‘%s’

Windows features you didn’t know existed: start /b and start /priority

May 12, 2007

In popular Unix/Linux shells, there is an option to start a process in the “background” by (i.e. in bash) typing “./something &“, or pressing Ctrl-Z and then “bg“. The process then prints its output to stdout as usual, but the bash runs in the foreground and receives console stdin.

In Windows, something similar (much less powerful than the bash “jobs”, though) can be done by doing: start /b something

Read the rest of this entry »

Python: Why to assign functions’ return values to dummy variables

May 12, 2007

In response to Kototama’s comment in the previous post:

There is a need, when running directly under the interpreter (code placed in the global namespace, not inside a function or method), to assign the return value of any function to a dummy variable.

Read the rest of this entry »

data: URI

May 11, 2007

(None of this works in IE – use Firefox.)

The data: URI is a type of URI that contains the data that is returned, in the URI itself.
Read the rest of this entry »

RealtimeCmd – hotkey for running cmd.exe in realtime priority

May 5, 2007

Sometimes your system hangs because some process enters a busy-loop that does evil things, like allocating huge amounts of memory and causing the swapfile manager to make Windows crawl. In those cases it would be nice to have something that runs in high priority that can kill the offending process. Microsoft addressed this by running winlogon.exe and taskmgr.exe in “High” priority, but that’s just not enough…

Read the rest of this entry »