Bill Wohler's Debian Notes to Self (and You)



2014-03-30

Creating your favicon.ico file permalink

Create your icon, make it 16x16, and export as a PNG. If you have ImageMagick installed, it's as easy as:

$ convert favicon.png favicon.ico      
    

Alternatively, use the ConvertICO web site to convert your image to a favicon.ico file.



2014-02-28

Google Music Manager on Debian Wheezy permalink

See Gabriel Saldaña'sblog for instructions to get an older version of Google Music Manager that works with Debian wheezy.



2014-02-16

GnuCash Price Editor: Unable to retrieve quotes for these items (redux) permalink

This error is described in Debian bug #739142. Although the bug says it's for Yahoo, the same patch referenced within works for Vanguard too. It's easy to apply, it just updates the URL in USA.pm.



2013-10-26

Detaching GNOME 3 modal dialogs permalink

If you need to get at the information hidden under GNOME 3 modal dialogs, run the following to detach the dialog from its parent window.

gsettings set org.gnome.shell.overrides attach-modal-dialogs false
    

You then need to restart the GNOME Shell to use this new setting. Press M-F2 r RET.



2013-10-26

Update Java plugin on Chrome permalink

If the Java plugin does not exist, of course it won't work. In addition, if it is too old, Chrome will complain or some sites that use a Java applet won't work. Chrome will provide a button that says "Update plug-in." In the case of Java, it will only let you download a tarball from Oracle. You can either use that tarball, or install the Debian package for the OpenJDK plugin.

The Debian OpenJDK package is called IcedTea. The appropriate package is icedtea-plugin (or its older variant such as icedtea6-plugin). Thus, all you have to do is install this package and restart Chrome:

$ sudo aptitude install icedtea-plugin
    

If you downloaded the Oracle tarball, install it and make Chrome aware of it with something like the following. The link to jre1.7 is created so that the link in ~/.mozilla/plugins doesn't have to be changed if you update the installation. If you want to make the plugin available to all users of the system, the appropriate directory is /opt/google/chrome/plugins (or /usr/lib/mozilla/plugins for Iceweasel).

$ cd /usr/local/lib
$ sudo tar xzf /tmp/jre-7u13-linux-x64.tar.gz
$ sudo ln -s jre1.7.0_13 jre1.7
$ sudo mkdir ~/.mozilla/plugins
$ sudo ln -s /usr/local/lib/jre1.7/lib/amd64/libnpjp2.so ~/.mozilla/plugins
    

Once this is done, restart Chrome. If you installed more than one plugin, you can control the plugin that is enabled by visiting chrome://plugins/. Then, test the plugin.

This entry supersedes this entry.



2013-10-20

Editing videos III permalink

I learned that my current video editor of choice, kino (see Editing videos I and Editing videos II), died in 2009. Since it was using obsolete arguments to ffmpeg in wheezy, it could no longer export edited video!

The editors avidemux, OpenShot, and PiTiVi surfaced after a brief survey. The editor avidemux fared poorly during my first survey, so I considered OpenShot and PiTiVi. Since PiTiVi seems to be very integrated with GNOME, is under very heavy development, has favorable reviews, and—best of all— is found in the wheezy distribution rather than in deb-multimedia.org, I was definitely leaning towards it.

I first gave OpenShot a brief try. I found it difficult to split a clip at the desired frame. You have to use the context menu to remove clips, that you need to drag remaining clip to beginning and orange vertical bar to end of remaining clip to avoid exporting black space. My export settings were: Export: Profile: Web, Target: YouTube HD, default video profile (HD 720p, 25 fps) and quality (med). A nice .mp4 video was exported. However, there was a segmentation fault upon exit!

I found it very easy to edit video in PiTiVi. The manual is worthwhile to scan as it points out a couple of things that might not be obvious, but on the whole, it took less time to learn how to splice a video together than the rest. I first rendered my video in N800/MP4, but the export hung. However, rendering to Web (.webm) worked. While totem was able to play this video, the quality was not that good. I then chose a Container format of MP4, a Frame rate of 25 fps, and Codec of x264enc in the Video tab, and produced a nice .mp4 video at less than half the size of OpenShot and YouTube-friendly. I added it as a preset. Like OpenShot, you first need to drag the timeline to 0:00 to avoid rendering blackness at the beginning of your movie. However, you don't have to worry about trimming blackness from the end.

To add text to your video, create a transparent PNG image in the GIMP that is the same size as your video, add your text to that image, and then import it into PiTiVi. If you update the image, I found that the quickest way for PiTiVi to reread it was to replace it on the timeline, that is, to delete the clip from the timeline and to drag it back from the clip library.



2013-10-01

Upgrading to wheezy permalink

I followed the release notes and things went rather smoothly. It took a little playing with aptitude afterward to complete the full update of the packages and work out the i386 multiarch kinks.

GNOME 3 has a changed a bit since I first talked about it. Here are a couple of changes and additional pointers that go with GNOME 3.4.

The computertemp applet appears to be gone as well and I learned that /proc/acpi/ibm is being deprecated in favor of the files in /sys. I found a good alternative to controlling my laptop's fan in the thinkfan package. I followed the German instructions for configuring thinkfan as well as a translation and embellishment using the sensors in /sys instead of in /proc/acpi/ibm. I referred to a page on my T500's sensors. The ThinkPad ACPI Extras Driver document contains additional good information.

With the upgrade, Picasa lost the ability to upload photos to Picasaweb. The file ~/.google/picasa/3.0/picasa.log held the clue: Picasa couldn't find libssl.so. Linking the new versions of libssl to libssl.so didn't work, but I found a compatible version 0.98 in /usr/local/lib/emul/ia32-linux that had been installed by somebody. In order to provide this library to Picasa, start Picasa as follows:

LD_LIBRARY_PATH=/usr/local/lib/emul/ia32-linux/usr/lib picasa
    


2013-07-01

Getting more performance out of USB memory sticks permalink

When I rsynced a directory onto my new Patriot 64 GB USB drive (60 MB/sec VFAT), the symbolic links failed to copy. When considering an ext filesystem for this stick in which I didn't care about compatibility with others, I found that you wanted to use ext2 rather than ext4 to avoid writing to the SDD (which has a limited lifetime). I also found an interesting article called Increase USB Flash Drive Write Speed .

Running the same commands shown in his blog, here are my results with this drive.

$ sudo hdparm -t /dev/sdb1
/dev/sdb1:
 Timing buffered disk reads:  90 MB in  3.07 seconds =  29.32 MB/sec
$ dd count=100 bs=1M if=/dev/zero of=/media/PATRIOT/test
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 4.62097 s, 22.7 MB/s
$ sudo fdisk -H 224 -S 56 /dev/sdb
$ sudo mke2fs -t ext4 -E stripe-width=32 -m 0 /dev/sdb1
$ sudo hdparm -t /dev/sdb1
/dev/sdb1:
 Timing buffered disk reads:  90 MB in  3.02 seconds =  29.82 MB/sec
$ dd count=100 bs=1M if=/dev/zero of=/media/891aeafd-24cd-426e-b37e-24738e324fdd/test
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.12317 s, 851 MB/s
$ sudo mke2fs -t ext2 -E stripe-width=32 -m 0 /dev/sdb1
$ sudo hdparm -t /dev/sdb1
/dev/sdb1:
 Timing buffered disk reads:  90 MB in  3.01 seconds =  29.90 MB/sec
$ dd count=100 bs=1M if=/dev/zero of=/media/2032f5d7-f4d0-4853-89a1-d6c7129e11cb/test
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.116094 s, 903 MB/s
$ sudo fdisk -H 32 -S 8 /dev/sdb
$ sudo mke2fs -t ext4 -E stripe-width=32 -m 0 /dev/sdb1
$ sudo hdparm -t /dev/sdb1
/dev/sdb1:
 Timing buffered disk reads:  94 MB in  3.06 seconds =  30.71 MB/sec
$ dd count=100 bs=1M if=/dev/zero of=/media/093eda14-da74-4446-ac35-0106cd5d644f/test
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.124107 s, 845 MB/s
$ sudo mke2fs -t ext2 -E stripe-width=32 -m 0 /dev/sdb1
$ sudo hdparm -t /dev/sdb1
/dev/sdb1:
 Timing buffered disk reads:  96 MB in  3.05 seconds =  31.52 MB/sec
$ dd count=100 bs=1M if=/dev/zero of=/media/9007be40-0a89-480f-a0d6-ebdad491f4cb/test
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.118107 s, 888 MB/s
    

The first fdisk command arguments follows the blog while the second follows a suggestion in the comments. In my case, the original suggestion seems faster on the writes, and ext2 seems faster than ext4. Since ext2 is also easier on the drive, I opted with the original fdisk suggestion.

But first, for fun, I tried the default fdisk and ext commands.

