<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ubuntu on Random notes from mg</title>
    <link>https://mg.pov.lt/blog/tags/ubuntu.html</link>
    <description>Recent content in Ubuntu on Random notes from mg</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>marius@gedmin.as (Marius Gedminas)</managingEditor>
    <webMaster>marius@gedmin.as (Marius Gedminas)</webMaster>
    <copyright>Copyright © 2004–2020 Marius Gedminas</copyright>
    <lastBuildDate>Fri, 22 May 2020 18:57:21 +0300</lastBuildDate>
    <atom:link href="https://mg.pov.lt/blog/tags/ubuntu/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Booting ISO images, 2020 edition</title>
      <link>https://mg.pov.lt/blog/booting-iso-from-usb-2020.html</link>
      <pubDate>Fri, 22 May 2020 18:57:21 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/booting-iso-from-usb-2020.html</guid>
      <description>&lt;p&gt;Now that Ubuntu 20.04 LTS is out, it was time to update my &lt;a href=&#34;https://mg.pov.lt/blog/booting-iso-from-usb.html&#34;&gt;bootable USB drive
with a bunch of ISO images&lt;/a&gt;.
Except I got tired of editing &lt;code&gt;grub.cfg&lt;/code&gt; by hand.  So I &lt;a href=&#34;https://github.com/mgedmin/bootable-iso/blob/master/mkgrubcfg.py&#34;&gt;wrote a
script&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now all I have to do is plug in my USB drive, &lt;a href=&#34;https://github.com/mgedmin/ubuntu-images&#34;&gt;download a new
ISO&lt;/a&gt; into it, run &lt;code&gt;make&lt;/code&gt; in the
/boot/grub subdirectory, and presto!  It works.&lt;/p&gt;
&lt;figure class=&#34;noshadow&#34;&gt;
    &lt;img src=&#34;https://mg.pov.lt/blog/img/grub-boot-menu.png&#34;
         alt=&#34;screenshot of the GRUB menu&#34;/&gt; 
&lt;/figure&gt;

