Search Results: "Torsten Landschoff"

7 November 2010

Torsten Landschoff: Accessing the Eclipse source code

Sometimes I really want to know how Eclipse implements one feature or another, because Eclipse sometimes feels like magic. Usually it turns out they are also just cooking with water. Most open source code is easily available by checking out a project from some SCM. For eclipse it is not as easy. But there is a nice tutorial how to access eclipse source code by Lars Vogel. This post is just so I can recover the link next time instead of googling for an hour. Thanks, Lars!

19 October 2010

Torsten Landschoff: Fun with my Sony PRS-600 eBook reader

I finally bought myself an eBook reader. To be precise, I got the Sony PRS-600 Reader Touch Edition. Two reasons: First of all, the display is only really great with a powerful light source. The reflection is a bit of a nuisance but I can live with it. What I don t like is the PDF support of the device. Viewing a normal page, the font faces are so tiny that it is not readable in any way. The zoom feature works around that, but you can t switch pages from there. Instead you have to unzoom, go to the next page and zoom again. Crappy! There is also the reflow option, which does not mix with source code figures in my books. I am glad that most of my electronic books are from The Pragmatic Bookshelf, which means that I can download them in Epub as well, all without DRM. Thanks, guys! For the PDFs I would like to carry, I googled a while and stumbled across this blog post. The example to work with source documents worked fine for The Little Book of Semaphores at least. But even with BRISS I did not (yet) manage to crop books I bought from APress. Most likely I will try doing it via a bit of python scripting and the poppler bindings for python. I also bought my first DRM content: Star Trek Vanguard: Harbinger. I really enjoyed the book, but the download was a PITA. After buying, you only get a link to a ASCM file, which is not useful by itself. One needs Adobe Digital Editions to download it. So I installed it into a virtual machine which has XP installed. After that, I was able to read it on the PC, which wasn t the goal of the exercise. To put it on the reader, one needs to authorize it from the same Windows software and upload the file. All that stuff took almost an hour and of course the digital edition of the book is more expensive than getting it from amazon germany. But at least I did not have to wait for delivery. Having finished the book I wanted to buy the second part, but of course it is only available for canadian residents on ebooks.com. I researched a number of ebook sites which mostly sell it only in the US. Funny enough, the first hits when searching where pirated versions of the book in full text. Why do they make it so hard to get stuff legally? *sigh*

10 August 2010

Torsten Landschoff: Merged wxWidgets 2.8.11.0 for Debian

Just in case I forget the link again: 7 weeks ago (says git) I merged upstream 2.8.11.0 into the Debian packaging git. The changes are available at a personal alioth repo if anybody cares. Edit: I just wanted to file a bug, only to notice that I did this weeks ago. Need more memory!

8 July 2010

Torsten Landschoff: How to run a single unit test/unit test module with py.test

Note to self: It is actually possible to select a single test module or a single test function in py.test. But passing the file name as argument to a py.test invocation selects only the doctest from that file (wtf!?). Instead, you need to call it like this:
1
2
$ py.test -k test_module # to run the tests from test_module.py
$ py.test -k test_func # to run tests having the function name test_func
This is documented in the section advanced test selection and running modes of the py.test documentation, although I fail to see how this is advanced.

4 July 2010

Torsten Landschoff: Postprocessing conference videos

I was planning to attend DebConf New York this year, but for a number of reasons I decided not to go. Fortunately, Ferdinand Thommes organized a MiniDebConf in Berlin at LinuxTag and I managed to attend. Thanks, Ferdinand! There were a number of interesting Talks. I especially liked the talk of our DPL, and those about piuparts and git-buildpackage. In contrast to the other LinuxTag talks, we had a livestream of our talks and recorded (most) of them. The kudos for setting this up goes to Alexander Wirt, who spent quite a few hours to get it up and running. I have to apologize for being late in bringing my Notebook, which was intended to do the theora encoding of the livestream. This was a misunderstanding on my part, I should have known that this is not going to be setup in the night before show time So to compensate the extra hours he had to put in for me, I offered to do the post processing of the videos. Basic approach for post processing The main goal of post processing the videos was (of course) to compress them to a usable size from the original 143 GB. I also wanted to have a title on each video, and show the sponsors at the end of the video. My basic idea to implement that consisted of the following steps:
  1. Create a title animation template.
  2. Generate title animations from template for all talks.
  3. Use a video editor to create a playlist of the parts title talk epilogue.
  4. Run the video editor in batch mode to generate the combined video.
  5. Encode the resulting video as ogg theora.
