Archive for the ‘Uncategorized’ Category

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’ »

At my parents place, we installed photovoltaic cells. The produced electricity is converted to AC power and is coupled with the normal grid: if we produce too little, the grid provides the remaining power; overproduction is given to the grid.

The inverter (the device that converts DC into AC) is a SolarMax C-series. It has a 2-line LCD display that gives out some basic information: current, voltage, power; produced energy today, this month, this year, … This is very useful information, but is a bit hard to access. The instruction manual reveals that there is a computer interface available to read out its data. Naturally, I wanted to explore this!

Continue reading ‘SolarMax MaxTalk protocol reverse engineered’ »

I was bored of constantly looking for updates on a website. A little googling turned up this nice site. It turns (a part of) a webpage into an RSS feed. Here are the ones I created:

If I log in to my Ubuntu box over SSH from my MacOSX terminal, then start screen, my backspace-key doesn’t work anymore. Pressing it deletes the first character on the right of the cursor, instead of the one on the left. This only happens inside screen, not on the regular bash-shell.

I found different workarounds:

  • A forum post telling to change the terminal preferences to send backspase as CTRL-H (ASCII 0×08) instead of the normal ASCII 0x7f.
  • A blogpost telling to lie about the terminal you’re using: “TERM=screen screen”
  • Another blog telling to do remapping inside screen with bindkey-commands

None of the above worked without side-effects: CTRL-H is not understood by MacOSX terminal applications; bindkey-commands are applied even if I SSH from my linux box.

The solution I like best is to change the terminal from the standard “xterm-color” to “rxvt”. After this change, everything worked like a charm.

My previous system was a Linux-box. I made some adjustments to my keyboard in order to make it “better”. Since I use Vim a lot (apologies to Emacs-fans), the escape-key is doing overtime. On a normal keyboard however, the escape-key is located at the top left. Other keys are very near the main keyboard, but are hardly used. I almost never use the CapsLock key at all. So I switched both keys around, giving the CapsLock key the escape-function and the other way around.

Under Linux, you can remap keys using xmodmap. It seems that Windows has a similar feature, although much less documented. Here is a short summary of this article.

Continue reading ‘Remap keys under Windows’ »

I just found a very nice post describing nice things to do with Bluetooth. By using the Proximity tool, my MacBook Pro can monitor the precense of my cell phone. Proximity will run an AppleScript when a selected device enters and/or leaves Bluetooth range. Most  phones are class 2 Bluetooth devices, which gives a range of 10m (outdoors). This allows you to automatically lock your desktop when you leave and unlock when you come back.

Continue reading ‘Useful things to do with Bluetooth’ »