&lt;p&gt;What the script does:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;finds all ISO files in &lt;strong&gt;../../ubuntu/*.iso&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;extracts &lt;strong&gt;/boot/grub/grub.cfg&lt;/strong&gt; from inside the ISO image
(yes, I wrote &lt;a href=&#34;https://github.com/mgedmin/bootable-iso/blob/master/parseiso.py&#34;&gt;an ISO 9660 filesystem
parser&lt;/a&gt; in
Python)&lt;/li&gt;
&lt;li&gt;extracts the kernel command line&lt;/li&gt;
&lt;li&gt;adds the &lt;strong&gt;iso-scan/filename=&amp;hellip;&lt;/strong&gt; argument to make it boot from an ISO image&lt;/li&gt;
&lt;li&gt;generates a new &lt;strong&gt;grub.cfg&lt;/strong&gt; with a menu listing all Ubuntu versions and
all image variants (desktop vs server)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This works for all Ubuntu ISO images based on
&lt;a href=&#34;http://manpages.ubuntu.com/manpages/focal/man7/casper.7.html&#34;&gt;casper&lt;/a&gt;, which
is a tool Ubuntu uses to produce their LiveCD images.&lt;/p&gt;
&lt;p&gt;Notably it doesn&amp;rsquo;t work for older Ubuntu server images based on
debian-installer.&lt;/p&gt;
&lt;p&gt;I don&amp;rsquo;t know about other distributions and Ubuntu variants.  Ubuntu variants
ought to work, but my script might generate wrong titles for them.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>New laptop: ThinkPad X390</title>
      <link>https://mg.pov.lt/blog/x390.html</link>
      <pubDate>Thu, 27 Jun 2019 01:09:48 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/x390.html</guid>
      <description>&lt;p&gt;The time has come to replace my trusty ThinkPad X220 with something more modern
(that has enough horsepower to run Subnautica).  I picked a ThinkPad X390 for
the usual reasons (it&amp;rsquo;s a ThinkPad, it&amp;rsquo;s small and light and portable, the
keyboard is reasonably sized, it has a trackpoint).&lt;/p&gt;
&lt;p&gt;I installed Ubuntu 19.04 from a USB stick.  This time I did not wipe Windows
(because Subnautica), which gave me an unpleasant surprise: the Ubuntu installer
&lt;a href=&#34;https://bugs.launchpad.net/bugs/1514120&#34;&gt;does not allow you to enable full disk encryption if you&amp;rsquo;re using
dual-boot&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Everything works great on Linux, except for the fingerprint scanner
(a Synaptics device with ID 06cb:00bd in &lt;code&gt;lsusb&lt;/code&gt;).  Good news: Huang Vincent
from Synaptics is &lt;a href=&#34;https://blogs.gnome.org/uraeus/2019/06/24/on-the-road-to-fedora-workstation-31/&#34;&gt;working on a
driver&lt;/a&gt;,
so stay tuned!&lt;/p&gt;
&lt;p&gt;The 13&amp;rdquo; 1920x1080 screen at ~160 dpi is a bit uncomfortable to use with my poor
eyesight, so first I tried to use GNOME Tweaks to scale fonts to 120%.  This
worked okay-ish (a shame that Firefox ignores this and I had to &lt;a href=&#34;https://dev-pages.info/enabling-high-dpi-mode-in-firefox/&#34;&gt;tweak it
separately&lt;/a&gt;) until I
plugged in an external monitor (~80 dpi) where the large fonts were
cartoonishly too large.  Next, I enabled GNOME&amp;rsquo;s &lt;a href=&#34;https://blog.3v1n0.net/informatica/linux/gnome-shell-fractional-scaling-in-wayland-landed/&#34;&gt;experimental fractional
scaling
support&lt;/a&gt;
(I use a Ubuntu on Wayland session instead of the default one) and (after a
reboot) set the zoom level on the internal screen to 125% (after resetting font
scaling back to 100%, of course).  Wayland apps look nice and crisp, X11 apps
(Firefox) look fuzzy, but &lt;em&gt;shrug&lt;/em&gt; at least I can read the text without squinting.&lt;/p&gt;
&lt;p&gt;Surprise: I don&amp;rsquo;t hate the new keyboard!  It took a while to get used to (and I
caught myself using vim&amp;rsquo;s 0/$/^F/^B instead of Home/End/PageDown/PageUp way
more than I usually do).  I&amp;rsquo;m not sure why the backlit keyboard has two
different light levels instead of just one.  The mute LEDs on the F1 and F4
keys are too bright, especially at night, so I turn down the volume to the
lowest level instead of muting.  (The power LED is also a bit too bright &amp;ndash; why
did Lenovo make it white instead of the traditional nice green?)&lt;/p&gt;
&lt;p&gt;I like the nice little physical camera switch that moves a little builtin
plastic cover over the lens so I can be sure nobody&amp;rsquo;s spying on me :)&lt;/p&gt;
&lt;p&gt;Things were less smooth on Windows 10: first it didn&amp;rsquo;t want to reboot (I waited
like 20 minutes at the blue &amp;ldquo;Do not turn off your computer&amp;rdquo; screen before
YOLOing the Power button for 10 seconds).  Next, Bluetooth didn&amp;rsquo;t work
(scanning for visible devices to add failed after a fraction of a second) until
I updated the driver (Device Manager -&amp;gt; Bluetooth something something -&amp;gt;
right-click -&amp;gt; Update driver) and/or installed Windows updates and rebooted.
Other than that Windows 10 was a pleasant surprise &amp;ndash; not something I could
love, but at least something I don&amp;rsquo;t hate.&lt;/p&gt;
&lt;p&gt;Subnautica runs &amp;hellip; at 20 fps, using the lowest graphics settings.
That&amp;rsquo;s integrated Intel graphics for you.  (This was a deliberate choice: I want
Linux compatibility more than I want to run games, so I avoid NVidia.)&lt;/p&gt;
&lt;p&gt;Overall verdict: a nice little machine, would buy again.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; In August of 2020 GNOME Software offered a firmware update for the
Synaptics Prometheus fingerprint scanner.  The fingerprint scanner now works!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ImportError: No module named _md5</title>
      <link>https://mg.pov.lt/blog/no-module-md5.html</link>
      <pubDate>Wed, 07 Jul 2010 01:20:04 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/no-module-md5.html</guid>
      <description>
&lt;p&gt;If you&#39;re using virtualenv, and after a system upgrade you get errors like&lt;/p&gt;
&lt;blockquote&gt;&lt;pre&gt;
...
  File &#34;...&#34;, line ...
    from hashlib import md5
  File &#34;/usr/lib/python2.6/hashlib.py&#34;, line 63, in __get_builtin_constructor
     import _md5
ImportError: No module named _md5
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;this means that the copy of the python executable in your virtualenv/bin
directory is outdated and you should update it:&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; cp /usr/bin/python2.6 /path/to/venv/bin/python
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;or, better yet, recreate the virtualenv.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Booting ISO images from a USB drive</title>
      <link>https://mg.pov.lt/blog/booting-iso-from-usb.html</link>
      <pubDate>Mon, 03 May 2010 20:24:31 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/booting-iso-from-usb.html</guid>
      <description>
&lt;p&gt;Dear lazyweb, I would like to download an arbitrary ISO image (say, a &lt;a
  href=&#34;http://www.ubuntu.com/getubuntu/download&#34;&gt;Ubuntu 10.04 Desktop CD&lt;/a&gt;)
into a directory of a USB flash drive, and then make that USB flash drive boot
that ISO image.  I do &lt;em&gt;not&lt;/em&gt; want to&lt;/p&gt;

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

&lt;p&gt;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&#39;s config)
to get that menu is fine.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Solution that I finally chose (from &lt;a href=&#34;http://ubuntuforums.org/showthread.php?t=1288604&#34;&gt;Ubuntu forums&lt;/a&gt;):&lt;/strong&gt;&lt;/p&gt;

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

&lt;blockquote&gt;&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;mount|grep /media&lt;/span&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;Install GRUB 2 into the USB key with&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;sudo grub-install --root-directory=/media/&lt;em&gt;usbdisk&lt;/em&gt; /dev/sd&lt;em&gt;x&lt;/em&gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;If it says something about embedding being impossible and falling back
to UNRELIABLE blocklist-based setup, run&lt;/p&gt;

&lt;blockquote&gt;&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;sudo grub-install --root-directory=/media/&lt;em&gt;usbdisk&lt;/em&gt; /dev/sd&lt;em&gt;x&lt;/em&gt; --force&lt;/span&gt;
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&#34;http://www.ubuntu.com/desktop/get-ubuntu/download&#34;&gt;Download a CD
image&lt;/a&gt;, let&#39;s say &lt;tt&gt;ubuntu-10.10-desktop-i386.iso&lt;/tt&gt;.  Put it into
&lt;tt&gt;/media/&lt;em&gt;usbdisk&lt;/em&gt;/ubuntu/&lt;/tt&gt;.  &lt;/p&gt;

&lt;!--
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;mkdir /media/&lt;em&gt;usbdisk&lt;/em&gt;/ubuntu&lt;/span&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;cd /media/&lt;em&gt;usbdisk&lt;/em&gt;/ubuntu&lt;/span&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;wget http://ftp.litnet.lt/pub/ubuntu-cd/maverick/ubuntu-10.10-desktop-i386.iso&lt;/span&gt;
--&gt;

&lt;p&gt;Create a text file &lt;tt&gt;/media/&lt;em&gt;usbdisk&lt;/em&gt;/boot/grub/grub.cfg&lt;/tt&gt; with&lt;/p&gt;

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

&lt;p&gt;You can have as many ISO images as you want, just make sure to add a
menuentry for each.  There&#39;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&#39;ll have to figure out the correct linux and initrd
lines somehow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Ubuntu 13.04 changed the name of the kernel -- use
&lt;tt&gt;(loop)/casper/vmlinuz.efi&lt;/tt&gt; instead of &lt;tt&gt;(loop)/casper/vmlinuz&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I tested it with the following images&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ubuntu-10.04-desktop-i386.iso&lt;/li&gt;
  &lt;li&gt;ubuntu-10.04-server-i386.iso&lt;/li&gt;
  &lt;li&gt;ubuntu-10.04-server-amd64.iso&lt;/li&gt;
  &lt;li&gt;ubuntu-10.10-desktop-i386.iso&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-11.04-desktop-i386.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-11.10-desktop-i386.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-12.04-desktop-i386.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-12.04-desktop-amd64.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-12.04-server-i386.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-12.04-server-amd64.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-12.10-desktop-i386.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-12.10-desktop-amd64.iso&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;ubuntu-13.04-desktop-amd64.iso&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This solution skips the CD-ROM&#39;s boot menu. I haven&#39;t found a better
one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I &lt;a href=&#34;https://mg.pov.lt/blog/booting-iso-from-usb-2020.html&#34;&gt;wrote
a script to generate a grub.cfg&lt;/a&gt; for me so I don&#39;t have to do it by hand any more.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>df</title>
      <link>https://mg.pov.lt/blog/disk-free.html</link>
      <pubDate>Wed, 15 Jul 2009 01:33:02 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/disk-free.html</guid>
      <description>
&lt;p&gt;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.&lt;/p&gt;

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

&lt;p&gt;Ironically, Ubuntu&#39;s update-motd &lt;a
  href=&#34;https://bugs.launchpad.net/ubuntu/+source/update-motd/+bug/399513&#34;&gt;gets
  confused&lt;/a&gt; by Ubuntu&#39;s private user directories and displays disk stats for
~/Private as if it were a real partition.  &lt;!-- This bug probably qualifies as
a &lt;a href=&#34;https://wiki.ubuntu.com/PaperCut&#34;&gt;paper cut&lt;/a&gt;, but I hear Ubunteros
already have more of those than they can fix...  Well, okay, the &#34;average user&#34;
probably never sees /etc/motd, so it fails one of the prerequisites of being
a paper cut. --&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Buildbot issues on Ubuntu Hardy</title>
      <link>https://mg.pov.lt/blog/hardy-nfs-sighup.html</link>
      <pubDate>Fri, 15 May 2009 15:33:26 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/hardy-nfs-sighup.html</guid>
      <description>
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: The story continues, but solution is not in sight
yet.&lt;/p&gt;

&lt;p&gt;I upgraded a buildbot slave to Ubuntu 8.04 (Hardy) recently and now I&#39;m
getting a strange intermittent failure: sometimes
&lt;tt&gt;cp -r /local/dir /nfs/mounted/dir&lt;/tt&gt; fails
(&#34;process killed by signal 1&#34;, i.e. SIGHUP).&lt;/p&gt;

&lt;p&gt;I wonder if NFS is relevant or incidental to the issue?&lt;/p&gt;

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

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

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: so far 4 build steps have failed on 6 separate
occasions:&lt;/p&gt;

&lt;!--
  ./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
  --&gt;
&lt;pre&gt;
May  5 02:31: cp -r local-dir1 nfs-mounted-dir1  &lt;!-- ivija-coverage cp --&gt;
May  6 02:31: cp -r local-dir1 nfs-mounted-dir1  &lt;!-- ivija-coverage cp --&gt;
May  6 04:33: cp -r local-dir2 nfs-mounted-dir2  &lt;!-- ivija-coverage cp_2 --&gt;
May 15 02:00: cp -r local-dir3 nfs-mounted-dir3  &lt;!-- ivija-docs cp --&gt;
May 17 04:32: rm -rf nfs-mounted-dir4            &lt;!-- ivija-coverage rm_2 --&gt;
May 20 04:31: rm -rf nfs-mounted-dir4            &lt;!-- ivija-coverage rm_2 --&gt;
&lt;/pre&gt;

&lt;p&gt;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.
&lt;/p&gt;

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

     jjobs = docs_jobs
     pp([&#39;%s %.1f %s&#39; % (s.name, s.finished - s.started, s.results) for s in (b.steps[[ss.name for ss in jobs[-1].steps].index(&#39;cp&#39;)] 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.
  --&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;We&#39;re having an email conversation with Jean-Paul Calderone (&#34;exarkun&#34;)
about the possibility of this being PTY-related, with no clear resolution
so far.&lt;/p&gt;

&lt;p&gt;And, hey, now this blog supports comments ;)&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Filing bugs on GUI apps</title>
      <link>https://mg.pov.lt/blog/filing-bugs-on-gui-apps.html</link>
      <pubDate>Thu, 09 Apr 2009 22:29:21 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/filing-bugs-on-gui-apps.html</guid>
      <description>
&lt;p&gt;Ubuntu people want users to use apport to report bugs.  There&#39;s a command-line
tool called &#39;ubuntu-bug&#39; that you can use if you know the name of the package
or at least the name of executable.  There&#39;s a &#34;Report a problem&#34; menu item
in many, but not all GUI apps.&lt;/p&gt;

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

&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;xprop|grep PID&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;Click on the app&#39;s window.  Watch that shell command return a line that
looks like&lt;/p&gt;

&lt;pre&gt;
_NET_WM_PID(CARDINAL) = 807
&lt;/pre&gt;

Now run

&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;ps 807&lt;/span&gt;  # substitute the real number
&lt;/pre&gt;

&lt;p&gt;You&#39;ll see the command name, e.g.&lt;/p&gt;

&lt;pre&gt;
  PID TTY      STAT   TIME COMMAND
  807 ?        S      0:02 /usr/lib/indicator-applet/indicator-applet --oaf-acti
&lt;/pre&gt;

&lt;p&gt;Now you can run&lt;/p&gt;

&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;ubuntu-bug /usr/lib/indicator-applet/indicator-applet&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;If you&#39;re not running Jaunty, you&#39;ll need to do one more step to find the
name of the Ubuntu package:&lt;/p&gt;

&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;dpkg -S /usr/lib/indicator-applet/indicator-applet&lt;/span&gt;
indicator-applet: /usr/lib/indicator-applet/indicator-applet
&lt;/pre&gt;

&lt;p&gt;You can use that with apport-cli or on the Launchpad online bug reporting
form.&lt;/p&gt;

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

&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;xprop|grep CLASS&lt;/span&gt;
WM_CLASS(STRING) = &#34;indicator-applet&#34;, &#34;Indicator-applet&#34;
&lt;/pre&gt;

&lt;p&gt;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.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Upgrade to Ubuntu Jaunty</title>
      <link>https://mg.pov.lt/blog/upgrade-to-jaunty.html</link>
      <pubDate>Mon, 06 Apr 2009 02:28:38 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/upgrade-to-jaunty.html</guid>
      <description>
&lt;p&gt;Ubuntu 9.04 is going to be released in around three weeks.  As usual I
couldn&#39;t wait (and saw that some bugs that were irritating me every day
were fixed in Jaunty), so I upgraded to the current beta.&lt;/p&gt;

&lt;p&gt;After &lt;a
  href=&#34;https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/154236/comments/3&#34;&gt;a
  little hiccough&lt;/a&gt; at the beginning, the upgrade was the smoothest Ubuntu
upgrade I&#39;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.&lt;/p&gt;

&lt;p&gt;Nice.  Now, after a reboot things were not so nice: I couldn&#39;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.&lt;/p&gt;

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

&lt;p&gt;Compiz failed to enable a plugin (GNOME Compatibility), so a couple of
key bindings didn&#39;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.&lt;/p&gt;

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

&lt;p&gt;A lot of very irritating bugs are gone.  I don&#39;t need to restart Compiz
after playing with xrandr.  X doesn&#39;t crash after I play with xrandr.
Two-finger scrolling with the Synaptics touchpad doesn&#39;t produce phantom
scroll-down-17-pages events when I take my fingers off the touchpad.  The
GNOME panels don&#39;t migrate to the external screen when I play with xrandr
(but one of them &lt;a
  href=&#34;https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/355848&#34;&gt;jumps
  from the bottom to the top&lt;/a&gt; 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&amp;mdash;now I get sensible
black bars on the sides. &lt;strong&gt;The new notification bubbles are
  beautiful!&lt;/strong&gt;.  I could stare at them all day.  (But the new indicator
applet &lt;a
  href=&#34;https://bugs.launchpad.net/ubuntu/+source/indicator-applet/+bug/334490&#34;&gt;is
  ugly&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;Overall I&#39;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&amp;mdash;Ooh,
shiny!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Submitting patches the Launchpad way</title>
      <link>https://mg.pov.lt/blog/smooth-bug-reporting.html</link>
      <pubDate>Mon, 06 Apr 2009 00:45:20 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/smooth-bug-reporting.html</guid>
      <description>
&lt;p&gt;Today I happened to read about &lt;a
  href=&#34;http://pypi.python.org/pypi/lazr.enum&#34;&gt;lazr.enum&lt;/a&gt; in a mailing list.
I went to &lt;a href=&#34;http://pypi.python.org/pypi/lazr.enum&#34;&gt;the PyPI page&lt;/a&gt; and
saw raw &lt;a href=&#34;http://docutils.sourceforge.net/rst.html&#34;&gt;ReStructuredText&lt;/a&gt;
markup instead of a nicely formatted page.  Now I know from prior experience
that this happens when the package&#39;s description has an error in the markup.
I thought I&#39;d report a bug and provide a patch.&lt;/p&gt;

&lt;p&gt;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&lt;/p&gt;

&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;bzr branch lp:lazr.enum&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;so I ran that command and it worked.&lt;/p&gt;

&lt;p&gt;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
&lt;tt&gt;..&amp;nbsp;toc-tree:&lt;/tt&gt; directive that does not exists in plain docutils
(it&#39;s a &lt;a href=&#34;http://sphinx.pocoo.org/&#34;&gt;Sphinx&lt;/a&gt; extension).&lt;/p&gt;

&lt;p&gt;I added up a couple of lines to setup.py to strip that out, tested it
(with &lt;tt&gt;setup.py --long-description &amp;gt; test.rst; restview test.rst&lt;/tt&gt;)
committed to my local branch, and created a bug report in Launchpad.  Then I
was a bit lost, since I didn&#39;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.&lt;/p&gt;

&lt;p&gt;I thought that first I&#39;d make that branch public, and then see if there
was a way to link it to the bug report.  I ran&lt;/p&gt;

&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;bzr push lp:~mgedmin/lazr.enum/pypi-fix&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;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&#39;t have to explicitly specify my Launchpad
username and the project name&amp;mdash;both of which bzr already knows&amp;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 &#34;~mgedmin/lazr.enum/pypi-fix&#34; easily enough when I pasted it
into the search box.&lt;/p&gt;

&lt;p&gt;After clicking on the branch, I saw a &#34;propose a merge&#34; option.  I did that
and Launchpad sent an email to the developers asking them to merge my fix.&lt;/p&gt;

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

&lt;p&gt;Other than that it was a pretty smooth experience.  When will I be able to
do that for Ubuntu packages?&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Bug of the day</title>
      <link>https://mg.pov.lt/blog/bug-of-the-day.html</link>
      <pubDate>Fri, 03 Apr 2009 00:31:41 +0300</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/bug-of-the-day.html</guid>
      <description>
&lt;p&gt;I think I&#39;m going to blog about Ubuntu bugs I encounter during my day.
Don&#39;t get me wrong&amp;mdash;I love Ubuntu and haven&#39;t seen a better OS yet.  But
it has bugs.&lt;/p&gt;

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

&lt;!-- Now let&#39;s try some reverse psychology --&gt;

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

&lt;p&gt;Things I did today:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;I enabled my dual-head screen and had to restart compiz to avoid
      &lt;a href=&#34;https://launchpad.net/bugs/317431&#34;&gt;bug 317431&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;After work I tried to switch to single-screen mode again and X promptly
      crashed&amp;mdash;&lt;a href=&#34;https://launchpad.net/bugs/298226&#34;&gt;bug 298226&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;When X restarted it picked a fugly stretched 1024x768 mode that looks
      very bad on my 1280x800 widescreen panel&amp;mdash;because this was the
      only common mode between the internal panel and the external 1280x1024
      LCD.&lt;/li&gt;
  &lt;li&gt;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&#39;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.)&lt;/li&gt;
  &lt;li&gt;I suspended my laptop and put it in my backpack, then went home.&lt;/li&gt;
  &lt;li&gt;At home I tried to resume. The laptop suspended again immediately after
      waking up.&lt;/li&gt;
  &lt;li&gt;When I woke it up again, it did not accept my fingerprint (this often
      happens, I don&#39;t particularly mind&amp;mdash;it&#39;s difficult to swipe the
      finger precisely).&lt;/li&gt;
  &lt;li&gt;I then typed my password, pressed Enter&amp;mdash;and then
      gnome-screensaver spent an unreasonably long time verifying my password
      (this I do mind).&lt;/li&gt;
  &lt;li&gt;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&amp;mdash;I haven&#39;t seen it before).  The interesting
      thing is that I don&#39;t remember running apt-get upgrade today, and
      /var/log/dpkg.log confirms I last upgraded things yesterday at
      noon.&lt;/li&gt;
  &lt;li&gt;I could not take a screenshot of the bizarreness described in step 3,
      but that&#39;s reasonable&amp;mdash;the desktop was still locked.  So I took a
      (crappy) picture with my cell phone (and now I&#39;m too lazy to upload
      it&amp;mdash;but I have proof! proof!).&lt;/li&gt;
  &lt;li&gt;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.&lt;/li&gt;
  &lt;li&gt;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.
  &lt;li&gt;It&#39;s the same as my login password.  Shouldn&#39;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.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now I feel like I should report item #3 (and #13) as a wishlist, item #6 as
a bug (there&#39;s probably one open, with a bunch of duplicates, already), #8 as a
bug (but that would be useless&amp;mdash;I&#39;ve no recipe for replicating that), #9
as a bug (again, how can I replicate?)&amp;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&lt;/p&gt;

&lt;blockquote&gt;

  &lt;p&gt;&lt;strong&gt;Refresh Advanced Linux Sound Architecture (ALSA) configuration
    presets&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;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&#39;s configuration presets.  You may
  accomplish this task by executing the following command in a Terminal:
  asoundconf set-default-card&lt;/p&gt;

&lt;/blockquote&gt;

&lt;p&gt;which reads like gibberish to any nontechnical person (and many technical
persons too, I think).&lt;/p&gt;

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

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

&lt;p&gt;Okay, I&#39;ll bite&lt;/p&gt;

&lt;blockquote&gt;
&lt;pre&gt;
&lt;span class=&#34;prompt&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;typing&#34;&gt;asoundconf list&lt;/span&gt;
Names of available sound cards:
Intel
&lt;/pre&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;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&#39;ve no idea.  I&#39;m afraid to do anything now.&lt;/p&gt;

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

&lt;blockquote&gt;

  &lt;p&gt;&lt;strong&gt;Technobabble technobabble&lt;/strong&gt;&lt;/p&gt;

  &lt;p&gt;gibberish gibberish gibberish&lt;/p&gt;

  &lt;!-- I wonder if this button will survive in the RSS feed being sanitized
  through Planet and then Google Reader? --&gt;
  &lt;input type=&#34;button&#34; value=&#34;close&#34; /&gt;

&lt;/blockquote&gt;

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

&lt;p&gt;&lt;small&gt;I&#39;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&amp;mdash;this has happened
  before, and I was surprised and grateful).&lt;/small&gt;&lt;/p&gt;

</description>
    </item>
    
    <item>
      <title>X ate my keyboard, again</title>
      <link>https://mg.pov.lt/blog/x-ate-my-keyboard-again.html</link>
      <pubDate>Fri, 06 Mar 2009 08:11:36 +0100</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/x-ate-my-keyboard-again.html</guid>
      <description>
&lt;p&gt;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.&lt;/p&gt;

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

&lt;p&gt;/var/log/Xorg.0.log has a series of errors like this:&lt;/p&gt;

&lt;pre&gt;
(EE) AT Translated Set 2 keyboard: Device has changed - disabling.
(WW) AT Translated Set 2 keyboard: Release failed (Invalid argument)
&lt;/pre&gt;

&lt;p&gt;Sadly, there are no timestamps.  I think this was printed once on resume,
and then once on every VT switch.&lt;/p&gt;

&lt;p&gt;xinput still lists &#34;AT Translated Set 2 Keyboard&#34; among its devices.&lt;p&gt;

&lt;p&gt;I remember now -- before suspending I had used &lt;code&gt;sudo showkeys -s&lt;/code&gt;
in an xterm (trying to see the scan code of the ThinkVantage button).  Could&#39;ve
mucked up the keyboard mode?&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Meta&lt;/strong&gt;: I wrote this post on March 6, and then decided it
wasn&#39;t interesting enough to post.  And then posted it accidentally on March
20.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: looks like &lt;a
href=&#34;https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/327175&#34;&gt;bug
327175&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>X.org and stuck Ctrl</title>
      <link>https://mg.pov.lt/blog/xorg-snafu.html</link>
      <pubDate>Fri, 27 Feb 2009 00:07:43 +0100</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/xorg-snafu.html</guid>
      <description>
&lt;p&gt;Warning: this is going to be a long story with a semi-happy ending.
Skip it unless you enjoy tales of woe and debugging.&lt;/p&gt;

&lt;p&gt;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:&lt;/p&gt;

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

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;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&#39;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&#39;t change the state of events seen
by xev, though.&lt;/p&gt;

&lt;p&gt;Did my keyboard map get lost?  Is some X client grabbing all the keys?
how do I recover?&lt;/p&gt;

&lt;p&gt;I use x2x to connect to the laptop from my desktop.  I now can use my
desktop&#39;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.&lt;/p&gt;

&lt;p&gt;I try to guess which X client might have the keyboard grab (if there is
one).  I killall compiz.  I&#39;m surprised that gnome-session doesn&#39;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.&lt;/p&gt;

&lt;p&gt;I have a VNC server running (vino), but I&#39;ve forgotten its password.&lt;/p&gt;

&lt;p&gt;I notice a weird message in my xev log:&lt;/p&gt;

&lt;pre&gt;
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   
&lt;/pre&gt;

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

&lt;pre&gt;
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   
&lt;/pre&gt;

&lt;p&gt;Looks normal.  Then I notice this at the end of the xev log:&lt;/p&gt;

&lt;pre&gt;
FocusOut event, serial 40, synthetic NO, window 0x3e00001,
    mode NotifyWhileGrabbed, detail NotifyNonlinear
&lt;/pre&gt;

&lt;p&gt;What&#39;s &#34;NotifyWhileGrabbed&#34; 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 &amp;lt;unknown&amp;gt; and show
no PID.&lt;/p&gt;

&lt;p&gt;I suspend the laptop (which is a very &lt;em&gt;stupid&lt;/em&gt; idea when your other
machine&#39;s mouse and keyboard are redirected to it via x2x) and resume it,
hoping that gnome-screensaver will somehow overpower the existing application&#39;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;amp; mouse back on the
desktop.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

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

&lt;p&gt;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.&lt;/p&gt;

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

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

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

&lt;p&gt;I restart gnome-settings-daemon and it promptly invokes xrandr to set up
a dual-head mode that confuses compiz.  By &#34;confuses&#34; 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.&lt;/p&gt;

&lt;p&gt;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, &#39;Segmentation fault&#39; at the end
of ~/.xsession-errors is quiet, isn&#39;t it?  Thankfully, &#39;firefox http://someurl&#39;
for some reason works and opens a window.  I cannot find the Compiz bug I
remember (could it have been &lt;a
  href=&#34;https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/135418&#34;&gt;#135418&lt;/a&gt;?),
but this looks like a better fit anyway: &lt;a
  href=&#34;https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/317431&#34;&gt;#317431&lt;/a&gt;
(and &lt;a
  href=&#34;https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/206998&#34;&gt;#206998&lt;/a&gt;
might be a duplicate).  And here&#39;s my gnome-settings-daemon bug:
&lt;a href=&#34;https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/335201&#34;&gt;#335201&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is all on Ubuntu 8.10 (Intrepid Ibex).&lt;/p&gt;

&lt;p&gt;Some days I just hate Linux.  Then I remember that it&#39;s worse on other
systems...&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Largest apps on my laptop #2</title>
      <link>https://mg.pov.lt/blog/largest-apps-2.html</link>
      <pubDate>Sun, 22 Feb 2009 12:28:41 +0200</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/largest-apps-2.html</guid>
      <description>
&lt;p&gt;I recently &lt;a href=&#34;https://mg.pov.lt/blog/largest-apps.html&#34;&gt;posted some
data&lt;/a&gt; about applications taking up the most RAM on my laptop.  That was
after 9 days of uptime, while this is after 12 hours:&lt;/p&gt;

&lt;pre&gt;
  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-
&lt;/pre&gt;

&lt;p&gt;I don&#39;t have GNOME Do any more, and I&#39;ve only one of the two PDFs open in
Evince.  I don&#39;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&#39;t quite apply to Banshee or Pidgin, but Pidgin&#39;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).&lt;/p&gt;

&lt;p&gt;OS: Ubuntu 8.10, up-to-date with all the updates from -security,
-updates, -proposed-updates and -backports.&lt;p&gt;

&lt;p&gt;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&#39;t work out so well when resuming, since the kernels didn&#39;t match -- I
had installed a kernel update, but hadn&#39;t rebooted.  I don&#39;t think I
ever used hibernation successfully in Linux.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Largest apps on my laptop</title>
      <link>https://mg.pov.lt/blog/largest-apps.html</link>
      <pubDate>Wed, 18 Feb 2009 21:31:39 +0100</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/largest-apps.html</guid>
      <description>
&lt;p&gt;After reading Alexander Larsson&#39;s post &lt;a
href=&#34;http://blogs.gnome.org/alexl/2009/02/17/eternal-vigilance/&#34;&gt;on
de-bloating nautilus&lt;/a&gt; I thought it would be interesting/useful to see what
apps are eating my RAM, as a statistical data point if nothing else.&lt;/p&gt;

&lt;p&gt;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:&lt;p&gt;

&lt;pre&gt;
  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
&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; compare these numbers with &lt;a
href=&#34;https://mg.pov.lt/blog/largest-apps-2.html&#34;&gt;what I get just 12 hours
uptime&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;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&#39;t want my 2 gigs of RAM to fill up
completely.  I hadn&#39;t needed to do that before, memory usage stayed pretty
constant.&lt;/p&gt;

&lt;p&gt;I cannot explain the X.org numbers.  pmap doesn&#39;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 (&#34;resource2&#34;).  xrestop sees a total
of 21027K of resources (pixmaps etc.) attributed to all the clients.  I have a
vague suspicion that this number doesn&#39;t include OpenGL textures used by
Compiz, but I&#39;m pretty clueless about those things.  compiz --replace reduces
Xorg&#39;s RSS down by 9 megabytes and increases VIRT by 5 megabytes.  The increase
is mirrored by xrestop, which now shows 25652K in total.&lt;/p&gt;

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

&lt;p&gt;I&#39;m not happy about the Banshee memory usage.  I wouldn&#39;t mind that much if
it didn&#39;t insist on minimizing to the system tray.&lt;/p&gt;

&lt;p&gt;I&#39;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;amp; virtual
machine.  And why on Earth does a &lt;em&gt;chat program&lt;/em&gt; need 1.6 gigs of
virtual memory?&lt;/p&gt;

&lt;p&gt;Tomboy: Mono again.  But Tomboy is a &lt;a
href=&#34;http://en.wikipedia.org/wiki/Killer_application&#34;&gt;killer application&lt;/a&gt;
and I need it.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Nautilus: pretty consistent with Alexander&#39;s numbers, looks like I can
expect improvements in Ubuntu 9.04 or at least 9.10.&lt;/p&gt;

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

&lt;p&gt;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 &lt;em&gt;what I
need/am used to&lt;/em&gt; better.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Huawei E220 USB 3G modem</title>
      <link>https://mg.pov.lt/blog/huawei-e220.html</link>
      <pubDate>Thu, 05 Feb 2009 10:05:48 +0100</pubDate>
      <author>marius@gedmin.as (Marius Gedminas)</author>
      <guid>https://mg.pov.lt/blog/huawei-e220.html</guid>
      <description>
&lt;p&gt;Almost works out of the box on Ubuntu.  Will work out of the box in the
forthcoming 9.04 release.&lt;/p&gt;

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

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

&lt;p&gt;On an unrelated note, Sweden is a very nice country.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