As always with technology, it turned out that the original plan needed a few modifications. Title animations
<video controls="controls" height="288" src="http://www.landschoff.net/blog/uploads/2010/07/mdc2010_title_anim1.ogv" width="360 "></video>
Originally I wanted to use Blender for the title animation, but I knew it is quite a complicated bit of software. So I looked for something simpler, and stumbled across an article that pointed me towards Synfig Studio for 2D animation. This is also in Debian, so I gave it a try. I was delighted that Synfig Studio has a command line renderer which is just called synfig and that the file format is XML, which would make it simple to batch-create the title animations. My title template can be found in this git repository. Batch creation of title animations I used a combination of make and a simple python script to replace the author name and the title of the talk into the synfig XML file. The data for all talks is another XML file talks.xml. Basically, I used a simple XPath expression to find the relevant text node and change the data using the ElementTree API of lxml python module. The same could be done using XSLT of course (for a constant replacement, see this file) but I found it easier to combine two XML files in python. Note that I create PNG files with synfig and use ffmpeg to generate a DV file from those. Originally, I had synfig create DV files directly but those turned out quite gray for some reason. I am now unable to reproduce this problem. Combining the title animation with the talk For joining the title animation with the talk, I originally went with OpenShot, which somebody of the video team had running at the conference. My idea was to mix a single video manually and just replace the underlying data files for each talk. I expected that this would be easy using the openshot-render command, which renders the output video from the input clips and the OpenShot project file. However, OpenShot stores the video lengths in the project file and will take those literally, so this did not work for talks of different play times I considered working with Kino or Kdenlive but they did not look more appropriate for this use case. I noticed that OpenShot and Kdenlive both use the Media Lovin Toolkit under the hood, and OpenShot actually serializes the MLT configuration to $HOME/.openshot/sequence.xml when rendering. I first tried to read that XML file from python (using the mlt python bindings from the python-mlt2 package) but did not find an API function to do that. So I just hard coded the video sequence in python. I ran into a few gotchas on the way: Things to improve While the results look quite okay for me now, there is a lot of room for improvement. Availability

16 March 2010

Torsten Landschoff: New notebook: Dell Latitude E6400

It has been some time since I blogged about something. I wanted to write this post for a while, but never got around. Since beginning of february 2010, I have a new job and got a new work notebook: A shiny Dell Latitude E6400. Interestingly, the company usually relies on getting Lenovo Notebooks due to good Linux support, but we were unable to find a notebook without integrated camera and decent specs. We also researched some HP Notebooks. We ended up with a Dell since the website makes it really easy to find a system that fits your requirements. There is still room for improvement though you still have to select between Vostro, Latitude, Precision Mobile and XPS before you are allowed to configure the system. There is a filter on the left side of the shop, but filtering for a Core 2 Duo and 4 GB RAM won t show you the notebook I got. Instead there is some overpriced Latitude (~ 3000) and an XPS system. I just tried the XPS, but was unable to find a Core 2 Duo processor in the options. Anyway, somehow I made it through and got the following configuration:
Processor Intel(R) Core(TM)2 Duo CPU P8700 @ 2.53GHz
RAM 4 GB 800MHz DDR2
Graphics Mobile Intel Integrated Graphics Media Accelerator X4500HD
Display 14.1 Widescreen WXGA+ (1440X900), LED backlight, non-glare
Hard Drive Seagate ST9250410ASG 250GB
Webcam None, but microphone fitted
Battery 9-cell 85 Wh
WLAN Intel Wireless WiFi Link 5100 (according to lspci, I did not care too much)
LAN Intel 82567LM Gigabit Network Connection
I installed Ubuntu karmic (amd64) the day it arrived and I am impressed. I have yet to find a serious problem with hardware support. Everything just worked out of the box, installation was done after half an hour (I needed 10 minutes to find a network cable since the installer did not support the wireless). I wanted to install Debian on it but so far I did not get around to actually do it. But I expect sid to perform just as well with lenny probably lacking some of the needed drivers. So why am I writing this? The main point is that you can buy a notebook today and have it fully supported wrt. Linux. Open Source has come a long way! Second: If I replace my personal notebook (a Sony Vaio), I will probably buy Dell as well. Definitely nothing from Sony, because I did not find any way to change the display brightness for the 3 years old system, which makes it usable only next to a power outlet.

