Archive for the ‘Uncategorized’ Category

I still have a perfectly working Windows Mobile PDA-phone. I use a program called PIM Backup to make backups of the databases such as calls, SMSes (text messages), contacts, calendar, …. The program can generate either a binary backup, or a more readable backup. I use the latter one, so I could unpack the backup on my desktop computer and use it as an archive. The generated backup files have a .pib extension. The file itself is a ZIP-file containing the different parts of the backup (calls, contacts, …) as separate files.

Continue reading ‘PIM Backup format reverse engineered’ »

Sometimes it’s really useful to prepend a timestamp to every output line of a command. This can be done fairly easily:

$command | \
perl -pe '@now=localtime();printf "%04d-%02d-%02dT%02d:%02d:%02d ",$now[5]+1900,$now[4]+1,$now[3],$now[2],$now[1],$now[0];'

The perl command reads in every line, prints the current time in the default format (or in whatever format you specify), followed by the read line.

I sometimes pipe a command to less to study it’s output. If it’s interesting enough, I re-run the command and redirect the output to file. This approach has some limitations: the command is run twice, possibly with different output.

Obviously, I should use tee to send the output to both less and the file, but I regularly forget this. That where this hint comes in: you can save the current less-buffer to file!

In short, to save the buffer that is being displayed by a session of `less’, use its pipe-to-shell-command capability by scrolling to the top of the file and press `|’ followed by `$’ as well as entering `tee DESTINATION_FILE’ when prompted for the shell command.

Fifefox has a very convenient auto-complete function when filling in forms and logins. Very convenient, until you somehow manage to mistype one of the fields (obviously, you never ever mistype, but some people do…). This mistake haunted me for long enough to get me motivated to solve it.

Apparently, the solution is very straightforward: just highlight the “wrong” value in the drop-down and hit Shift+delete to get rid of it.

Google is my favorite search engine; I use Maps regularly and enjoy Earth as well. I am however concerned about privacy using all these cloud-services. Privacy has a lot of different meanings. Here I’m talking about the control meaning: I want to be in control over my stuff, being it my computer, my mails or my documents.

My concert just got another boost when Growl notified me that a new volume was mounted. I was surprised, since I was laying back, watching a movie… The volume mounted was “GoogleSoftwareUpdate-1.0.6.1054”.

I do have Google Earth installed on my machine, but don’t remember asking it to update itself, definitely not when it’s not even running!

After some digging around, I found the dmg hiding in ~/Library/Caches/com.google.UpdateEngine.Framework.501/Downloads/com.google.Keystone.dmg. Apparently, I’m not the only one who noticed this. This updating seemed to be launched from launchd and can be disabled by removing or disabling the plist-file:

Disabling the startup item can be done by deleting the file ~/Library/LaunchAgents/com.google.keystone.agent.plist or adding a new “Disabled” property to it (in case you want to keep the file):

Disabled

This is probably something everybody knows, but I’ve been Googling for this answer for over an hour:

  • BASEDIR=/whatever
  • cp $DEBs $BASEDIR/.
  • mkdir -p $BASEDIR/dists/$DIST/$COMPONENT/binary-amd64
  • cd $BASEDIR
  • apt-ftparchive packages . > dists/$DIST/$COMPONENT/binary-amd64/Packages
  • echo “deb file:$BASEDIR $DIST $COMPONENT” >> /etc/apt/sources.list
  • apt-get update

$BASEDIR is whatever directory you have space in (preferably an empty directory); $DIST and $COMPONENT are “jaunty-backports” and “main” in my setup, but you can vary.

You also might need to add the following line to /etc/apt/apt.conf to get rid of the “untrusted source” warning:

APT::Get::AllowUnauthenticated “true”;

I was looking for an easy way to parse a binary file. I know what the file contains (it’s an MPEG2 transport stream) and know the bit-field layout. It’s just a pain to figure the bits out manually in a hex editor.

Google pointed me to 010 Editor which supports binary templates, which is pretty much what I was looking for. However, this tool only runs on Windows and is commercial. Enough reason to look further.

That’s when I came across the Data::ParseBinary perl module, which is a true relief to use. It supports pretty much every thing you need to parse a binary file:

  • Signed and unsigned integers
  • Big and little endian
  • 8, 16, 32 and 64 bit integers
  • Bitfields
  • Enum-types to specify your own names for values
  • If-constructs: Fields are present or not depending on the value of another field

In short, an incredible tool!

Since I like to follow up on my RSS-feeds from multiple locations and computers, a regular desktop-based aggregator does not fit my needs. I played around in Google’s Reader, which is a very nice tool. Personally I don’t like my data to be in someone’s cloud. Although unlikely, Google can decide to sell your RSS-ing habits to the highest bidder or vaporize your hard-gathered collection of feeds.

That’s why I wanted to host a Reader-like interface on my own server. Some Googling around – yes, they do have a very good search engine – I found this wonderful, open source, PHP application: feed on feeds. Some highlights:

  • Keyboard shortcuts: read your feeds with only the keyboard, no clicking around
  • Shared items: Create an RSS-feed of interesting posts you read
  • Tagging: tag items with custom tags (manually or automatically)

I got another toy to play with: A digital multimeter with RS232 interface and True RMS power measurement. Sadly, it comes with Windows-only software, which I interpreted as a challenge!

Continue reading ‘VoltCraft VC-940 protocol reverse engineered’ »

When I’m debugging serial communications, it’s very useful to run the standard application inside a VM. This allows me to connect the virtual RS232 port to the physical one with socat, which provides me with a detailed log of every byte.

The VMware products under Windows and linux have the option to connect their serial port to a “named pipe“, although it’s more a socket, since they allow bidirectional communication. Strangely enough, VMware Fusion, the Mac product, does not have this option.

Continue reading ‘Connecting a serial port from VMware Fusion to a unix socket’ »