<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" 
   xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" 
   xmlns:html="http://www.w3.org/1999/html" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
   <title>Hay In A Needlestack</title>
   <link>http://www.sagui.org/~gustavo/blog</link>
   <description>Gustavo Vieira's small place in the web, where he shares with the world the geeky bits of knowledge he sometimes finds.</description>
   <language>en</language>
   <copyright>Copyright © 2007,2008,2009,2010 Gustavo M. D. Vieira</copyright>
   <ttl>60</ttl>
   <pubDate>Tue, 08 Jun 2010 01:45 GMT</pubDate>
   <managingEditor>gustavo at sagui.org</managingEditor>
   <generator>PyBlosxom http://pyblosxom.sourceforge.net/ 1.4.2 8/16/2007</generator>
<item>
   <title>Complete Guide to Tap-to-Click in GNOME</title>
   <guid isPermaLink="false">software/complete-guide-to-tap-to-click-in-GNOME</guid>
   <link>http://www.sagui.org/~gustavo/blog/software/complete-guide-to-tap-to-click-in-GNOME.html</link>
   <description><![CDATA[

<p>Want to know everything that matters about tap-to-click and other
touchpad configurations in GNOME. Look no further, <a
href="http://who-t.blogspot.com/2010/05/how-to-enable-tapping-tap-to-click-on.html">go
straight to the source</a>.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">software</category>
   <pubDate>Tue, 08 Jun 2010 01:45 GMT</pubDate>
</item>
<item>
   <title>Boot an Expert 1.1 in OpenMSX</title>
   <guid isPermaLink="false">virtualization/boot-an-expert-1.1-in-openmsx</guid>
   <link>http://www.sagui.org/~gustavo/blog/virtualization/boot-an-expert-1.1-in-openmsx.html</link>
   <description><![CDATA[

<p>Someone asked me recently how to run the Expert 1.1 with DDX-3.0
floppy in <a href="http://openmsx.sourceforge.net/">OpenMSX</a>, as I
described in <a
href="http://www.sagui.org/~gustavo/blog/virtualization/openmsx-rocks.html">this
post</a>.</p>
 
<p>It is very simple actually, as the configuration of a proper
machine is already included in the OpenMSX distribution. If you are
curious, look for these files:
<tt>machines/Gradiente_Expert_1.1/hardwareconfig.xml</tt> and
<tt>extensions/DDX_3.0/hardwareconfig.xml</tt>.</p>

<p> All that remains to do is to find the correct ROMs and use the
correct command line options. Finding the ROMs is quite easy: ask
Google. Put the ROMs in <tt>~/.openMSX/share/systemroms/</tt>. The
final command line should be something like:</p>

<pre>
$ openmsx -machine Gradiente_Expert_1.1 -ext DDX_3.0
</pre>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">virtualization</category>
   <pubDate>Sat, 31 Oct 2009 18:12 GMT</pubDate>
</item>
<item>
   <title>GTalk TLS Handshake Bug</title>
   <guid isPermaLink="false">software/GTalk-TLS-handshake-bug</guid>
   <link>http://www.sagui.org/~gustavo/blog/software/GTalk-TLS-handshake-bug.html</link>
   <description><![CDATA[

<p>Since late February I stopped seeing my GTalk friends in my IM
client. I use a personal Jabber server (<a
href="http://jabberd2.xiaoka.com/">jabberd2</a>) and all its
connections to the GTalk servers were being dropped. After some
investigation in the web, I found that Google:

<ul>
  <li>Uses a buggy TLS implementation.</li>
  <li>Has activated encryption for s2s connections starting in
  February.</li>
</ul>

The end result was that my server could not establish an encrypted
connection with GTalk servers. Here is a <a
href="http://twistedmatrix.com/trac/ticket/3463">very informative bug
report</a>.</p>

<p>As GTalk connectivity is very important for any open Jabber server,
many servers have published workarounds for the problem. Here is <a
href="http://jabberd2.xiaoka.com/ticket/256">a patch for
jabberd2</a>. A <a
href="http://ftp.xiaoka.com/jabberd2/releases/jabberd-2.2.7.1.tar.bz2">new
release (2.2.7.1)</a> of jabberd2 was also made to address the
issue.</p>

<p>I have jabberd2 2.2.4 in my server. For some reason, I could not
make 2.2.7.1 work because of some problems with the Berkeley DB back
end. I ended up applying <a
href="http://jabberd2.xiaoka.com/ticket/256">this patch</a> to 2.2.4
and it fixed the problem. I also created a <a
href="https://bugzilla.redhat.com/show_bug.cgi?id=488456">bug
report</a> in the Fedora Bugzilla, so maybe a fixed package will be
pushed as an update.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">software</category>
   <pubDate>Wed, 04 Mar 2009 13:45 GMT</pubDate>
</item>
<item>
   <title>Fedora 9</title>
   <guid isPermaLink="false">fedora/fedora-9</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/fedora-9.html</link>
   <description><![CDATA[

<p>The Fedora train never stops! I've just upgraded my machines
(including this server) to Fedora 9 and I'm very pleased (as usual)
with this new release. The polish of the desktop is
fantastic. PackageKit is really simple to use (I love its "queue for
backend operations" interface philosophy). NetworkManager has
matured. The PulseAudio integration, that bothered me a lot in Fedora
8, seems to be complete (the sound daemon is always started and Ekiga
won't crash anymore).</p>

<p>As usual, there are some sore spots. And I seemed to attract a lot
of bugs this time. For example, among <a
href="http://fedoraproject.org/wiki/Bugs/F9Common">the most common
bugs in F9</a>, I got two: <a
href="http://bugzilla.redhat.com/439386">"Synaptics touchpad touching
to tap doesn't work"</a> and <a
href="https://bugzilla.redhat.com/show_bug.cgi?id=442457">"Samsung
hard disks crash the installer"</a>. The last one was a real problem
and I ended up upgrading using YUM, which I don't recommend if you
have a lot of installed packages and have to suffer ridiculous
Brazilian "broadband" speeds.</p>

<p>But it gets better. I was hit by more obscure stuff: While
installing Fedora on the university cluster I discovered that <a
href="https://bugzilla.redhat.com/show_bug.cgi?id=392021">Anaconda
doesn't work right now with static IPs</a>. I ended up setting a DHCP
server just for installing Fedora.  Also, due to a rewrite <a
href="https://bugzilla.redhat.com/show_bug.cgi?id=446224">GDM XDMCP
support is broken</a>. I must be one of the two guys who still use
XDMCP to power an old terminal and share the (relatively) powerful
desktop. I worked around it by enabling KDM instead of GDM.</p>

<p>The annoying thing about these bugs is that most of them were
found on the beta testing period of F9, and none were corrected for
the final release. At least, I don't have to feel guilt for never
trying one of the preview releases. ;)</p>

<p>Finally, this isn't a bug proper, but I hope I can help someone
with the same problem. If your numeric keypad stops working
mysteriously, go to the "Assistive technology" preferences and disable
the "Mouse keys". It was enabled magically during the upgrade and took
me bit of time to figure it out.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Mon, 25 Aug 2008 22:45 GMT</pubDate>
</item>
<item>
   <title>IPv6 on Fedora (Redux)</title>
   <guid isPermaLink="false">fedora/ipv6-on-fedora-redux</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/ipv6-on-fedora-redux.html</link>
   <description><![CDATA[

<p>A little improvement on my <a
href="http://www.sagui.org/~gustavo/blog/fedora/ipv6-on-fedora.html">IPv6
setup</a>. I discovered a handy configuration parameter for RADV that
makes it unnecessary to update the configuration file in the rare
occasion my IP address changes.  The improved <tt>/etc/radvd.conf</tt>
looks like this:</p>
<pre>
interface eth0
{
        AdvSendAdvert on;
        MinRtrAdvInterval 30;
        MaxRtrAdvInterval 100;
        prefix 0:0:0:1::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
                Base6to4Interface eth1;
        };

};
</pre>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Tue, 24 Jun 2008 20:54 GMT</pubDate>
</item>
<item>
   <title>IPv6 on Fedora</title>
   <guid isPermaLink="false">fedora/ipv6-on-fedora</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/ipv6-on-fedora.html</link>
   <description><![CDATA[

<p>After hearing about the <a
href="http://arstechnica.com/news.ars/post/20080102-icann-to-add-ipv6-addresses-for-root-dns-servers.html">activation
of IPv6 (AAAA) records for four of the root DNS servers</a> I got very
curious about IPv6 and its current state of adoption. Well, it turns
out IPv6 <a
href="http://www.nanog.org/mtg-0710/presentations/Bush-v6-op-reality.pdf">may
not be the solutions to all Internet woes but we will have to learn to
live with it anyway</a>.</p>

<p>And so I did. Like 99.999% percent of Internet users I don't have a
native IPv6 connection, but enabling a IPv6 tunnel on Fedora is very,
very easy. I decided for the simplest type of tunnel, called <a
href="http://en.wikipedia.org/wiki/6to4">6to4</a>. This type of tunnel
is very convenient as I don't need to register it anywhere nor do I
need to ask permission to anyone. It is based on the kindness of
people that run 6to4 routers in the IPv4 Internet at the 192.88.99.1
anycast address. Usually people disregard this type of tunnel as being
slow, but routing from Brazil to the world is already so slow I found
the performance acceptable. Besides, there isn't much yet to do in the
current IPv6 Internet.</p>

<p>Enabling a 6to4 tunnel on Fedora is ridiculously simple. First put
the following lines in <tt>/etc/sysconfig/network</tt>:</p>
<pre>
NETWORKING_IPV6=yes
IPV6_DEFAULTDEV=tun6to4
IPV6FORWARDING=yes
</pre>

<p>The last line is only required if you are going to share the IPv6
connection with a local network. The rest of this recipe assumes you
are. Now find the configuration file for the interface connected to
the Internet. If it is <tt>eth1</tt> the file should be
<tt>/etc/sysconfig/networking/devices/ifcfg-eth1</tt>. Put the
following lines there:<p>
<pre>
  IPV6INIT=yes
  IPV6TO4INIT=yes
  IPV6_CONTROL_RADVD=yes
  IPV6TO4_ROUTING="eth0-:1::1/64 wlan0-:2::1/64"
</pre>

<p>Once again, the last two lines are only required if you have a local
network you want to provide with IPv6 connectivity. If not, remove the
extra lines and you are set. Restart the interface and you are
connected to the IPv6 Internet! When using 6to4, probably due to the
performance concerns, Fedora prefers IPv4 addresses. So, go to a IPv6
only site (like <a
href="http://www.ipv6.bieringer.de/">http://www.ipv6.bieringer.de/</a>)
to test it. And remember to define a IPv6 firewall. Your current
iptables firewall only covers IPv4, use ip6tables to create a IPv6
one.</p>

<p>A nice thing about this setup is that a 6to4 tunnel gives me a
whole /48 netblock based on my IPv4 address. So, no NAT in my local
IPv6 network! The last two lines
lines above allow the networking scripts to control the RADV daemon
and to create IPv6 addresses to other interfaces (besides the one you
are actually configuring). Just treat the /48 of your 6to4 address as
a prefix and create a /64 netblock for each interface. Create a
<tt>/etc/radvd.conf</tt> file with an entry like this for each
interface:</p>
<pre>
interface eth0
{
        AdvSendAdvert on;
        MinRtrAdvInterval 30;
        MaxRtrAdvInterval 100;
        prefix 2002:XXXX:XXXX:1::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        };

};
</pre>

<p>Where <tt>2002:XXXX:XXXX</tt> is your automatically configured 6to4
adress. Start RADV daemon and the hosts in you internal network should
receive an automatically generated address.</p>

<p>For me, the next step would be to do the same to this site and add
a little bit more content to the IPv6 Internet. Unfortunately, the Xen
kernel used by my VPS provider doesn't support stateful iptables
support for IPv6. I though IPv6 support on Linux was a done deal, but
this critical functionality was only added about and year ago in
kernel 2.6.20. It seems IPv6 may be a bit farther in the future than I
expected. But it was surely fun to set it up anyway.</p>


]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Mon, 25 Feb 2008 22:27 GMT</pubDate>
</item>
<item>
   <title>Fedora 8</title>
   <guid isPermaLink="false">fedora/fedora-8</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/fedora-8.html</link>
   <description><![CDATA[

<p>I've been running Fedora 8 for the last couple of weeks. If nothing
else, using Fedora is a constant source of fun. Always new toys to
play with, old bugs fixed, new bugs created. And obviously, new tricks
to be learned.</p>

<p><a href="http://www.pulseaudio.org/">PulseAudio</a> is one of the
great features introduced in Fedora 8. I really enjoyed the good work
that went into integrating PulseAudio and Fedora. It really is
seamless, except for the <a
href="https://bugzilla.redhat.com/show_bug.cgi?id=303951">odd bug in
alsa</a> and <a
href="http://www.pulseaudio.org/wiki/PerfectSetup#Skype">proprietary
applications</a>. Here are two things I discovered regarding pulse
audio. </p>

<p>First: PulseAudio shows a simplified but functional interface to
control sound, and to support Alsa applications transparently, it
appears as the default virtual device hiding you hardware
device. Problem is, if the hardware device is muted or has the volume
set too low, there is nothing you can do through the PulseAudio
interface to make sound work. Obvious as it seems, you have to first
enable and adjust the volume of the relevant inputs in the hardware
device, and then be able to enjoy PulseAudio. You can use the
<tt>alsamixer -c [0...7]</tt> command, changing the <tt>-c</tt>
argument until you find your hardware device, set it up, and you are
ready to go. The good news is that, once it is done, applications
(such as Skype) won't be messing with your hardware device as
PulseAudio hides it.</p>

<p>Second: to enable the PulseAudio daemon in you GNOME session, you
need to go to System|Preferences|Hardware|Sound and <b>enable
ESD</b>. That's really stupid, they should have changed the label, but
this control really creates an instance of the PulseAudio daemon. If
it isn't running, sound won't work. I discovered this because ESD gave
me a lot of problems in the past and have been deactivated in my GNOME
preferences for a long time. It never occurred to me to enable it to
fix Alsa applications that suddenly stopped working. But, again, once
you discover that, everything just works.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Tue, 22 Jan 2008 00:59 GMT</pubDate>
</item>
<item>
   <title>Munin and Postfix</title>
   <guid isPermaLink="false">software/Munin-and-Postfix</guid>
   <link>http://www.sagui.org/~gustavo/blog/software/Munin-and-Postfix.html</link>
   <description><![CDATA[

<p>One more in the ongoing series "patches that make the world go
round". If you happen do use the excellent <a
href="http://munin.projects.linpro.no/">Munin</a> to monitor your
servers and use the Postfix plugins, you may have noticed that Munin
1.2.5 introduced a bug in the postfix_mailstats plugin. The bug report
and fix is <a
href="http://munin.projects.linpro.no/ticket/479">here</a>.</p>

<p>Remember people: release early, release often!</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">software</category>
   <pubDate>Sat, 15 Dec 2007 16:00 GMT</pubDate>
</item>
<item>
   <title>OpenSER 1.2.2 PostgreSQL Driver Patch</title>
   <guid isPermaLink="false">software/OpenSER-1.2.2-PostgreSQL-driver-patch</guid>
   <link>http://www.sagui.org/~gustavo/blog/software/OpenSER-1.2.2-PostgreSQL-driver-patch.html</link>
   <description><![CDATA[

<p>I run a personal SIP server powered by <a
href="http://www.openser.org/">OpenSER</a>. Actually, calling
something a SIP server is a bit of oversimplification as the protocol
and actions associated with it are fairly complex (as far as I know, I
run a SIP proxy and location server). All this to say that OpenSER uses a
relational database to store its data, as do all classy enterprise
software out there.</p>

So far, so good, but when it comes to relational databases I like
using PostgreSQL instead of the OpenSER default MySQL. Why? Because I
know how to use it! Problem is, the last stable release of OpenSER
(1.2.2) has a serious bug in the PostgreSQL driver, <a
href="http://openser.org/pipermail/users/2007-August/012641.html">making
it impossible to use</a>. It's a pity no one bothered to do a brown
bag release because of this issue. Not being the default database
really turns you into a second class citizen. Anyway, the fix is
already in the OpenSER SVN, but I will post the patch here, to those
that want to stick to the released version.

<pre>
diff -ru openser-1.2.2-tls.orig/modules/postgres/db_res.c openser-1.2.2-tls/modules/postgres/db_res.c
--- openser-1.2.2-tls.orig/modules/postgres/db_res.c    2007-08-16 11:23:05.000000000 -0300
+++ openser-1.2.2-tls/modules/postgres/db_res.c 2007-11-25 08:23:53.000000000 -0200
@@ -572,6 +572,7 @@
         * If this is not done, a memory leak will happen.
         */
        for (col = 0; col < ROW_N(_row); col++) {
+         _val = &(ROW_VALUES(_row)[col]);
           switch (VAL_TYPE(_val)) {
             case DB_STRING:
               LOG(L_DBG, "PG[free_row]: %p=pkg_free() VAL_STRING[%d]\n", (char *)VAL_STRING(_val), col);
</pre>

<p>The silver lining in this was that it was quite easy to find a
solution to this problem. Before OpenSER I used for some time the
original SER, and I can tell you, it is almost impossible to find some
help on the web. Both because SER is a lousy name to base a Google
search :) and because the project isn't quite transparent as  a proper
open source project should be.  So, congratulations to the OpenSER
developers! And remember, release early, release often!</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">software</category>
   <pubDate>Sun, 25 Nov 2007 20:03 GMT</pubDate>
</item>
<item>
   <title>Really Obsolete RPMs</title>
   <guid isPermaLink="false">fedora/really-obsolete-rpms</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/really-obsolete-rpms.html</link>
   <description><![CDATA[

<p>The version of K9Copy  packaged by Livna is now newer than the one
I maintained, so I'm officially taking it down.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Sun, 25 Nov 2007 19:20 GMT</pubDate>
</item>
<item>
   <title>Obsolete RPMs</title>
   <guid isPermaLink="false">fedora/obsolete-rpms</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/obsolete-rpms.html</link>
   <description><![CDATA[

<p>Both <a href="http://openmsx.sourceforge.net/">OpenMSX</a> and <a
href="http://k9copy.sourceforge.net/">K9Copy</a> now have official
RPMs for Fedora. OpenMSX is part of the main distribution, just
execute <tt>yum install openmsx</tt>. K9Copy is packaged by <a
href="http://rpm.livna.org/">Livna</a>, go there and install their
repo.</p>

<p>As my version of K9Copy is newer than the one packaged by Livna, I
will keep it a bit longer. When Livna catches up, I will remove it
from the site. See, I actually like being obsoleted. :)</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Fri, 05 Oct 2007 20:57 GMT</pubDate>
</item>
<item>
   <title>Emacs And Cedilla</title>
   <guid isPermaLink="false">software/emacs-and-cedilla</guid>
   <link>http://www.sagui.org/~gustavo/blog/software/emacs-and-cedilla.html</link>
   <description><![CDATA[

<p>This one is for the "unlikely bugs" section. If you use the
magic combination of Emacs 22, a US keyboard and dead keys in a UTF-8
locale, the combination ' + c will give you ć instead of
ç. Of course, this is a bug only if you want ç and not ć, so please
forgive my ç-centrism. No offense intended to ć-using languages,
whatever they may be. :)</p>

<p>GTK2 had this same bug about 5 years ago, and they solved it by
creating the "cedilla" input method, and selecting it according to
locale. Guess the Emacs guys will have to go the same
route. Meanwhile, a simple workaround is to fire up Emacs in a
ISO-8859-1 locale: "<tt>$ LC_ALL=pt_BR emacs</tt>" and as soon as the
program opens up, select "Options|Mule|Set Language
Environment|UTF-8". It isn't pretty, but as I use the US keyboard only
rarely this works for me.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">software</category>
   <pubDate>Wed, 03 Oct 2007 17:04 GMT</pubDate>
</item>
<item>
   <title>DSPAM Hash Driver Patches</title>
   <guid isPermaLink="false">software/DSPAM-hash-driver-patches</guid>
   <link>http://www.sagui.org/~gustavo/blog/software/DSPAM-hash-driver-patches.html</link>
   <description><![CDATA[

<p>I use the fantastic <a
href="http://www.nuclearelephant.com/">DSPAM</a> SPAM filter in my
mail server. I like it very much, specially when using the built-in
hash-based storage, making it very fast and really easy to setup. That
is, if the documentation and administration tools weren't so
lacking. On the plus side, I got to know a little better the tool that
keeps my email sanity and respect the developers that make it
happen.</p>

<p>If you are an user of the hash driver, you can't rely on the
provided tools to maintain your installation. The recommended way of
cleaning old messages signatures doesn't work for this driver. Also,
the hash-based database has to be cleaned from time to time or it will
grow too big, but the tool to do it (<tt>cssclean</tt>) just doesn't
work. To handle these problems, I first had to patch DSPAM so I could
get a working <tt>cssclean</tt>. The main patch was created by Frank
Cusack and you can get it in his aptly named message <a
href="http://www.mail-archive.com/dspam-dev@lists.nuclearelephant.com/msg00066.html">"cssclean
is a redheaded stepchild"</a> to the dspam-dev mailing list.</p>

<p>The second patch isn't strictly necessary (and I fear it might
violate some design principle of DSPAM), but it keeps
<tt>cssclean</tt> from resetting the statistics of the database. I
really can't remember where I found it, so I post it here:</p>

<pre>
diff -ru dspam-3.8.0.orig/src/tools.hash_drv/cssclean.c dspam-3.8.0/src/tools.hash_drv/cssclean.c
--- dspam-3.8.0.orig/src/tools.hash_drv/cssclean.c      2006-05-27 18:00:36.000000000 -0300
+++ dspam-3.8.0/src/tools.hash_drv/cssclean.c   2007-06-27 19:18:51.000000000 -0300
@@ -167,7 +167,7 @@
     header = offset;
     filepos += sizeof(struct _hash_drv_header);
   }
-
+  bcopy (old.header, new.header, sizeof(struct _hash_drv_header));
   _hash_drv_close(&new);
   _hash_drv_close(&old);
   rename(newfile, filename);
</pre>

<p>Finally, I run the following script monthly using cron:</p>

<pre>
# Clean hashes and signatures.
for u in /var/lib/dspam/data/*/*.css; do
    /usr/bin/cssclean $u
done
find /var/lib/dspam/data -name *sig -type f -mtime +30 -exec rm -f {} \;
</pre>

<p> Probably you will have to adapt it to the file locations of your
DSPAM installation.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">software</category>
   <pubDate>Tue, 02 Oct 2007 20:19 GMT</pubDate>
</item>
<item>
   <title>K9Copy 1.1.3 RPM</title>
   <guid isPermaLink="false">fedora/k9copy-1.1.3-rpm</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/k9copy-1.1.3-rpm.html</link>
   <description><![CDATA[

<p>I've updated my RPM package for <a
href="http://k9copy.sourceforge.net/">K9Copy</a> to the 1.1.3 release.
Get it <a
href="http://www.sagui.org/~gustavo/blog/static/k9copy-rpm.html">here</a>.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Wed, 29 Aug 2007 14:46 GMT</pubDate>
</item>
<item>
   <title>High Resolution Timer in Java 5</title>
   <guid isPermaLink="false">code/high-resolution-timer-in-java-5</guid>
   <link>http://www.sagui.org/~gustavo/blog/code/high-resolution-timer-in-java-5.html</link>
   <description><![CDATA[

<p>Last week I needed to generate (somewhat) high-frequency recurring
events in Java for my thesis work. Nothing like real time, just call a
method from 10 to 1000 times per second, but I want to able to tune it
so it can run at a precise frequency in this interval. Should be easy,
right? In theory it is: discover the period of recurrence, do the
action, sleep the remaining time until the next occurrence. For
example: if I want to generate 500 events per second and my action
takes 200µs, then my period is 2ms and I must sleep 1800µs between
executions.</p>

<p>So, I need microsecond precision for the sleep. It is widely known
that this is impossible in Java 1.4 without some native
code. Fortunately, in Java 5 it's pretty easy to get nanosecond
precision and this <a
href="http://blogs.sun.com/dholmes/entry/inside_the_hotspot_vm_clocks">blog
entry</a> is very, very informative. Briefly, if you want to measure a
time delta with nanosecond precision use <tt>System.nanoTime()</tt>,
if you want to schedule a (possibly recurring) event with the same
precision use the <tt>ScheduledThreadPoolExecutor</tt> class. I ended
up using the former for my code.</p>

<p>But now, the weird part. Along with <tt>System.nanoTime()</tt>,
Java 5 introduced the <tt>Object.wait(millis, nanos)</tt> and
<tt>Thread.sleep(millis, nanos)</tt> methods for high resolution
sleeps. Take a look at the source code for the implementation of these
methods <a
href="https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/j2se/src/share/classes/java/lang/Thread.java?rev=227&view=markup">here</a>
(gotta love free software!). See. These methods just round up or down
the millisecond argument using the nanosecond argument and call the
millisecond only version of the methods. It took me some time and a
bit of frustration to notice this. Annoying. You might be wondering:
how the heck is <tt>ScheduledThreadPoolExecutor</tt> implemented then?
The answer is another sleep method introduced in Java 5:
<tt>LockSupport.parkNanos</tt>. This one actually works, as it uses a
different native implementation.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">code</category>
   <pubDate>Tue, 28 Aug 2007 14:47 GMT</pubDate>
</item>
<item>
   <title>Jaitime.org Fedora Core 6 Image Fix</title>
   <guid isPermaLink="false">virtualization/jailtime.org-fedora-core-6-image-fix</guid>
   <link>http://www.sagui.org/~gustavo/blog/virtualization/jailtime.org-fedora-core-6-image-fix.html</link>
   <description><![CDATA[

<p>My VPS provider uses Xen and the distro images from <a
href="http://jailtime.org/">Jailtime.org</a>. Recently I installed a
fresh Fedora Core 6 image (as they don't have a Fedora 7 image) and
found a very subtle bug.</p>

<p>In the tweaks section of the <a
href="http://jailtime.org/download:fedora:fc6">FC6 image at
Jailtime.org</a> it is said:</p>
<pre>
To resolve tls issues, issued the following commands (*):
  # cp /lib/i686/nosegneg/lib* /lib/i686/
  # ldconfig
</pre>

<p>The problem with this hack is that when you <b>upgrade</b> your
glibc, the copied files will remain and will conflict with the new
updated files. This is not theoretical, right now if you download and
run the image, then execute <tt>yum upgrade</tt> your VM is hosed.
End result, segmentation faults all around and you VM won't boot
anymore.<p>

<p>To avoid the problem, remove all files copied into
<tt>/lib/i686</tt>:</p>

<pre>
# rm -f /lib/i686/libpthread* /lib/i686/libc* /lib/i686/libm* \
        /lib/i686/librt* /lib/i686/libthread_db*
</pre>

<p>The alternative to fix TLS problems is proposed on the Jailtime.org
site itself:<p>

<pre>
An alternative to the tweak above is to use the following commands:
  # echo "hwcap 0 nosegneg" > /etc/ld.so.conf.d/libc6-xen.conf
  # ldconfig
</pre>

<p>But it came with the cryptic warning that "This alternative did not
work in the jailtime image however". Well, it <b>does</b> work with
the Jailtime.org image.</p>

<p>By the way, after this issue was solved, I was able not only to
update FC6, but to upgrade to F7 using Yum. The only extra step
necessary is to make sure in the newly installed
<tt>/etc/rc.d/rc.sysinit</tt> has the <tt>/sbin/start_udev</tt> line
is commented out. Also, for some strange reason, the libgcc and libstdc++
packages have a higher version number in FC6 than in F7, so you will
have to update these two by hand. Besides that, just follow <a
href="http://fedoraproject.org/wiki/YumUpgradeFaq">this
procedure</a>.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">virtualization</category>
   <pubDate>Tue, 24 Jul 2007 16:47 GMT</pubDate>
</item>
<item>
   <title>Philips MCM108 Remote Bug</title>
   <guid isPermaLink="false">hardware/philips-mcm108-remote-bug</guid>
   <link>http://www.sagui.org/~gustavo/blog/hardware/philips-mcm108-remote-bug.html</link>
   <description><![CDATA[

<p>Recently I bought a Philips MCM108 compact stereo. It's a simple
device, that works really well as an alarm clock. But it got a UI bug
that's really annoying. The remote, for some bizarre reason, operates
in a mode oriented fashion. That is, it only sends CD commands when
you are in "CD mode". Problem is, you can enter "CD mode" from the
main device itself, obviously without authorization from the
remote. The end result is that you believe you remote is broken
because you can't change albums, stop or start CD play. The solution?
Every time the remote becomes catatonic, press the CD button to
remember it of its sole purpose in life.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">hardware</category>
   <pubDate>Mon, 02 Jul 2007 22:13 GMT</pubDate>
</item>
<item>
   <title>My Pyblosxom Setup</title>
   <guid isPermaLink="false">metablog/my-pyblosxom-setup</guid>
   <link>http://www.sagui.org/~gustavo/blog/metablog/my-pyblosxom-setup.html</link>
   <description><![CDATA[

<p>I'm running this site using Pyblosxom running on Fedora. Pyblosxom (as
the original Blosxom) is very simple and uses only the file system to
store blog entries, configuration, etc. Think of it as server side
includes on steroids. As I know a bit of HTML, CSS and Python, and
really hate big complex web applications it seemed like the perfect
match for me.</p>

<p>I setup Pyblosxom as a non-root user, serving it from my
<tt>public_html</tt>. To do this in Fedora you have to uncomment in
the <tt>httpd.conf</tt> files the lines controlling <tt>UserDir</tt>
directories and add the following to enable CGI from the
<tt>public_html</tt>:
<pre>
&lt;Directory /home/*/public_html/cgi-bin/&gt;
    Options ExecCGI SymLinksIfOwnerMatch
    SetHandler cgi-script
&lt;/Directory&gt;
</pre>

If SELinux is active you have to ensure that the files in
<tt>~/public_html</tt> and <tt>~/public_html/cgi-bin</tt> have the
right context (more info <a
href="http://docs.fedoraproject.org/selinux-apache-fc3/">here</a>).</p>

<p>With that out of the way, just install Pyblosxom as described by its
documentation. The only twist in my setup is that I hide the name of
Pyblosxom CGI script from my URLs and make the root of my page
redirect to the blog root. This is accomplished with a bit of Apache
rewrite magic. Put this <tt>.htaccess</tt> file in your
<tt>public_html</tt>:
<pre>
RewriteEngine on
RewriteBase /~replace-with-your-user-name
RewriteRule ^$ blog/ [R=permanent]
RewriteRule ^index.htm.*$ blog/ [R=permanent]
RewriteRule ^blog$ cgi-bin/pyblosxom.cgi
RewriteRule ^blog/(.*) cgi-bin/pyblosxom.cgi/$1
</pre></p>

<p>Configuration of Pyblosxom is best covered in its manual, but here is
a tip I missed the first time. When customizing a flavour (and that's
exactly like maintaining some server side includes), you can just copy
the default <tt>html.flav</tt> dir to your local flavour dir; Pyblosxom will
always pick the locally defined one overriding the default, so you
don't have to call it anything different than "html".</p>

<p>Besides Pyblosxom, some HTML and CSS, I use the following Pyblosxom
plug-ins:
<ul>
 <li><a
 href="http://pyblosxom.sourceforge.net/blog/registry/files/pystaticfile"><tt>pystaticfile.py</tt></a>:
 To have some non-blog entry, non-dated pages rendered with the same
 layout.</li>
 <li><a
 href="http://pyblosxom.sourceforge.net/blog/registry/display/pagetitle"><tt>pagetitle.py</tt></a>:
 To have the entry title display at the page title (be sure to read
 the documentation in the <emph>source file</emph>).</li>
 <li><a
 href="http://pyblosxom.sourceforge.net/blog/registry/archives/wbgarchives"><tt>wbgarchives.py</tt></a>:
 For compact archive links.</li>
</ul></p>

<p>There are many other plug-ins available, and it doesn't seem to be
really hard to code a new one in Python.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">metablog</category>
   <pubDate>Sat, 30 Jun 2007 12:39 GMT</pubDate>
</item>
<item>
   <title>OpenMSX Rocks!</title>
   <guid isPermaLink="false">virtualization/openmsx-rocks</guid>
   <link>http://www.sagui.org/~gustavo/blog/virtualization/openmsx-rocks.html</link>
   <description><![CDATA[

<p>If you are a Brazilian (or Russian) geek in your thirties you must
have spend a lot of your teen years in front of a <a
href="http://en.wikipedia.org/wiki/MSX">MSX computer</a>.</p>

<p>For a long time I have kept copies of <a
href="http://fms.komkon.org/fMSX/">fMSX</a> lying around in my hard
disk, in case I want to play some of the memorable games of my
childhood. Problem is, I was having a hard time compiling it in recent
systems. When looking for a alternative, I investigated <a
href="http://openmsx.sourceforge.net/">OpenMSX</a> and instantly
recognized I had found the holy grail of MSX emulation. OpenMSX does
not emulate one MSX implementation, it implements <b>all</b> of
them. It isn't just a matter of playing the games, you can really
relive the hardware with it.<p>

<p>For example, I was able to boot a <a
href="http://www.old-computers.com/museum/computer.asp?st=1&c=832">Gradiente
Expert 1.1</a>, with the DDX-3.0 floppy controller and a MegaRAM
cartridge just like it was 1988. I'm really sorry now
that I haven't managed to make images of all my floppies.</p>

<p>As an extra bonus, OpenMSX is very Linux friendly and very easy to
build. So I created a RPM package of it for Fedora, instead of just
installing in my home dir. I don't know if I will be able to properly
maintain it, but if you are interested check the <a
href="http://www.sagui.org/~gustavo/blog/static/openmsx-rpm.html">OpenMSX
RPM</a> link in the nav bar.</p>


]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">virtualization</category>
   <pubDate>Tue, 19 Jun 2007 19:45 GMT</pubDate>
</item>
<item>
   <title>Copying Dual Layer DVDs on Fedora</title>
   <guid isPermaLink="false">fedora/k9copy-to-copy-dual-layer-dvds</guid>
   <link>http://www.sagui.org/~gustavo/blog/fedora/k9copy-to-copy-dual-layer-dvds.html</link>
   <description><![CDATA[

<p>If you want to copy a dual layer DVD to a single layer one in
Linux, you will very pleased to know <a
href="http://k9copy.sourceforge.net/">K9Copy</a>. This is a nice
utility that removes unwanted extras and/or requantizes the main title
while preserving the menu structure.</p>

<p>As it isn't available in the Livna repository, I created a RPM of
it for Fedora. Check the <a
href="http://www.sagui.org/~gustavo/blog/static/k9copy-rpm.html">K9Copy
RPM</a> link in the nav bar.</p>

]]></description>
   <category domain="http://www.sagui.org/~gustavo/blog">fedora</category>
   <pubDate>Tue, 19 Jun 2007 19:42 GMT</pubDate>
</item>
</channel>
</rss>