20 February 2010

Torsten Landschoff: Watching TV with vlc on Linux via T-Home Entertain

For quite a while we are receiving TV via Internet. The original reason is that I got at most 2 MBit/s via ADSL due to line noise, but VDSL supports 25 MBit/s on the same line. Of course, you couldn t order the DSL line without also getting a phone flat rate and IPTV. Most of the channels are encrypted and can only be received with the original Media Receiver , which is a proprietary (and Microsoft) solution. But at least, I can watch the public service broadcasts using these playlists for VLC or mplayer.

25 January 2010

Torsten Landschoff: Eclipse 3.5.1 mouse event problems with gtk >= 2.18

Recently, Eclipse started ignoring clicks on dialog buttons for me. This seems to be due to some changes in gtk 2.18. It does not use native windows for all widgets anymore, and SWT seems to rely on it. Thanks to this blog post, I have this fix in my bashrc:
1
alias eclipse="GDK_NATIVE_WINDOWS=true eclipse"
The Debian bug tracker also knows about this problem, which is partly fixed for the eclipse packages. Bad luck that I am using a download from eclipse.org.

19 January 2010

Torsten Landschoff: quiltrc for Debian packaging

Working on another laptop, I was missing my quiltrc settings. I think, I got them from a this email by Marco d Itri. Perhaps it is of help to somebody (for example, when I go searching for it again). BTW, I changed it locally to check only for debian folder in parent directories and create debian/patches automatically if needed:
1
2
3
4
5
6
7
8
for d in . .. ../.. ../../.. ../../../.. ../../../../..; do
if [ -d $d/debian ]; then
if ! [ -d $d/debian/patches ]; then
mkdir $d/debian/patches
fi
export QUILT_PATCHES=debian/patches
fi
done
I d rather end up with a patches dir inside the debian folder instead of having it at a random place in the package sources when adding the first quilt patch. I wonder if we should ship this with the quilt package!?

30 December 2009

Torsten Landschoff: libtool silently skips shared libraries without -rpath

Ouch! This is the second time I am running into this so I ll write it up this time. I used libtool via automake for building a python module. Quite unhelpfully, libtool happens to build only the static library. It does that even though I passed the -module option, which should make it clear that a static library does not help at all. There is also no mention why it skips the shared library. After some research, my memory came back: libtool requires to pass the -rpath option to actually build shared libraries. I did not want to pass that options, since it is considered harmful where multiple variants of a library are available. It is even less useful in my specific case, as the module is only used inside the source tree for unit testing. Solution: I changed the Makefile.am to use
1
_helper_la_LDFLAGS = -module -rpath /freaking/libtool/requires/at/least/a/dummy/path
Interestingly, the same scheme (apart from the wording) is used in libtool s own source.

23 December 2009

Torsten Landschoff: Hitting the dynamic linker wall

