Friday, December 26, 2008

Takis blog: CVS to GIT and back

Takis blog: CVS to GIT and back contains very nice info for using a CVS-server and a git-client.

Thanks Takis!

Sunday, July 27, 2008

A Fujitsu Siemens webcam on Linux

Today I got a webcam (loaned from work) working under CentOS. It's a nameless model from Fujitsu Siemens Computers (USB Vendor/Product 0c45:613b).

The sn9c102-driver


I have packaged the suitable driver from Luca Risolia. There also seems to be a binary-only driver which is only available for Ubuntu 7.04. This driver should be better, however it can't be used for free on other Linux distributions.

Downloaded the .src.rpm for the driver from my homepage (direct download).

GTK+ UVC Viewer


Having only a driver is of no use. There should also be a easy to use viewer software. I was unable to find a packaged version for guvcview, so created the RPM myself. The .src.rpm is also available from my site.

No Skype :(


Unfortunately Skype 2.0.0.72 does not support the MJPEG-format delivered by this camera. Looking for possible solutions, I found the ov51x-jpeg-driver and gstfakevideo. Tried both and got the same unsuccessful result.

gstfakevideo seems most promising as it does everything in user-space. It is mainly a library which gets loaded before any others libraries (see LD_PRELOAD in man ld.so). This makes it possible to change the behavior of any function-call. In this case Skype uses libgstreamer and the API can be changed on the fly. But as it doesn't work and the camera is not my personal posession, I won't look into this much more.

Saturday, July 26, 2008

Developing with Google App Engine on CentOS-5

Unfortunately CentOS-5 does not have python-2.4 yet. When using wsgiref.handlers.CGIHandler for handling get() and/or post() requests the following ImportError occurs:


ImportError: No module named wsgiref.handlers


This can be solved by installing the Python Extension wsgiref. I've created an SRPM which can be rebuilt quite easily.

After the installation of WSGI, the google_appengine/dev_appserver.py still does not find the library. This can be solved by configuring the wsgire as a third party module.

cd /path/to/my/google/app
ln -s /usr/lib/python-2.4/site-packages/wsgiref


Now it should be possible to run the Google App:

google_appengine/dev_appserver.py /path/to/my/google/app



More links:
* Google App Engine
* Application Gallery

Wednesday, July 2, 2008

Let Firefox add RSS-Feeds to Thunderbird

I'm using Thunderbird as mail client and RSS-reader. Firefox is the web browser of my choice. Now I would like Firefox to add links to RSS-feeds to Thunderbird. The next script makes that possible.


#!/bin/sh
#
# Open an RSS-Feed with Thunderbird.
# Idea from: http://ubuntuforums.org/showpost.php?p=4368033&postcount=7
#

exec thunderbird -mail "feed:${1}"


Unfortunately I was unable to make it work (using about:config) without a script.

Thursday, June 26, 2008

NSPluginWrapper in CentOS-5.2 (x86_64)

This is an update for an older post by me: Installing Flash on CentOS-5.x86_64

CentOS-5.2 already includes NSPluginWrapper. Yust install it as usual with:

yum -y install nspluginwrapper

Sync time without VMware Tools installed

Just a little note for those who are always looking for missing configuration parameters (like me).

Guests can sync time with the host automatically if you set the following parameter in the .vmx file of the guest:

tools.syncTime = "TRUE"


The same can be achieved by using the VMware Tools, however these might not be installed and installing them could be troublesome on systems not containing a development environment.

Saturday, June 21, 2008

Chicken-Melon Soup

Just had a (late) lunch at Gallia (corner Stargarderstr./Papelallee, Berlin). They change the menu every 3-4 weeks, so there is always something new to try.



Today I had a chicken-melon soup (very exotic!). It's a very tasteful combination of chicken, gallia melon balls, lots of cream and some spices. It tasted really great and inspired me to Blog about it :)



For the main course I chose Pasta Gallia. No melon on this dish, but therefor fried chicken, noodles and champions in a nice sauce. Some salad leaves and small pieces of tomato made it really look appetizing.



I can highly recommend anyone to visit Gallia. For this menu, including a coke and my coffee afterwards, I paid around €15. You can definitely eat cheaper in the area, but the food is outstanding, service is nice and it is't overcrowded like lot's of other restaurants.

Monday, June 16, 2008

Starting SafeBoot with GRUB

Installation of SafeBoot


SafeBoot can be installed over Tivoli. After installation, you need to authenticate on every boot and Windows will be started.
Only the partitions used by Windows will be encrypted, the Linux partitions are not affected.

Boot from a Rescue System


Booted my CentOS x86_64 with the installation DVD, giving on the boot-prompt linux rescue. This rescue system automatically detects my /-filesystem and all used partitions. The dialogs explain how to change to the installed system:
chroot /mnt/sysimage

Now you are prepared to backup SafeBoot and setup GRUB as default bootloader.
Note:
If your Linux is installed with a x86_64 version, you'll need a x86_64 rescue system.
Note:
It is adviced to use a CD or DVD for booting. A USB-Stick (which is emulated like a harddrive) could give troubles installing GRUB.

Backup the SafeBoot MBR


dd if=/dev/sda of=/boot/safeboot.mbr bs=512 count=1

The master-boot-record will be saved in the file called /boot/safeboot.mbr.

Install GRUB on the MBR


/sbin/grub-install /dev/sda

This overwrites the MBR with GRUB. By default GRUB will boot (no authentication needed).

Starting SafeBoot from GRUB


Edit /boot/grub/grub.conf (on Red Hat/CentOS) or /boot/menu.lst on other distributions. Add the next entry too the file:

title Microsoft Windows XP Professional
rootnoverify (hd0,0)
makeactive
chainloader (hd0,5)/safeboot.mbr

Here (hd0,0) is the Windows partition and /safeboot.mbr is the backup of the SafeBoot-MBR. In this case it is missing the /boot directory, as /boot is a seperate partition ((hd0,5) which is /dev/sda6).

Monday, June 9, 2008

Compose key magic

A very good article about typing special characters under Linux: Compose key magic by cyberborean.

Friday, May 16, 2008

Installing Flash on CentOS-5.x86_64

With some help from a post in the CentOS-wiki I was able to install the 32-bit version of Adobe's Flash-Plugin on a 64-bit Firefox.

Using the nspluginwrapper RPMs and the flash-plugin from RPMforge.

This is what I have done:

  • install nspluginwrapper (viewer)

  • install nspluginwrapper (plugin)

  • install the flash-plugin: yum -y install flash-plugin or manually from the RPM

  • run the following command as root: nspluginwrapper --install /usr/lib/mozilla/plugins/libflashplayer.so

  • check the installation: in the firefox addressbar about:plugins or visit a site with flash ;)