$ sudo fdisk /dev/sdb
$ sudo mke2fs -t ext2 /dev/sdb1
$ sudo hdparm -t /dev/sdb1
/dev/sdb1:
 Timing buffered disk reads:  96 MB in  3.02 seconds =  31.75 MB/sec
$ dd count=100 bs=1M if=/dev/zero of=/media/adde8bde-13f5-4b1d-bf14-c3682d109715/test
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.119677 s, 876 MB/s
    

The proposed commands are about 3 percent faster than using the defaults which isn't enough for me to eschew the defaults. So I went with the default fdisk and ext2 commands.



2013-06-09

Getting the microphone working on Debian squeeze permalink

I thought my microphone on my ThinkPad T500 running squeeze was working, but I hadn't used it in a really long time. When I really needed it recently, it didn't work. Googling didn't turn up an answer, but I stumbled across it.

  1. Run
    $ sudo alsactl init
    $ sudo shutdown -r now
            
    The alsactl program complained about unknown hardware, but this was OK in my case. From what I read (and experienced), you do need to reboot after this step.
  2. Bring up the ALSA Mixer panel with System -> Preferences -> Sound.
  3. Set the Preferences -> Digital Recording checkbox. This was key. Strangely, the mic continued to work even if I unchecked the box.
  4. Select the Recording tab.
  5. Set level to about 70% and ensure that everything is unmuted.
  6. On the playback tab, set the Docking Mic and Internal Mic levels to about 70%. I found that the Docking Mic levels worked for the mic that was plugged in (rather than the obvious External Mic), and the Internal Mic
  7. Use Sound and Video -> Sound Recorder to test. There is a mic level display on the recorder; I tweaked the levels in the ALSA Mixer Playback tab to ensure the mic levels were set to a nice level.


2013-02-10

Update Java plugin on Chrome permalink

This entry has been superseded by this entry.

If the default version of the Java plugin is too old, Chrome will complain or some sites that use a Java applet won't work. Chrome will provide a button that says "Update plug-in." In the case of Java, it will only let you download a tarball from Oracle. Here are the steps I took to tell Chrome about it. Your precise locations may vary.

$ cd /usr/local/lib
$ sudo tar xzf /tmp/jre-7u13-linux-x64.tar.gz
$ sudo ln -s jre1.7.0_13 jre1.7
$ sudo mkdir /opt/google/chrome/plugins
$ sudo ln -s /usr/local/lib/jre1.7/lib/amd64/libnpjp2.so /opt/google/chrome/plugins
    

After restarting Chrome, test the plugin.

I was hoping to be able to link to this library from my ~/.config/google-chrome directory. Please let me know if you know the directory Chrome is looking for.

By the way, the directory that that Iceweasel uses is /usr/lib/mozilla/plugins.



2013-02-04

Fixing "pam_abl[32671]: Invalid argument (22) while opening or creating database" permalink

The Debian pam-abl maintainer Alex Mestiashvili suggested that I run the following to test the database:

$ sudo db5.1_verify -h /var/lib/abl users.db
$ sudo db5.1_verify -h /var/lib/abl hosts.db
    

This revealed a problem with the database, so Alex proposed I perform the following:

$ sudo db5.1_recover -v -h /var/lib/abl
    

This took a long time to run, but it completed successfully and pam_abl returned to blocking access from script kiddies. In addition, I found that you can clean up the thousands of log files in /var/lib/abl with the following command:

$ sudo db5.1_archive -d  -h /var/lib/abl
    

While this does prevent recovery from a catastrophic database corruption, in the case of pam-abl, there isn't much harm in starting from scratch. Thus, this cleanup does not present much risk.



2012-11-22

Problems with wireless permalink

We began having issues streaming our Netflix movies. They began to break up more and more. I also started noticing slow network speeds and dropouts on my Linux laptop and the following errors in my log:

kernel: [96404.491351] iwlagn 0000:03:00.0: Microcode SW error detected.  Restart
ing 0x2000000.
wpa_supplicant[1910]: Failed to initiate AP scan.
kernel: [107123.472075] wlan0: direct probe to AP XX:XX:XX:XX:XX:XX timed out
wpa_supplicant[1910]: Authentication with XX:XX:XX:XX:XX:XX timed out.
    

After rebooting of every box in the house to no avail, I stumbled across this amazing Amazon review of my wireless router that suggested using a slower rate if there was wifi congestion in the neighborhood (does 13 APs count as a lot?)

After dialing the network speed down to 217 MB/sec from 450 Mb/sec, I have not seen any of the above errors in the past week and Netflix streaming is working perfectly.



2012-10-06

Using pam_abl to help against brute force login attacks permalink

My logs are full of failed login attempts. I wanted to reduce the output in the logs so I installed libpam-abl and configured it per the instructions in /usr/share/doc/lib-pam/README.Debian. In addition, I replaced !root with * in the user rule since I don't allow remote root logins anyway. Also, there is a bug in version 0.4.3 of libpam-abl that allows logins with correct passwords that would otherwise be blocked. The symptom is a "Operation not permitted" error in auth.log. The workaround is to set MaxAuthTries to 1 in /etc/ssh/sshd_config.

I then tested per the instructions in Jonathan Gardner's wiki by uncommenting out the debug line in the configuration file and logging in with:

$ ssh -o "PubkeyAuthentication=no" you@yourhost
    

As Bob Cromwell states on his How to Set Up and Use SSH page, access controls actually result in more logging, not less. However, now I'll feel a little better about suppressing failed logins from my logcheck messages.



2012-08-13

Getmail is not for me permalink

The fetchmail program started throwing a segmentation violation last week, which seemed correlated to my changing my password at work. Because changing my password is such a pain, and it wasn't guaranteed to fix the problem (since I've had longer passwords, and passwords with similar characters), I switched to getmail, which hopefully will only be until the next time I have to change my password or upgrade to wheezy and get fresh bits.

First, here's my simple fetchmail configuration.

set daemon 60
set bouncemail
set properties ""
poll host protocol IMAP user keep ssl idle
    

Here is my .getmail/getmailrc.

[retriever]
type = SimpleIMAPSSLRetriever
server = host
username = user
password = password

[destination]
type = MDA_external
path = /usr/bin/procmail
unixfrom = true

[options]
read_all = false
delete_after = 30
delivered_to = false
    

In order to use it, you have to create a cron entry.

* * * * * getmail --quiet
    

Here is why getmail sucks and why I'm looking forward to switching back to fetchmail.

  1. getmail does not have a daemon mode, which means that
  2. You have to create a crontab entry (with the associated syslog noise), and
  3. You don't have access to IMAP's IDLE mode for faster updates, and
  4. You have to add your password to the configuration file. It is a huge security problem to have plaintext passwords in a text file, regardless of the permissions of the file and directory. In addition, I use Subversion to maintain and distribute my environment to my various machines so now the plaintext password is in an unknown environment in the Subversion repository. Finally, I now have yet another task to do when I change my password (required every two months). In contrast, my fetchmail configuration file hasn't changed for the five years I have worked here. That's the way it should be.
  5. getmail sets the value of the Return-Path header field to unknown instead of the address of the sender. This makes all of my procmail log entries start with From unknown making the log useless for checking on mail from a particular person.

Lame, lame, lame!



2012-08-12

gvfs-open (via xdg-open) opens the wrong application permalink

The xdg-open program was opening gnumeric instead of libreoffice for .xlsx files. I found a few tools to help diagnose the problem:

$ xdg-mime query filetype foo.xlsx 
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
$ xdg-mime query default application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
openoffice.org-calc.desktop
$ grep -r gnumeric ~/.local
~/.local/share/applications/mimeapps.list:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=openoffice.org-calc.desktop;gnumeric.desktop;libreoffice-calc.desktop;file-roller.desktop;
$ locate openoffice.org-calc.desktop
/usr/share/app-install/desktop/openoffice.org-calc.desktop
$ locate gnumeric.desktop
/usr/share/app-install/desktop/gnumeric.desktop
/usr/share/applications/gnumeric.desktop
/var/lib/menu-xdg/applications/menu-xdg/X-Debian-Applications-Office-gnumeric.desktop
$ locate libreoffice-calc.desktop
/usr/share/applications/libreoffice-calc.desktop
    

I think what is happening is that /usr/share/app-install/desktop is not in the search path and /usr/share/applications is, so gnumeric.desktop is being used in favor of openoffice.org-calc.desktop since the former is found and the latter is not. The correct application, libreoffice-calc.desktop, doesn't even get to play.

I removed the offensive line from .local/share/applications/mimeapps.list and then ran:

$ xdg-mime default libreoffice-calc.desktop
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
    

When I run xdg-open on a .xlsx file, I get libreoffice as desired.



2012-06-22

Fixing "Server certificate verification error" error in fetchmail permalink

Recent versions of fetchmail seem to be getting picky about their SSL certificates. I only noticed after it seemed that fetchmail was taking its time getting mail. Running fetchmail -vN, I saw the following:

fetchmail: Server certificate verification error: self signed certificate
fetchmail: This means that the root signing certificate (issued for
/O=Dovecot mail server/OU=tassie.newt.com/CN=tassie.newt.com/emailAddress=root@newt.com)
is not in the trusted CA certificate locations, or that c_rehash needs
to be run on the certificate directory. For details, please see the
documentation of --sslcertpath and --sslcertfile in the manual page.
    

I tried running c_rehash on my server to no avail. After a bit of Googling, I learned that I could give fetchmail my server's certificate fingerprint to satisfy its security stringentness. To obtain your server's fingerprint, run:

sudo openssl x509 -md5 -subject -dates -fingerprint -in /etc/ssl/certs/dovecot.pem
    

To tell fetchmail about it, add the sslfingerprint keyword to your .fetchmailrc. For example,

poll <host>
     ssl sslfingerprint "<fingerprint obtained above in quotes>"
     <other parameters>
    


2012-03-13

Readying a new disk for use permalink

Here are my notes on configuring a new disk for use. Update device names, volume group, and logical volume names to taste.

This time, instead of running fdisk or cfdisk, I tried System Tools -> Disk Utility. I had used it previously to label external drives so that since the label is used as the name of the directory in /media. It was certainly nicer than working with cfdisk. I created a single partition that spanned the entire disk.

I then made this partition ready for use with the following commands:

# pvcreate /dev/sdc1
# vgcreate lmc2 /dev/sdc1
# vgdisplay lmc2 | grep "Total PE"
# lvcreate -l 238466 lmc2 -n backup
# mkfs -t ext4 /dev/mapper/lmc2-backup
# emacs /etc/fstab
/dev/mapper/lmc2-backup /var/local/backup ext4 errors=remount-ro 0 3
# mount /var/local/backup
    

The vgdisplay command was used to get the number of extents in the volume group which was used in the lvcreate command. Here, I used all of them when creating the logical volume. I used LVM so that if I ever have to add another logical volume, I can simply resize the existing volume and add another.



2011-12-31

Creating static mount points dynamically permalink

I have a pair of external backup drives that I use alternatively for backups. For ages, I just let Nautilus mount them wherever and my backup script, which used tar under the covers, looked for a special file called BACKUPS in all of the directories in /media. However, I just switched to rsnapshot and needed to specify the root to the backup directory in rsnapshot.conf. The question was thus: How can I ensure that my two backup drives always have the same mount point?

One way is to use /etc/fstab. For example:

UUID=11111111-1111-1111-1111-111111111111 /media/backups ext3 rw,nosuid,nodev,user 0 0
UUID=22222222-2222-2222-2222-222222222222 /media/backups ext3 rw,nosuid,nodev,user 0 0
    

Note that there is currently a bug in Nautilus that duplicates the backups name in its bookmarks using the UUID format. A workaround for that is to use the link in /dev/disk/by-uuid as follows:

/dev/disk/by-uuid/11111111-1111-1111-1111-111111111111 /media/backups ext3 rw,nosuid,nodev,user 0 0
/dev/disk/by-uuid/22222222-2222-2222-2222-222222222222 /media/backups ext3 rw,nosuid,nodev,user 0 0
    

Since Nautilus and gvfs-mount create and remove mount points on the fly for removable media, it seems a shame to have to modify /etc/fstab. More important, I have set the no_create_root variable to 1 in rsnapshot.conf so I don't want to have to create the /media/backups mount point because otherwise, my backup would go into my root partition if my external drive wasn't mounted.

I learned that Nautilus will use the partition's label as a mount point if it exists; otherwise, it uses the UUID as the mount point, which I was seeing. I then changed the label of my external drives to backups via the System Tools -> Disk Utility command. So, without any local configuration, my external drives are mounted on /media/backups and that mount point is dynamically created and removed as needed. Case closed.



2011-12-18

Goodbye Delicious, hello Pinboard permalink

Charles Arthur was kind enough to write Goodbye Delicious, hello Pinboard: why we'll pay for internet plumbing and I invite you to start with that article for my motivation to leave Delicious. Look to the Delicious forum to see that this truly is the winter of Delicious discontent.

I briefly checked out Google Bookmarks. I was disappointed to see that their tags are comma-separated. Adding bookmarks seemed to be pretty cumbersome, at least in Chrome. There is a bookmarklet available, but I don't want to waste screen real estate for a bookmark toolbar. Chrome extensions claim to be able to access Google Bookmarks but I couldn't figure out how to add bookmarks with them. Why can't one just use the existing Chrome bookmarking star to access a different bookmark tool?

I wasn't able to import my Delicious bookmarks (the feature exists, but Delicious responded with "access denied"--mmmmm), and there isn't a means to import an HTML file with bookmarks. I therefore didn't actually try its searching and browsing capabilities.

There is a limited sharing capability, but that is to be retired tomorrow.

In short, Google Bookmarks looks promising if you're willing to put in a little work to discover an easy way to add bookmarks and don't use the social aspect of bookmarking.

The Wikipedia page for "Social bookmarking" indicates a number of related sites. Another Delicious user mentioned Pinboard and I also read Charles Arthur's article Goodbye Delicious, hello Pinboard: why we'll pay for internet plumbing. I therefore thought Pinboard might be worth trying. At the moment, it has a nominal one-time fee of about $10.

To switch, export your Delicous bookmarks to an HTML file and import that file into Pinboard.

Pinboard has the look and feel of the original Delicious. It's fast. It's clean. I created a Chrome search engine using the query http://pinboard.in/search/?query=%s&mine=Search+Mine so that I can efficiently navigate my bookmarks using the Omnibox. You can browse bookmarks by adding and subtracting tags from your set of tags. URLs are a bit annoying: a URL in delicious such as delicious.com/user/tag+tag would be pinboard.in/t:user/t:tag/t:tag.

You can add a bookmark with a bookmarklet, but I don't want to waste real estate with a bookmark toolbar. There are quite a few Pinboard Chrome extensions for adding bookmarks available. Ideally, the extension would use the existing star to add bookmarks and highlight it in yellow if the current page is bookmarked. Next best would be an icon. A context menu item would be helpful. I don't have a need to have a browse or search capability since I use the Omnibox for that. There is an official Pinboard extension called Pinboard Tools. However, Pinboard Plus is the best in my opinion: it changes color when the page is bookmarked and provides a delete button, enter will confirm an autocompleted tag as well as submit and dismiss the dialog, selected text goes in to the description. The only issue, which should be easily fixed, is that the focus does not start at the Tags field.

I sent a few ideas to the author, Maciej, and he's already responded with a gracious response.

To summarize, Pinboard is what Delicious used to be. Maciej is planning to add the good stuff that Delicious had (breadcrumbs, tag bundles).

This weekend, I said goodbye to Delicious and have said hello to Pinboard.



2011-08-02

Removing underlines from links in Chrome permalink

Apparently, I'm not alone in my dislike of link underlines. Links are already colored to indicate that they are links and the underlines can be very distracting on pages with many links. Many forums talk about ways to get rid of the underlines, including installing plugins, or writing JavaScript or CSS. Here is the simplest way to remove the underlines in Chrome.

Add the following text to ~/.config/google-chrome/Default/User StyleSheets/Custom.css and either refresh each page or restart Chrome. The comments describe what each section does.

/* Don't underline links by default. */
:link, :visited {
    text-decoration: none;
}

/* Underline links when hovering above them. */
:link:hover, :visited:hover {
    text-decoration: underline;
}
    


2011-08-09

Where's the CPU temperature applet? permalink

I have an old Thinkpad which gets hot and shuts off even though the fan is on full speed. Maybe some fresh thermal grease is all it needs. In the meantime, having the CPU temperature applet is mandatory.

