Compiling rtmpdump from source

2011-12-29

Today I needed to upgrade rtmpdump to a newer version than the one supplied with Ubuntu 11.10. Compiling and installing was very easy:

git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump
make
sudo make install

But the resulting binary still failed with this error message:

WARNING: HandShake: Type mismatch: client sent 6, server answered 9
WARNING: HandShake: Server not genuine Adobe!
ERROR: RTMP_Connect1, handshake failed.

After a bit of digging it turned out that my new rtmpdump used the old dynamic library. I had to set the rpath of the new binary, so that it used the new version of the library. There are several ways to do this; I choose to recompile with:

make clean
make XLDFLAGS='-Xlinker -rpath -Xlinker /usr/local/lib'
sudo make instal

You know its DST when…

2011-03-27

You know its daylights savings time again when Nagios warns about a backup job that should have run at 02:03.

Migrating from Strip to OI Safe

2010-11-06

I have been a long-time user of an ancient palm m515 handheld. Since getting an Android cell phone, I’ve almost stopped using the palm. But until today, I have still used if to manage passwords.

On the Palm, I have been using Strip v1.0 to store all my passwords. Strip is short for Secure Tool for Recalling Important Passwords. It encrypts all passwords with AES, and on startup you have to enter a master passphrase to unlock all the passwords.

The OI Safe application for Android is similar to Strip. It also encrypts the passwords using AES.

Today I finally got around to importing my passwords to OI Safe. If there are anybody else who has not made the switch, you might find this useful. I used a computer running Ubuntu 10.04 to perform the conversion, but I think most applications I use run just fine on most Unix-like systems.

Step one: export from Palm

For a long time, I have been using pilot-xfer to make a backup of my palm, so I already had an up-to-date copy of the relevant files.

 $ sudo apt-get install pilot-link   # Unless you already have pilot-xfer.
 $ mkdir mirror
 $ pilot-xfer -p /dev/ircomm1 -s mirror

Start the HotSync application on the palm, and sync.

If you are lucky, /dev/ircomm1 is the name of your IR port, and you will end up with a total backup of your palm in the mirror directory. (My Palm m515 is partially broken, so I can no longer sync via USB. I have to use the slow IRDA interface instead. I’m glad that I can now retire the device.)

Check that the  following files are present:

  StripPassword-SJLO.pdb
  StripSystems-SJLO.pdb
  StripAccounts-SJLO.pdb

Step two: obtain the conversion script

OI Safe can import passwords from a comma-separated file. I wrote a small Perl script to export the Palm database in the proper format. Actually, I did not have to write the script from scratch. I just tweaked code that David Dribin and Zetetic (the makers of Strip) had already made, so that the output format was what OI Safe wants.

My fork of the work is available on github. To get a copy, just run:

  $ sudo apt-get install git-core    # Unless you already have git.
  $ git clone  git://github.com/cederlys/Palm-Zetetic-Strip.git

Then, follow the installation instructions in Palm-Zetetic-Strip/README.

Step three: run the conversion

Running the conversin script is easy. Mount your Android device, and then run something like this:

 $ Palm-Zetetic-Strip/scripts/strip-to-oisafe.pl mirror > /media/1234-1234/oisafe.csv

This assumes that the directories created by step one and two are present in you current working directory, and that you Android device is mounted on /media/1234-1234.

You will be prompted for the Strip password.

Step four: import the file to OI Safe

Install OI Safe from the Android Market (if you have not already done so), start it, and enter you master password. Press menu -> More -> Import Database.  Be prepared to wait for a while if, like me, you have more than 200 passwords.

Patch management with TopGit

2010-07-14

I have used Mercurial Queues for a while, and find them to be a really powerful way to organize my development. I have even used them when developing using CVS.  It worked fairly well to use both hg and CVS at the same time, as long as you are careful.

However,  Mercurial Queues are far from perfect. Maybe the most severe problem is that you cannot easily do any distributed development of the patches.

For those of us that use Git, there are a couple of Mercurial Queues-like alternatives. The Guilt system is very similar to Mercurial Queues, so if you have been using it, you have a very shallow learning curve.  It has  roughly the same strengths and weaknesses.

TopGit on the other hand is different.  It does not store patch files.  Instead, it has a branch for each patch, and what you record on that branch is actually the entire working tree of your project when the patch is applied.  This means that you can use the powerful merge algorithms of Git to update your patch when commits are added to the branch that you develop the patch for. It also means that you can push the TopGit branches to a remote repository, and that you can do distributed develop of them.

(It might be a bad idea to push them to the central Git repository, but you and a co-worker could have a shared repository where you coordinate the work that later leads to a nice set of commits in the official repository.  Or maybe you just want to keep backups of your work by pushing it to another repository.)

One detail of TopGit that I didn’t like was that when you switch between your patches, you use git checkout branch. Yes, you have to type the name of the patch every time you switch between patches. Since I often move back and forth between patches, I really like the hg push/hg pull or guilt push/guilt pop method of switching between patches.

Since TopGit is open source, I could fairly easily add the missing functionality. I have added tg next and tg prev commands. (tg push already exists, and is used to push patch branches to remote repositorys, so I had to invent new names.)

If you also want them, you can find my code as a fork of the official project. I have sent a merge request to the maintainer, so one day this might be a part of the official TopGit distribution.

I sign of with a link to the documentation of tg next and tg prev.

Disabling the track stick in Ubuntu

2010-07-13

The track stick (also known as pointing stick, TrackPoint, and various other names) can easily be disabled in Ubuntu. I never use it, since my Dell Inspiron has a trackpad that I find more ergonomic to use. Recently, the track stick started to go haywire, sending my mouse pointer all over the screen.  Since I don’t use it, I wanted to disable it.

Googling found many old posts that stated that it was impossible.

But, finally, I stumbled upon the xinput utility. It can disable the device!

To list all available input devices:

 $ xinput list
 ⎡ Virtual core pointer                    	id=2
 ⎜   ↳ Virtual core XTEST pointer              	id=4
 ⎜   ↳ Wacom Graphire2 4x5 eraser              	id=9
 ⎜   ↳ Wacom Graphire2 4x5 cursor              	id=10
 ⎜   ↳ Wacom Graphire2 4x5                     	id=11
 ⎜   ↳ AlpsPS/2 ALPS DualPoint TouchPad        	id=14
 ⎜   ↳ Macintosh mouse button emulation        	id=15
 ⎜   ↳ DualPoint Stick                         	id=13
 ⎣ Virtual core keyboard                   	id=3
     ↳ Virtual core XTEST keyboard             	id=5
     ↳ Video Bus                               	id=6
     ↳ Power Button                            	id=7
     ↳ Sleep Button                            	id=8
     ↳ AT Translated Set 2 keyboard            	id=12

The device I want to disable has id 13. Use xinput to list its properties:

 $ xinput -list-props 13
 Device 'DualPoint Stick':
 	Device Enabled (117):	0
 [...several lines removed...]
 $ xinput -set-prop 13 117 0

Once I knew the solution, I could easily find other posts that mentions it. But what good is that? 🙂

Actually, the device is is dynamically allocated, and can change. So a better command to disable the stick is:

 $ xinput -set-prop "DualPoint Stick" "Device Enabled" 0

Let me know if you found the solution via this post.