Wednesday, May 14, 2008

German Dictionary in Thunderbird-1.5 on CentOS-5

It's very anoying that the dictionaries from the Thunderbird Add-ons are not available for the version of Thunderbird from CentOS-5.

After getting some error messages, and trying around I found Localized Dictionaries for Mozilla Thunderbird on mozilla.org. Unfortunately the downloadable .xpi does not work for me?! However there is a nice note about OpenOffice.org Dictionaries and Thunderbird on the same page. This seems to work perfectly!

Friday, April 11, 2008

Copenhagen and a RHCE exam

Thursday



So, staying in Copenhagen in the Copenhagen Business Hotel. The rooms are like little appartments and include a small kitchen, livingroom, bedroom and bathroom.

After getting familiar with the appartment and relaxing a bit, we disided to wander a bit through the city center and find something to eat. We got a nice seat at Jensen's. They have a great offer and are not that expensive ;)

Friday



After doing the RHCE exam we (Björn and I) walked a bit through Copenhagen. First we found something to eat; a little restaurant called Butterfly. The food was quite nice and the atmosphere was all rigth.



Copenhagen is really a nice city for tourists. We were told this already by our collegue Ole (we didn't know he does business here too).

Saturday


Only posting the slideshow for today:

Wednesday, February 13, 2008

Including Picasa Slideshows in MediaWiki

Unfortunately I was unable to find a MediaWiki Extension for Picasa slideshows.

Taking the idea (and PHP-code) from the MediaWiki GoogleCalendar Extension, I created a Picasa-Extension. It's very easy to get it running. Like all/most other MediaWiki Extensions the file should be placed in the /extensions directory.

Save the code below as /extensions/Picasa.php:

<?php
/**
* Picasa Slideshows
*
* Tag:
* <picasa>picasaweb-URL</picasa>
*
* Example:
* from url http://picasaweb.google.com/tester/GoogleSNewSantaMonicaOffice?authkey=3V8IljiqEO0
* <picasa>http://picasaweb.google.com/tester/GoogleSNewSantaMonicaOffice?authkey=3V8IljiqEO0</picasa>
*/

$wgExtensionFunctions[] = 'wfPicasa';
$wgExtensionCredits['parserhook'][] = array(
'name' => 'Picasa Slideshow',
'description' => 'Display a Picasa Slideshow',
'author' => 'Niels de Vos (based on GoogleCalendar from Kasper Souren)',
'url' => 'http://nixpanic.blogger.com/'
);

function wfPicasa() {
global $wgParser;
$wgParser->setHook('picasa', 'renderPicasaSlideshow');
}

/* The callback function for converting the input text to HTML output */
function renderPicasaSlideshow($input) {
/* some defaults */
$width = 800;
$height = 600;
$feed_start = 'http://picasaweb.google.com/data/feed/';
$url_feed = '/data/feed/base/user';
$api_feed = '/data/feed/api/user';

/* convert the input to a string */
$input = "$input";

/* if the input is a direct URL to the album, give an error */
if (strpos($input, $feed_start) !== 0) {
$input = picasaGetFeed($input);
}

/* if the input is an RSS-feed, replace '../base/..' by '../api/..' */
$input = str_replace($url_feed, $api_feed, $input);

/* the flash-applet expects a URL-encoded parameter (?) */
$input = urlencode($input);

$output = '<embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" ' .
'width="' . $width . '" height="' . $height . '" ' .
'flashvars="' .
'host=picasaweb.google.com&' .
'captions=1&RGB=0x000000&' .
'feed=' . $input . '" ' .
'pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';

return $output . "\n";
}

/* variable and functions needed for parsing the HTML to get a RSS-feed */
$picasaFeedURL = '';

function picasaGetFeed($url)
{
global $picasaFeedURL;

$xp = xml_parser_create();
xml_set_element_handler($xp, 'picasaXEStart', 'picasaXEEnd');

$fp = fopen($url, 'r');
while ($data = fread($fp, 4096)) {
xml_parse($xp, $data);
}
fclose($fp);

xml_parser_free($xp);

return $picasaFeedURL;
}

function picasaXEEnd($parser, $name) {}

function picasaXEStart($parser, $name, $attrs)
{
global $picasaFeedURL;

if ($name == 'LINK') {
if (array_key_exists('TYPE', $attrs) && array_key_exists('HREF', $attrs)) {
if ($attrs['TYPE'] == 'application/rss+xml') {
$picasaFeedURL = $attrs['HREF'];
return;
}
}
}
}
?>


Now include in LocalSetting.php:

/* Picasa slideshow extension */
require_once("$IP/extensions/Picasa.php");


Edit an article and write the Picasa-URL of an album between <picasa></picasa> tags. As an example a test album of Google could be used (http://picasaweb.google.com/tester/GoogleSNewSantaMonicaOffice?authkey=3V8IljiqEO0):

<picasa>http://picasaweb.google.com/tester/GoogleSNewSantaMonicaOffice?authkey=3V8IljiqEO0</picasa>


The result should look like the slideshow on http://googleblog.blogspot.com/2007/05/oh-places-youll-go.html.