Posts tagged ‘linux’

When doing some research on the different tables in iptables, I was trying to figure out in what order what tables are traversed. Obviously PREROUTING happens before POSTROUTING, but it becomes more difficult to figure out if mangle happens before are after nat.

I found a post which links to this overview (local copy):

packetflow

Recent tests on kernel 3.13.0 (Ubuntu Trusty 14.04) show that tcpdump captures before mange-PREROUTING and after nat-POSTROUTING.

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

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 0x08) 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’ »

Our weather station has a serial connection and comes with Windows-software to view the weather data on your PC. The app is very eye-candy, but doesn’t do anything more than displaying the data. I’m more interested in long-term trending. So I wrote my own application to talk to the weather station and store the result in an rrdtool database.

Continue reading ‘Reverse engineering the Oregon WMR928NX weather station’ »

My car has a CD player build-in that supports MP3 CDs. However, it’s fairly picky on the format of the disc. I tried to burn a CD using Burn Folder which comes with Leopard, which creates a multistandard disc containing a HFS+, an ISO-9660 with Rock Ridge, and a Joliet with Rock Ridge. While this looks very nice on paper, the car’s CD player was less satisfied: “Error CD”.

Another issue is that the player has no support for M3U-playlists. It does, however, support “albums” (directories), which can be used to emulate playlists. Just add a number prefix to each filename and it’ll work. Placing the same file in multiple playlists/albums/directories is possible, but wastes space. But this can be worked around.

Continue reading ‘Faking playlists on an MP3 CD’ »

Time Machine is the Mac way of doing backups. The concept is fairly similar to incremental rsync snapshots. Officially, Apple does not support Time Machine backups to a network volume: network drives don’t show up in the Time Machine user interface. The only way to get network-based Time Machine is by buying a Time Capsule.

When doing a Time Machine backup to a normal disk (I tried it with a LaCie 1TB USB disk), one can see the file structure created. Mine looked like this: Backups.backupdb///Macintosh HD/… Inside this directory is my full system (minus the parts I explicitly excluded in the Time Machine config).

Since we have more than 1 Mac, I’d like to have all of them back up to the same hard drive. I already have a Linux-based server serving files over AFP. This is where it gets more interesting…

Continue reading ‘Time Machine to a linux server’ »