<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Live aus der Marschrutka &#187; computer</title>
	<atom:link href="http://www.bluetwanger.de/blog/categories/computer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bluetwanger.de/blog</link>
	<description>Markus Bertheau, Software developer</description>
	<lastBuildDate>Tue, 22 Sep 2009 05:27:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash Media Server 3.5 on Ubuntu Linux</title>
		<link>http://www.bluetwanger.de/blog/2009/01/19/flash-media-server-35-on-ubuntu-linux/</link>
		<comments>http://www.bluetwanger.de/blog/2009/01/19/flash-media-server-35-on-ubuntu-linux/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 18:11:13 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/?p=36</guid>
		<description><![CDATA[Update September 13th 2009: Easier to use install script available.
I have been asked for a patch for installing Adobe Flash Media Server 3.5 on Ubuntu. Here it is, with instructions for Ubuntu 8.04.:
# install dependencies for Ubuntu 8.04
# please let me know what is needed on other versions of Ubuntu
sudo apt-get install libnspr4-0d libstdc++6

Now download [...]]]></description>
			<content:encoded><![CDATA[<p style="font-size: large"><strong>Update September 13th 2009:</strong> <a href="http://www.markusbe.com/2009/09/installing-flash-media-server-on-ubuntu-linux/">Easier to use install script available.</a></p>
<div style="text-decoration: line-through">I have been asked for a patch for installing Adobe Flash Media Server 3.5 on Ubuntu. Here it is, with instructions for Ubuntu 8.04.:</p>
<pre># install dependencies for Ubuntu 8.04
# please let me know what is needed on other versions of Ubuntu
sudo apt-get install libnspr4-0d libstdc++6
</pre>
<p>Now download <a href="http://download.macromedia.com/pub/flashmediaserver/fms_development/3_5/linux/FlashMediaServer3.5.tar.gz">Flash Media Server 3.5</a> and copy FlashMediaServer3.5.tar.gz over to your Ubuntu box. Don’t untar the .tar.gz file on windows and copy the files over to linux &#8211; this way file permissions will be wrong and the patch won’t work. Then</p>
<pre>tar xfz FlashMediaServer3.5.tar.gz
cd FMS_3_5_0_r405
wget http://www.bluetwanger.de/~mbertheau/<a href="http://www.bluetwanger.de/~mbertheau/flash-media-server-3.5-ubuntu.patch">flash-media-server-3.5-ubuntu.patch</a>
patch -p1 < flash-media-server-3.5-ubuntu.patch
sudo ./installFMS
</pre>
<p>If you get</p>
<pre>./installFMS: line 172: ./fmsini: No such file or directory

ERROR: You are running the Adobe Flash Media Server installer on the wrong platform.
</pre>
<p>then execute the following:</p>
<pre>sudo apt-get install ia32-libs
</pre>
<p>That will install 32bit support on your 64bit Ubuntu.</p>
<p>If you opted to install Apache and it doesn't work, execute the following if you are on 32 bit:</p>
<pre>sudo ln -s libexpat.so.1 /usr/lib/libexpat.so.0
</pre>
<p>If you are on 64 bit, execute this instead:</p>
<pre>sudo ln -s libexpat.so.1 /usr/lib32/libexpat.so.0
</pre>
<p>You can later uninstall the server:</p>
<pre>cd /opt/adobe/fms
sudo ./uninstallFMS
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2009/01/19/flash-media-server-35-on-ubuntu-linux/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Flash Media Server 3 on Ubuntu 7.10 Gutsy</title>
		<link>http://www.bluetwanger.de/blog/2008/02/11/flash-media-server-3-on-ubuntu-710-gutsy/</link>
		<comments>http://www.bluetwanger.de/blog/2008/02/11/flash-media-server-3-on-ubuntu-710-gutsy/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 17:52:18 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/2008/02/11/flash-media-server-3-on-ubuntu-710-gutsy/</guid>
		<description><![CDATA[Update September 13th 2009: Easier to use install script available.

Update January 31st 2009: Patch for Adobe Flash Media Server 3.5 on ubuntu available.
I have been asked for a patch for installing Adobe Flash Media Server 3 on Ubuntu. Here it is:

# install dependencies
sudo apt-get install libnspr4-dev

Now download Flash Media Server 3, unzip the file and [...]]]></description>
			<content:encoded><![CDATA[<p style="font-size: large"><strong>Update September 13th 2009:</strong> <a href="http://www.markusbe.com/2009/09/installing-flash-media-server-on-ubuntu-linux/">Easier to use install script available.</a></p>
<div style="text-decoration: line-through">
<p><strong>Update January 31st 2009:</strong> <a href="http://www.bluetwanger.de/blog/2009/01/19/flash-media-server-35-on-ubuntu-linux/">Patch for Adobe Flash Media Server 3.5 on ubuntu</a> available.</p>
<p>I have been <a href="http://www.bluetwanger.de/blog/2006/12/25/installing-flash-media-server-2-on-ubuntu-610-edgy/#comment-27811">asked</a> <a href="http://www.bluetwanger.de/blog/2006/12/25/installing-flash-media-server-2-on-ubuntu-610-edgy/#comment-28421">for</a> a patch for installing Adobe Flash Media Server 3 on Ubuntu. Here it is:
<pre>
# install dependencies
sudo apt-get install libnspr4-dev
</pre>
<p>Now <a href="http://www.adobe.com/go/tryflashmediaserver">download Flash Media Server 3</a>, unzip the file and copy <tt>FlashMediaServer3.tar.gz</tt> over to your Ubuntu box. Don&#8217;t untar the <tt>.tar.gz</tt> file on windows and copy the files over to linux &#8211; this way file permissions will be wrong and the patch won&#8217;t work. Then</p>
<pre>
tar xfz FlashMediaServer3.tar.gz
cd FMS_3_0_0_r1157
wget http://www.bluetwanger.de/~mbertheau/<a href="http://www.bluetwanger.de/~mbertheau/flash-media-server-3-ubuntu.patch">flash-media-server-3-ubuntu.patch</a>
patch -p1 &lt; flash-media-server-3-ubuntu.patch
sudo ./installFMS
</pre>
<p>You can later uninstall the server:</p>
<pre>
cd /opt/adobe/fms
sudo ./uninstallFMS
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2008/02/11/flash-media-server-3-on-ubuntu-710-gutsy/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Mapping CapsLock to Escape in Xorg</title>
		<link>http://www.bluetwanger.de/blog/2007/05/12/mapping-capslock-to-escape-in-xorg/</link>
		<comments>http://www.bluetwanger.de/blog/2007/05/12/mapping-capslock-to-escape-in-xorg/#comments</comments>
		<pubDate>Fri, 11 May 2007 21:14:06 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/2007/05/12/mapping-capslock-to-escape-in-xorg/</guid>
		<description><![CDATA[Ok, as I promised, here is how to map CapsLock to Escape in Xorg. This is especially useful for folks who use vim, as CapsLock in on the home row, and Escape is not. Actually escape is that far away that you have to have really long fingers in order to hit escape without moving [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, as I <a href="http://blog.ryanak.ca/archives/14#comment-29">promised</a>, here is how to map CapsLock to Escape in Xorg. This is especially useful for folks who use vim, as CapsLock in on the home row, and Escape is not. Actually escape is that far away that you have to have really long fingers in order to hit escape without moving your hand from its usual position.</p>
<p style="font-size: 85%; margin-left: 20px">Paths and line numbers are given for Ubuntu 7.04 Feisty Fawn, so if you&#8217;re on another distribution or another version of Ubuntu, your mileage may vary.</p>
<p>What we&#8217;ll do is add an XkbOption to the keyboard configuration files. At first, add the following at the end of <tt>/usr/share/X11/xkb/symbols/capslock</tt>:</p>
<pre>
partial hidden modifier_keys
xkb_symbols "escape" {
    key &lt;CAPS&gt; {        [       Escape  ]       };
    key &lt;ESC&gt;  {        [       None    ]       };
};
</pre>
<p>This defines an option that maps the CAPS and ESC key codes to the Escape and None symbols respectively. If you don&#8217;t want to disable the original Escape key, leave the corresponding line out. Now let&#8217;s give it an option name: insert the following line to <tt>/usr/share/X11/xkb/rules/base</tt>, somewhere around line 810, where the other capslock lines are:</p>
<pre>
caps:escape          =       +capslock(escape)
</pre>
<p>Now let&#8217;s add that option to the keyboard configuration in <tt>/etc/X11/xorg.conf</tt>: Find the InputDevice section for the keyboard and add the following line to the section:</p>
<pre>
        Option          "XkbOptions"    "caps:escape"
</pre>
<p>Now restart X by logging out and typing Ctrl-Alt-Backspace at the login prompt. That&#8217;s it. CapsLock is gone and on its place Escape stood in.</p>
<p>I wasn&#8217;t successful in convincing <a href="http://www.advogato.org/person/svu/">the XKeyboardConfig maintainer Sergej Udaltsov</a> to accept a patch for this, but I attempted only once yet :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2007/05/12/mapping-capslock-to-escape-in-xorg/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Firefox custom search engine rant</title>
		<link>http://www.bluetwanger.de/blog/2007/05/11/firefox-custom-search-engine-rant/</link>
		<comments>http://www.bluetwanger.de/blog/2007/05/11/firefox-custom-search-engine-rant/#comments</comments>
		<pubDate>Thu, 10 May 2007 18:48:34 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/2007/05/11/firefox-custom-search-engine-rant/</guid>
		<description><![CDATA[If it wasn&#8217;t for Vimperator, I would still be using Epiphany instead of Firefox. Compare how you create a custom search engine in both:
Epiphany

Create a bookmark of a result page of the search engine (Ctrl-D)
Replace the search term with %s in the URL

Firefox

Write up an XML file according to the OpenSearch spec
Figure out how to [...]]]></description>
			<content:encoded><![CDATA[<p>If it wasn&#8217;t for <a href="http://vimperator.mozdev.org">Vimperator</a>, I would still be using <a href="http://www.gnome.org/projects/epiphany/">Epiphany</a> instead of Firefox. Compare how you create a custom search engine in both:</p>
<h3>Epiphany</h3>
<ol>
<li>Create a bookmark of a result page of the search engine (Ctrl-D)</li>
<li>Replace the search term with <tt>%s</tt> in the URL</li>
</ol>
<h3>Firefox</h3>
<ol>
<li>Write up an XML file according to the <a href="http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox">OpenSearch spec</a></li>
<li>Figure out how to load that file into Firefox</li>
<li>Figure out how to get that XML file right &#8211; Firefox just says that it doesn&#8217;t support this search engine</li>
<li>&#8230;</li>
</ol>
<p>End of rant.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2007/05/11/firefox-custom-search-engine-rant/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Host Networking with VirtualBox on Ubuntu 7.04 Feisty</title>
		<link>http://www.bluetwanger.de/blog/2007/04/30/host-networking-with-virtualbox-on-ubuntu-704-feisty/</link>
		<comments>http://www.bluetwanger.de/blog/2007/04/30/host-networking-with-virtualbox-on-ubuntu-704-feisty/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 12:38:10 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/2007/04/30/host-networking-with-virtualbox-on-ubuntu-704-feisty/</guid>
		<description><![CDATA[This post describes how to set up host networking for VirtualBox on Ubuntu 7.04 Feisty. The procedure probably works for older versions of Ubuntu.
The outcome of the procedure is that you&#8217;ll have a second network card for your virtual machine, which you can configure from inside the virtual machine as if it was a real [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes how to set up host networking for <a href="http://virtualbox.org">VirtualBox</a> on Ubuntu 7.04 Feisty. The procedure probably works for older versions of Ubuntu.</p>
<p>The outcome of the procedure is that you&#8217;ll have a second network card for your virtual machine, which you can configure from inside the virtual machine as if it was a real network card connected to the same ethernet as your real network card.</p>
<p>I assume that you either</p>
<ul>
<li>get your IP address with <a href="http://en.wikipedia.org/wiki/DHCP">DHCP</a></li>
<li>or have a static IP address</li>
</ul>
<p>If you&#8217;re on DSL or cable modem with PPPoE you probably don&#8217;t want host networking, but NAT, which works out of the box.</p>
<p>We&#8217;re going to</p>
<ol>
<li>create a virtual network interface</li>
<li>set up an ethernet bridge</li>
<li>add your physical network interface and the virtual interfaces to the bridge</li>
</ol>
<h2>Preparations</h2>
<p>At first let&#8217;s install the needed software:</p>
<pre>$ sudo apt-get install bridge-utils uml-utilities</pre>
<p>The virtual network interface is configured with the package <tt>uml-utilities</tt>. uml stands for <a href="http://user-mode-linux.sourceforge.net/">User Mode Linux</a>, so understandably the package is preconfigured for use with User Mode Linux. In order to work correctly with VirtualBox, in <tt>/etc/network/if-pre-up.d/uml-utilities</tt> replace</p>
<pre>
chown root:uml-net /dev/net/tun
</pre>
<p>with</p>
<pre>
chown root:vboxusers /dev/net/tun
</pre>
<p>As we&#8217;re going to change the network configuration, we&#8217;re going to shut down the network. So don&#8217;t close this browser window :)</p>
<pre>
$ sudo /etc/init.d/networking stop
</pre>
<h2>Creating a Virtual Network Interface</h2>
<p>Now on to configuring the virtual network interface. Ubuntu and Debian store network configuration in the file <tt>/etc/network/interfaces</tt>. Assuming your network card is <tt>eth0</tt>, you&#8217;ll find a stanza beginning with the following in the file:</p>
<pre>
auto eth0
iface eth0 inet .....
</pre>
<p>Actually at install Ubuntu writes several such stanzas into the file so that they automatically work. Create a backup copy of <tt>/etc/network/interfaces</tt> (Now.) Then comment out all interfaces you don&#8217;t use so that NetworkManager doesn&#8217;t change the network configuration when we don&#8217;t want to. Leave in the <tt>lo</tt> interface, it&#8217;s required for local IP communication.</p>
<pre>
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet .....

#auto eth1
#iface eth1 inet dhcp

#auto ath0
#iface ath0 inet dhcp

#auto wlan0
#iface wlan0 inet dhcp
</pre>
<p>The next step is to create a virtual network interface. This is the network interface that will be used by the virtual machine. We don&#8217;t configure it &#8211; the virtual machine will do it. Add the following stanza under the <tt>lo</tt> interface:</p>
<pre>
auto tap0
iface tap0 inet manual
tunctl_user markus
uml_proxy_arp markus.mynetwork.loc
uml_proxy_ether eth0
</pre>
<p>Replace <tt>markus.mynetwork.loc</tt> with the host name or IP address you get from DHCP for your host machine (not the virtual machine). Also replace <tt>eth0</tt> with your real network interface, if that is not <tt>eth0</tt>, and <tt>markus</tt> with your user name on the system. The user name set here will be the only user with permission to work with the virtual network interface.</p>
<h4>Static IP address</h4>
<p>If you have a static IP address, replace <tt>markus.mynetwork.loc</tt> instead with your static IP address.</p>
<h2>Creating the bridge</h2>
<p>Now we&#8217;ll set up the bridge. Add the following stanza after the <tt>tap0</tt> stanza:</p>
<pre>
auto br0
iface br0 inet dhcp
bridge_ports eth0 tap0
bridge_maxwait 0
</pre>
<h4>Static IP address</h4>
<p>If you have a static IP address, you have to carry over the network settings from <tt>eth0</tt> to <tt>br0</tt>. Assuming your <tt>eth0</tt> stanza looks something like this:</p>
<pre>
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.254
</pre>
<p>change the <tt>br0</tt> stanza to look like this:</p>
<pre>
auto br0
iface br0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.254
bridge_ports eth0 tap0
bridge_maxwait 0
</pre>
<p>In any case, change the stanza for <tt>eth0</tt> to the following:</p>
<pre>
auto eth0
iface eth0 inet manual
</pre>
<p>That&#8217;s it. Enable networking again:</p>
<pre>
$ sudo /etc/init.d/networking start
</pre>
<p>You can use <tt>ifconfig -a</tt> to see if all devices were correctly configured. You can now use host networking in VirtualBox. Enter <tt>tap0</tt> in the interface name field. The fields setup application and terminate application can be left empty.</p>
<h2>More than one virtual network interface</h2>
<p>You can run more than one OS at the same time and have all them use host networking. Add a <tt>tap</tt> interface for all of them. Here&#8217;s an example for three virtual network interfaces:</p>
<pre>
auto tap0
iface tap0 inet manual
tunctl_user markus
uml_proxy_arp markus.mynetwork.loc
uml_proxy_ether eth0

auto tap1
iface tap1 inet manual
tunctl_user markus
uml_proxy_arp markus.mynetwork.loc
uml_proxy_ether eth0

auto tap2
iface tap2 inet manual
tunctl_user markus
uml_proxy_arp markus.mynetwork.loc
uml_proxy_ether eth0

auto br0
iface br0 inet dhcp
bridge_ports eth0 tap0 tap1 tap2
bridge_maxwait 0
</pre>
<p>Have fun, and let me know if that post was helpful to you :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2007/04/30/host-networking-with-virtualbox-on-ubuntu-704-feisty/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Correctly displaying russian MP3 ID3 tags in Muine</title>
		<link>http://www.bluetwanger.de/blog/2007/04/15/correctly-displaying-russian-mp3-id3-tags-in-muine/</link>
		<comments>http://www.bluetwanger.de/blog/2007/04/15/correctly-displaying-russian-mp3-id3-tags-in-muine/#comments</comments>
		<pubDate>Sat, 14 Apr 2007 19:26:01 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/2007/04/15/correctly-displaying-russian-mp3-id3-tags-in-muine/</guid>
		<description><![CDATA[Although I&#8217;m from Germany, I live in Novosibirsk at the moment. Novosibirsk is in Russia, so I listen to russian music. The player I use is muine. Unfortunately the artist and title information looks like this: 
The reason is that windows software that adds meta tags to music files uses the default russian 8-bit encoding [...]]]></description>
			<content:encoded><![CDATA[<p>Although I&#8217;m from Germany, I live in Novosibirsk at the moment. Novosibirsk is in Russia, so I listen to russian music. The player I use is <a href="http://muine-project.org">muine</a>. Unfortunately the artist and title information looks like this: <img src="http://www.bluetwanger.de/blog/wp-content/uploads/2007/04/muine-before.png"/></p>
<p>The reason is that windows software that adds meta tags to music files uses the default russian 8-bit encoding CP1251. All ID3 versions except for the newest ones only allow ISO-8859-1 as the tag encoding. So muine, according to the standard, interprets the tags in ISO-8859-1. Let&#8217;s change that.</p>
<p>I&#8217;m using Ubuntu 6.10. Let&#8217;s have a look at the muine sources:</p>
<pre>~/src/deb$ apt-get install build-essential
~/src/deb$ apt-get source muine
...
dpkg-source: extracting muine in muine-0.8.5
dpkg-source: unpacking muine_0.8.5.orig.tar.gz
dpkg-source: applying ./muine_0.8.5-1ubuntu4.diff.gz
~/src/deb$ cd muine-0.8.5/
~/src/deb/muine-0.8.5$ ls src/
...
AddWindowEntry.cs             DndUtils.cs      Metadata.cs          SkipToWindow.cs
...
</pre>
<p>The file Metadata.cs looks like it&#8217;s responsible for the ID3 tags. Searching it for title shows the following lines:</p>
<pre>
                // Properties :: Title (get;)
                [DllImport ("libmuine")]
                private static extern IntPtr metadata_get_title (IntPtr metadata);
</pre>
<p><tt>DllImport</tt> imports a binary library file. The next line declares a function <tt>metadata_get_title</tt> which is implemented in libmuine. Let&#8217;s look at that.</p>
<pre>
~/src/deb/muine-0.8.5$ ls libmuine/
...
gsequence.c  metadata.c   player-gst-0.8.c  rb-cell-renderer-pixbuf.c
...
</pre>
<p>Searching for <tt>title</tt> in <tt>metadata.c</tt> gives us the following line:</p>
<pre>
        metadata->title = get_mp3_comment_value (tag, ID3_FRAME_TITLE, 0);
</pre>
<p>Which leads us to <tt>get_mp3_comment_value</tt>. Let&#8217;s look at its definition:</p>
<pre>
get_mp3_comment_value (struct id3_tag *tag,
                       const char *field_name,
                       int index)
{
...
        frame = id3_tag_findframe (tag, field_name, 0);
...
        field = id3_frame_field (frame, 1);
...
        ucs4 = id3_field_getstrings (field, index);
...
        utf8 = id3_ucs4_utf8duplicate (ucs4);
...
}
</pre>
<p><tt>get_mp3_comment_value</tt> calls a lot of functions the name of which starts with id3. The functions are not defined in <tt>metadata.c</tt>. They aren&#8217;t defined anywhere in the muine source code:</p>
<pre>
~/src/deb/muine-0.8.5$ grep -r id3_field_getstrings .
./libmuine/metadata.c:  latin1 = id3_ucs4_latin1duplicate (id3_field_getstrings (field, 0));
./libmuine/metadata.c:  ucs4 = id3_field_getstrings (field, index);
</pre>
<p>Only calls to that function. In <tt>metadata.c</tt> there&#8217;s an include statement that includes <tt>id3tag.h</tt>. Looks like what we need. Let&#8217;s download the source for the corresponding library:</p>
<pre>
~/src/deb/muine-0.8.5$ apt-cache search id3tag
libid3tag0 - ID3 tag reading library from the MAD project
libid3tag0-dev - ID3 tag reading library from the MAD project
mp3rename - Rename mp3 files based on id3tags
somaplayer - player audio for the soma suite
~/src/deb/muine-0.8.5$ cd ..
~/src/deb$ apt-get source libid3tag0
...
dpkg-source: extracting libid3tag in libid3tag-0.15.1b
dpkg-source: unpacking libid3tag_0.15.1b.orig.tar.gz
dpkg-source: applying ./libid3tag_0.15.1b-8.diff.gz
~/src/deb$ cd libid3tag-0.15.1b/
~/src/deb/libid3tag-0.15.1b$ grep -r id3_field_getstrings .
...
./field.c:id3_ucs4_t const *id3_field_getstrings(union id3_field const *field,
...
</pre>
<p>The function is defined in <tt>field.c</tt>. It accesses an array <tt>stringlist</tt>. That array is filled in the function <tt>id3_field_parse</tt>. This function calls another function, <tt>id3_parse_string</tt> that extracts the string values of a field.</p>
<pre>
~/src/deb/libid3tag-0.15.1b$ grep -r id3_parse_string *
parse.c:id3_ucs4_t *id3_parse_string(id3_byte_t const **ptr, id3_length_t length,
parse.h:id3_ucs4_t *id3_parse_string(id3_byte_t const **, id3_length_t,
</pre>
<p>This function is defined in <tt>parse.c</tt>. For ISO-8859-1 fields it calls <tt>id3_latin1_deserialize</tt>.</p>
<pre>
~/src/deb/libid3tag-0.15.1b$ grep -r id3_latin1_deserialize *
latin1.c:id3_ucs4_t *id3_latin1_deserialize(id3_byte_t const **ptr, id3_length_t length)
...
</pre>
<p><tt>id3_latin1_deserialize</tt> is defined in <tt>latin1.c</tt>. It calls <tt>id3_latin1_decode</tt> to convert the latin1 string to UCS-4, which in turn calls <tt>id3_latin1_decodechar</tt> to convert a single character. We&#8217;re there: we have found the place we have to change:</p>
<pre>
/*
 * NAME:        latin1->decodechar()
 * DESCRIPTION: decode a (single) latin1 char into a single ucs4 char
 */
id3_length_t id3_latin1_decodechar(id3_latin1_t const *latin1,
                                   id3_ucs4_t *ucs4)
{
  *ucs4 = *latin1;

  return 1;
}
</pre>
<p>The function is very simple: ISO-8859-1 is a subset of unicode, so only a direct assignment is needed. For CP1251 things are different. Looking at the <a href="http://en.wikipedia.org/wiki/CP1251">wikipedia page for CP1251</a>, we see that the letters of the russian alphabet start at 0xC0 with the upper case letters, followed by the lower case letters to 0xFF. Using gnome-character-map, we find that the corresponding unicode code points are U+0410 through U+044F and that the letters are in the same order. Very convenient. Let&#8217;s change the function to return the correct unicode values for the CP1251 letters 0xC0 through 0xFF:</p>
<pre>
id3_length_t id3_latin1_decodechar(id3_latin1_t const *latin1,
				   id3_ucs4_t *ucs4)
{
  if (*latin1 >= 0xc0)
    *ucs4 = 0x410 + (*latin1 - 0xc0);
  else
    *ucs4 = *latin1;

  return 1;
}
</pre>
<p>The unicode encoding used here, UCS-4, just packs the unicode code point in a 32 bit integer, so we can just directly assign the unicode value. Now on to compiling the changed libid3tag.</p>
<pre>
~/src/deb/libid3tag-0.15.1b$ sudo apt-get build-dep libid3tag0
...
~/src/deb/libid3tag-0.15.1b$ sudo apt-get install fakeroot
...
~/src/deb/libid3tag-0.15.1b$ fakeroot dpkg-buildpackage -uc -us
...
~/src/deb/libid3tag-0.15.1b$ sudo dpkg -i ../libid3tag0_0.15.1b-8_i386.deb
...
</pre>
<p>Now let&#8217;s delete the muine song database so that it re-reads the metadata.</p>
<pre>
~/src/deb/libid3tag-0.15.1b$ rm ~/.gnome2/muine/*
</pre>
<p>Start muine and import the music file:</p>
<p><img src="http://www.bluetwanger.de/blog/wp-content/uploads/2007/04/muine-after.png"/></p>
<p>Победа! :)</p>
<p><strong>Update:</strong> Added install of <tt>build-essential</tt> at the beginning.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2007/04/15/correctly-displaying-russian-mp3-id3-tags-in-muine/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Word boundaries for Ctrl-{Left,Right} in Firefox and other Gecko browsers</title>
		<link>http://www.bluetwanger.de/blog/2007/04/12/word-boundaries-for-ctrl-leftright-in-firefox-and-other-gecko-browsers/</link>
		<comments>http://www.bluetwanger.de/blog/2007/04/12/word-boundaries-for-ctrl-leftright-in-firefox-and-other-gecko-browsers/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 08:27:01 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/2007/04/12/word-boundaries-for-ctrl-leftright-in-firefox-and-other-gecko-browsers/</guid>
		<description><![CDATA[By default Gecko based browsers (Firefox, Epiphany) don&#8217;t take punctuation symbols for a word boundary. This means that when you navigate by-word in the URL bar, text inputs or text areas using Ctrl-Left, Ctrl-Right or Ctrl-Backspace, it moves right to the next resp. previous white space. I have found this to be inconvenient when editing [...]]]></description>
			<content:encoded><![CDATA[<p>By default <a href="http://wiki.mozilla.org/Gecko:Home_Page">Gecko</a> based browsers (Firefox, Epiphany) don&#8217;t take punctuation symbols for a word boundary. This means that when you navigate by-word in the URL bar, text inputs or text areas using Ctrl-Left, Ctrl-Right or Ctrl-Backspace, it moves right to the next resp. previous white space. I have found this to be inconvenient when editing URLs, or source code snippets in bug reports and in other places. Thanks to an entry <a href="http://mg.pov.lt/blog/unbreak-firefox-address-bar.html">Unbreaking Firefox&#8217;s address bar</a> from <a href="http://mg.pov.lt/">Marius Gedminas</a> I came to learn how to unbreak this behaviour: Search for <tt>punctuation</tt> in <a href="about:config">about:config</a>; Gecko finds <tt>layout.word_select.stop_at_punctuation</tt> which you need to set to true. More information in the blog post I linked to.</p>
<p>I can generally recommend <a href="http://mg.pov.lt/blog">Marius Gdeminas&#8217; blog</a>, I found quite a lot of interesting things in there, including a link to his <a href="http://mg.pov.lt/gtimelog/">GTimeLog</a>, <a href="http://mg.pov.lt/blog/bash-prompt.html">Bash prompts: showing the command in the window title</a>, <a href="http://mg.pov.lt/blog/xsel.html">xsel: the power of Unix</a>, &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2007/04/12/word-boundaries-for-ctrl-leftright-in-firefox-and-other-gecko-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Flash Media Server 2 on Ubuntu 7.10 Gutsy, 7.04 Feisty and 6.10 Edgy</title>
		<link>http://www.bluetwanger.de/blog/2006/12/25/installing-flash-media-server-2-on-ubuntu-610-edgy/</link>
		<comments>http://www.bluetwanger.de/blog/2006/12/25/installing-flash-media-server-2-on-ubuntu-610-edgy/#comments</comments>
		<pubDate>Mon, 25 Dec 2006 14:02:18 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/2006/12/25/installing-flash-media-server-2-on-ubuntu-610-edgy/</guid>
		<description><![CDATA[Update September 13th 2009: Easier to use install script available.

Update January 31st 2009: Patch for Adobe Flash Media Server 3.5 on ubuntu available.
Update February 11th 2008: Patch for Adobe Flash Media Server 3 on Ubuntu available.
The installation script for Flash Media Server 2 works only on RedHat Enterprise by default. With some modifications it works [...]]]></description>
			<content:encoded><![CDATA[<p style="font-size: large"><strong>Update September 13th 2009:</strong> <a href="http://www.markusbe.com/2009/09/installing-flash-media-server-on-ubuntu-linux/">Easier to use install script available.</a></p>
<div style="text-decoration: line-through">
<p><strong>Update January 31st 2009:</strong> <a href="http://www.bluetwanger.de/blog/2009/01/19/flash-media-server-35-on-ubuntu-linux/">Patch for Adobe Flash Media Server 3.5 on ubuntu</a> available.</p>
<p><strong>Update February 11th 2008:</strong> <a href="http://www.bluetwanger.de/blog/2008/02/11/flash-media-server-3-on-ubuntu-710-gutsy/">Patch for Adobe Flash Media Server 3 on Ubuntu</a> available.</p>
<p>The installation script for Flash Media Server 2 works only on RedHat Enterprise by default. With some <a href="http://www.bluetwanger.de/~mbertheau/fms.patch">modifications</a> it works fine on Ubuntu Gutsy, Feisty and Edgy. At first we need to install the dependencies:</p>
<pre>
# install dependencies
apt-get install libnspr4-dev libstdc++5 libstdc++5-3.3-dev
</pre>
<p>For older versions of Ubuntu (7.04 and 6.10) use:</p>
<pre>
# install dependencies
apt-get install libnspr4 libstdc++5 libstdc++5-3.3-dev
</pre>
<p>Then <a href="http://www.adobe.com/cfusion/tdrc/index.cfm?product=flashmediaserver">download FlashMediaServer2.tar.gz</a> and use the patch:</p>
<pre>
tar xfz FlashMediaServer2.tar.gz
cd FMS*
wget http://www.bluetwanger.de/~mbertheau/fms.patch
patch -p1 < fms.patch
sudo ./installFMS
</pre>
<p>You can later uninstall the server:</p>
<pre>
cd /opt/macromedia/fms
sudo ./uninstallFMS
</pre>
<p><strong>Update January 3rd 2007:</strong> Added installation of dependencies. Thanks to <a href="http://www.markontech.com">Mark Sullivan</a>.</p>
<p><strong>Update May 23rd 2007:</strong> Checked on feisty. Removed dead FMS download link.</p>
<p><strong>Update November 29th 2007:</strong> Adapted instructions for gutsy. Thanks to <a href="http://www.dwalbert.com/">Donavan</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2006/12/25/installing-flash-media-server-2-on-ubuntu-610-edgy/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Jabber transports, or a tutorial on how to use ICQ with Gossip</title>
		<link>http://www.bluetwanger.de/blog/2006/09/24/jabber-transports-or-a-tutorial-on-how-to-use-icq-with-gossip/</link>
		<comments>http://www.bluetwanger.de/blog/2006/09/24/jabber-transports-or-a-tutorial-on-how-to-use-icq-with-gossip/#comments</comments>
		<pubDate>Sun, 24 Sep 2006 06:28:00 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/?p=8</guid>
		<description><![CDATA[Update: It seems that this will soon be obsoleted &#8211; AOL, mother of ICQ, is adopting Jabber.
Gossip has been my favourite Jabber client for a long time. I like the simplicity and non-intrusiveness of its interface. But at work the standard IM network is ICQ. I&#8217;ve been using Gaim to connect to ICQ, but its [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> It seems that this will soon be obsoleted &#8211; <a href="http://florianjensen.com/2008/01/17/aol-adopting-xmpp-aka-jabber/">AOL, mother of ICQ, is adopting Jabber</a>.</p>
<p><a href="http://developer.imendio.com/projects/gossip">Gossip</a> has been my favourite Jabber client for a long time. I like the simplicity and non-intrusiveness of its interface. But at work the standard IM network is ICQ. I&#8217;ve been using <a href="http://gaim.sf.net">Gaim</a> to connect to ICQ, but its interface has always bugged me.</p>
<p>The Jabber protocol provides for so-called transports, which enable you to talk to other IM networks while using Jabber on the client side. Gossip doesn&#8217;t support transports. But although that sounds like a deal-breaker, it isn&#8217;t. Transports work like this: you register on a jabber server and then sign up for a transport, providing your ICQ credentials. Then your ICQ contacts are available through UIN@transport.jabber.example.com, for example. After signing up for the transport using a transport-supporting client, you can use any Jabber client you like, and that includes Gossip. All your ICQ contacts will appear on the new account, and you can add other ICQ accounts using UIN@transport.jabber.example.com.</p>
<p>Now step-by-step for Ubuntu Dapper users:</p>
<ol>
<li>Shut down Gossip.</li>
<li>Install gajim:
<ol>
<li>Applications -&gt; Add/Remove Software</li>
<li>check &#8220;show applications without tech support&#8221;</li>
<li>in the search field enter &#8220;gajim&#8221;</li>
<li>check gajim and click OK</li>
</ol>
</li>
<li>Start gajim through the Applications menu. It&#8217;s in &#8220;Internet&#8221;.</li>
<li>Add your existing jabber account to gajim.</li>
<li>Add a new account on a server that has a transport for ICQ (or whatever you need). I used jabber.freenet.de. This server has transports for AIM/ICQ, MSN, Yahoo, ICQv2 and IRC. You can see a list of accounts in Edit -&gt; Accounts -&gt; New -&gt; Forward.<img src="http://www.bluetwanger.de/gajim-servers.png" />
<p>Use the &#8220;Discover services&#8221; window to find out which transports are offered by a specific server.</p>
<p><img src="http://www.bluetwanger.de/gajim-transports.png" /></p>
<p>You can have both windows open at the same time.</li>
<li>Close the &#8220;Discover services&#8221; window and open it with your new jabber account.</li>
<li>Select the transport you want and click &#8220;Edit&#8221; or &#8220;Register&#8221;. You&#8217;ll be asked to provide the credentials for your ICQ/AIM/whatever account.<img src="http://www.bluetwanger.de/gajim-register-transport.png" /></li>
<li>Close gajim.</li>
<li>Start gossip and add your account on the new server.</li>
</ol>
<p>That&#8217;s it! All your ICQ contacts appear in Gossip. Add new ICQ contacts using UIN@icq.jabber.freenet.de (replace icq.jabber.freenet.de with the transport server you selected).</p>
<p><a href="http://digg.com/linux_unix/How_to_use_ICQ_with_Jabber_clients">Digg this</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2006/09/24/jabber-transports-or-a-tutorial-on-how-to-use-icq-with-gossip/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Epiphany: Automatic bookmark updating</title>
		<link>http://www.bluetwanger.de/blog/2006/09/23/epiphany-automatic-bookmark-updating/</link>
		<comments>http://www.bluetwanger.de/blog/2006/09/23/epiphany-automatic-bookmark-updating/#comments</comments>
		<pubDate>Sat, 23 Sep 2006 09:08:00 +0000</pubDate>
		<dc:creator>Markus Bertheau</dc:creator>
				<category><![CDATA[computer]]></category>

		<guid isPermaLink="false">http://www.bluetwanger.de/blog/?p=7</guid>
		<description><![CDATA[
The text says &#8220;Update bookmark &#8220;IEs 4 Linux &#8211; Internet Explorers for Linux &#8211; English Page&#8221;? The page has moved to the location http://www.tatanka.com.br/ies4linux/index-en.html. [Don't update] [Update].
When a web site is moved to a new address, it can use several ways to redirect visitors to the new address. If it&#8217;s a permanent move, the correct [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.bluetwanger.de/epiphany-respect.png"><img src="http://www.bluetwanger.de/epiphany-respect.png" alt="" border="0" /></a><br />
The text says &#8220;Update bookmark &#8220;IEs 4 Linux &#8211; Internet Explorers for Linux &#8211; English Page&#8221;? The page has moved to the location http://www.tatanka.com.br/ies4linux/index-en.html. [Don't update] [Update].<br />
When a web site is moved to a new address, it can use several ways to redirect visitors to the new address. If it&#8217;s a permanent move, the correct way is to send a <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP 301 Moved Permanently</a>. As it turns out, <a href="http://www.gnome.org/projects/epiphany/">Epiphany</a> notices such redirects and offers to update your bookmark, if you have bookmarked the site&#8217;s old location.<br />
I&#8217;m impressed. The developers of <a href="http://www.gnome.org/projects/epiphany/">Epiphany</a> really did their homework here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluetwanger.de/blog/2006/09/23/epiphany-automatic-bookmark-updating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
