Resolving DBus uniqe names

Often you stumble across DBus logs (e.g. originating from bustle or dbus-monitor) which only feature DBus unique names (those :1.xyz numbers) and you can only guess which process it originates from.

Helper script to resolve those addresses to processes (if the system is still running):

#!/bin/bash
 
name=$1
while [ -n "$name" ]
do
    result=`LANG=C dbus-send \
                  --session \
                  --print-reply \
                  --dest=org.freedesktop.DBus \
                  / \
                  org.freedesktop.DBus.GetConnectionUnixProcessID \
                  string:"$name" 2>/dev/null`
    if [ $? -eq 0 ]
    then
        process=`ps ax | grep ^${result##* }`
        echo "$name -> $process"
    fi
    shift; name=$1
done

Fake rpm database in ubuntu

At work I’m currently developing software which is supposed to run on openSUSE. I need to query the package database at some point which of course does not exist on my ubuntu machine. Here’s a quick setup how to create a fake local RPM database:

echo "%_dbpath /home/user/rpmdb" >> ~/.rpmmacros
mkdir /home/user/rpmdb
rpm -i --nodeps --justdb --force-debian *.rpm

And that’s it.

any to WMV

While trying to vamp up XBox 360 support for rygel, I also need a transcoder suitable for the XBox. While H.264 would work it is CPU consuming and hard to get right for the XBox, because it is quite picky. So I decided to go for WMV1/WMA2. Prototype gst-launch commandline:

gst-launch filesrc location=input_file ! decodebin2 name=decoder \
               asfmux name=mux ! filesink location=foo.wmv \
               { decoder. ! queue ! ffenc_wmv1 bitrate=1200 ! mux. } \
               { decoder. ! queue ! audioconvert ! audioresample ! ffenc_wmav2 bitrate=64000 ! mux. }

I know that the curly braces are not needed anymore but I still think they improve readability a lot.
Update:The resulting file works great for offline playback on the XBox, but live streaming does not work unfortunatly. I had to rely on ffmux_asf to make live transcoding working.