I was working on replacing some mockup code for testing an internal library with python. Basically, the C code is incredibly big and I would rather mock the 3rd party API we are using in python. I wrote a generator to create wrapping code that forwards the C API calls to my python module. Now that most of the work is finished, I get the following error message from my python mock:
1
2
3
4
5
6
Traceback (most recent call last):
File "simple_mockup.py", line 2, in <module>
import threading
File "/usr/lib/python2.5/threading.py", line 11, in <module>
from time import time as _time, sleep as _sleep
ImportError: /usr/lib/python2.5/lib-dynload/time.so: undefined symbol: PyExc_ValueError
What s going on here? This issue reminds me of a bug of my ancient Debian times which affected loading of GTK theme engines from python-gtk. The bug (#38138) is so old, it s not even in the BTS archive anymore The problem is illustrated by the following example program (consisting of three files):
demo.c
1
2
3
4
5
6
7
#include <Python.h>

void test_python()

Py_Initialize();
PyRun_SimpleString("import threading\n");
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <dlfcn.h>

int main(void)

const char *error;

void *handle = dlopen("./demo.so", RTLD_LAZY EXTRA_RTLD_FLAGS);
void (*test_python)();
*(void**) &test_python = dlsym(handle, "test_python");
if ((error = dlerror()))
fprintf(stderr, "%s\n", error);
return 1;


printf("Calling test_python @ %p in shared object @ %p.\n", test_python, handle);
(*test_python)();
dlclose(handle);
printf("Feels fine, finishing.\n");
return 0;
run_it.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/sh

gcc -shared python-config --includes -o demo.so demo.c python-config --ldflags

echo "Running example with default RTLD flags:"
gcc -DEXTRA_RTLD_FLAGS=0 -o main main.c -ldl
./main
echo

echo "Passing RTLD_GLOBAL in addition:"
gcc -DEXTRA_RTLD_FLAGS=RTLD_GLOBAL -o main main.c -ldl
./main
echo
On my system, this results in the following output:
torsten@pulsar:~/sh_bug$ ./run_it.sh
Running example with default RTLD flags:
Calling test_python @ 0xb77084bc in shared object @ 0x96bc018.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.5/threading.py", line 11, in <module>
    from time import time as _time, sleep as _sleep
ImportError: /usr/lib/python2.5/lib-dynload/time.so: undefined symbol: PyExc_ValueError
Feels fine, finishing.
Passing RTLD_GLOBAL in addition:
Calling test_python @ 0xb783f4bc in shared object @ 0x95e1018.
Feels fine, finishing.
Sucky. So embedding Python into an application is easy but if you want to use the interpreter and its modules from a plugin, you are out of luck. Somebody knows a way around this problem? The only solution I can think of is to link libpython.so into each of the python plugins. Update: Work around Small update: For my current problem, the work around is to run the application with the python library preloaded: LD_PRELOAD=/usr/lib/libpython2.5.so.1.0 app. Back to adding functionality

20 December 2009

Torsten Landschoff: Restoring a package selection on new system

I am moving from my old Debian development system to a new one, changing architectures from i386 to amd64. So I need to do a fresh install, but basically I want to keep my package selection. Conventional wisdom is to use dpkg --get-selections and dpkg --set-selections to preserve the package selection. However, this does not keep the information about automatically installed packages. Instead, I used
aptitude search '?installed?not(?automatic)' -F %p > packages.txt
to dump the packages I installed manually. Installing these was a matter of running:
aptitude install  cat packages.txt 
In fact this was taking so long that I loaded the packages in batches using
cat packages.txt xargs -n 100 aptitude install --schedule-only; aptitude
While I was at it, it ran
aptitude remove '?obsolete'
on the original system, killing of a few hundred packages that accumulated since 2003.

2 December 2009

Torsten Landschoff: OpenVPN and DHCP: Good idea?

Great, I spent a few hours today to set up a nice OpenVPN server. Nice in that I wanted the (Windows) clients to be able to access the company network like they were connected locally. My idea was to use the OpenVPN tap mode and let the DHCP server at work assign IPs to the VPN clients. This turned out to be a dumb idea. After I got everything going, I noticed the following message in syslog (which probably scrolled by previously in the debug drivel):
NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Hmm, sure, I guess that will exclude every second incoming VPN connection. Summary: Think about IP space clashes before setting up a VPN.

29 November 2009

Torsten Landschoff: New on Debian planet

Now that there is some content here, I added myself to the Planet Debian blog aggregator. Sorry for my weird head image, the shadow looked much better in Gimp. I ll have to correct that on another day Thanks to Holger Levsen for pointing me at the wiki entry which describes how a Debian developer can add himself to the Planet.

Torsten Landschoff: New development box installation woes

I got a new computer at home a week ago and finally got around to assemble all the parts. Which wasn t as easy as expected, especially fitting the CPU cooler was a hard fight. Specs For the curious, here are the specs:
CPU
AMD Phenom II X4 965 (4 3.4 GHz)
Mainboard
MSI 790GX-G65
Graphics
ATI Radeon HD 3300 (on-board)
RAM
8 GB, DDR3
Hard drives
2x SATA 1.5 TB (by Western Digital)
Ubuntu installation For testing and having a first look, I installed Ubuntu karmic koala (amd64). Installation went like a breeze, everything was detected and worked out of the box. Well, kind of graphics performance was dreadful. Which was kind of expected. Debian installation I originally thought about using Debian only inside virtual machines or change roots. Still, Ubuntu does not really feel like the real thing . So I went to install Debian, aiming at a sid/unstable installation. The first boot using the official squeeze snapshot netinst image (Binary-1 20091128-11:21) went fine. Up to the first prompt: No input was possible. Probably a problem with the USB keyboard I had connected (Logitech wireless). Out of curiosity I tried the graphical installer, which did not even get so far. It was stuck in an endless loop trying to start an X11 server. So I dug for a PS/2 connected keyboard and had more luck. I got to the point where the installer searches for the CD-ROM drive. As I did not want to dismantle my old system yet, I used an external USB DVD/RW drive. This was not detected by the installer so I was unable to continue installation. I guess, the NIC driver was also on the disc so no ethernet either. Today I installed the DVD burner into the tower and had more luck. It still amazes me how easy it is to create my default storage setup using d-i (LVM on RAID). However, the installer failed to reread the partitions after I created two on each drive, interestingly telling me about /dev/sda2 being busy. Perhaps a left-over swap partition from the Ubuntu install? Anyway, after running fdisk manually and writing the same partition table again, I was able to continue. The remaining d-i steps went fine, with just a nuisance: I was asked for the console font setting twice. And I had no idea what it was asking of me, AFAIK UTF-8 should be fine for all possible uses. I selected # Latin1 and Latin5 western Europe and Turkic languages. Not that I will see the console unless Xorg fails to run After having the base system running, I rebooted without selecting any more software, partly because I knew that the resync on md1 will need restarting after booting into the new system. The new system booted fine and I called aptitude to install build-essential, Xorg and both KDE and Gnome desktops. This pulled in MySQL via akonadi-server (ouch!) and I was asked for a MySQL root password. Seriously, I don t care, this is a desktop system. I tend to forget the password anyway and the last time, root was able to reset it. So I just hit Enter, leaving no password set. This lead to the installation asking me two more times for the password, which really sucks given that the server is only used by Akonadi for whatever reason and the last time I looked, it creates its own MySQL configuration. Albeit my old system is 8 years old, the new system still seemed slower. Which of course is due to disk latencies, given that /dev/md1 was being synchronized in the background. Anyway, I was eager to test the desktop experience and started gdm. X came up fine, but again I had no mouse and no keyboard (USB mouse, keyboard connected as well as PS/2 keyboard). I also was unable to switch to a VT, so I logged in remotely and rebooted the new system. After the reboot, hal obviously picked up the input devices and X11 worked fine now. At this point, I stopped as the sunday almost passed already. Summary: Debian installation still needs some improvements I think. Maybe our distribution is just too stable, after all my last install is 3 years back due to a disk crash Relevant Debian bugs