The package gnome-shell-extension-cpu-temperature seems to be the ticket. After installing this package (on my Fedora system--I don't see it on Debian at this time) and restarting the GNOME Shell (Alt-F2 r RET), the temperature appeared on the status bar. I still need to figure out how to run a command when the temperature exceeds a certain temperature.

I've also found it helpful to turn down the CPU speed at times. This can be done with:

$ sudo cpufreq-set --cpu 0 --max 1.6GHz
$ sudo cpufreq-set --cpu 1 --max 1.6GHz
    

Use cpufreq-info to inquire what values of clock rate you can use. The rate 1.6 isn't my slowest, but it's enough to cool down the engines.



2011-08-02

So what replaces the desktop metaphor? permalink

The Finding and Reminding document discusses the pertinent design considerations going into the GNOME Shell, but does not discuss what specific elements of the GNOME Shell address the desktop metaphor.

The original GNOME Shell design paper says, "In the Shell design, the `desktop' folder should no longer be presented as if it resides behind all open windows. We should have another way of representing ephemeral and working set objects."

And that is?

I could not find a concise answer to this question, so I'll attempt to do so. I agree with the designers that displaying the desktop folder on the background has a couple of major problems. The icons will either be occluded, or distracting. I think the desktop icons can be replaced in the following ways:



2011-07-21

Why I love GNOME 3.0 permalink

OK, so now I'm using GNOME 3.0. And I'm loving it.

After using GNOME 3 for just half a day, coming home to my GNOME 2 desktop on my laptop seemed really ugly and clunky. I've removed my window list and workspace widget to clear the clutter somewhat, and moved my calendar to the middle so there is some semblance of consistency between home and work.

I have to agree, even after using GNOME since its infancy in 1999, and customizing it thoroughly, that hanging on to Window 95 roots isn't a good thing. I enjoy letting go and not worrying about customizing the desktop.

What is GNOME 3.0? It is a huge redesign, and can work on touchscreens and netbooks as well as on desktops. The GNOME Shell and Mutter (a metacity fork) replace the GNOME Panel and the metacity window manager. Written in JavaScript and using CSS, the GNOME Shell uses the same tools employed by HP's (Palm) WebOS. It uses the Clutter graphic and scene graph library. Unity, as it turns out, is Ubuuntu's offering at a new UI.

I would strongly suggest getting acquainted with GNOME 3.0 before upgrading your system and being shocked by the experience. To start, the GNOME 3 overview page contains some 45-second videos that highlight the new features and might even tempt you into trying the GNOME Shell. That, and the GNOME Shell Design paper, the GNOME Shell Tour, and especially the GNOME Shell Cheat Sheet are great introductions. The GNOME 3.0 release notes also provides a quick overview. Had I read these before the update, it would have helped to reduce the initial shock I received upon logging in.

After a few hours, I no longer miss the window list, fixed workspaces, application menus, and Desktop icons. The Activities window and dynamic workspaces, with an improved Alt-TAB/Alt-` command, make it easy to switch between applications and application windows. The application and recent document search function replaces the application menu and desktop icons just dandy. The notification area has replaced my widgets on the taskbar. I absolutely love the window tiling gestures.

But, while I look forward to GNOME 3 coming to Debian stable, if GNOME 3 is still not for you, please read my comments in Why I hate GNOME 3 to see how to go back to GNOME 2 (mostly).

Here are some additional articles on GNOME 3 that I found which may be interesting to you.

Here's a list of bugs or "features" that I discovered along the way along with fixes or workarounds when possible.

There are a few items in my last post that are applicable to GNOME 3 as well (keyboard rate, middle mouse button, etc.).



2011-07-20

Why I hate GNOME 3.0 permalink

License: You agree to read Why I Love GNOME 3 before reading this blog posting.

We upgraded to Fedora 15 at work last night. This came with GNOME 3.0. I think it will be likely that you will have a WTF moment when this happens to you when GNOME 3.0 comes to Debian. More likely, you'll have a WTF day. I did. Your first reaction may be to get back to back to GNOME 2. This post describes how you can (mostly) do that. I hope you find it helpful. (I also hope that you read Why I Love GNOME 3 and find that GNOME 3 works for you too.)

The Fedora 15 upgrade brought some surprising changes. What follows is a list of my questions, and answers that I discovered.



2011-07-02

Setting screensaver picture directory shouldn't be so hard permalink

You select the Pictures folder option in the Screensaver Preferences, and you'd expect to see a simple Configure button in the screensaver preferences where you can tell Screensaver where to get your pictures. Nope. Instead, you have to JFGI and discover that you have to edit /usr/share/applications/screensavers/personal-slideshow.desktop and change the Exec line. For example, I have:

Exec=/usr/lib/gnome-screensaver/gnome-screensaver/slideshow --location /home/wohler/doc/photos/apod
    

The gnome-screensaver program appears to ignore your ~/.local/share/applications folder which is why you have to edit the system file. GNOME 3 doesn't even have a screensaver (yet).

Note that the path on Fedora 15 is /usr/libexec/gnome-screensaver/slideshow.



2011-04-26

Juniper VPN produces martian souce in logs permalink

After firing up the Juniper VPN, I get martian logging when the other hosts on my local network send out broadcasts. For example:

Apr 26 17:54:33 olgas kernel: [838375.198780] martian source 255.255.255.255 from 192.168.0.104, on dev wlan0
Apr 26 17:54:33 olgas kernel: [838375.198787] ll header: ff:ff:ff:ff:ff:ff:90:27:e4:e9:26:8b:08:00
Apr 26 17:54:33 olgas kernel: [838375.200480] martian source 192.168.0.255 from 192.168.0.104, on dev wlan0
Apr 26 17:54:33 olgas kernel: [838375.200485] ll header: ff:ff:ff:ff:ff:ff:90:27:e4:e9:26:8b:08:00
    

I discovered that you can turn off the logging of those packets via /proc/sys/net/ipv4/conf/*interface*/log_martians. In my case, this is done with the following.

sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/wlan0/log_martians"
    

The proc filesystem is documented in the kernel source tarball's Documentation subdirectory.

You don't want to always ignore martian logging since it helps to identify IP address spoofing. See the second post in this blog warning against it. I therefore clear this setting manually after closing the VPN.

sudo sh -c "echo 1 > /proc/sys/net/ipv4/conf/wlan0/log_martians"
    

Another reader in the SUSE blog came up with a possible solution, included below. I have not yet tried to play with the routing as he suggested.

Well, seeing as no one else has come up with a solution for me I found it myself I thought I would post it here for the benefit of future readers. It comes down to simple routing on the Linux machine. Even though the default gateway (192.168.2.x) is set for the normal subnet (lets say 192.168.2.0/24) it doesn't want to work for a different subnet (lets say 192.168.0.0/24). So what you have to do is add in a route like so:
        Destiation: 192.168.0.0/24
        Gateway: 192.168.2.x (same as default gateway)
        Netmask: 255.255.255.0
        Device: (whatever device the communication is coming in on)
      


2010-10-15

Fixing Java's SocketException: Network is unreachable permalink

After upgrading to squeeze, my Java programs stopped networking. They all complained with, "SocketException: Network is unreachable." While there is some disagreement as to whether this is a Debian bug or a Java bug, the problem extends to both Sun/Oracle's version of Java as well as the OpenJDK.

There are two workarounds. On a per-program scale, pass in the -Djava.net.preferIPv4Stack Java option. On a global scale, edit /etc/sysctl.d/bindv6only.conf, set net.ipv6.bindv6only to 0, and run service procps restart.

I went with the later workaround since I had to affect a suite of programs. However, there may be consequences of this setting.



2010-09-07

Dealing with syntax errors when starting X in squeeze permalink

I installed squeeze this weekend, but could not start an X session. From a console window, I could see the syntax errors in ~/.xsession-errors from when my .gnomerc was run. It contains the line . ~/.bashrc so that my X session has all the environment variables that it needs, especially PATH.

It turns out that the problem was caused by a symlink from sh to dash. While it might make a new squeeze system run faster, it certainly broke my X session. Perhaps the X session should use bash now, at least where it reads ~/.gnomerc.

The workaround for this is to run dpkg-reconfigure dash and say no when it asks to link sh to dash.

See Bug #595906h.



2010-09-07

Installing Flash on 64-bit squeeze permalink

2010-09-26 update: The flashplugin-nonfree package in sid installs the new 64-bit version of Flash from Adobe. The instructions in the wiki page below have been updated accordingly.

The Debian wiki came to the rescue. I simply followed the first four steps in section Debian Testing 'Squeeze' amd64 in the FlashPlayer wiki page.



2010-02-15

Updating a remove server from etch to lenny permalink

I took some notes where I had to deviate from the release notes which might be helpful to both me and you.

General

I accepted the default for any prompts that were given.

Note that the upgrade created new configuration files. After the upgrade, I replaced configuration files with the new ones and merged my changes into them. Here's what I ran to identify them:

sudo find /etc -name '*.dpkg-*' -o -name '*.ucf-*'
    

In the spirit of keeping a minimal server, the last step after the reboot, configuration file cleanup, and performing the tasks in section 4.10, Obsolete packages, was to remove any packages that had been installed as part of the upgrade that aren't necessary.

One way to do that is to run one or both of the following commands. The first that lists the packages you have explicitly installed while the latter lists all packages which have been installed. Do this before and after the upgrade, diff, and remove any packages you don't want.

aptitude search '!(!~i|~M)' -F %p
dpkg --get-selections |grep install
    

Since I maintain my system files with Subversion, I also ran svn diff / (which might not be useful on your system). This identified new files that seemed suspicious. For example, /etc/cups, I don't print from my server :-). I used dpkg --search file to identify the package that referred to these suspicious files.

Finally, use deborphan --guess-all to identify additional packages that can be removed. If it lists packages you installed, use deborphan -A package to tell deborphan that you need it.

Release Notes: 4.2.2. Disabling APT pinning

The release notes don't give an example, but here is what they meant:

Package: *
Pin: release a=stable
Pin-Priority: 1001
    

If you don't have /etc/apt/preferences, consider adding it with this for its sole contents. Comment it out after the upgrade for next time. The comment character is "Explanation:" :-).

Release Notes: 4.4. Preparing sources for APT

Here is the /etc/apt/sources.list file that I used for the upgrade.

deb http://mirrors.xmission.com/debian/ lenny main non-free contrib
deb-src http://mirrors.xmission.com/debian/ lenny main non-free contrib
deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free
    

Please don't use as is; rather use an example of what is described in the release notes. In particular, your mirror might be different. Note that I changed etch to lenny and commented out the non-critical sources to make the upgrade go as smoothly as possible. I'll leave the other sources commented-out until needed since lenny has the stuff I was getting from backports and sid.

Release Notes: 4.5.6. Minimal system upgrade

The sudo aptitude safe-upgrade command issued the following errors:

The following packages have unmet dependencies:
libgl1-mesa-swx11: Conflicts: libgl1 which is a virtual package.
libgl1-mesa-glx: Conflicts: libgl1 which is a virtual package.
    

I resolved this by running:

sudo aptitude purge libgl1-mesa-swx11 libgl1-mesa-glx xbase-clients
    

I reinstalled xbase-clients after the upgrade.

Release Notes: 4.5.7. Upgrading the rest of the system

This went swimmingly!

After running sudo aptitude dist-upgrade, I ran the following (mentioned at the end of this section) to ensure things were clean.

sudo aptitude -f install
    

This removed the now-unused libio-zlib-perl package.

Release Notes: 4.8.1. How to avoid the problem before upgrading

I didn't want to take the chance of a hanging reboot. Since UUIDs are the wave of the future, I opted to follow the instructions in the section "To implement the UUID approach:."

The instructions aren't correct. I got an error when I ran update-grub after updating menu.lst. After replacing /dev/hda* with UUIDs for / and /boot in /etc/fstab, update-grub ran fine.

In addition, I also the following commands to do the same thing with swap (where /dev/hda5 is the device associated with swap in /etc/fstab). First I disabled some low priority processes to avoid using swap.

sudo swapoff -a
sudo mkswap /dev/hda5
    

The output of the mkswap command provided a UUID that I could use for the swap entry in /etc/fstab. I then ran the following to turn swap on:

sudo swapon -a
    

I then pulled the trigger and rebooted. It worked!

After the reboot, my devices where still /dev/hda{1,5,6} so I would have been OK had I not done this. However, you have newer hardware, so perhaps the problem described might be an issue for you. Or not. It's possible that the problem described might have only been a problem from someone upgrading from, say, a 2.4 kernel.



2010-02-13

Creating PDFs from scans permalink

This can be done completely in XSane. In XSane, select the Multipage mode. Select a working directory and press Create project (the PDF will be written in the directory containing this working directory). Use XSane as usual, including using Acquire Preview to select your scan area and pressing Scan to initiate the scan(s). Press the Save multipage file button in the multipage project dialog when you're done to create the PDF.

Setting the Scansource choice to Automatic Document Feeder can be very helpful. In this case, setting the ADF-Pages item to the number of pages in your hopper (or larger) makes XSane scan the pages automatically. Once XSane stopped when it was done scanning; another time it honored my ADF-Pages setting (and dutifully scanned dozens of blank images) so it is prudent not to make this number too large.

The links below describe some pretty fancy ways to turn scans into PDF documents, which are useful for bulk scanning of books and magazines. However, if you aren't scanning that much, creating PNGs (for text) or JPGs (for images) from the scans and running the following command is sufficient:

convert *.png *.jpg document.pdf
    

I'd suggest using 300 DPI if you plan to print the document. If you're only going to view the document on the screen, you can create smaller documents by scanning at 150 DPI and/or by choosing a Scanmode of Gray.

References:
Creating multi-page PDF documents from scanned images in Linux
How to create ebooks with Linux
How to scan printed papers and to create Metadata



2010-02-06

Editing videos II permalink

I recently tried to put together a few videos taken on an iPhone in cinelerra, but the sound in the exported video was corrupted. Kino, however, exported useful video and audio.

And today, I wanted to remove some bits of a video. Again kino made it easy to do. I loaded the video, selected the edit mode, used the cursor and arrow keys to pick frames, pressed the Split scene button at the beginning and end of each scene that I wanted to delete, and then pressed the Cut scene button. Note that the Split scene button creates the split before the selected frame. I then exported the video using H.264 MP4 Dual Pass Tool (Export button, Other tab). According to Optimizing your video uploads, this is a preferred YouTube format.

Please refer to Scott Hanselman's How to rotate an AVI or MPEG file taken in Portrait to see how to rotate a video.



2010-01-04

Creating OpenOffice envelope data from Google Contacts permalink

  1. In the Google Contact Manager, click on the Export link.
  2. Export the group of your choosing, or Everyone, select the Outlook CSV format (not that the format is specific with LookOut/OutBreak), and press Export.
  3. Save the file in, for example, contacts.csv.
  4. Run ooffice contacts.csv, run File -> Save, and press the No button to save the spreadsheet in OpenDocument file format (contacts.ods).
  5. Run ooffice envelope.odt (previously created using Insert -> Envelope as described in the references).
  6. Run the Edit Exchange Database command and press the Browse button.
  7. Select the contacts.ods file and press the Close button.
  8. Run the View -> Data Sources command and select the contacts -> Tables node and double-check that the data source's headings match those in your envelope. Drag and drop data source headings to envelope if necessary.
  9. Run File -> Print, press the Yes button (print a form letter), and press the OK button.
  10. To test, select the Print to file checkbox, or just push the OK button to print.

My references include Robbie Ferguson's YouTube video and Kevin Andle's page on creating an envelope in OpenOffice.



2009-07-04

GNOME Terminal Select-by-word characters permalink

The following update to GNOME's select-by-word characters setting in the Edit profile command lets you select an entire email address or URL (including Subversion svn+ssh URL) by simply double-clicking on it.

-A-Za-z0-9,./?%&#:_@+
    


2009-04-25

svnadmin: Unable to parse unordered revision ranges permalink

I got the following message when I tried to load a Subversion dump:

svnadmin: Unable to parse unordered revision ranges '9414-9445' and '7044-8971'
    

I discovered that I had some uncommitted transactions from years past using the svnadmin lstxns command. I cleaned them up with the following command, but this did not fix the problem.

sudo svnadmin rmtxns /repos/main $(svnadmin lstxns /repos/main)
    

I then performed svn info file:///var/tmp/foo on the temporary repository I was loading and observed that the last revision was 9547. I then went into the dump file and looked for the next revision, 9548, to see what may have caused the problem. I found the smoking gun!

K 13
svn:mergeinfo
V 177
/home/wohler/branches/common:6912-7042
/home/wohler/branches/tassie:6913-7043
/home/wohler/common:7043-9259
/home/wohler/sydney:8972-9413
/home/wohler/tassie:9414-9445,7044-8971
PROPS-END
    

Ah ha! Note how the revisions for the tassie branch are swapped. I fixed this by editing the Subversion database. Note that I use FSFS. I'm not sure if this would be possible with BDB.

$ diff db/revs/9548.orig db/revs/9548
--- db/revs/9548.orig	2008-11-15 14:03:54.000000000 -0800
+++ db/revs/9548	2009-04-25 12:08:43.000000000 -0700
@@ -181,7 +181,7 @@
 /home/wohler/branches/tassie:6913-7043
 /home/wohler/common:7043-9259
 /home/wohler/sydney:8972-9413
-/home/wohler/tassie:9414-9445,7044-8971
+/home/wohler/tassie:7044-8971,9414-9445
 END
 ENDREP
 id: 3zl.x0.r9548/2049
    

I grepped for that same string and found it in revision 9590 as well. I performed a similar fix.

I verified the fix with the following:

$ svnadmin create foo
$ svnadmin dump --quiet /REPO | svnadmin load --quiet foo    
$ svn log -v file:///REPO > repository.log
$ svn log -v file:///var/tmp/foo > temp.log
$ diff repository.log temp.log
$
    

I vaguely remember having similar troubles in the past after I converted from the svnmerge properties to the built-in Subversion 1.5 svn:mergeinfo property. At the time, I think I made a similar change to the svn:mergeinfo property manually and checked in the change. I am not sure if the problem was caused by the svnmerge conversion script or by Subversion 1.5 itself.

It's also possible that the svn:mergeinfo property was munged by the bug described in svn: Working copy path 'foo' does not exist in repository.

The moral of the story is that after you convert from svnmerge to Subversion's built-in merge tracking, do inspect the svn:mergeinfo property after the svnmerge conversion. If you see that the revision numbers are not in order, fix them as described above. Also inspect the svn:mergeinfo property after subsequent merges--particularly if you hit any Subversion bugs--before you commit the changes. If you see that the revision numbers are not in order, simply edit the svn:mergeinfo property before you check it in.



2009-03-17

Editing videos I permalink

My Canon G9 can shoot AVI movies. I recently shot a video that I wanted to edit. I just needed to chop bits out at the beginning and end. However, it might be useful to be dub in audio in the future. A quick Google search and apt-cache search turned up the following:



2009-03-14

Getting GoogleEarth to run on a 64-bit Debian system permalink

I was able to run GoogleEarth, a 32-bit binary, on my system by first performing the actions described in Running 32-bit binaries on a 64-bit Debian system. I then ran the following commands as described in Debian bug #514122. Note that it isn't necessary to link libcrypto.so.0.9.8 to the installed copy.

$ cd /usr/lib/googleearth/
$ sudo mv libcrypto.so.0.9.8 libcrypto.so.0.9.8-
    

If GoogleEarth freezes up your system, as it did to mine, ensure that lib32nss-mdns is installed. Then remove .googleearth and rerun make-googleearth-package --force (like many others, I got lots of warnings about shared libraries not being available when I ran this command; I ignored them). Move libcrypto.so out of the way as described above and try again.

Since then GoogleEarth has frozen up my system once or twice so you might just try restarting GoogleEarth without bothering to follow the instructions in the previous paragraph. I've since found that GoogleEarth works fine for a period of time after a reboot (without repeating the above steps). I'm hoping that a real 64-bit version will clear this up for good.

Not sure why GoogleEarth continues to complain about not being able to create .googleearth after it creates it!



2009-03-14

Running 32-bit binaries on a 64-bit Debian system permalink

I was able to run GoogleEarth, a 32-bit binary, on my 64-bit system after running the following.

$ sudo aptitude install ia32-libs ia32-libs-gtk lib32nss-mdns
    

I've also read that you have to install Skype as follows (although I have not yet done this).

$ sudo dpkg -i --force-architecture skype-debian_2.0.0.72-1_i386.deb
    


2009-03-14

GnuCash Price Editor: Unable to retrieve quotes for these items permalink

This error is described in Debian bug #490395. Until the patch contained within is applied to Debian, apply the patch yourself. It's really easy.



2009-02-28

Enabling Emacs keybindings in Iceweasel (Firefox) permalink

There are two ways to enable Emacs keybindings in Iceweasel (Firefox). The first is the GNOME way. Run gconf-editor, edit the /desktop/gnome/interface/gtk_key_theme key, and change it from Default to Emacs.

The GTK way is to append the following to ~/.gtkrc-2.0 and restart Iceweasel.

include "/usr/share/themes/Emacs/gtk-2.0-key/gtkrc"

gtk-key-theme-name = "Emacs"
    


2009-02-16

svn: Working copy path 'foo' does not exist in repository permalink

The error listed in the title is due to a Subversion bug, which has been fixed in 1.6. The bug was triggered for me when I moved a file in the trunk, merged the renamed file into a branch, and then later tried to merge the branch back into the trunk.

I found a workaround that can be used if you still have 1.5. For me, the renamed file was merged into the branch in revision 9739. Normally, I'd issue the following command to merge the branch back into the trunk:

$svn merge branch-URL
    

However, this doesn't work in this scenario. The workaround is to avoid including the revision of when the trunk was merged into the branch. This is fine because the trunk already has the changes. In the example, revision 9688 is the last revision merged into the trunk, and 9750 is the HEAD version on the branch (or simply the largest revision in your repository).

$svn merge -c9739 --record-only branch-URL
$svn merge -r9688:9738 -r9739:9750
    


2008-12-02

Eclipse crashes on 64-bit machine with Java 6 permalink

Although Eclipse seemed to be well-behaved on a 64-bit etch system with Java 6, after upgrading to lenny, it started crashing all the time. I found that the crashes went away after uninstalling Subclipse. But I found a better workaround. My crashes had the following signature:

#  SIGSEGV (0xb) at pc=0x00007f762d5c225a, pid=2534, tid=1091451216
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (10.0-b23 mixed mode
linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1f125a]
...
Current CompileTask:
C2:715
      org.eclipse.core.internal.dtree.DataTreeNode.forwardDeltaWith(
          [Lorg/eclipse/core/internal/dtree/AbstractDataTreeNode;
          [Lorg/eclipse/core/internal/dtree/AbstractDataTreeNode;
          Lorg/eclipse/core/internal/dtree/IComparator;)
      [Lorg/eclipse/core/internal/dtree/AbstractDataTreeNode;
      (469 bytes)
    

I was able to work around this problem by not compiling the method listed above. I launch eclipse from a script, so I added -XX:CompileCommandFile to eclipse's args as follows:

exec ./eclipse "$@" -vmargs -Xmx1500M -XX:MaxPermSize=256M \
    -XX:CompileCommandFile=/usr/local/etc/hotspot
    

The file /usr/local/etc/hotspot contains:

exclude org/eclipse/core/internal/dtree/DataTreeNode forwardDeltaWith
    

This file is handy if you have several methods to list. If you only have one, you can do this instead:

-XX:CompileCommand=exclude,org/eclipse/core/internal/dtree/DataTreeNode,forwardDeltaWith
    

Finally, you can add either of these arguments to your eclipse.ini in Eclipse's installation directory.



2008-08-03

Naughty nameservers permalink

Earthlink, and some other knaves who maintain root nameservers, have a really annoying "feature" in which they return the IP address of one of their search pages if you enter a bogus hostname in your browser's location bar.

The problem is that this breaks the feature in browsers like Firefox which try prepending a www if the host lookup fails. This is also annoying to the user since instead of fixing a simple typo, the user has to clear the bogus URL provided by Earthlink and re-enter the URL.

I found a way to subvert Earthlink's subversion: the dnsmasq program is a caching-only nameserver which has a feature which translates bogus IP addresses to NXDOMAIN DNS records. I configured /etc/dnsmasq.conf as follows (note that I do not have any programs that update /etc/resolv.conf):

no-resolv
server=192.168.1.1
bogus-nxdomain=207.69.131.10
bogus-nxdomain=207.69.131.9
    

I then edited /etc/resolv.conf as follows:

search newt.com
#nameserver 192.168.1.1
nameserver 127.0.0.l
    

Here is what the host command on a bogus host returned before I made this change:

$ host lskjdflkdsjf.com
lskjdflkdsjf.com has address 207.69.131.10
lskjdflkdsjf.com has address 207.69.131.9
Host lskjdflkdsjf.com not found: 3(NXDOMAIN)
;; connection timed out; no servers could be reached
    

And here is what it looks like now, and how it should have looked like in the first place!

$ host lskjdflkdsjf.com
Host lskjdflkdsjf.com not found: 3(NXDOMAIN)
    

As a nice side-effect, the dnsmasq server also insulates me from transient DNS outages to Earthlink which was seen in the previous example.



2008-08-03

Firefox rewrites host part of URL permalink

I had a problem whereby the host in the URL would randomly be rewritten with www.newt.com, my domain. I suspected that Firefox wasn't getting to DNS and had some sort of "feature" for rewriting the host part. I was partially right.

I suspect that when there was a transient DNS error, the search newt.com directive in /etc/resolv.conf would cause the host in the URL to be rewritten with my domain appended. Because of the wildcard entry in my zone file, my web server's address would be returned. My web server then rewrote the address with www.newt.com as the host.

I deleted the wildcard entry and the problem disappeared as soon as the change propagated down to my local nameservers.



2008-07-15

Bluetooth stopped working! permalink

After a recent upgrade or something, I noticed that my Bluetooth light on my ThinkPad was out and Fn-F5 didn't turn it on. I was able to enable Bluetooth manually with the following command (which should have been executed by /etc/acpi/ibm-wireless.sh):

sudo sh -c 'echo "enabled" >| /proc/acpi/ibm/bluetooth'
    

So, why didn't this script run when Fn-F5 was pressed?



2008-07-07

Dual-head Nvidia configuration permalink

With the help of HOWTO Dual Monitors, I was able to simply add the three Option lines to my xorg.conf as shown below, restart my X server, and be on my way.

Section "Device"
        Identifier      "nVidia Corporation NV44 [Quadro NVS 285]"
        Driver          "nvidia"
        Option          "TwinView"
        Option          "MetaModes" "1920x1200,1680x1050; 1920x1200,1280x1024; \
                        1600x1200,1600x1200; 1280x1024,1280x1024; 1152x864,1152x864; \
                        1024x768,1024x768; 800x600,800x600; 640x480,640x480"
        Option          "TwinViewOrientation" "RightOf"
EndSection
    

The MetaModes line is actually all on a single line.



2008-06-28

Fixing scanning with HP printers permalink

Although I could print, I could not longer scan, and the HP Device Manager from the system tray couldn't communicate with my printer either. I was seeing the following error message in syslog:

python: hp-toolbox(UI)[6561]: error: Unable to communicate with device
(code=12): hp:/usb/OfficeJet_G85?serial=SGG16E0ZRVVL
python: hp-toolbox(UI)[6561]: warning: Device not found
    

As of version 2.8.2 of hplip, all communications to the hp: device is now confined to members of the scanner group. Therefore, the fix was to run sudo adduser wohler scanner, log out, and log back in.



2008-06-28

Fixing escapes in man output permalink

After installing a new system, man started emitting these ugly <80><90> escapes all over the place. I finally found the cause. I had LC_ALL set to en_US.utf8 but LESSCHARSET was still set to latin1. The fix was to change LESSCHARSET to utf-8.



2008-06-21

Configuring postfix to use SMTP AUTH permalink

I finally got around to configuring SMTP AUTH (SASL) in postfix.

On the Server

  1. Create /etc/postfix/sasl/smtpd.conf and add the following to it:
    pwcheck_method: saslauthd
    mech_list: plain login
            
  2. Add the following to /etc/postfix/main.cf:
    # TLS parameters.
    smtpd_tls_security_level = may
    smtpd_tls_auth_only = yes
    smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
    smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
    smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
    
    # SMTP AUTH parameters.
    smtpd_sasl_auth_enable = yes
    smtp_sasl_security_options = noanonymous
            
  3. Modify /etc/default/saslauthd as follows:
    START=yes
    OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"
            
  4. Run the following commands:
    # aptitude install sasl2-bin libsasl2-modules
    # dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd
    # adduser postfix sasl
            
  5. Restart saslauthd and postfix.

On the Client

  1. Create /etc/postfix/sasl/sasl_passwd and add one or both of the following lines as appropriate to it. Make sure the mode of this file and the directory that contains it are 600 and 700 respectively
    [mail.your-domain.com]:smtp your-login:your-password
    [mail.your-domain.com]:submission your-login:your-password
            
  2. Add the following to /etc/postfix/main.cf:
    # SASL
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
    smtp_sasl_security_options = noanonymous
    
    # TLS
    smtp_tls_security_level = encrypt
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
            
  3. Run postmap /etc/postfix/sasl/sasl_passwd and restart postfix.

See the following references for the whys and wherefores:
James Turnbull, Hardening Linux, 2005, p. 395-400.
Luca Gibelli <nervous at nervous.it>, http://www.nervous.it/txt/Postfix-SMTP-AUTH-4-DUMMIES.html.
Fabian Fagerholm <fabbe at debian.org>, /usr/share/doc/sasl2-bin/README.Debian.
http://www.postfix.org/SASL_README.html.



2008-06-07

Iceweasel gets no respect permalink

I was trying to use a feature at Bank of America's Homebanking (SafePass) and it didn't work for me. First I had to install Flash 9. But I also discovered that the site was also not recognizing my Iceweasel browser. I was able to fix this and enable SafePass by navigating to the URL about:config, filtering on "agent", and changing the general.useragent.extra.firefox setting from Iceweasel/2.0.0.14 to Firefox/2.0.



2008-06-07

Atheros ath5k wireless driver permalink

The ath5k driver for the Atheros wireless chipset is built into kernel 2.6.24. Remove madwifi-tools, or switch blacklist in /etc/modprobe.d/madwifi. modprobe -r ath* wlan*. modprobe ath5k. http://linuxwireless.org/en/users/Drivers/ath5k. http://madwifi.org/wiki/About/ath5k



2008-05-26

Aptitude equivalent of dpkg --get-selections permalink

I wanted a list of packages on my current system so just in case I needed to recreate my entire system, I could just say

aptitude install $(cat packages)
      
Of course I don't want automatically installed packages in packages. Thanks to Scott Wegner on the Ubuuntu forums, here's how I created the packages file:
aptitude search '!(!~i|~M)' -F %p > packages
      



2008-05-17

Kernel 2.6.25 upgrade permalink

I installed 2.6.25 from sid since it didn't pull in anything else.



2008-05-17

Kernel 2.6.24 upgrade permalink

A while ago I installed 2.4.24. While it fixed the problem where gpsbabel could not talk to the usb: device, I found that my wireless (Atheros) connection would drop after a while. The network with 2.6.22 was fine. A second 2.4.24 update fixed the network problem, but a third 2.4.24 update broke it again.



2008-04-26

Recovering from an interrupted aptitude permalink

Against my better judgment, I remotely interrupted an aptitude session so that I could continue with the installation at my current location. This put the package that was being installed into the half-installed state. After this, aptitude responded with:

Writing extended state information... Error!
E: I wasn't able to locate a file for the sun-java6-bin package.
   This might mean you need to manually fix this package. (due to missing arch)
E: Couldn't lock list directory..are you root?
    

After a bit of investigation, I discovered how to fix the dpkg database:

sudo dpkg --force-remove-reinstreq --remove sun-java6-bin
    


2008-04-05

Resizing filesystems with LVM permalink

When I last installed lenny, I opted for the encrypted LVM filesystems. I recently ran out of room in /usr so I now had the opportunity to use LVM! I was apprehensive that the LUKS (Linux Unified Key Setup) encryption might get in the way, but since I wasn't dealing with the root filesystem, it wasn't an issue since I was able to work with the running system.

I learned that changes must be done in 4 MB increments, the size of the physical extent. In my ignorance and inexperience, I was nervous that the size given to resize2fs might round up and the same size given to lvreduce would round down which would mean that the end of the filesystem would get guillotined. I picked even gigabyte values mostly because resize2fs doesn't accept fractional values, but a gigabyte is divisable by the 4 MB extent size and the 512 byte disk sector size as well as any other unit the system might throw at me. If you choose megabytes as your unit, ensure the value is divisible by four. At any rate, I threw in an extra fsck at the end of each operation for paranoia and all seemed to go well.

I first had to decide how much space to transfer. I'm running out of space on my laptop, so I didn't want to steal much from /home. I ran lvs, df, and df -h to get some numbers. I decided that 500 MB would be enough, so I first needed to reduce /home from 44.5 GB to 44 GB.

# lsof
# kill [any processes still running out of /home]
# umount /home
# fsck -f /dev/mapper/olgas-home
# resize2fs -p /dev/mapper/olgas-home 44G
# lvreduce [--test] -L 44G olgas/home
# fsck -f /dev/mapper/olgas-home
# mount /home
    

Note the --test lvreduce argument above. I used that first to see what lvreduce would do. It's more useful when you aren't using gigabytes as a unit. You'll see what I mean when you run lvextend in the next example.

I then ran vgs (and vgdisplay) to see the Free Size which should now be around 500 MB. It was 788 MB in this case and that's the number I used to grow /usr in the lvextend command below.

# shutdown now "Resizing filesystems"
# lsof /usr
# kill [any /usr processes still hanging around]
# umount /usr
# fsck -f /dev/mapper/olgas-usr
# lvextend [--test] -L +788M olgas/usr
# resize2fs -p /dev/mapper/olgas-usr
# fsck -f /dev/mapper/olgas-usr
# mount /usr
    

I then opted for a quick reboot so that if that caused trouble, it would be now rather than when I least expected it. When the system returned, df showed that I once again had breathing room in /usr. While it took a while this time around for me to think I knew what I was doing, the next time, it'll go quickly. Unless it's the root filesystem, in which case I'll have to learn how to turn on LUKS when running with a Live CD.

References:

AJ Lewis, LVM HOWTO, http://www.tldp.org/HOWTO/LVM-HOWTO/ .
Bodhi Zazen, How to Resize a LUKS Encrypted File System, http://ubuntuforums.org/showthread.php?t=726724 .
Martti Kuparinen, Hard Drive Encryption in My Ubuntu Installation, http://users.piuha.net/martti/comp/ubuntu/en/cryptolvm.html .



2008-04-05

/dev/random versus /dev/urandom permalink

I just learned the difference between /dev/random and /dev/urandom. Use the former when you need strong randomness for keys; use the latter when you need speed and don't expect the bits to be broken (like when scattering random bits on a cleaned disk partition or when preparing the partition for encryption).



2008-04-05

gnome-keyring versus ssh-agent permalink

This morning, ssh worked without having to run ssh-add, which is strange because I expire my passphrase. I then ran ssh-add and got a SSH_AGENT_FAILURE message. Apparently, gnome-keyring usurped ssh-agent as reported in BTS #473864.

Until I learn more about gnome-keyring, I've disabled the ssh component as Josh Triplett suggested by unsetting the gconf key /apps/gnome-keyring/daemon-components/ssh. You can do this in gconf-editor, or run the following command:

gconftool-2 --set /apps/gnome-keyring/daemon-components/ssh false --type=bool
    

2010-12-05 update: It appears that this bug is fixed in squeeze. This workaround is no longer necessary.



2008-03-01

Syncing the Treo over USB permalink

I was spurred on by Tommy Trussell to enable syncing over USB so that I could take advantage of the sync button on the cradle and because it's much, much faster than using net: over Bluetooth.

When I plugged in the Treo and hit the button on the cradle, there wasn't a single message in the syslog and lsusb didn't list the device either. I found that if you unload ehci_hcd, then the system recognizes the Treo. However, after a reboot, I found that my system recognized the Treo (under uhci_hcd) even though the ehci_hcd module was still loaded, so all is well.

I also found that pilot-xfer -l -p usb: didn't connect initially. It seems that the first time you HotSync, you need to run the pilot-xfer command before starting HotSync on the Treo. After that first time, the order doesn't matter.

I've updated Using the Palm Treo 650 with Debian GNU/Linux accordingly.



2008-02-07

Talking to a Garmin GPS permalink

In order to get the usb: filename to work with gpsbabel, follow the directions in Hotplug vs. Garmin USB on Linux, namely, add the following to /etc/modprobe.d/local:

blacklist garmin_gps
    

And add the following to /etc/udev/rules.d/51-garmin.rules:

SYSFS{idVendor}=="091e", SYSFS{idProduct}=="0003", MODE="0666"
    

However, while this worked for kernel 2.6.18, later kernel versions broke it! It is still not working as of 2.6.22.

Newsflash! I inserted the garmin_gps module and tried using /dev/ttyUSB0 instead of usb: and I was able to back up the Garmin! It appears that this driver has been repaired--somewhat--along the way. I still had some errors uploading routes, although with persistence, they eventually all arrived. I wasn't brave (or stupid) enough to try uploading large tracks or waypoint files though. So, I'll probably still try the usb: file again once 2.6.24 is installed.



2008-02-07

Fixed blank DHCP host name permalink

My router's DHCP table was showing a blank where my laptop's hostname should be. I fixed this by uncommenting the send host-name line in /etc/dhcp3/.



2007-11-25

Donated to the Software Freedom Law Center permalink

I just made a donation to the Software Freedom Law Center. Consider making a donation yourself.



2007-11-25

Bluetooth woes permalink

I was getting errors like dund[31782]: Failed to connect to the local SDP server. Connection refused(111) in my syslog and HotSyncs that were failing with Faulty modem. I worked around this problem by running the following commands:

$ sudo killall dund
$ sudo /usr/bin/dund --listen --persist --auth call treo
    

I've reported the bug as BTS #452869.



2007-11-24

Building AIDE from source permalink

The AIDE that comes with etch is very hard to keep quiet. Marc Huber suggested that the lenny version might be a bit quieter, so I ran the following to get the latest and greatest on my etch system:

apt-get source aide
aptitude install dpatch libmhash-dev flex libgcrypt-dev
(cd aide-0.13.1 && fakeroot dpkg-buildpackage -b -uc)
sudo dpkg -i aide_0.13.1-8_i386.deb aide-common_0.13.1-8_all.deb
    

These commands are listed here mostly so that I can clean up if aide 0.13.1-8 hits backports.



2007-11-12

Rhythmbox and sound-juicer don't see CD permalink

I could mount data CDs, play DVDs with totem, and play audio CDs with gnome-cd. However, I was not getting the usual CD icon in rhythmbox when an audio CD was inserted, and sound-juicer produced a No CD-ROM drives found--Sound Juicer could not find any CD-ROM drives to read message and exited.

Both rhythmbox and sound-juicer played CDs just fine a week before my disk crashed and I reinstalled lenny from scratch.

I found that rebooting cleared this problem.



2007-11-12

Truncated PDFs from Gnucash permalink

My disk crashed on Friday so I bought a new one and installed lenny from scratch. One problem I encountered is that the top of the PDF printed from Gnucash was truncated. It seems that this was observed by others in the gmane.linux.debian.user thread entitled Text on printed pages truncated with Message-ID 45A2C319.8020400@heard.name.

Interestingly, after I configured my printer in CUPS, this problem went away. This was confirmed by one of the installation gurus:

Jim Paris <jim@jtan.com> wrote:

> Interestingly, the top of Gnucash reports printed to PDF were truncated
> until I installed a printer in CUPS, and then the problem disappeared.
> Is a CUPS installation default suboptimal?

Maybe it was a paper size issue, and installing a printer changed your
default papersize?  You can change the current setting with
"dpkg-reconfigure libpaper1".  I noticed in your system information:

> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)

If LC_ALL was set to C during installation, I think libpaper1 would
have defaulted to A4 (because "locale width" and "locale height"
return A4 size in that case)
    

2010-03-27 update: Another problem that can cause margins to go away is the new "borderless" media size provided by HPLIP. To see if this is the source of your problem, go to System -> Administration -> Printing, bring up the context menu for your printer, view the Properties, go to the Printer Options dialog, and view the Media Size field. If this field is set to one of the borderless flavors, use either the vanilla or AutoDuplex (if you have a duplexer) flavor instead.



2007-10-20

Apt's Dynamic MMap ran out of room error permalink

On one of my etch systems, I got this error message after a recent upgrade. (I did not get it on my etch server, nor my lenny laptop.) I fixed this by adding the following to /etc/apt/apt.conf:

Cache-Limit "20000000";
      



2007-10-08

Kernel 2.6.22 upgrade permalink

I installed Linux kernel version 2.6.22 and found that the ibm_acpi module was renamed to thinkpad_acpi. Unfortunately, this broke the Fn-F4 hotkey combination used to suspend my laptop. I'm assuming that Debian Bug report #434845: acpi-support: ibm_acpi module renamed thinkpad_acpi in kernel 2.6.22 is related, but the suggested fix didn't work for me. The GNOME Shut Down menu item does work however.

Gpsbabel still doesn't work--I'm keeping a version of 2.6.18 around for it. This might be related to the CONFIG_USB_SUSPEND problems that have been reported. But then, it could be CONFIG_USB_SUSPEND which fixed suspending under ACPI on my ThinkPad.



2007-09-23

When ISPs block port 25 permalink

If your ISP (such as Earthlink) blocks port 25, and someone else in your household controls the authentication credentials and understandably does not want to share them with you, how do you send mail?

I got my hosting company to poke a hole in port 587 (submission) and then updated postfix on my laptop and on the server as follows:

master.cf (on server my.relayhost.com)
submission inet n - - - - smtpd
    
main.cf (client)
relayhost = [my.relayhost.com]:587
    

Note that I use pop-before-smtp for authentication.



2007-09-09

Hibernate permalink

Thanks to a post on gmane.linux.debian.user.laptop from Stefan Monnier, I installed the hibernate package, and created a file called /etc/hibernate/scriptlets.d/local which contains the following code which turns off the Ultrabay LED. If you want to use it, replace my initials (BW) with your own since the hibernate namespace is global.

# -*- sh -*-
# vim:ft=sh:ts=8:sw=4:noet

# Ideas from /usr/share/hibernate/scriptlets.d/hardware_tweaks.

# ibm_acpi proc directory
BW_IBM_ACPI_PROC=/proc/acpi/ibm

BwIbmAcpiStartSuspend() {
    # Turn off Ultrabay LED.
    IbmAcpiLed 4 off
    return 0 # this shouldn't stop suspending
}

BwIbmAcpiEndResume() {
    # Turn on Ultrabay LED.
    IbmAcpiLed 4 on
    return 0
}

BwIbmAcpiOptions() {
    if [ -d "$BW_IBM_ACPI_PROC" -a -z "$BW_IBM_ACPI_HOOKED" ]; then
        AddSuspendHook 12 BwIbmAcpiStartSuspend
        AddResumeHook 12 BwIbmAcpiEndResume
        BW_IBM_ACPI_HOOKED=1
    fi

    return 0
}

BwIbmAcpiOptions
    


2007-09-04

Power permalink

I had found that with lenny and 2.6.21 kernel, ACPI suspend was finally working. Yay! Further, I felt that the built-in power management stuff might be working as well and I could remove the acpid package dispense with the /etc/acpi scripts since I was seeing some gnome-power-management warnings in the syslog.

When I pressed Fn-F4 however, I got the message:

      gnome-power-manager: (wohler) A security policy in place
      prevents this sender from sending this message to this
      recipient, see message bus configuration file (rejected message
      had interface "org.freedesktop.Hal.Device.
      SystemPowerManagement" member "Suspend" error name "(unset)"
      destination ":1.22") code='9' quark='dbus-glib-error-quark'
    

After a little digging, I discovered that I had to add myself to the powerdev group. Then I got this message:

      gnome-power-manager: (wohler) Doing nothing because the suspend
      button has been pressed
    

This was fixed by going into the gconf-editor and changing the value for /apps/gnome-power-manager/action_button_suspend to suspend.


by-nc-sa Best Viewed With YOUR Browser Valid HTML 4.01! Valid CSS! Powered by Debian GNU/Linux GetJava Download Button