In The Armchair

PGF and TikZ

Posted in Computers by Armchair Guy on September 26, 2008

I guess I’m just completely out of touch, but there’s an excellent package that allows you to draw sophisticated graphics within LaTeX (using a graphics programming language) I hadn’t heard of till recently.

It’s called PGF, and the component you use in your LaTeX/TeX source code is called TikZ. You enter simple LaTeX-style commands to tell it what to draw, in an environment right in your (La)TeX code, and it does the job for you. The excellent user manual can be found here, including instructions for installing and a tutorial. (If you’re a Ubuntu user, of course, there’s already a package you can install with a few clicks.) Great examples can be found here. Wow! What a package.

Tagged with:

Emacs Word Wrap

Posted in Computers by Armchair Guy on August 9, 2008

Real word wrapping in emacs isn’t automatic, but here’s how it can be done. I found these instructions at It’s not perfect; despite the comments on that website, I don’t yet know how to make word-wrap work after vertical splitting. First, get longlines.el and put it somewhere. Then, add the following lines to your .emacs:

(load "/path/to/longlines.el" t t)(autoload 'longlines-mode "longlines.el" "Minor mode for editing long lines." t);; Uncomment the next line to wrap by default in text mode;;(add-hook 'text-mode-hook 'longlines-mode)

To activate manually, do M-x longlines. More info at

Tagged with:

Adding An Emacs Menu

Posted in Computers by Armchair Guy on August 9, 2008

Here’s some template code for adding a menu item to the main emacs menu bar. I don’t know hos this works; I just use it as a template!

;;;;;;; Add items to menu bar(modify-frame-parameters (selected-frame) '((menu-bar-lines . 2)));; Make a menu keymap (with a prompt string);; and make it the menu bar item's definition.(define-key global-map [menu-bar MyMenu] (cons "MyMenu" (make-sparse-keymap "MyMenu")));; Define specific subcommands in this menu.(defun MyMenu-linkify() (interactive) (replace-regexp "^\\(.*\\)$" "\\1"))(define-key global-map  [menu-bar MyMenu linkify]  '("Linkify" . MyMenu-linkify))(define-key global-map  [menu-bar MyMenu truncate]  '("Truncate em" . toggle-truncate-lines))
Tagged with:

Linux Brain Games

Posted in Computers by Armchair Guy on August 3, 2008

These involve the mind in some way… I like to do Blinken and Gnomine.

Chess. These engines are way too hard for me.

  1. Gnuchess
  2. Crafty


  1. Blinken

Quick Thinking

  1. Gnomine
  2. KSirtet
  3. Tetravex
  4. Gnome Sudoku


  1. gtans (Tangrams)
  2. Code Breaker / Gnomermind (Mastermind clones)
  3. Klotski/Gnome Klotski

Free Online

  1. Happy Neuron free games
  2. MyBrainTrainer has a test and one free puzzle every month


  1. The Amazing Brain Train (has a demo)

I Love Evince!

Posted in Computers by Armchair Guy on July 31, 2008

Evince, the Gnome document viewer under Ubuntu 7.10 and up, is simply a great piece of software. It has some simple features which enhance its usefulness for academic work.

Incremental search instead of boring-old-search make evince my favourite viewer for almost any type of document it supports.

The extra feature I use most often is “Open a Copy” in the File menu. This opens up another instance of evince displaying the same file, very useful when you need several different pages of the document open at the same time.

Another useful related feature is, if you click using the middle button while following a PDF link, the link opens up in a new window (just like in Firefox). That way you don’t lose the original page.

Of course, evince could be made better. Here’s my wish-list:

  1. Add a cycle-through-bookmarks feature for the cases when I want quick browsing in one window instead of many
  2. Add an “Open a Copy” toolbar button
  3. The version of evince I’m using on Ubuntu 7.10 doesn’t work at all with the print server CUPS; maybe this is already fixed in the newer versions
  4. DVI files are blurred (or maybe over-antialiased)
  5. We need browser-style back and forward buttons in addition to the page back and page forward buttons, so we can follow links more easily
  6. Would be nice to be able to place two arbitrary (not just adjacent) pages side-by-side.
  7. Alternatively, allow left-right split window with synchronized scrolling made possible (i.e. scrolling one scrolls the other by the same amount)
  8. Add a “search for full word only” option to the incremental search
  9. More when I think of it!
Tagged with:

Whizzytex on Ubuntu 7.10

Posted in Computers by Armchair Guy on July 28, 2008

Whizzytex is a pretty nifty application that updates a compiled TeX pane in real-time as you type into emacs. Under Ubuntu 7.10 it comes as a package in the repositories.

With my installation (on a Thinkpad t61) I’ve had an annoying problem: every few seconds, emacs will freeze completely for a 1-5 seconds (presumably doing a slice compilation or some such thing for whizzytex). This can happen right in the middle of a yank, and it can happen ten times a minute.

Here’s my solution, though I can’t explain why it works: put the line

(setq whizzy-load-factor 10)

in your .emacs file. The problem still occurs but very occasionally (once in 5-6 minutes, which I can live with). Whizzy is a lot more responsive now as well.

There is one downside: this really increases processor usage. My laptop runs hot and the battery doesn’t last long when I have the load factor set high this way.

Tagged with: , ,

Backup (Part II)

Posted in Computers by Armchair Guy on June 11, 2008

I listed some requirements that I have for backup software for a single workstation in an earlier post. I seem to have found a solution that has many of those properties, though not all. It is called SBackup (for Simple Backup) and I am running it on Ubuntu 7.10. (I won’t be shifting to 8.04 until all the kinks are worked out, or they invent hibernate for Linux.) It really is simple and runs very well in my situation.

Here’s how SBackup satisfies my requirements:

  1. SBackup has a modicum of network awareness; it can backup over an SSH or FTP connection in addition to a local directory.
  2. SBackup can do incremental and full backups. By default every backup (except the first) in SBackup is an incremental backup. The administrator can specify a schedule for full backups, such as a full backup every 21 days.
  3. SBackup has pretty good scheduling. The frequency of full and incremental backups can be controlled. A purging schedule can also be set up, for example: keep all backups for the last week, keep one backup a month for the last year, keep one backup every 6 months for years before that.
  4. SBackup’s backups are software independent. This was a major problem I had with DAR, which I was using before SBackup: DAR archives couldn’t be read without DAR. SBackup just uses tarred, gzipped files. So I have no worries about how I’m going to access the files in backup if SBackup is discontinued or unavailable in the future.
  5. SBackup doesn’t have encryption, but right now this is not crucially important to me.

In addition, SBackup really is very simple to configure, and it works silently behind the scenes.

Tagged with:


Posted in Computers by Armchair Guy on December 13, 2007

I used to use Dar/KDar for backup purposes back when I was using SuSE 10.2. I’ve switched to Ubuntu, and it seems KDar is no longer packaged for Ubuntu. It got me thinking: what are the features that I want in a simple desktop backup application? Here are some in no particular order:

  1. Network awareness. This is something I missed in Dar, which could only write to a directory on the system, which meant I had to ssh-mount a remote filesystem before I could back up to it.
  2. Incremental and Full Backups.
  3. A good scheduler. That is, it should be possible to specify the frequency and type of incremental and full backups, and a purge schedule for old backups.
  4. Software independence. Dar used its own proprietary format, which forces me to use Dar to look at any of my backups. With KDar no longer available, it is quite painful to try to look at the contents of any of the older backup files. I have to get Dar to extract them somewhere, browse them and then delete them later. Something uses simple tar or tar.gz is much better; I can use Konqueror etc. to browse inside them directly.
  5. Encryption is good if I’ll be using NAS, otherwise it’s not as important to me.

Maybe I’ll add more requirements later.

Tagged with: , ,

Ubuntu 7.10, the T61 and External Monitors

Posted in Computers by Armchair Guy on December 13, 2007

I had a spot of bother trying to use an external monitor with Ubuntu 7.10 Gutsy Gibbon on a Lenovo T61. My T61 has an Nvidia Quadro 140M card and I’m using the proprietary (restricted) drivers.

I got a Lenovo Mini-dock and a Lenovo D221 monitor with my T61. When I connected everything up and put my T61 on the mini-dock and started it, everything appeared on the external monitor up to the Ubuntu splash screen with the progress bar. Right after that, the external monitor went blank and the T61’s screen took over. (I think that happened when the X server was started, but not sure.) The same thing happened when I connected the external monitor to the T61 directly (not through the mini-dock).

To resolve this:

  1. Connect the external monitor to the laptop directly
  2. Open up a terminal, get root access using “su”, and type “nvidia-settings &” at the prompt. This is a configuration program from the package “nvidia-glx-new” (I think it gets installed when you install the restricted nvidia drivers, but not sure).
  3. Within nvidia-settings, select “X Server Display Information”. It should show two monitors in a little box called “Layout”. The external monitor may be disabled.
  4. Click on the external monitor’s icon, then click “Configure”, then select “Separate X Screen”.
  5. Click on the laptop screen’s icon (which is probably enabled), then click “Configure”, then select “Disabled”.
  6. Note: This step will overwrite the X Confuration File (usually /etc/X11/xorg.conf). You may first want to backup that file to something like xorg.conf.bak.01. When you’ve backed it up, click “Save to X Configuration File”.

When I restarted my X Server (or restarted the computer) after this, all output came out only on the external monitor, which is what I wanted.

However, this didn’t solve the problem when I put the T61 on the mini-dock. I also had to connect the T61 and the external monitor to the mini-dock, and then repeat steps 2-6 with the T61 on the mini-dock.

Finally, when the T61 is not connected to the external monitor in any way, it should continue to work as usual. The above configurations don’t affect this.


  1. After doing this, there is an Nvidia splash screen every time the X Server is started up. This can be removed by editing /etc/X11/xorg.conf, but I don’t detail that here.
  2. After this reconfiguration, I began noticing that my GL Desktop window manager crashes very frequently. When that happens, I can resolve it by running System > Preferences > GL Desktop. But it is a bother.
Tagged with: ,

Gnome Frustrations

Posted in Computers by Armchair Guy on November 18, 2007

The Gnome desktop environment, as packaged with Ubuntu 7.10 “Gutsy Gibbon”, is a queer mix of liberating and frustrating. While it’s got some great features and applets, and Compiz is pretty cool, it really falls flat on its face in some areas. While I understand that the Gnome people want to be minimalist, the extremes to which they go are counter-productive. Here are some of my gripes:

  1. Their File Open dialogs don’t have a place where you can type in a file location; you are forced to navigate to it using mouse clicks. This becomes really frustrating if you want to hide folders starting with a period (“.”). I like to hide them because there are way too many and I access them only rarely. But when I do want to access them, Gnome makes it so difficult.
  2. Having the option to see more information about what’s going on during various operations can save a lot of frustration. I guess giving people access to information doesn’t necessarily go against Gnome’s philosophy; there could be an option to turn on extra information. One applet which frustrates me in this regard is the nm-applet which provides wireless access. The applet sometimes cannot connect to wireless networks, for example if I had to restart a wireless router. The problem is it keeps working away without allowing any kind of interaction. There is no option to cancel, no output indicating what it’s doing; just the animation showing that it’s working.
  3. Gnome workspaces simply don’t implement the best aspects of workspaces. The only thing you can do with Gnome workspaces is have different applications on different workspaces. What would be vastly more useful is to allow a different set of icons on each workspace. This is more important now that Gnome shows large thumbnail views of PDF files; there simply isn’t enough space on a single workspace, and Gnome prevents users from effectively using the additional space that multiple workspaces provide. Allowing a different desktop background would nice too, but this is just eye candy.
  4. Gnome has drawers, but these are too limited. You can’t look at its contents and see what each element is. (The drawers just show identical icons for all PDF documents, for example.)
  5. You can’t select multiple applications on the taskbar (using Ctrl-click, for example) to close or minimize several windows at once! This is the worst regression I’ve seen. I once tried to open a large number of audio files with Audacity (thinking they would be queued in a playlist) and it opened up about 50 windows. I had to close them one by one.

So if you have a large number of documents that you want to organize on your desktop for quick access, there is no way to do it: you can’t use workspaces because all workspaces have the same desktop icons, and you can’t use drawers because you have no way to label a drawer or its contents.

And, this isn’t Gnome’s fault, but lack of good out-of-the-box hibernate negates all the benefits of having multiple desktops.<

_uacct = “UA-1666123-4”;

Tagged with: ,

Ubuntu: sudo woes

Posted in Computers by Armchair Guy on October 31, 2007

Ubuntu’s philosophy is to have a privileged “first user” account, created during system setup, which has sudo privileges. There is also a separate user account with username “root”, but the password is unknown right after installation. The system administrator is expected to administer the system through the privileged first user account.

To get access to the root account, you can use the command “sudo passwd root” as the privileged user to reset the root password.

Suppose you want to run a package manager as the privileged first user, while logged in as a regular (non-privileged) user in Gutsy Gibbon (Ubuntu 7.10). You cannot use sudo unless the non-privileged user is in the sudoers group. Attempting something like the command “gksudo -u privileged-username package-manager” brings up a root password prompt, but you always get an “incorrect password” error. Using gksu also results in the same problem. However, using su in a terminal rather than gksudo or gksu works.


The reason this doesn’t work is that gksu’s behaviour defaults to gksudo (see gksu man page). A solution:

1. Reset root password using “sudo passwd root” as the privileged user
2. Then “gksu –su-mode package-manager” to run it as root.

I still don’t know how to make this work running the package manager as the privileged user rather than root.

_uacct = “UA-1666123-4”;

Tagged with: , ,

Ubuntu Gutsy Gibbon on the T61

Posted in Computers by Armchair Guy on October 23, 2007

Having installed KUbuntu, I was interested in trying out Ubuntu on my T61. I installed it on a separate partition, and I am thrilled with the results. Kubuntu and Ubuntu have their strengths and weaknesses, but Ubuntu seems better on the whole.

I did have a couple of problems during the installation. The Ubuntu GRUB installer got confused and thought the Windows XP Pro partition was another Ubuntu partition… rendering it unbootable. This was fixed easily enough, though, by simply editing the /boot/grub/menu.lst file a bit.

A peculiar problem with both KUbuntu and Ubuntu on the T61 is that the keyboard volume controls don’t work the way you’d expect them to. On Kubuntu, there are only two volume levels you can select with the keyboard controls. On Ubuntu, the controls do work… the problem is that they are not integrated with the system software controls. For example, if I press the mute button, the system doesn’t seem to realize that it’s been muted. Using the volume up and down does change the volume appropriately, and Ubuntu recognizes this and even shows an overlay displaying the volume changing, but this is not reflected in the system volume levels. This confused me a couple of times.

The screen brightness controls on the keyboard (Fn+Home and Fn+End) are recognized. Ubuntu shows an overlay with increasing or decreasing brightness. However, Ubuntu ignores them: it does not respond by changing screen brightness.

Ubuntu has a host of usability hacks that KUbuntu lacks. For example, it automagically recognized the .Xmodmap file I had placed in my home directory (to switch Caps Lock and Ctrl). Compiz works well out of the box on Ubuntu; I couldn’t figure out how to enable it on KUbuntu.

One thing I did miss on Ubuntu is Konqueror’s multi-functionality. I installed Konqueror, but it was a different version and didn’t have the handy “File Size View”.

Both Ubuntu and KUbuntu seem to have problems with their “Switch User” functionality. It’s a little slow, and one of the sessions crashes a little too often. On Ubuntu, there’s a peculiar effect when switching: one of the sessions will slow down a hundredfold, taking several seconds to respond to mouse clicks or draw/move windows etc. Switching back and forth a couple of times solves the problem, but it is an annoyance.

_uacct = “UA-1666123-4”;

KUbuntu Gutsy Gibbon + Lenovo T61 = Freedom!

Posted in Computers by Armchair Guy on October 17, 2007

I just got a new Lenovo T61, with 2.2 GHz core 2 duo, NVIDIA Quadro NVS 140M, 3 gigs of RAM, and a 160 Gig hard drive. As soon as I could, I installed KUbuntu 7.10 Gutsy Gibbon on it, and am impressed with the results. Installation was (almost) a breeze, and (almost) everything works right out of the box. After using SuSE 10.2 for over a year, I can finally breathe! Read on for a review.


The laptop came with the 160 gigs partitioned into two parts: a small recovery partition by Lenovo (about 6 gigs), and a large (~150 gigs) partition with Windows XP Pro (more expensive than Vista Home). I wanted to keep XP along with one “production” Linux system and a “trial” Linux system to play around with. I used the gparted LiveCD (from, which made re-partitioning a breeze. I left the recovery partition strictly alone. My final partitioning scheme:

 Device Gigs  System/dev/sda1 30.7  HPFS/NTFS (Win XP)/dev/sda3 79.5  W95 FAT32 (Data)/dev/sda4 40.2  Extended/dev/sda5 12.6  Linux (Trial)/dev/sda6  3.2  Linux (Trial home)/dev/sda7 15.9  Linux (Production)/dev/sda8  5.2  Linux (Production home)/dev/sda9  3.3  Linux swap / Solaris/dev/sda2  5.8  Compaq diagnostics (Lenovo Recovery)

Initial Hiccups

I initially tried to install KUbuntu 7.04 (“Feisty Fawn”) because Gutsy was still in the RC (Release Candidate) stage. When using the standard Live CD, Feisty would boot up and ask for mode of operation, but wouldn’t be able to initialize its X Window System (from which you can install). There is some discussion online about setting the SATA setting to “Compatibility” instead of “HCPI” in the T61’s BIOS, but that didn’t work for me, so I went ahead with the Gutsy Gibbon RC. Gutsy couldn’t initialize its usual X Window System, either, but I followed the advice at:

and simply selected the “Safe Graphics” option and the rest of the installation was a breeze.


During installation KUbuntu asks for the name of a user and an admin password. This refers to a special user with sudo privileges, so I avoided my usual username and put in something like “sysadmin”. I didn’t have any other installation issues.

Startup, Logon and Shutdown

Gutsy is the fastest Linux I’ve ever seen, even giving Win XP a run for its money. Here are the startup (time to display logon screen), logon (time from display of logon screen to delivering a usable cursor and clickable icons after logon) and shutdown (from a session with no windows open) times of XP and Gutsy on this machine:

Win XP: Startup = 40s, Logon = 30s, Shutdown = 28s.
Gutsy: Startup = 49s, Logon = 19s, Shutdown = 20s.

Adding Packages

The installer installs a basic functional system. I wanted to add more packages. I like the package manager synaptic better than the default, adept. So I installed it using the command “apt-get install synaptic” in a terminal window.


Worked out of the box. Knetworkmanager stores the authentication information in the KDE wallet.


Works out of the box, but the volume up/down buttons don’t work properly. Mute works.


The brightness controls don’t work. The night light works.


The restricted NVIDIA driver is required to enable harware 3D acceleration. Enabling it is a breeze.

Fonts & Appearance

This was the biggest surprise. After getting accustomed to fuzzy, ugly fonts, blunt mouse pointers, and a generally shoddy appearance on Linux for ages, I am now happy to state that Gutsy surpasses Win XP in terms of appearance. Everything is crisp and beautiful. Caveat: Enabling the restricted NVIDIA driver actually diminished the appearance somewhat, with some fonts looking too thin.


This doesn’t work very well out of the box. When only one session was active, I recovered from a hibernate once and couldn’t another time. When I did recover, Gutsy showed some corrupted screens etc. and then a blank screen; it took me a few seconds to realize I had to move the mouse to get a login dialog. When two sessions were active, Gutsy wouldn’t hibernate at all. With Gutsy’s amazing boot-up speed, this is less of an issue than on SuSE 10.2, but is still a problem when I’m in the middle of several applications and have to move.

The Mini-Dock

I got a mini-dock with the T61. Gutsy works fine on the mini-dock as long as the T61 is turned off when putting it on or taking it off. If I eject it from the dock while Gutsy is running, the T61 screen stays blank, and I have to do a hard reboot.

Overall Experience

The overall experience is great. The most bothersome Linux issues seem to have disappeared in this distribution. And this is just the release candidate!

There are still some bugs, however. Konqueror doesn’t remember its settings properly. Integration between the KDE clipboard and applications like kterm and emacs is quite problematic. Some applications and KDE components crash, especially when switching between multiple X sessions. And a few others.

_uacct = “UA-1666123-4”;

Why Not Microsoft?

Posted in Computers by Armchair Guy on August 31, 2007
  1. Microsoft competes using business and personal tactics, not on technical merit. (Using SCO to run an anti-Linux malicious legal witchhunt designed to spread FUD about the legality of Linux, scaring away corporate customers of Linux; threatening PC manufacturers who offer Linux; using lobbying money instead of technical arguments to push OpenXML through)
  2. Microsoft doesn’t try to create better products than competitors; it tries to make competitor’s products worse. (Java is an example where Microsoft was foiled.) As a result, thousands of innovations never see the light of day unless Microsoft can make more money out of them.
  3. Microsoft has a culture of reliance on deception rather than openness. (In its earlier days, it tried to cover up security flaws rather than fix them numerous times. Currently, its claims about OpenXML being an open standard are disingenuous: Microsoft uses various techniques to make it almost impossible for 3rd parties to write software compatible with Microsoft Office even if OpenXML is followed.)
  4. Microsoft decisions are technically flawed. Microsoft sets off to make radical changes in the way things are done, relative to Unix. Several years later, it then begins a costly process of converting its legacy of bad code into practices similar to those of Unix. (Example: DOS’s lack of memory protection, user accounts, application settings instead of the registry, home directories, making security a priority, remote access)
  5. Microsoft’s “copy, don’t innovate” strategy has a significant opportunity cost for customers who don’t get useful features for years after they are available elsewhere. The problem is compounded by Microsoft’s monopoly. (Example: tabbed browsing, available for 4 years on Opera and 2 years on Firefox before Microsoft could make it available on IE.)
  6. With Microsoft, customers have no chance at code ownership. So features Microsoft wants to add are added when Microsoft wants them. A customer can pay to have features added to an open source app. Not so with Microsoft products; customers are entirely at Microsoft’s mercy. The problem is exacerbated if this refers to a feature that is useful to a small minority of customers, or just to one customer.
  7. Developers with smart ideas can add features to open source software. Not so with Microsoft software. Such ideas cannot be widely distributed without the entire piece of software being rewritten as an alternative, or Microsoft deciding to support the modification. No such ideas are ever part of Microsoft software. Thus, Microsoft stifles creativity (unintentionally, in this case).

_uacct = “UA-1666123-4”;

Tagged with: ,

YaST2’s Package Manager

Posted in Computers by Armchair Guy on June 7, 2007

I don’t know much about the internals of SUSE Linux’s Software Management under YaST2. But it’s trivial to see that it is deeply flawed, and that the flaws can be fixed by making a few simple, basic changes.

Integrate the “Installation Source” module with “Software Management”. It is facile to have to switch between two different apps when you’re just trying to install software. The current process is to start Installation Source, specify which sources you want updated, close Installation Source, start Software Management, and the install software. Let’s say that you then want to add a source. You’d have to close Software Management, open Installation Source, add the source and update it, again open Software Management… It’s ridiculously roundabout.

The solution is very simple. Just integrate Installation Sources into Software Management:

  1. Create a pane within Software Management with all of the installation sources.
  2. Add all Installation Source options to a right-click context menu.
  3. For 2. above, make it possible to select multiple sources at a time.
  4. Make it possible to update the packages from any source at any time. Add an “Update Now” button to the context menu.
  5. Make it simple to add a new installation source within Software Management.
  6. Cache the parsed package information so that re-parsing isn’t necessary every time. Re-parse only when an installation source is updated.
  7. Make it possible to view package information (files, etc.) after downloading, without installing the package first.
  8. Do away with the separate installation sources app, or keep it if you wish… doesn’t matter.

These changes alone would massively improve SUSE’s usability to those of us whose major grouch is its package management.

Tagged with: