<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:dc="http://purl.org/dc/elements/1.1/" 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>Random notes from mg</title><link>http://mg.pov.lt/blog</link><description>a blog by Marius Gedminas</description><language>en</language><ttl>60</ttl><dc:creator>Marius Gedminas</dc:creator><admin:generatorAgent rdf:resource="http://pyblosxom.sourceforge.net/"/><admin:errorReportsTo rdf:resource="mailto:marius@gedmin.as"/><item><title>ImportError: No module named _md5</title><guid isPermaLink="false">no-module-md5</guid><link>http://mg.pov.lt/blog/no-module-md5</link><description>If you're using virtualenv, and after a system upgrade you get errors like ... File &quot;...&quot;, line ... from hashlib ...</description><content:encoded><![CDATA[
<p>If you're using virtualenv, and after a system upgrade you get errors like</p>
<blockquote><pre>
...
  File "...", line ...
    from hashlib import md5
  File "/usr/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
     import _md5
ImportError: No module named _md5
</pre></blockquote>

<p>this means that the copy of the python executable in your virtualenv/bin
directory is outdated and you should update it:</p>

<blockquote><pre>
<span class="prompt">$</span> cp /usr/bin/python2.6 /path/to/venv/bin/python
</pre></blockquote>

<p>or, better yet, recreate the virtualenv.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2010-07-06T22:20:04Z</dc:date></item><item><title>Booting ISO images from a USB drive</title><guid isPermaLink="false">booting-iso-from-usb</guid><link>http://mg.pov.lt/blog/booting-iso-from-usb</link><description>Dear lazyweb, I would like to download an arbitrary ISO image (say, a Ubuntu 10.04 Desktop CD ) into a ...</description><content:encoded><![CDATA[
<p>Dear lazyweb, I would like to download an arbitrary ISO image (say, a <a
  href="http://www.ubuntu.com/getubuntu/download">Ubuntu 10.04 Desktop CD</a>)
into a directory of a USB flash drive, and then make that USB flash drive boot
that ISO image.  I do <em>not</em> want to</p>

<ul>
  <li>re-partition or re-format the flash drive (this eliminates <a
    href="https://launchpad.net/usb-creator">usb-creator</a>, AFAIU)</li>
  <li>extract the contents of the ISO image into the root of the USB drive
      (this eliminates <a
       href="http://sourceforge.net/apps/trac/unetbootin/wiki/howitworks">unetbootin</a>)</li>
  <li>skip the ISO's bootloader and directly boot the kernel+initramfs from
      the ISO (eliminates <a
       href="https://lists.ubuntu.com/archives/ubuntu-users/2010-April/216901.html">this
       recipe</a>, and <a
       href="https://lists.ubuntu.com/archives/ubuntu-users/2010-April/216426.html">this</a><a
       href="https://lists.ubuntu.com/archives/ubuntu-users/2010-April/216429.html">
       recipe</a>)</li>
</ul>

<p>I just want a bootloader on the USB to read the VFAT filesystem, mount the ISO image as a loop device,
then chain-load the bootloader from that ISO.  Bonus points for having a menu letting me choose one of
several ISO images.  Running a script to edit a text file (say, grub's config)
to get that menu is fine.</p>

<p>Is this even possible?  If not, can I at least have two out of three (no
partition/extraction, but skipping intrinsic bootloader is fine)?</p>

<p><strong>Solution that I finally chose (from <a href="http://ubuntuforums.org/showthread.php?t=1288604">Ubuntu forums</a>):</strong></p>

<p>Plug in USB key.  Find out the mount point (<tt>/media/<em>disk</em></tt>) and the device
name (<tt>/dev/sd<em>x</em></tt>) of the USB key with</p>

<blockquote><pre>
<span class="prompt">$</span> <span class="typing">mount|grep /media</span>
</pre></blockquote>

<p>Install GRUB 2 into the USB key with</p>

<blockquote><pre>
<span class="prompt">$</span> <span class="typing">sudo grub-install --root-directory=/media/<em>usbdisk</em> /dev/sd<em>x</em></span>
</pre></blockquote>

<p>If it says something about embedding being impossible and falling back
to UNRELIABLE blocklist-based setup, run</p>

<blockquote><pre>
<span class="prompt">$</span> <span class="typing">sudo grub-install --root-directory=/media/<em>usbdisk</em> /dev/sd<em>x</em> --force</span>
</pre></blockquote>

<p><a href="http://www.ubuntu.com/desktop/get-ubuntu/download">Download a CD
image</a>, let's say <tt>ubuntu-10.10-desktop-i386.iso</tt>.  Put it into
<tt>/media/<em>usbdisk</em>/ubuntu/</tt>.  </p>

<!--
<span class="prompt">$</span> <span class="typing">mkdir /media/<em>usbdisk</em>/ubuntu</span>
<span class="prompt">$</span> <span class="typing">cd /media/<em>usbdisk</em>/ubuntu</span>
<span class="prompt">$</span> <span class="typing">wget http://ftp.litnet.lt/pub/ubuntu-cd/maverick/ubuntu-10.10-desktop-i386.iso</span>
-->

<p>Create a text file <tt>/media/<em>usbdisk</em>/boot/grub/grub.cfg</tt> with</p>

<blockquote><pre>
menuentry "<em>Ubuntu 10.10 (x86 desktop livecd)</em>" {
    set isofile="<em>/ubuntu/ubuntu-10.10-desktop-i386.iso</em>"
    loopback loop $isofile
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash noprompt --
    initrd (loop)/casper/initrd.lz
}
</pre></blockquote>

<p>You can have as many ISO images as you want, just make sure to add a
menuentry for each.  There's no need to run grub-install again after adding
or removing a .iso file.  Oh, and if you want to use an ISO file for a
different distribution, you'll have to figure out the correct linux and initrd
lines somehow.</p>

<p>I tested it with the following images (WARNING: this list may be
inaccurate):</p>

<ul>
  <li>ubuntu-10.10-desktop-i386.iso</li>
  <li>ubuntu-10.04-desktop-i386.iso</li>
  <li>ubuntu-10.04-server-i386.iso</li>
  <li>ubuntu-10.04-server-amd64.iso</li>
</ul>

<p>This solution skips the CD-ROM's boot menu. I haven't found a better
one.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2010-05-03T17:24:31Z</dc:date></item><item><title>df</title><guid isPermaLink="false">disk-free</guid><link>http://mg.pov.lt/blog/disk-free</link><description>Modern Linux system have all sorts of fake filesystems cluttering the output of df and mount: tmpfs, bind mounts, fuse ...</description><content:encoded><![CDATA[
<p>Modern Linux system have all sorts of fake filesystems cluttering the output
of df and mount: tmpfs, bind mounts, fuse for ~/.gvfs, etc.  I have only one
real partition on my laptop, yet mount returns 22 lines of output.</p>

<p>Question: are there any df-like utilities that filter out all the crap and
show only interesting bits?  The standard df as well as <a
  href="http://kassiopeia.juls.savba.sk/~garabik/software/pydf/">pydf</a> both
display 8 lines instead of 1.  <a
  href="http://nickshontz.com/blog/ubuntu-hard-drive-usage">Discus</a> is
worse: it shows 20.  GUI utilities like <a
  href="http://www.marzocca.net/linux/baobab/">Baobab</a> also suffer from this
confusion, especially bind mounts.</p>

<p>Ironically, Ubuntu's update-motd <a
  href="https://bugs.launchpad.net/ubuntu/+source/update-motd/+bug/399513">gets
  confused</a> by Ubuntu's private user directories and displays disk stats for
~/Private as if it were a real partition.  <!-- This bug probably qualifies as
a <a href="https://wiki.ubuntu.com/PaperCut">paper cut</a>, but I hear Ubunteros
already have more of those than they can fix...  Well, okay, the "average user"
probably never sees /etc/motd, so it fails one of the prerequisites of being
a paper cut. --></p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-07-14T22:33:02Z</dc:date></item><item><title>Buildbot issues on Ubuntu Hardy</title><guid isPermaLink="false">hardy-nfs-sighup</guid><link>http://mg.pov.lt/blog/hardy-nfs-sighup</link><description>Update : The story continues, but solution is not in sight yet. I upgraded a buildbot slave to Ubuntu 8.04 ...</description><content:encoded><![CDATA[
<p><strong>Update</strong>: The story continues, but solution is not in sight
yet.</p>

<p>I upgraded a buildbot slave to Ubuntu 8.04 (Hardy) recently and now I'm
getting a strange intermittent failure: sometimes
<tt>cp -r /local/dir /nfs/mounted/dir</tt> fails
("process killed by signal 1", i.e. SIGHUP).</p>

<p>I wonder if NFS is relevant or incidental to the issue?</p>

<p>Google finds <a
  href="http://osdir.com/ml/python.buildbot.devel/2005-07/msg00000.html">an old
  thread from 2005</a>, with a workaround (usepty=False), but I'd like to
understand the problem before applying random fixes.</p>

<p>So far three different build steps doing <tt>cp -r</tt> have failed during
10 days.  I've now changed them all to <tt>cp -rv</tt>, so I can at least see
if the failure is in the middle of the copy or at the end, if it fails
again.</p>

<p><strong>Update</strong>: so far 4 build steps have failed on 6 separate
occasions:</p>

<!--
  ./ivija-coverage/754-log-cp-stdio
  ./ivija-coverage/757-log-cp-stdio
  ./ivija-coverage/757-log-cp_2-stdio
  ./ivija-coverage/770-log-rm_2-stdio
  ./ivija-coverage/773-log-rm_2-stdio
  ./ivija-docs/342-log-cp-stdio
  -->
<pre>
May  5 02:31: cp -r local-dir1 nfs-mounted-dir1  <!-- ivija-coverage cp -->
May  6 02:31: cp -r local-dir1 nfs-mounted-dir1  <!-- ivija-coverage cp -->
May  6 04:33: cp -r local-dir2 nfs-mounted-dir2  <!-- ivija-coverage cp_2 -->
May 15 02:00: cp -r local-dir3 nfs-mounted-dir3  <!-- ivija-docs cp -->
May 17 04:32: rm -rf nfs-mounted-dir4            <!-- ivija-coverage rm_2 -->
May 20 04:31: rm -rf nfs-mounted-dir4            <!-- ivija-coverage rm_2 -->
</pre>

<p>I see no particular correlation between step duration and results, e.g.
the rm -rf step usually takes between 2.2 and 4.6 seconds.  The two SIGHUPs
happened after 2.4 seconds.
</p>

<!--
     cd /var/lib/buildbot/masters/ivija
     python
     import pickle, pprint
     pp = pprint.pprint
     coverage_jobs = [pickle.load(file('ivija-coverage/' + str(n))) for n in range(750, 774)]
     docs_jobs = [pickle.load(file('ivija-docs/' + str(n))) for n in range(300, 349)]

     jjobs = docs_jobs
     pp(['%s %.1f %s' % (s.name, s.finished - s.started, s.results) for s in (b.steps[[ss.name for ss in jobs[-1].steps].index('cp')] for b in jobs) if s.finished])

     rm_2 takes between 2.2 and 4.6 seconds.  The two failures were at 2.4
     seconds.

     cp_2 takes between 6.2 and 19.2 seconds.  The one failure was after 7.2
     seconds.

     cp takes between 3.5 and 15.7 seconds.  The two failures were after 3.8
     and 4.1 seconds.

     ivija-docs cp takes between 0.8 and 4.1 seconds.  The failure was after
     1.6 seconds.
  -->

<p>They all make no output.  When I changed the cp steps and added a -v, they
stopped failing, but that could be just a coincidence.</p>

<p>We're having an email conversation with Jean-Paul Calderone ("exarkun")
about the possibility of this being PTY-related, with no clear resolution
so far.</p>

<p>And, hey, now this blog supports comments ;)</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-05-15T12:33:26Z</dc:date></item><item><title>Filing bugs on GUI apps</title><guid isPermaLink="false">filing-bugs-on-gui-apps</guid><link>http://mg.pov.lt/blog/filing-bugs-on-gui-apps</link><description>Ubuntu people want users to use apport to report bugs. There's a command-line tool called 'ubuntu-bug' that you can use ...</description><content:encoded><![CDATA[
<p>Ubuntu people want users to use apport to report bugs.  There's a command-line
tool called 'ubuntu-bug' that you can use if you know the name of the package
or at least the name of executable.  There's a "Report a problem" menu item
in many, but not all GUI apps.</p>

<p>Here's what you can do if the GUI app in question doesn't have that menu
item, and you don't remember what it's called, and you're the same sort of a
crazy command-line person that I am:</p>

<pre>
<span class="prompt">$</span> <span class="typing">xprop|grep PID</span>
</pre>

<p>Click on the app's window.  Watch that shell command return a line that
looks like</p>

<pre>
_NET_WM_PID(CARDINAL) = 807
</pre>

Now run

<pre>
<span class="prompt">$</span> <span class="typing">ps 807</span>  # substitute the real number
</pre>

<p>You'll see the command name, e.g.</p>

<pre>
  PID TTY      STAT   TIME COMMAND
  807 ?        S      0:02 /usr/lib/indicator-applet/indicator-applet --oaf-acti
</pre>

<p>Now you can run</p>

<pre>
<span class="prompt">$</span> <span class="typing">ubuntu-bug /usr/lib/indicator-applet/indicator-applet</span>
</pre>

<p>If you're not running Jaunty, you'll need to do one more step to find the
name of the Ubuntu package:</p>

<pre>
<span class="prompt">$</span> <span class="typing">dpkg -S /usr/lib/indicator-applet/indicator-applet</span>
indicator-applet: /usr/lib/indicator-applet/indicator-applet
</pre>

<p>You can use that with apport-cli or on the Launchpad online bug reporting
form.</p>

<p>For some (many?) programs you can short-circuit this trail by looking at
the WM_CLASS property instead of the _NET_WM_PID property:</p>

<pre>
<span class="prompt">$</span> <span class="typing">xprop|grep CLASS</span>
WM_CLASS(STRING) = "indicator-applet", "Indicator-applet"
</pre>

<p>While there is no requirement for the window class name to match the name of
the Ubuntu package or the name of the executable, it may give you a reasonable
guess.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-04-09T19:29:21Z</dc:date></item><item><title>Upgrade to Ubuntu Jaunty</title><guid isPermaLink="false">upgrade-to-jaunty</guid><link>http://mg.pov.lt/blog/upgrade-to-jaunty</link><description>Ubuntu 9.04 is going to be released in around three weeks. As usual I couldn't wait (and saw that some ...</description><content:encoded><![CDATA[
<p>Ubuntu 9.04 is going to be released in around three weeks.  As usual I
couldn't wait (and saw that some bugs that were irritating me every day
were fixed in Jaunty), so I upgraded to the current beta.</p>

<p>After <a
  href="https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/154236/comments/3">a
  little hiccough</a> at the beginning, the upgrade was the smoothest Ubuntu
upgrade I've ever had: I spent those two and a half hours browsing the web,
watching screencasts and chatting on IRC, while update-manager worked in the
background.  Firefox was mostly very responsive, only stuttering when
update-manager got around to unpacking openoffice.org-common.  There were few
debconf or conffile questions (one from sysstat 2 minutes into the upgrade,
then a conffile question after 1 hour and 20 minutes, then two more after 15
minutes, and one more 5 minutes later.  And the last one 10 minutes later).
There were no ugly theme changes or failing GNOME applet error messages during
the upgrade.  Near the end X-Chat automatically started showing new-style
notifications (beautiful!) and Firefoxes nicely asked to be restarted with a
fold-down notification bar.</p>

<p>Nice.  Now, after a reboot things were not so nice: I couldn't login.
After typing in my password and a couple of mode changes I was kicked back
to the GDM prompt.  I panicked and started logging into the text consoles
and trying to run startx, quite in vain, since when I just tried gdm again
it worked fine.</p>

<p>The intel video driver feels slower, as promised by the release notes,
but it's acceptable as long as you don't try to rotate the external screen.
Then it's horrible and unusable&mdash;a regression since Intrepid.  I'll have
to retry with UXA.</p>

<p>Compiz failed to enable a plugin (GNOME Compatibility), so a couple of
key bindings didn't work (Alt+F1 to get the menu, Alt+F2 to get the run dialog,
my custom keybinding to open a terminal) until someone on FreeNode told me
what to enable.</p>

<p>The Flash plugin is now swfdec, and it is unable to cope with Youtube music
videos&mdash;the sound is all choppy.  I'm wondering if this is swfdec's fault,
pulseaudio's fault (it's common knowledge that all audio problems stem from
pulseaudio, right? ;) or X.org's fault (top shows it's X that's eating 90% CPU
when swfdec is trying to play a video).</p>

<p>A lot of very irritating bugs are gone.  I don't need to restart Compiz
after playing with xrandr.  X doesn't crash after I play with xrandr.
Two-finger scrolling with the Synaptics touchpad doesn't produce phantom
scroll-down-17-pages events when I take my fingers off the touchpad.  The
GNOME panels don't migrate to the external screen when I play with xrandr
(but one of them <a
  href="https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/355848">jumps
  from the bottom to the top</a> when I play some more).  The new splash
screen has a pretty gradient for its progress bar (but is displayed off-center,
maybe because I added vga=872 to my GRUB kernel options list to avoid ugly
stretching of text consoles).  X.org no longer distorts the aspect ratio of
1024x768 when stretching it to fit the 1280x800 screen&mdash;now I get sensible
black bars on the sides. <strong>The new notification bubbles are
  beautiful!</strong>.  I could stare at them all day.  (But the new indicator
applet <a
  href="https://bugs.launchpad.net/ubuntu/+source/indicator-applet/+bug/334490">is
  ugly</a>.)</p>

<p>Overall I'm happy.  A bunch of very irritating bugs were replaced with
a smaller bunch of somewhat less irritating bugs.  The intel video slowdown
scares me a bit, though, but the prettiness of the notification bubbles
outweigh everything else.  What can I say, I like pretty things&mdash;Ooh,
shiny!</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-04-05T23:28:38Z</dc:date></item><item><title>Submitting patches the Launchpad way</title><guid isPermaLink="false">smooth-bug-reporting</guid><link>http://mg.pov.lt/blog/smooth-bug-reporting</link><description>Today I happened to read about lazr.enum in a mailing list. I went to the PyPI page and saw raw ...</description><content:encoded><![CDATA[
<p>Today I happened to read about <a
  href="http://pypi.python.org/pypi/lazr.enum">lazr.enum</a> in a mailing list.
I went to <a href="http://pypi.python.org/pypi/lazr.enum">the PyPI page</a> and
saw raw <a href="http://docutils.sourceforge.net/rst.html">ReStructuredText</a>
markup instead of a nicely formatted page.  Now I know from prior experience
that this happens when the package's description has an error in the markup.
I thought I'd report a bug and provide a patch.</p>

<p>Leap of knowledge: since I know lazr.enum was created by the Launchpad.net
team I could safely assume they were keeping the sources in Launchpad.  Therefore
I was pretty sure I could get them with</p>

<pre>
<span class="prompt">$</span> <span class="typing">bzr branch lp:lazr.enum</span>
</pre>

<p>so I ran that command and it worked.</p>

<p>Next I looked at setup.py to see how it produces the long_description field.
It was reading the contents of a couple of text files, one of them being
src/lazr/enum/README.txt.  I looked at that and saw a
<tt>..&nbsp;toc-tree:</tt> directive that does not exists in plain docutils
(it's a <a href="http://sphinx.pocoo.org/">Sphinx</a> extension).</p>

<p>I added up a couple of lines to setup.py to strip that out, tested it
(with <tt>setup.py --long-description &gt; test.rst; restview test.rst</tt>)
committed to my local branch, and created a bug report in Launchpad.  Then I
was a bit lost, since I didn't know how to make my fix available.  Attach a
patch?  Maybe, but I wanted to see if this distributed version control thing is
good for anything else.</p>

<p>I thought that first I'd make that branch public, and then see if there
was a way to link it to the bug report.  I ran</p>

<pre>
<span class="prompt">$</span> <span class="typing">bzr push lp:~mgedmin/lazr.enum/pypi-fix</span>
</pre>

<p>which took a few seconds to create a new public branch on Launchpad with my
fix in it (it would be nice if I didn't have to explicitly specify my Launchpad
username and the project name&mdash;both of which bzr already knows&mdash;and
just specify the name of the branch).  Then I went back to my bug report and
saw an option to link it to a branch.  There was a search field in the popup
that found my "~mgedmin/lazr.enum/pypi-fix" easily enough when I pasted it
into the search box.</p>

<p>After clicking on the branch, I saw a "propose a merge" option.  I did that
and Launchpad sent an email to the developers asking them to merge my fix.</p>

<p>I made one mistake, I think: I should've created the bug report
<em>first</em>, and then mentioned the bug number in my commit message (with
<tt>bzr commit --fixes=NNN</tt>, although here I'm suddenly not sure if the bug
number should be left bare, or prefixed with something like "lp" to indicate it
was a Launchpad bug number?).</p>

<p>Other than that it was a pretty smooth experience.  When will I be able to
do that for Ubuntu packages?</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-04-05T21:45:20Z</dc:date></item><item><title>Bug of the day</title><guid isPermaLink="false">bug-of-the-day</guid><link>http://mg.pov.lt/blog/bug-of-the-day</link><description>I think I'm going to blog about Ubuntu bugs I encounter during my day. Don't get me wrongI love Ubuntu ...</description><content:encoded><![CDATA[
<p>I think I'm going to blog about Ubuntu bugs I encounter during my day.
Don't get me wrong&mdash;I love Ubuntu and haven't seen a better OS yet.  But
it has bugs.</p>

<p><small>Why blog and not report them to <a
  href="https://bugs.launchpad.net/ubuntu">Launchpad</a>?  Many reasons:
producing good bug reports is hard work; bugs rarely show up alone, and if I
start filing one, I'll forget details about the others; sometimes it's unclear
whether something is or is not a bug until you've written it down and looked
at it; Launchpad is slow while previewing a blog post on the local machine is
fast.</small></p>

<!-- Now let's try some reverse psychology -->

<p>This is one of those long and rambling posts that you can skip without
feeling guilty. ;-)</p>

<p>Things I did today:</p>

<ol>
  <li>I enabled my dual-head screen and had to restart compiz to avoid
      <a href="https://launchpad.net/bugs/317431">bug 317431</a>.</li>
  <li>After work I tried to switch to single-screen mode again and X promptly
      crashed&mdash;<a href="https://launchpad.net/bugs/298226">bug 298226</a>.</li>
  <li>When X restarted it picked a fugly stretched 1024x768 mode that looks
      very bad on my 1280x800 widescreen panel&mdash;because this was the
      only common mode between the internal panel and the external 1280x1024
      LCD.</li>
  <li>I used Ctrl+Alt+Backspace after pulling the VGA cable as a quick way
      to restart GDM with a saner resolution.  I wonder what I'll do in Jaunty
      where Ctrl+Alt+Backspace is disabled by default.  (BTW I agree with
      that decision, having accidentally pressed Ctrl+Alt+Backspace on
      several painful occasions.)</li>
  <li>I suspended my laptop and put it in my backpack, then went home.</li>
  <li>At home I tried to resume. The laptop suspended again immediately after
      waking up.</li>
  <li>When I woke it up again, it did not accept my fingerprint (this often
      happens, I don't particularly mind&mdash;it's difficult to swipe the
      finger precisely).</li>
  <li>I then typed my password, pressed Enter&mdash;and then
      gnome-screensaver spent an unreasonably long time verifying my password
      (this I do mind).</li>
  <li>While it was verifying the password suddenly the GNOME panel showed up
      on top of the gnome-screensaver, with two new notification bubbles: one
      was the usual post-upgrade reboot required, and the other was a typical
      post-upgrade informational notice (one about refreshing ALSA
      configuration presets&mdash;I haven't seen it before).  The interesting
      thing is that I don't remember running apt-get upgrade today, and
      /var/log/dpkg.log confirms I last upgraded things yesterday at
      noon.</li>
  <li>I could not take a screenshot of the bizarreness described in step 3,
      but that's reasonable&mdash;the desktop was still locked.  So I took a
      (crappy) picture with my cell phone (and now I'm too lazy to upload
      it&mdash;but I have proof! proof!).</li>
  <li>After 30 seconds or so gnome-screensaver finally timed out, the GNOME
      panel disappeared, and I got a new fresh screensaver unlock dialog.
      This time it worked.</li>
  <li>Just after unlocking the screen I saw a GNOME keyring prompting
      for my keyring password to enable Network Manager to get the WPA
      passphrase needed to log in.
  <li>It's the same as my login password.  Shouldn't some PAM magic I
      recently read about in Ubuntu mailing lists unlock that keyring for me
      automatically on login?  Oh, right, I log in using
      my fingerprint, not my password.  Darn.</li>
</ol>

<p>Now I feel like I should report item #3 (and #13) as a wishlist, item #6 as
a bug (there's probably one open, with a bunch of duplicates, already), #8 as a
bug (but that would be useless&mdash;I've no recipe for replicating that), #9
as a bug (again, how can I replicate?)&mdash;or, rather two bugs (why did the
informational notices got delayed by a day?).  Maybe three bugs: the untitled
(four bugs!) window with the update information says</p>

<blockquote>

  <p><strong>Refresh Advanced Linux Sound Architecture (ALSA) configuration
    presets</strong></p>

  <p>New Advanced Linux Sound Architecture (ALSA) configuration presets have
  been added.  Please execute the asoundconf(1) set-default-card macro in a
  Terminal now to refresh your user's configuration presets.  You may
  accomplish this task by executing the following command in a Terminal:
  asoundconf set-default-card</p>

</blockquote>

<p>which reads like gibberish to any nontechnical person (and many technical
persons too, I think).</p>

<p>Let's talk more about this notification: the first thought that comes into
the mind of a technical person is: <em>if you know what command I should run in
  a terminal, why don't you run it yourself, you stupid machine?</em>  The
answer is &ldquo;because that's <em>not</em> the complete command that you need
to run&rdquo;: </p>

<blockquote>
<pre>
<span class="prompt">$</span> <span class="typing">asoundconf set-default-card</span>
You have omitted a necessary parameter.  Please see the
output from `asoundconf list`, and use one of those sound
card(s) as the parameter.
</pre>
</blockquote>

<p>Okay, I'll bite</p>

<blockquote>
<pre>
<span class="prompt">$</span> <span class="typing">asoundconf list</span>
Names of available sound cards:
Intel
</pre>
</blockquote>

<p><em>There's only one card.</em>  Why isn't it selected as default
  automatically, without forcing me to jump through hoops in a terminal?  Think
  of the children (or, better, your mother)!</p>

<p>But now I remember that Pulseaudio is supposed to be the default ALSA card.
  What will happen if I select Intel here?  Will it break Pulseaudio?  Oh dear,
  I've no idea.  I'm afraid to do anything now.</p>

<p>I think I will put on my regular-user-glasses<!-- add a link to an old
  Jeff Waugh's GUADEC presentation (IIRC) where I first saw this trick,
  if I manage to find it --> and look at that dialog again:</p>

<blockquote>

  <p><strong>Technobabble technobabble</strong></p>

  <p>gibberish gibberish gibberish</p>

  <!-- I wonder if this button will survive in the RSS feed being sanitized
  through Planet and then Google Reader? -->
  <input type="button" value="close" />

</blockquote>

<p>Okay, I hit the only button available&mdash;close.  I'm done here.
Sound appears to continue to work fine without me doing anything.
Why was that dialog necessary?  Just get rid of it.</p>

<p><small>I'm sorry.  I did not intend this to become a rant.  I wanted to make
  a list of reportable bugs that I could review later and file properly (or
  have helpful people look up and send me via email&mdash;this has happened
  before, and I was surprised and grateful).</small></p>

]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-04-02T21:31:41Z</dc:date></item><item><title>X ate my keyboard, again</title><guid isPermaLink="false">x-ate-my-keyboard-again</guid><link>http://mg.pov.lt/blog/x-ate-my-keyboard-again</link><description>Last night I thought it would be fun to try to suspend my laptop with the 3G USB modem still ...</description><content:encoded><![CDATA[
<p>Last night I thought it would be fun to try to suspend my laptop with the 3G
USB modem still plugged in and connected.  This morning when I woke it up I had
no keyboard.</p>

<p>Ctrl+Alt+F1 worked to switch to a text console (when I pressed it twice).
The text console wasn't garbled, which was nice.  killall gnome-settings-daemon
or gnome-screensaver didn't fix anything.  Suspending and resuming again didn't
fix things either (not that there's any reason why it should).  When I noticed
that Ctrl+Alt+Backspace didn't work in X, I realized this wasn't an X grab
issue.</p>

<p>/var/log/Xorg.0.log has a series of errors like this:</p>

<pre>
(EE) AT Translated Set 2 keyboard: Device has changed - disabling.
(WW) AT Translated Set 2 keyboard: Release failed (Invalid argument)
</pre>

<p>Sadly, there are no timestamps.  I think this was printed once on resume,
and then once on every VT switch.</p>

<p>xinput still lists "AT Translated Set 2 Keyboard" among its devices.<p>

<p>I remember now -- before suspending I had used <code>sudo showkeys -s</code>
in an xterm (trying to see the scan code of the ThinkVantage button).  Could've
mucked up the keyboard mode?</p>

<p>Alt+SysRq+R (raw mode) didn't help, even when followed by more VT switches.
I think I'm gonna restart the X server.  Or reboot the whole PC, Ubuntu
notifier is showing its reboot icon again...</p>

<p><strong>Meta</strong>: I wrote this post on March 6, and then decided it
wasn't interesting enough to post.  And then posted it accidentally on March
20.</p>

<p><strong>Update</strong>: looks like <a
href="https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/327175">bug
327175</a>.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-03-06T07:11:36Z</dc:date></item><item><title>X.org and stuck Ctrl</title><guid isPermaLink="false">xorg-snafu</guid><link>http://mg.pov.lt/blog/xorg-snafu</link><description>Warning: this is going to be a long story with a semi-happy ending. Skip it unless you enjoy tales of ...</description><content:encoded><![CDATA[
<p>Warning: this is going to be a long story with a semi-happy ending.
Skip it unless you enjoy tales of woe and debugging.</p>

<p>So, I open up my laptop, plug in a USB keyboard and mouse, start up Inkscape
and start fooling around.  Suddenly I notice strange behaviour:</p>

<ul>
  <li>I cannot select two objects in Inkscape by holding down ctrl or shift and
      clicking -- only the last object I clicked on becomes selected.</li>
  <li>Menus don't pull down, although the highlighted bar follows my mouse</li>
  <li>I cannot type any text into text boxes</li>
  <li>Moving the mouse into a screen corner doesn't trigger the Expose-like effect</li>
  <li>I cannot drag windows around by grabbing the title-bar</li>
  <li>I cannot drag windows around by alt+dragging</li>
  <li>Dragging the mouse inside an xterm creates a vertical selection</li>
</ul>

<p>That last hint seems to indicate that the Ctrl key could be stuck.  I
try pressing it and releasing, then the other one, then both Ctrl keys on the
USB keyboard.  Surely, if X sees a press and a release event for each Ctrl
it will realize none of them are still down?  No such luck.  I try to unplug
the USB keyboard and mouse next.  No results.</p>

<p>This is not the first time this has happened to me.  Previously I found no
exit out of this state other than killing X.org with (great pleasure and)
Ctrl+Alt+Backspace.  Surely there must be a better way?</p>

<p>I ssh in and start xev.  MotionNotify events have state 0x4, which is
control, I think.  By the way, I only see mouse events in xev, keyboard
events don't make it.  The keyboard itself is alive at some level, as Caps Lock
turns on its LED, and Ctrl+Alt+F1 gives me a (garbled and unusable) text
console.  Holding down Alt or Shift doesn't change the state of events seen
by xev, though.</p>

<p>Did my keyboard map get lost?  Is some X client grabbing all the keys?
how do I recover?</p>

<p>I use x2x to connect to the laptop from my desktop.  I now can use my
desktop's mouse and keyboard to control the laptop.  x2x works by injecting
X events via XTest.  I see mouse events x2x injects, but xev again shows
nothing on the keyboard front.</p>

<p>I try to guess which X client might have the keyboard grab (if there is
one).  I killall compiz.  I'm surprised that gnome-session doesn't restart it
(or spawn a different window manager in its place).  I start metacity manually.
The problem is not gone.  I kill metacity and start Compiz again.</p>

<p>I have a VNC server running (vino), but I've forgotten its password.</p>

<p>I notice a weird message in my xev log:</p>

<pre>
KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  4294967195 0   0   0   32  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
</pre>

<p>Huh?  4294967195 keys?  That looks like an unsigned 32-bit int
underflow.  I scroll back and find the first KeymapNotify event seen by xev:</p>

<pre>
KeymapNotify event, serial 25, synthetic NO, window 0x0,
    keys:  0   0   0   0   32  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
</pre>

<p>Looks normal.  Then I notice this at the end of the xev log:</p>

<pre>
FocusOut event, serial 40, synthetic NO, window 0x3e00001,
    mode NotifyWhileGrabbed, detail NotifyNonlinear
</pre>

<p>What's "NotifyWhileGrabbed" mean?  How do I find the rogue app and kill
it?  xrestop shows me 35 X clients, do I just kill them one-by-one until
the problem disappears?  Some of those clients are &lt;unknown&gt; and show
no PID.</p>

<p>I suspend the laptop (which is a very <em>stupid</em> idea when your other
machine's mouse and keyboard are redirected to it via x2x) and resume it,
hoping that gnome-screensaver will somehow overpower the existing application's
lock with its own.  Gnome-screensaver is nowhere in sight.  At least my x2x
connection becomes alive again and I have my keyboard &amp; mouse back on the
desktop.</p>

<p>I notice that I can no longer make any kinds of selections in
gnome-terminal.  Why?  Window focus no longer follows mouse.  xev no longer
sees mouse motion events.  It sees a couple of MappingNotify events when I plug
in a (different) USB keyboard, though.</p>

<p>I killall gnome-screensaver (which was invisible, remember?) and can now
again see motion events in xev and select windows with the mouse.</p>

<p>I start randomly killing applications.  gnome-power-manager.  nautilus.
inkscape.  firefox.  gtk-window-decorator.  gnome-panel.  notification-daemon.
gnome-terminal.  pulseaudio (no reason).  vino-server.  update-notifier.
seahorse-agent.  gnome-keyring-daemon.  bluetooth-applet.  fast-user-switch-applet.
multiload-applet-2.  mixer_applet2.  system-config-printer.
gnome-settings-daemon.</p>

<p>And the system becomes ugly (no GNOME theme) but alive.  I get a second xev
window from an earlier attempt to type 'xev<enter>' in a terminal that was
unable to receive key events.</p>

<p>Of course, since I killed all the actual applications and half of the
necessary support programs my session is now useless, so I'll have to log
out and log back in again.  But at least in the future I'll know: when
something like this goes wrong, <strong>killall gnome-settings-daemon</strong>.</p>

<p>Now I'd like to report a bug (the thought of hurling a brick through
the responsible developer's window never crossed my mind, honest!), but
without a reliable way of reproducing the problem will it be of any use?</p>

<p>I restart gnome-settings-daemon and it promptly invokes xrandr to set up
a dual-head mode that confuses compiz.  By "confuses" I mean displays a
rotating cube in the top-left 1280x700 area of my 2560x1024 extended desktop,
filling the rest with whatever was in the video memory last time I had a
dual-head mode.</p>

<p>I try to start up Firefox on my desktop and put a link to the relevant bug,
but Firefox quietly refuses to start up.  Well, 'Segmentation fault' at the end
of ~/.xsession-errors is quiet, isn't it?  Thankfully, 'firefox http://someurl'
for some reason works and opens a window.  I cannot find the Compiz bug I
remember (could it have been <a
  href="https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/135418">#135418</a>?),
but this looks like a better fit anyway: <a
  href="https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/317431">#317431</a>
(and <a
  href="https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/206998">#206998</a>
might be a duplicate).  And here's my gnome-settings-daemon bug:
<a href="https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/335201">#335201</a>.</p>

<p>This is all on Ubuntu 8.10 (Intrepid Ibex).</p>

<p>Some days I just hate Linux.  Then I remember that it's worse on other
systems...</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-02-26T23:07:43Z</dc:date></item><item><title>Largest apps on my laptop #2</title><guid isPermaLink="false">largest-apps-2</guid><link>http://mg.pov.lt/blog/largest-apps-2</link><description>I recently posted some data about applications taking up the most RAM on my laptop. That was after 9 days ...</description><content:encoded><![CDATA[
<p>I recently <a href="http://mg.pov.lt/blog/largest-apps.html">posted some
data</a> about applications taking up the most RAM on my laptop.  That was
after 9 days of uptime, while this is after 12 hours:</p>

<pre>
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
16033 root      20   0  527m 109m  11m S    3  5.5   6:52.82 Xorg
17834 mg        20   0  244m 105m  24m S    6  5.3   3:26.49 firefox
26425 mg        20   0 96872  58m  12m S    0  2.9   0:01.71 evince
16747 mg        20   0 90704  54m  19m S    0  2.8   0:10.70 tomboy
27169 mg        20   0  166m  53m  23m S    0  2.7   0:07.05 banshee-1
27167 mg        20   0 77392  31m  17m S    0  1.6   0:01.16 pidgin
16706 mg        20   0 86508  27m  18m S    0  1.4   0:35.35 gnome-panel
16708 mg        20   0 75196  20m  14m S    0  1.0   0:02.80 nautilus
20092 mg        20   0 61880  19m  11m S    1  1.0   0:07.08 gnome-terminal
16614 mg        20   0 58456  15m 9836 S    0  0.8   0:09.82 gnome-settings-
</pre>

<p>I don't have GNOME Do any more, and I've only one of the two PDFs open in
Evince.  I don't see multiload-applet on the first page of top output, which
seems to indicate a slow leak.  Evince has the same two documents.  That
concept doesn't quite apply to Banshee or Pidgin, but Pidgin's numbers
are quite striking anyway (from 70 megs VIRT to 1.6 gigs VIRT in 9 days;
thankfully RES only grows 2x during that time).</p>

<p>OS: Ubuntu 8.10, up-to-date with all the updates from -security,
-updates, -proposed-updates and -backports.<p>

<p>Incidentally, I have 12 hours of uptime because my battery died while the
laptops was suspended during my flight back home (either that, or it work up
in the backpack, which is a scary thought).  Apparently Ubuntu tried to
hibernate when the battery was very low, which was a nice gesture.  This
didn't work out so well when resuming, since the kernels didn't match -- I
had installed a kernel update, but hadn't rebooted.  I don't think I
ever used hibernation successfully in Linux.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-02-22T10:28:41Z</dc:date></item><item><title>Largest apps on my laptop</title><guid isPermaLink="false">largest-apps</guid><link>http://mg.pov.lt/blog/largest-apps</link><description>After reading Alexander Larsson's post on de-bloating nautilus I thought it would be interesting/useful to see what apps are eating ...</description><content:encoded><![CDATA[
<p>After reading Alexander Larsson's post <a
href="http://blogs.gnome.org/alexl/2009/02/17/eternal-vigilance/">on
de-bloating nautilus</a> I thought it would be interesting/useful to see what
apps are eating my RAM, as a statistical data point if nothing else.</p>

<p>OS: Ubuntu 8.10.  Uptime: 9 days, 20:45 (desktop session also started 9 days
ago; I suspend and never log out).  Top ten apps, according to top:<p>

<pre>
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
29594 mg        20   0  472m 269m  32m S    3 13.6  23:14.38 firefox
 7383 root      20   0  591m 182m  14m S    4  9.2 557:37.73 Xorg
 5199 mg        20   0  114m  67m  13m S    0  3.4   0:35.71 evince
17256 mg        20   0  230m  64m  24m S    0  3.3   4:10.93 banshee-1
29306 mg        20   0 1652m  62m  19m S    0  3.1   7:38.97 pidgin
 8060 mg        20   0  105m  59m  17m S    0  3.0   1:23.20 tomboy
 8015 mg        20   0  137m  42m  20m S    0  2.2  41:55.95 gnome-panel
 8017 mg        20   0  138m  41m  16m S    0  2.1   2:26.75 nautilus
 8063 mg        20   0 45876  30m 8788 S    0  1.6  33:22.14 multiload-apple
 8087 mg        20   0 80708  28m  15m S    0  1.4   4:45.49 gnome-do
</pre>

<p><strong>Update:</strong> compare these numbers with <a
href="http://mg.pov.lt/blog/largest-apps-2.html">what I get just 12 hours
uptime</a>.</p>

<p>Firefox started leaking memory quite rapidly lately, possibly after I
upgraded to 3.0.6+nobinonly-0ubuntu0.8.10.1 exactly a week ago.  I have to
restart it once a day if I don't want my 2 gigs of RAM to fill up
completely.  I hadn't needed to do that before, memory usage stayed pretty
constant.</p>

<p>I cannot explain the X.org numbers.  pmap doesn't show me RSS numbers, but
150 megs of VIRT are attributed to the heap (an anonymous read-write mapping),
while 256 megs look like the frame buffer ("resource2").  xrestop sees a total
of 21027K of resources (pixmaps etc.) attributed to all the clients.  I have a
vague suspicion that this number doesn't include OpenGL textures used by
Compiz, but I'm pretty clueless about those things.  compiz --replace reduces
Xorg's RSS down by 9 megabytes and increases VIRT by 5 megabytes.  The increase
is mirrored by xrestop, which now shows 25652K in total.</p>

<p>I have <a
href="http://www.cs.washington.edu/homes/djg/papers/analogy_oopsla07.pdf">two</a>
<a href="http://dreamsongs.org/DesignedAsDesigner.html">PDFs</a> open in the
background since I intend to read them within the next couple of days, this
explains the evince data.</p>

<p>I'm not happy about the Banshee memory usage.  I wouldn't mind that much if
it didn't insist on minimizing to the system tray.</p>

<p>I'm even less happy about Pidgin.  Banshee at least has the excuse that it
is built on top of Mono, which adds a whole new runtime &amp; virtual
machine.  And why on Earth does a <em>chat program</em> need 1.6 gigs of
virtual memory?</p>

<p>Tomboy: Mono again.  But Tomboy is a <a
href="http://en.wikipedia.org/wiki/Killer_application">killer application</a>
and I need it.</p>

<p>GNOME Panel: self-explanatory.  The multitude of applets that I think that I
need fill up both panels and slow down login times as well.</p>

<p>Nautilus: pretty consistent with Alexander's numbers, looks like I can
expect improvements in Ubuntu 9.04 or at least 9.10.</p>

<p>Multiload applet: looks like I shouldn't have blamed GNOME Panel's memory
usage on applets.  30 megs RSS for four ticking graphs seems a bit biggish,
but maybe memory fragmentation is at fault.</p>

<p>GNOME do: people keep blogging about its coolness, then I install it, try
it out twice, and forget it.  The default GNOME Run dialog does <em>what I
need/am used to</em> better.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-02-18T20:31:39Z</dc:date></item><item><title>Huawei E220 USB 3G modem</title><guid isPermaLink="false">huawei-e220</guid><link>http://mg.pov.lt/blog/huawei-e220</link><description>Almost works out of the box on Ubuntu. Will work out of the box in the forthcoming 9.04 release. One ...</description><content:encoded><![CDATA[
<p>Almost works out of the box on Ubuntu.  Will work out of the box in the
forthcoming 9.04 release.</p>

<p>One curious little detail: according to the manual, a blinking green
light means it's trying to find the GSM network (if it's blinking twice every
2.7 seconds) or that it's successfully found a GSM network (if it's blinking
twice every 2.9 seconds).  I'd like to have been on the meeting when this was
decided.  "I know!  Let's make it blink 0.2 seconds faster to indicate it
hasn't found a network yet!  Brilliant!"</p>

<p><strong>Update:</strong> given its shape and position next to my right-hand
USB ports, it should double as a USB mouse.</p>

<p>On an unrelated note, Sweden is a very nice country.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-02-05T09:05:48Z</dc:date></item><item><title>Volume control keys on Ubuntu</title><guid isPermaLink="false">volume-control</guid><link>http://mg.pov.lt/blog/volume-control</link><description>Does anybody else think it's retarded that volume control keys do not work if you have a menu open in ...</description><content:encoded><![CDATA[
<p>Does anybody else think it's retarded that volume control keys do not work
if you have a menu open in Ubuntu?</p>

<p>I'm sure people can claim there are good technical reasons for that (the
toolkit has to grab the X server to implement popup menus, and then
gnome-settings-daemon doesn't see the XF86VolumeUp/Down key events or
whatever), but if you take a step back and look at this from the user's
perspective, it makes no sense.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2008-11-10T12:42:02Z</dc:date></item><item><title>Fixing the netspeed applet</title><guid isPermaLink="false">netspeed-applet</guid><link>http://mg.pov.lt/blog/netspeed-applet</link><description>Netspeed is a GNOME panel applet that shows your current upload/download speed in bytes (or bits) per second. I love ...</description><content:encoded><![CDATA[
<p><a href="http://www.gnome.org/projects/netspeed/">Netspeed</a> is a GNOME
panel applet that shows your current upload/download speed in bytes (or bits)
per second.  I love it.  Except... you have to manually say which network
device to monitor.  If you're switching between wireless and wired, this gets
old really quickly.  There's an option, <em>Always monitor a connected
device</em>, but it is <a
href="http://bugzilla.gnome.org/show_bug.cgi?id=503518">buggy</a> and usually
gets stuck monitoring some stupid network interface like wmaster0 or
vmnet8.</p>

<p>Today I spent a couple of hours fiddling with netspeed's source code and
<a href="http://bugzilla.gnome.org/show_bug.cgi?id=503518#c17">fixed</a> <a
href="http://bugzilla.gnome.org/show_bug.cgi?id=503518#c18">the bug</a>!
Patches attached to the bug report and tested with netspeed-0.14 on Ubuntu
Hardy.</p>

<p>While doing this I created a local Bazaar branch for playing with the source
code.  Sadly, Bazaar decided to hurt me again: bzr viz, instead of letting me
look at my commits in a nice GUI window, barfs <em>AttributeError:
'KnitPackRepository' object has no attribute 'get_revision_graph'</em> and
stops.  Apparently the latest version of bzr-gtk (trunk from launchpad) is not
compatible with the latest version of bzr (1.6rc2 from the Hardy PPA).</p>

<p>It's becoming a pattern: every couple of months I give Bazaar a try, and I
hit a new bug that prevents me from doing whatever I wanted to do.  Why do I
even keep trying?</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2008-08-24T00:53:58Z</dc:date></item><item><title>D-bus frustration</title><guid isPermaLink="false">dbus-frustration</guid><link>http://mg.pov.lt/blog/dbus-frustration</link><description>So, you hear that your media player supports remote control over D-Bus . That's great, isn't it? So, you're lying ...</description><content:encoded><![CDATA[
<p>So, you <a
href="http://download.banshee-project.org/documents/GUADEC-2008-Banshee_Talk.pdf">hear</a>
that your <a href="http://banshee-project.org/">media player</a> supports
remote control over <a
href="http://www.freedesktop.org/wiki/Software/dbus">D-Bus</a>.  That's great,
isn't it?</p>

<p>So, you're lying on a couch, listening to music and reading a book on your
<a href="http://en.wikipedia.org/wiki/Nokia_N810">N810</a>.  Suddenly a song
you don't like starts playing.  Do you</p>

<blockquote>A. Stand up, walk to the PC, click the "Next song" button with your
mouse,</blockquote>

<p>or</p>

<blockquote>B. Open Terminal on your N810, ssh into your desktop and run
<tt>banshee-1 --next</tt>?</blockquote>

<p>If you chose option B, <strong>you lose</strong>:</p>

<blockquote><pre>
<span class="prompt">mg@mg-desktop:~$</span> <span class="typing">banshee-1 --next</span>
[Warn  00:43:59.080] DBus support could not be started. Disabling for this session.
[Info  00:43:59.101] Running Banshee 1.0.0

(Nereid:9174): Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.

(Nereid:9174): Gtk-WARNING **: cannot open display: 
</pre></blockquote>

<p>You can't access your D-Bus session from a different login session.
This means, among other things, that I cannot ask gnome-power-manager to
suspend my laptop that I left at work if I'm trying to run
<tt>gnome-power-cmd.sh suspend</tt> over an SSH session.</p>

<p>Dear lazyweb, what's the fix?</p>

<p><small>P.S. I apologise for the impertinence of asking dear lazyweb a
question on a blog that has no comments facility, but I somehow <a
href="http://mg.pov.lt/free-candy.jpg">cannot bring myself to trust</a>
Pyblosxom's <a href="http://pyblosxom.sourceforge.net/registry/">comment
plugins</a> in today's spam-filled world without an in-depth evaluation for
which I don't have the time and energy.  At least there's a mailto link clearly
labeled "<a href="mailto:marius@gedmin.as">send feedback</a>" below each blog
entry.</small></p>

<p><strong>Update:</strong> Steve Holden suggested using <a
href="http://www.gnu.org/software/screen/">screen</a>, which works, but only if
I have the foresight to start a screen session on the desktop before I walk
away.  I can then reattach to the running screen session with <tt>screen
-x</tt> and run <tt>banshee-1 --next</tt> inside.</p>

<p>Ross Burton says that setting </tt>DISPLAY=:0</tt> ought to help D-Bus
find the existing session, but only if I have the very latest and greatest
D-Bus (1.2.1), which I don't have.  With D-Bus 1.1.20 in Hardy, all I get by
setting $DISPLAY is Banshee opening a second player instance.</p>

<p><strong>Update #2:</strong> Lee Harr suggests fishing out the
DBUS_SESSION_BUS_ADDRESS environment variable from ~/.dbus/session-bus/*.</p>

<p><strong>Update #3:</strong> <a
href="http://www.outflux.net/blog/?p=159">Kees Cook also has a
solution</a>.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2008-07-24T22:00:00Z</dc:date></item><item><title>Testing Mango Lassi on Hardy</title><guid isPermaLink="false">mango-lassi</guid><link>http://mg.pov.lt/blog/mango-lassi</link><description>Mango Lassi is a GNOME program that lets you painlessly share keyboard &amp; mouse (&amp; clipboard too!) between computers. It's ...</description><content:encoded><![CDATA[
<p><a href="http://0pointer.de/blog/projects/mango-lassi.html">Mango Lassi</a> is a GNOME
program that lets you painlessly share keyboard &amp; mouse (&amp; clipboard
too!) between computers.  It's <a
    href="https://bugs.launchpad.net/ubuntu/+bug/151076">not packaged for
    Ubuntu yet</a> so you have to build it from sources.</p>

<p><strong>Big fat warning:</strong> Mango Lassi has no authentication and
does no encryption, so use it with extreme care.  Don't type any passwords
over your unsecured WiFi network!</p>

<p>Here's how to get it working on Ubuntu Hardy:</p>

<pre>
<span class="prompt">$</span> sudo apt-get install git-core curl build-essential intltool \
    automake-1.9 libdbus-glib-1-dev libgtk2.0-dev libxtst-dev \
    libavahi-glib-dev libavahi-client-dev libavahi-ui-dev \
    libnotify-dev libglade2-dev
<span class="prompt">$</span> git clone http://git.0pointer.de/repos/mango-lassi.git/
<span class="prompt">$</span> cd mango-lassi
<span class="prompt">$</span> ./bootstrap.sh
</pre>
<p>Press Enter once at the prompt.</p>
<pre>
<span class="prompt">$</span> make
<span class="prompt">$</span> sudo make install
</pre>

<p>Now you can run it with</p>
<pre>
<span class="prompt">$</span> mango-lassi
</pre>

<p>When you're tired of it, go back to the source tree and type</p.

<pre>
<span class="prompt">$</span> sudo make uninstall
</pre>

<p>If it only used an SSH tunnel for encryption &amp; authentication, it would
be perfect.</p>

<p>Porting it to Maemo would be an interesting project.  Imagine copying and
pasting URLs from your laptop browser to your N8x0 tablet browser.  Is Avahi
available for Maemo?</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2008-06-25T22:09:18Z</dc:date></item><item><title>Asus EeePC 900</title><guid isPermaLink="false">asus-eeepc-900</guid><link>http://mg.pov.lt/blog/asus-eeepc-900</link><description>I unexpectedly acquired an Asus EeePC 900 last weekend. Lovely piece of hardware. The Xandros distro was okay at first ...</description><content:encoded><![CDATA[
<p>I unexpectedly acquired an <a
href="http://eeepc.asus.com/global/900.htm">Asus EeePC 900</a> last weekend.
Lovely piece of hardware.</p>

<p>The Xandros distro was okay at first (<a
href="http://www.icewm.org/">IceWM</a> brought me fond memories of the year
2000, <a href="http://gedmin.as/icewm/index-en.html">when I used it</a>).  Then
I started longing for Firefox 3 and the aesthetics of GNOME applications.
Finally, when <tt>apt-cache search</tt> told me there was no SSH server package
available, I gave up and installed <a href="http://www.ubuntu-eee.com/">Ubuntu
Eee</a> from a SD card.  The software selection is incomparable (Asus/Xandros:
870 packages available, according to <tt>apt-cache stats</tt>.  Ubuntu: over
30,000 packages.)  Also, yay rotating cube desktop!</p>

<p>Things I like about the Eee:</p>

<ul>
<li>Small! Lightweight! Beautiful white colour!</li>
<li>Small pixels are pretty! 1024x600 at 8.9" is 133 dpi.  Not quite the 225
dpi of a Nokia N810, but nicer than the 100 dpi of my T61W or the 85 dpi of my
19" external LCD.</li>
<li>The keyboard is much better than I expected.  I hate those laptops that
squeeze Home/End/PgUp/PgDn in an extra column on the right.  Asus didn't.</li>
<li>Web browsing is much more pleasant than on a N810.  It's faster for AJAXy
sites such as Google Reader.  Also, Firefox 3.</li>
<li>Video watching is much more pleasant than on a N810: no need to convert
anything.</li>
</ul>

<p>Things that are bad:</p>

<ul>
<li>It gets hot.  Either the hardware is not power-efficient, or the software
isn't doing a good job.</li>
<li>Only 2 hours of battery life (plus an extra 40 minute safety warning with
the blinking red battery low light).  This is during normal usage (WiFi on,
Compiz, Firefox, no CPU-intensive Flash plugins).</li>
<li>No integrated Bluetooth.  Therefore you have to lug a dongle around if
you want to use GPRS/EDGE/3G when there are no WiFi access points around.
I hate dongles.</li>
<li>Doesn't come with Ubuntu preinstalled.</li>
<li>Not all hardware works in Ubuntu:
  <ul>
    <li> Even after using the Eee version of Ubuntu I had to manually tweak
         config files and compile kernel modules to get volume hot keys working.
         </li>
    <li> No webcam or mic for me, though others report those working. </li>
    <li> Touchpad is not configurable and doesn't do wheel emulation on the
         right edge, although most other gestures work. </li>
    <li> Sound needs a module reload after suspend/resume, which causes an
         irritating error dialog from the volume control applet).</li>
    <li> Video playback sometimes shows a blank black screen until you move a
         window to overlap part of the picture. </li>
    <li> Firefox scrolling/redrawing under Compiz is noticeably slow sometimes
         (I don't know if it's because I enabled CPU frequency scaling, or if
         this is a <a
         href="https://bugs.launchpad.net/xserver-xorg-video-intel/+bug/177492">problem
         with the Intel graphics driver problem</a>.).</li>
    <li> When I unplug a Bluetooth USB dongle, a btdelconn process starts
         eating 100% CPU time in the kernel and cannot be killed. Did I mention
         my hate for dongles? </li>
  </ul>
</li>
</ul>

<p>My workhorse, a 14" Lenovo T61W, now seems <em>huge</em> by comparison:</p>

<center>
<img src="http://mg.pov.lt/n810-eeepc-t61.jpg" width="649" height="471"
     alt="Nokia N810 on top of Asus EeePC 900 on top of Lenovo ThinkPad T61W"
     />
</center>

<p>I'm not going to stop using my N810 (which fits in a pocket, has a much longer
battery life, and is more convenient for e-books or <a
href="http://numptyphysics.garage.maemo.org/">NumptyPhysics</a>).  I'll stop
lugging my T61W around instead and start leaving it at work.  The EeePC is an
almost-perfect travelling laptop.</p>

<p>The upcoming <a
href="http://www.reghardware.co.uk/2008/06/17/review_eee_pc_901/">Asus EeePC
901</a> is going to fix the lack of internal Bluetooth and the battery life.  I
wonder when it will become available in Lithuania.  (The 900 is displayed in
almost every electronics shop here.  Yay Asus.  Boo Nokia for not doing this
with its Internet Tablets.)</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2008-06-21T19:56:27Z</dc:date></item><item><title>PowerTop as GNOME applet?</title><guid isPermaLink="false">powertop-as-gnome-applet</guid><link>http://mg.pov.lt/blog/powertop-as-gnome-applet</link><description>Dear lazyweb, Where's the GNOME applet that can show me my laptop's power usage in Watt? I cannot believe that ...</description><content:encoded><![CDATA[
<p>Dear lazyweb,</p>

<p>Where's the GNOME applet that can show me my laptop's power usage in
Watt?  I cannot believe that nobody has written one yet.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2008-06-05T21:21:25Z</dc:date></item><item><title>Linux on a Thinkpad T23</title><guid isPermaLink="false">linux-on-t23</guid><link>http://mg.pov.lt/blog/linux-on-t23</link><description>Andrew Dalke writes about his painful attempts to install Ubuntu Feisty on a Thinkpad T23 . I've had a T23 ...</description><content:encoded><![CDATA[
<p>Andrew Dalke writes about his <a
href="http://www.dalkescientific.com/writings/diary/archive/2007/12/20/installing_linux.html">painful
attempts to install Ubuntu Feisty on a Thinkpad T23</a>.  I've had a T23 and
ran various versions of Ubuntu on it happily.  When it works, Ubuntu (and Linux
in general) is great; when it doesn't work, it is painful (but at least I can
fix it, unlike, say, Windows).<p>

<p>One thing, though: the T23 doesn't support USB2.  Using an external hard
disk over USB1 is very slow and uncomfortable.  Also, I wonder what sort of an
install disk Andrew used.  It sounds like a server or alternate install CD --
the regular desktop CD installs X and everything else for you.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2007-12-20T16:33:25Z</dc:date></item></channel></rss>
