Monday, May 07, 2007

Hal's Turn for Feisty

(Not that long ago, I poked a bit of fun at Windows, counting all the steps necessary to restore a Windows XP system. Then I turn around and post this. However, note that you have a working system, including a complete office suite, just at the point below where you see the line across the page. Everything beyond that is what I consider essential to a computer system. Your mileage may vary. Taxes, tags, and ammunition extra. Offer not valid it Redmond, Washington.)

Having installed Ubuntu's brand new Feisty Fawn (aka 7.04) Release on Hal's Evil Twin and Hal's Other Twin, it's time to work on Hal.

Since my last install, of Dapper Drake (6.04), I've added a honkin' big disk drive which now holds my /home directory. As a result, the 60 GB boot drive has a lot of space on it that can profitably be used for things other than data storage.

Before we begin, of course, back up everything. Then I pulled the plug from my big /home drive so I wouldn't accidentally overwrite anything on it.

Next it's time to repartition the drive. Geeks repartition drives the way some people rearrange furniture: it's always a good time to do it, especially if you have someone else move everything. My someone else is the extremely useful GParted, a graphical interface for partitioning disks. After much thinking about things, I'm doing the breaking the disk up like this (note that Feisty now pretends that everything is a SCSI disk, even when it's not, so what was /dev/hda is now /dev/hdb):

Partition Mount Point Type Size Description
/dev/sda1 / ext3 15 GB Mount point for Feisty
/dev/sda2 /home ext3 15 GB For now, the user's home directories, which will eventually be moved to the other disk. In the future, this will be where I install another OS, say the next version of Ubuntu, or Slackware, or even that thing Microsoft sells. For now, it will hold a /scratch directory.
/dev/sda3 swap Linux-swap 1 GB Swap space, on the general rule that you should have twice as much swap as you have memory. This is actually at the bottom of the disk drive, but it's sda3 because I installed it before I installed:
/dev/sda4 Extended Extended Partition, which holds:
/dev/sda5 /usr/local ext3 10 GB OK, most people won't need this much space, but I tend to put a lot of programs into /usr/local, and I don't like running out of space.
/dev/sda6 /opt ext3 Approx. 12 GB Some third party programs, such as the Intel Fortran compiler, use this space. Having it in a separate partition means I won't have to install multiple copies for multiple distributions, and I can always create a /opt/scratch directory.

Commit to all of this, eject the GParted live CD, and put in the Ubuntu Live CD. And away we go:

  • As I mentioned before, when you do what Ubuntu calls a “Manual Partition” of the drive, it rescans the disk drive every time you click the mouse, which is more than a trifle annoying.
  • Somewhat scary: the first time I rebooted after the install, I got a blank screen. It seems to be OK now, though. Interestingly, when Hal's Other Twin boots up, I get a nice not-all-brown Ubuntu Logo on the screen, along with a log of what's happening. When Hal and Hal's Evil Twin boot up, I get a blank screen until the login screen magically pops up. Probably there is a setting to fix this, I'll try to find it later.
  • Run update manager. Looks like the default installation has 15 updates since the release date which was, what, two weeks ago? Of course, many of those aren't security related.

  • Now install a bunch of things that the default install leaves out. This, of course, is the problem with installing from a live CD, in that you don't get much choice. However, the synaptic interface is pretty easy to use, so let's go ahead with it. Forgive me if I don't link to the home page for all of this software. Also forgive me if I occasionally mistype. I have a cat on my lap.
    Useful references include:
    The Unofficial Ubuntu 7.04 (Feisty Fawn) Starter Guide
    and
    Ubuntu Tips and Tricks from Linux Magazine (registration required, consider BugMeNot.com).

    In more or less alphabetical order:
    • a2ps: Nicely formats many-page-to-one output.
    • Abiword: Word processor, starts up faster than OpenOffice.org.
    • amarok, mplayer, vlc, xine, xmms: Listen and Watch Stuff.
    • apt-file: Enhance the capabilities of the Debian file system. Run
      $ sudo apt-file update
      once you install it.
    • build-essential: Installs things you might need to compile programs: e.g., g++
    • Celestia: Interstellar astronomy.
    • checkinstall: Converts the “make install” command into a .deb file.
    • EMACS: The One True Editor.
    • Frozen Bubble: I have no idea why I like this game.
    • fvwm (Gnome version): My favorite window manager.
    • g77: Not as powerful as the Intel Fortran compiler, but it's open source, and adheres to the standard. And if you ask why I'm still using Fortran 77, it's just because, OK?
    • gnumeric & sc: Spreadsheet programs. Often more useful than the one in OpenOffice.org.
    • gnuplot: Not only does it plot, it does non-linear curve fitting (non-linear regression to you statistics types).
    • grip: Rip stuff.
    • gv & xpdf: Viewing postscript and PDF. Old, but serviceable.
    • IEs4Linux: Not a Ubuntu package. This uses WINE (see below) to run Internet Explorer on your Linux box. Well, IE 5 or IE 6, not IE 7, because you'll never pass the Microsoft Genuine Advantage test. But it does show you how your web page looks to those with really bad browsers.
    • Imagemagick: Image manipulation.
    • k3b: Burn CDs and DVDs.
    • kdegames: Occasionally I waste time at the computer.
    • lavaps: '70's funk method for looking at the activity on your computer. I put it in the FVWM ButtonBar.
    • libgnome-dev: Provides some library header files needed to compile older programs not included in Ubuntu, e.g., Electric Eyes.
    • lynx: Text-based web browser, originally developed at KU.
    • mailutils & msmtp: mostly to enable me to send mail from the command line.
    • Mozilla-Thunderbird: My favorite mail client.
    • PlanetPenguin Racer: The old Tux Racer, done up in open source.
    • RealPlayer: This used to be available in Canonical's “Commercial” repository, but it's not yet available for Feisty. So go to the Helix Community download site, download HelixPlayer or RealPlayer, depending on your level of purity, and install. I put mine copy in /home/local/RealPlayer. Then you must link the mozilla plugins to firefox and mozilla:
      $ sudo -i
      # cd /usr/lib/firefox/plugins
      # ln -s /home/local/RealPlayer/mozilla/* .
      # cd /usr/lib/mozilla/plugins
      # ln -s /home/local/RealPlayer/mozilla/* .
      

      and then remember to add the rtsp protocol to Firefox.
    • sox: Convert sound files from one type to another. This version, like the one in Dapper, doesn't have full mp3 support, so I'll have to compile it myself, later.
    • spider: The best two-deck solitaire game — ever.
    • sysv-rc-conf: Curses-based program that lets you control which programs start at a given runlevel. Useful to stop the computer from checking for Bluetooth devices when you know that there are none.
    • tcl and tk: For simple widgets.
    • tcsh: My favorite shell.
    • tetex, revtex: TeX and LaTeX, for document production
    • tidy & ftnchek Syntax checkers for HTML and Fortran files, respectively.
    • wine: Just in case I want to try running a Windows program. Some version of IE might be nice, to check out web pages.
    • xnetload: Graphical rendition of network activity. Another FVWM ButtonBar import.
    • xpaint: Old, but quite useful, paint program.
    • xscreensaver: More fun than your average screensaver.
    • Check out the Unofficial Ubuntu 7.04 (Feisty Fawn) Starter Guide for more fun things you can add.
    • I've probably forgotten a bunch of stuff, when I remember them I'll add them to this list.
  • Create accounts for other users on the machine.
  • Turn off the computer, plug in the big disk drive, reboot.
  • Edit fstab to mount the new disk drive as /home. Note that since Ubuntu pretends that the drives are SCSI, so new drive is /dev/sdb, rather than /dev/hdd.
  • Reboot (or unmount/mount) and check everything over.
  • As root, change the ownership of each account in the new /home directory so that it belongs to the appropriate user, e.g.
    # chown -R dave:dave /home/dave
  • Done. Well, more or less. I could go on forever, of course, because I true Geek's computer is never exactly right. I'll add to the list as I think of things.

Wednesday, January 17, 2007

Funky Software

I hope to Great A'Tuin that y'all know what a lava lamp is. I suspect that everyone with more than a casual interest in this blog knows what the ps and top commands do. Put them all together and whatdoyagot?

LavaPS, a visual description of what's going on in your machine. Take a look at the pictures below. I'm running a Quantum Espresso calculation in the background (tungsten in the perovskite structure, since you ask), so there's plenty of CPU action:

The pinkish blob is the QE calculation, as you could see if you could left-click on it, which you can't. It keeps roughly the same area, representing the amount of memory it is using, but moves around a lot compared to the other running processes, indicating that it is getting most of the CPU time. So lavaps provides a visual map of memory/CPU usage. It's moderately useful, though I really haven't run it in years. I thought of it yesterday and, of course, found the compiled version in the Ubuntu repository — back in the day I had to compile it from source.

Then I had an idea that smacks of, dare I say, hackery — I remembered that, some time ago, I was able to load xnetload into FVWM's buttonbar. Would it work with with lavaps?

Add this line to the the FvwmButtons section of your ~/.fvwm/.fvwmrc file:

*FvwmButtons(2x2, Frame 2, Title lavaps, Swallow(UseOld) "lavaps" 'Exec lavaps &')

You might also have to change the size of the box (I commented out the old geometry):

*FvwmButtons: Geometry 100x550-0-0
# *FvwmButtons: Geometry 100x450-0-0

And here are some shots of of the bar, still with Quantum Espresso running:

Now all we need are a black light and some ... brownies. Yeah, that's it, brownies.

Saturday, January 06, 2007

The Sword Project

If you aren't interested in the Bible, you'll probably want to move on right now.

Mind, this doesn't mean that you have to be particularly religious to continue reading. The Bible is such an important part of our culture that everyone is affected by it each and every day, no matter what their personal opinion is. If you think not, start reading David Plotz's Blogging the Bible over on Slate. Don't worry, it's a secular take on the Bible. It's also highly entertaining.

Still with me? The problem with reading the Bible is that it was written in ancient Hebrew and Koine Greek. This makes a translation necessary for roughly 99% of the population. For English-speaking Protestants the traditional translation has been the Authorized (aka King James) Version. While beautifully written, it has certain deficiencies from the modern point of view, mostly because we know a lot more about languages and theology in the Classical period than we did in Shakespeare's time. As a result, there has been a massive proliferation of Bible translations in my lifetime.

All of which puts those of us who occasionally teach Bible study in a quandary. Which translation to use? Is it really right? Is there another take on this passage? While these questions are addressed by many writers, sometimes it's worthwhile to try to tease the answers out of the text itself — and that means either learning Hebrew and Greek, or looking at a variety of translations and trying to figure out the sense of the passage by looking at it from all sides.

Looking up at my bookshelf, I see I have seven translations here (King James, New Revised Standard, Jerusalem, New King James, New American Standard, Contemporary English, and Living Bible). I didn't set out to buy all of these. Some are confirmation Bibles, one (Oxford's NRSV) I use because it has copious notes, and one (Jerusalem) I bought for 10¢ when the local library was cleaning off its bookshelves. But I only have a small number of translations. There are literally hundreds. And you can't spread all of them out on a table to easily look at a group of translations of a particular passage. Plus, you can't search them easily, and you certainly can't pack them all up and haul them around the countryside.

Enter the Open Source SWORD Project. This includes software for Linux, Windows and Macs, along with a set of modules which can be loaded onto each platform. The modules include Bible translations (even Joseph Smith's), not all of them in English, as well as Commentaries (including translations of Luther), Dictionaries, Maps, and the complete surviving works of Josephus.

There are some things missing. You won't get the NRSV, for example, because that's under copyright, even though you can read it online. The best modern translation available is probably the Net Bible, though some versions of the software leave out the massive translator's footnotes available from the Net Bible's own download.

If you run a Windows or a Mac, you can go now. The rest of this is for Linux users.

The software for Linux is available in two versions: GnomeSword, for use with (duh) the Gnome desktop, and BibleTime for KDE. Both are available using apt-get or synaptic. (On this, I'm agnostic. I use FVWM.) I tend to like GnomeSword's interface better than BibleTime, but BibleTime shows the translator's footnotes and/or cross-references, and so far I haven't been able to figure out how to do that with GnomeSword.

The biggest challenge will be installing the modules. Ubuntu has a limited set of modules available, but not many. To get more, you have to download them from Sword's modules page. With GnomeSword you can do this by going to Edit =>Module Manager =>Configure. There you'll have the choice of installing in your local directory, e.g. $HOME/.sword, or in /usr/share/sword. To do the latter you'll have to have root access. The software thoughtfully warns people living in "a persecuted country" that they should probably not be downloading over the Internet.

If you use BibleTime, or if the module you want doesn't come up on GnomeSword's menu, you'll have to do a manual install. This isn't too hard. Pick the Raw ZIP version of the module, save it as, say, ~/downloads/module.zip. Then

  • To install it in your local directory,
    $ cd ~/.sword
    $ unzip ~/downloads/module.zip
  • For a global install:
    $ cd /usr/share/sword
    $ sudo unzip ~/downloads/module.zip

The module will be available the next time you start either GnomeSword or BibleTime.

Tuesday, August 15, 2006

Adding A Printer

I don't usually have a printer installed on this machine, because I don't need it all that much, and it's fairly easy to get to the upstairs printer using a USB drive and SneakerNet. This week, though, Child#1 is going to GatorLand, and we bought a printer to go along. An Epson C88+, to be exact ($79.98 at Staples). The usual: USB 2.0, Prints photos, etc. I mentioned that I might want one for the Linux box and the salesman freaked out. He started muttering something about having a printer specially built, but I stopped him by saying that this printer was for a Windows laptop. He calmed down a bit.

So we took it home and installed it on the laptop, using the driver on the CD included in the package. It worked, of course. So naturally I had to try it on the Linux machine, before taking the thing down to Far North Orlando.

Hook it up, boot up. Now what? /var/log/messages shows that a printer was detected. I know that CUPS (Common Unix Printer System) is the method Linux uses to find printers, but what command do I use? If I running GNOME I'd use System=>Administration=>Printing or something like that, but that only points to a "real" command. Under FVWM there isn't a menu item like that, so we need to know the command.

It turns out to be gnome-cups-manager, which brings up a menu that includes the item New Printer. Clicking on that found the Epson, and hitting Add Printer found the proper driver — unlike Windows, I didn't have to install the driver from a disk. There is also an option to make this printer the default.

And you know what? It worked right away. Now lpr prints to the Epson, lpq shows the print status, and lpstat tells me what's connected. Just like a real Linux system. For under $80, I might well go out and get one of these for myself.

Friday, July 28, 2006

Something Other than Brown

Ubuntu uses the Gnome Display Manager (GDM) as its login program. There's nothing wrong with that, except that the default Ubuntu login them is something called Human. The only thing special about Human is that it's brown. How brown? Well, I just spent a week in Western Kansas in July, and it's browner than that. It's ubiquitously and irredeemably brown. Brown, Brown, Brown. As boring as the background to this blog, as a matter of fact.

Fortunately, others have noticed this and provided information on how to fix the problem. The solution given on the quoted page gives you directions if you use the Gnome desktop. I, of course, use FVWM, so I can't just follow along with the menu as described in the link.

So the procedure is as follows:

  1. Go to gnome-look.org to find a login screen you can live with — OK, you can probably make your own, but I don't know how to do that yet. Given that it's Friday night, I chose a Stargate SG-1 theme.
  2. Download the theme, which will be in .tar.gz format, to someplace in your file-system where it won't be disturbed. I created a directory called /home/local/share/gnomelogin to store themes.
  3. Run the gdmsetup program. Use either
    $ sudo /usr/sbin/gdmsetup
    from the command line, or add the line
    + "Login (GDM) Manager" Exec exec gksudo /usr/sbin/gdmsetup
    to some menu in your ~/.fvwm/.fvwm2rc file and click on that.
  4. When the gdmsetup window appears, you'll see a list of default themes. IF you like one of them, click the radio button. Otherwise, click the "Add" button and give the program the path to your favorite downloaded theme.
  5. Note that you can choose multiple themes which will be brought up randomly (click on the bar beside the word Themes:)
  6. You can also change the login message.
  7. Log off of FVWM (or whatever window manager you are using. The new theme should appear as your login window.

Thanks, of course, to The Linux Extremist.

P.S. There are more themes on Freshmeat.

Monday, July 03, 2006

Thunderbird, Firefox.
Firefox, Thunderbird

Once you've gotten everything set up with Thunderbird as your emailer, you need to get it talking nicely to Firefox, and visa versa. That is, when you have an HTML link in Thunderbird, clicking on it should bring up the link in Firefox. And clicking on a mailto link in Firefox should bring up a composition window in Thunderbird.

Doing this while running a GNOME or GNOME compatible desktop such as FVWM is easy:

  • From a text window run
    $ gnome-control-center
  • Click on Preferred Applications
  • Click on the Internet tab.
  • Choose the default web browser and email client from the menus, or type the address in the box, if needed.

I suppose there's a similar thing you can do under KDE, but I'm not all that familiar with the system.

You can also hard-wire the behavior into your browser by editing the user.js files. That is, edit

~/.mozilla/firefox/xxx.default/user.js

so that it contains the line

user_pref("network.protocol-handler.app.http","/usr/bin/firefox");

and edit

~/.mozilla-thunderbird/xxx.default/user.js

so that it contains the line

user_pref("network.protocol-handler.app.mailto","/usr/bin/mozilla-thunderbird");

(xxx.default is actually a random string assigned by Firefox and Thunderbird)

This marries Firefox and Thunderbird, they're linked together, and GNOME cannot pull them asunder.

Friday, April 07, 2006

Using Ubuntu

So I've been using Ubuntu for almost a week. How's it going?

Fine, thanks for asking. The nice thing about Ubuntu is that nearly everything is available as a precompiled package. If you remember, with Fedora I had to compile FVWM, xnetload, and msmtp, and other things I've forgotten now. Well, Ubuntu has all those packages available. OK, I haven't gotten msmtp to work right yet, but anyway ...

Now if I had wanted to recompile those programs (and I'll have to do some compiling, such as for ical), I would have been out of luck with the default install, since neither the gcc compiler nor make is installed by default. Neither are many of the header packages (which usually end in dev). You just have to try compiling until something breaks, then try to find the appropriate header package. Usually this involves a Google search.

What else? Ubuntu ships with Firefox 1.0.7, not the latest and greatest version of 1.5. So I had to go the the Firefox site and download my own copy. Not terribly hard to do, of course, and it fits in /home/local just as before.

I also want to get the Intel Fortran compiler installed. Like Fedora Core, Ubuntu ships with gcc 2.4+, and that doesn't support the old g77 Fortran compiler front-end. So to run Fortran, I need a good compiler, and the best free (as in beer) one is from Intel. Maybe this weekend.

Saturday, January 07, 2006

Positioning Firefox in FVWM Windowspace

Finally, I've figured out how to get FVWM to put the Firefox browser where I want it when I start up my system.

A little background. As you probably have figured out by now, I use FVWM as my Window Manager in Linux. It's endlessly configurable, and does exactly what I want it to, when I want it, independent of what someone else thinks should be the default behavior of by desktop.

And yet, ...

Some applications are easy to position on an X11 desktop. For example, open a shell window, and run this command:

$ xterm -geometry 80x25-0-0 &

You now have a terminal window in the lower right corner of your screen. It's 80 columns wide and 25 rows wide. If you'd try

$ xterm -geometry 80x25+100-50 &

the window would appear 100 pixels from the left edge of your screen and 50 pixels from the bottom.

The old Mozilla browsers used to obey this type of command, but neither Mozilla, Netscape, nor Firefox do anymore. This presents a problem. When I log on to this machine, I open and FVWM desktop which is 9 times bigger than my terminal screen. I'd like specific applications specific places when I log on. If you excuse my ASCII art, I'd like the thing to look like this:


|----------|----------|----------|
|       0,0|       1,0|       2,0|
| Evolution| Emacs    |          |
|          |          |          |
|----------|----------|----------|
|       0,1|       1,1|       1,2|
| Firefox  | Ical     |          |
|          |          |          |
|----------|----------|----------|
|       0,2|       1,2|       2,2|
|          |          |          |
|          |          |          |
|----------|----------|----------|

Where Evolution is my mail client, Emacs my editor, Firefox my browser, and Ical is a calendar program, though probably not the one you're thinking of. Each square, of course, represents a physical screen on the 3x3 virtual desktop. I can switch between them by scrolling the mouse past the edge of the screen.

Now Evolution starts at the first page of the virtual window, so I can just call it up in the usual manner. Emacs and Ical recognize the geometry command. I've got 1024x800 resolution on my screen, I can get these three programs to start up where I want them by adding this to my ~/.fvwm/.fvwm2rc file:

AddToFunc InitFunction
+ I Exec evolution &
+ I Exec emacs -fn 9x15 -geometry 81x42+1264+25 -T emacs &
+ I Exec ical -geometry +1024+800 &

But what about Firefox? If it respected the geometry option I could add another line:

+ I Exec firefox -geometry +0+800 &

But Firefox doesn't use -geometry. So what to do? For years I've brought up Firefox after I logged onto my system, insuring that it would go where I wanted it.

Today I found out about a FVWM command called StartsOnPage. It tells FVWM to start a certain "Style" of command on a specific page on your virtual desktop. See those little numbers in my desktop picture above? 2,2 is the lower right-hand screen, 1,0 the middle screen on the top, etc. I want to put Firefox in screen 0,1. This involves StartsOnPage, but I didn't know how. Then I found this post, which explains all, or at least enough for my purposes. What I need to do is make sure my ~/.fvwm/.fvwm2rc file has the lines:

Style Gecko StartsOnPage 0 1, SkipMapping

AddToFunc InitFunction
+ I Exec evolution &
+ I Exec emacs -fn 9x15 -geometry 81x42+1264+25 -T emacs &
+ I Exec ical -geometry +1024+800 &
+ I Exec firefox &

The "Gecko" style should work with Mozilla, Netscape, Galeon, ..., any Gecko-based browser, which includes Firefox. The "0 1" means start in window 0,1 on the above grid. I'm not sure what SkipMapping does, but it doesn't seem to hurt anything.

And now, when I log on, Firefox appears where I want it.

Finally.

Thursday, December 15, 2005

Making FVWM an Option

A correspondent (we now have correspondents, aka people who write us) sent us a link to FVWM Crystal, a set of tweaks and addons to enhance the FVWM Window Manager.

I'm not going to be using it soon, it looks rather bulky, and one of the reasons for using FVWM was the fact that it is relatively lightweight when compared to Gnome and KDE. (The other reason was the large virtual desktop, mine is 9 times larger than the screen, and I can pan anywhere on it with the mouse.) However, Correspondent also mentioned that FVWM-Crystal contained a file which made FVWM show up on the GDM (and KDM, presumably) window manager login screen.

This has been an irritant. In a default Fedora Core 4 setup, when you turn on the computer there's a splash screen which has a box for your username and password. Down at the lower left there's an entry called, I think Session. The options inside Session are, by default, Gnome, KDE, Last Session, and Default.

If you install FVWM from source, as I've done (or use a home-rolled RPM file) it doesn't show up on the login screen. To get FVWM to launch when you log in you need to create a .xsession file in your home directory which contains the line

/usr/bin/fvwm

if that's the location of your FVWM executable. This is the "default" option on the Session menu.

That's not too hard for me to figure out, but suppose I want some other user of this machine to have a chance to learn the glories of FVWM? The easiest way to do that is to give them the ability to launch FVWM from the Session menu. That's where the hint from FVWM-Crystal comes in.

The Gnome (GDM) and KDE (KDM) window managers look in the directory /usr/share/xsessions to see what window managers are available. I found the files gnome.desktop and kde.desktop there. Obviously I need to install a fvwm.desktop file. But what goes in it?

FVWM-Crystal comes with a fvwm.desktop file. It's not totally appropriate for my setup, but it provided enough hints to let me construct a version for myself. Mine looks like this:

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Name=FVWM
Comment=F(eeble) Virtual Window Manager:  Lightweight, Fast
Exec=fvwm
Terminal=False
TryExec=fvwm
Type=Application

[Window Manager]
SessionManaged=true

I'm not sure if all of that is necessary or not.

Save this file as /usr/share/xsessions/fvwm.desktop, make it executable ($ chmod 755 /usr/share/xsessions/fvwm.desktop), log out of your Xsession, and look at the Session option on the login screen. FVWM should be available as an option.

Wednesday, December 14, 2005

Cleaning Up the File Installation Mess

Who knew Christmas shopping would be useful?

The other morning I played hooky from work to go Christmas shopping. Don't worry, I took annual leave.

I took a break from my arduous task by getting a coffee at the local Borders. Before I got that, though, I looked around for something to read and found the Jan/06 issue of Linux Journal. I intended to put it back when I left, but it was so useful that I decided to shell out the $5.25 to buy it.

Which brings us to the current topic, an article by Marcel Gangé on cleaning up your $HOME (or other) directory after you've installed a program from a tarball.

So what's the problem? If you're new to Linux, you may have only installed programs from RPM or Debian .deb files, then you might not have encountered a tarball. Heck, if you use yum or apt-get you might never have seen an .rpm or .deb file at all, even though they are there.

Simply put, a tarball is collection of files that will install a program for you on your system. Unfortunately, usually the files are the source code for the program, plus some "hints" (a file called configure and another called makefile, or maybe Imakefile) on how the files are to be compiled. The tarball is a compressed archive file, usually with a name like fineprogram.tar.gz or fineprogram.tgz, the "gz" indicating that everything is compressed with the gzip program.

Now installing from source is a chancy proposition — my current success rate is maybe 90%, but some programs just won't install on my system, probably because I'm missing some key libraries (that's why we have yum and apt-get, to handle these dependencies).

For now, though, let's assume that you've got the program compiled, and even installed (more about that later). You delete the source code directory as a bunch of junk you'll never need again, and run the program happily.

Until one day, you find that the program doesn't really do exactly what you want it to do, and you decide to delete it from your system and replace it by a newer program.

A small problem: The program may have left traces of itself in /usr/bin, /usr/lib, /etc, /usr/share, and maybe /opt, just out of a general sense of perversity. Where are all those files?

Well, if the program was nicely written, you could go back to your source directory and run "make uninstall". This looks for a set of commands in the makefile which remove all of the installed program components.

Unfortunately, you deleted the makefile along with the rest of the source, remember?

Oops.

Now, this post won't tell you how to clean up that mess, but it will tell you one way of preventing the mess from happening.

The secret is a program which Gangé's article talks about extensively: CheckInstall. Basically, the program (available as a tarball, RPM, Slackware, or DEB file) keeps track of where all of the files a tarball installs are, and makes it easy to delete them if you want to. It does this by creating a RPM, DEB, or Slackware Binary file. You install this just like you would a binary file you get from your distributer, and you can delete it the same way.

How does it work? I'm just going to discuss how it works under Fedora, so I'll create an RPM file. I think it works pretty much the same way for Debian and Slackware files, but that's for you to test out.

For an explicit example, let's assume that I want to install the FVWM window manager from source.

That last link should get you a file called fvwm-2.4.19.tar.gz, a tarball with the FVWM source code. Compiling this code is actually fairly easy. You just open up an terminal window, and execute the following commands:

$ tar tvzf fvwm-2.4.19.tar.gz
$ cd fvwm-2.4.19
$ ./configure
$ make
$ sudo make install
$ cd ..
$ rm -fr fvwm-2.4.19

What's all that do? Let's go through it line by line:

  1. $ tar tvzf fvwm-2.4.19.tar.gz uncompresses the tarball. This creates a directory named fvwm-2.4.19 and puts all the files you need into it.
  2. $ cd fvwm-2.4.19 goes into that directory.
  3. $ ./configure runs a program which searches your machine and decides if you have all the libraries you need to compile and run fvwm. If you do, it will create a makefile which has the locations of all the files you need to run the program, plus appropriate compiler flags.
  4. $ make executes the makefile. Typically this will take minutes to hours, as all the components of your system are compiled. If it's successful, then
  5. $ sudo make install will put all of the program bits where they belong. You need the sudo if you want to install the program in /usr or /usr/local, or someplace else that's owned by the superuser.
  6. $ cd .. returns you to the directory above fvwm-2.4.19.
  7. $ rm -fr fvwm-2.4.19 deletes the source code.

What does CheckInstall do? It gets rid of the "make install" step. Basically, you run the following commands:

$ tar tvzf fvwm-2.4.19.tar.gz
$ cd fvwm-2.4.19
$ ./configure
$ make
$ sudo "/usr/local/sbin/checkinstall"
$ sudo rpm -i /usr/src/redhat/RPMS/i386/fvwm-2.4.19-1.i386.rpm
$ cd ..
$ rm -fr fvwm-2.4.19

The process is pretty self-explanatory. You can give the default answers to all of the questions, tell the code to create an RPM file, and it will tell you that it has created an RPM file in the location /usr/src/redhat/RPMS/i386/fvwm-2.4.19-1.i386.rpm or wherever. The exact name and location depends on the installation. (All these "su" and "sudo"s will require the appropriate passwords, by the way.)

So what's the big deal? The RPM file installation process knows where all the files belonging to fvwm-2.4.19 went on install. Thus, if you later decide you don't want to use FVWM as your window manager,

sudo rpm -e fvwm removes the program from your system, along with all of the auxiliary files it installed.

Now, a word of warning: this is not a real RPM file. "Real" RPM files have dependency information in them. What's that? Well, say that FVWM depends upon a library called "libfoo". If for some reason I remove the "libfoo" RPM from the system, a "real" RPM installation would tell me that this is going to break FVWM. However, here the RPM isn't connected to "libfoo" so far as your RPM system knows, so it won't warn you. Also, you probably can't pass this RPM off to a friend with any hope of him getting it to run on his system: he's better off trying to compile the code himself.

However, it does make file installation and cleanup a lot neater, and so is extremely usefull.

And well worth the $5.25 for the magazine.

Wednesday, September 14, 2005

Easy to Use is Easy to Say

When I'm done, the title will probably seem, to most of you, to be a cheap shot. It is. Deal with it.

At work I need to create actual, honest, true blue, all American, PowerPoint files. Accept no substitutions, especially files produced by OpenOffice.org.

Given that constraint, I need two computers -- a "real" Linux one, which will actually run complicated Fortran codes while reading my email, surfing the web, walking the dog and polishing my car, and either a PC or a Mac to run PowerPoint. Your tax dollars at work, folks.

OK, it's a no-brainer:

  • Mac OS X is BSD-Unix based. I can, and have, run the same codes I run on the Linux box on a Mac.
  • All of the people above me in the food chain use Macs. They're the ones that need my PowerPoint files, so that they can select parts of my presentations, mangle them together with others, and show those higher in the food chain all the neat stuff we're doing.
  • Though they are produced by the same Evil Empire, Mac and PC versions of PowerPoint don't quite get along -- in particular, fonts used in equations get screwed up when going from one platform to another.
  • A Mac PowerBook is infinitely cooler to carry through the airport. And, when it's on, the Apple on the back of the screen lights up, sort of like a Cylon's backbone during sex.

To go along with the notebook computer, this week I got a Mac mini for my desk. It runs Mac OS X 10.4 (Tiger).

OK, it's easy to use. It's a joy, a breeze, except that FireFox won't recognize the middle button on my 3 button mouse, and I haven't figured out how to get FVWM running under X11.

But there are some (a very few, but some) things on the Mac that just aren't obvious. And so I list them here, so that the next time I get a new Mac I won't forget:

  • Making something other than Safari the default browser:
    1. Open Safari (well of course, what could be more obvious?)
    2. Under Preferences, click on "Default Web Browser" and put in FireFox or whatever
  • Make something other than "Mail" the default email reader:
    1. Open Mail (after the Safari thing, what did you expect)?
    2. Give it the information to open one of your POP email accounts (otherwise, it will just kick you out of the program. Who'd want to run a Mail program without an email account. Duh.)
    3. Under Preferences, select "Default Email Reader" and change it to the desired program.
  • Bring up something other than a single xterm window when you start X:
    1. Open a terminal window and run the command:
      $ cp /etc/X11/xinit/xinitrc ~/.xinitrc
    2. Edit ~/.xinitrc to start the programs you desire
  • Change your default shell:
    1. Go to the Applications folder, find the Utilities folder, under it find the "NetInfo Manager" folder, and in it find a tab called "users"
    2. Catch your breath
    3. Under "users" click on your account name
    4. Click on the Lock icon in the lower left-hand corner of the box and enter your password, assuming your account has administrative privileges.
    5. If it doesn't, find an Administrator. Yell at him for awhile, until he gives you Administrative privileges.
    6. Find the line that says "shell", click on the /bin/bash part of the line, and replace it with /bin/tcsh or whatever.
    7. If your worst enemy shares this computer, change his login shell to /dev/null
    8. Click the lock closed
    9. Exit the whole mess

OK, that's only four things, which is why the title of this article is unfair. However, you'd think that Apple would have made these choices just a bit more transparent, don't you?

Saturday, June 25, 2005

Next Steps

Editing the /etc/sudoers file to allow me to run high-level commands without being root all the time.

That was easy, I just followed the directions listed.

Re-install the fvwm window manager.

That wasn't easy. Even the "unstable" release of fvwm wanted a library with an older version than what Fedora provided. So I downloaded the fvwm2.4.19 source as a tarball, unpacked it in /home/local/src, and (running as local) did:

$ ./configure --prefix=/home/local
$ make install

which puts the executable in /home/local/bin, then I edited the .xsession file so that it starts /home/local/bin/fvwm2. Simple, huh?

Saturday, November 20, 2004

Mounting CDs

I wanted to look at the Fedora Core 3 Disc 4, which didn't come up in the installation process. In KDE it was auto-mounted, with an icon appearing on the desktop. FVWM doesn't do that as far as I know. It certainly didn't automount the disk. However, it is set up to mount with the command

mount /media/cdrecorder/

and of course the corresponding umount command works as well.

Not that much on the disk. Extras, such as alternate dictionaries for aspell, the full mozilla browser, etc.

Friday, November 19, 2004

An Old-Time Window Manager

FVWM ("FVWM" Virtual Window Manager) is still my favorite. I downloaded new versions of

  • fvwm (2.4.19-1)
  • fvwm-themes (0.7.0-2)

and used my old version of

  • libstroke

all available from the FVWM home page. Using my old .fvwm/.fvwm2rc file makes everything work just fine.

My files copied

Well, enough of them so that I can run Firefox properly, and have my tcsh shell preferences set correctly.

After I get the local files set up, I'll start looking for things that haven't been installed with Fedora Core. First off, we need mplayer and xine, not to mention plugger, ee. Most importantly, fvwm so I can use the window manager I want rather than KDE or Gnome.

There are probably a few other things, as well. I'll document the installation of each one of them as I go along. Many are in past posts to this blog, so I'll try to reference those posts as well.

Friday, January 09, 2004

Traffic Monitor

When I was running Mandrake Linux I couldn't get (meaning, didn't know how at the time) to get the FVWM window manager to work as I wanted, so I used icewm. Actually, I might still use it, if I could figure out how to set up a giant virtual desktop like FVWM has.

But I digress. One of the things I liked about icewm is that it had a network traffic meter which fit into the toolbar. This was particularly helpful because it let me know when my Linksys BEFW11S4 (ver 4) router decided that it didn't want to handle downloading that file anymore, thank you very much.

FVWM doesn't come with a traffic meter, but a quick Google search found Roland's software for Linux. Roland created a program called xnetload. It was easy to compile, though I had to hand-change the install location from the default /usr/local to my preferred /home/local location.

And then I was able to get it into FVWM's ButtonBar. After much playing around, I finally decided on an entry that looked like this: *FvwmButtons(2x2, Frame 2, Title eth0, Swallow(UseOld) "xnetload" 'Exec xnetload -nv -ni -kb eth0 -fg red -bg gray &') which monitors my ethernet port ("eth0") displays the upload and download information in graphic form only ("-nv -ni"), and logs information in kilobytes.

So thank you Roland, great software.

Monday, December 29, 2003

USB Camera!!!

For Christmas, Santa got us an Olympus C-5000 digital camera, 5MP, 3X optical, ~4X digital. It works fine under Windows, so how does it do under Linux?

Fortunately, the good people at LinuxQuestions.org had already posted what to do. I'll just summarize what comes up in the Fedora Core distribution. I did this under FVWM, working under GNOME or KDE may make things a little more automatic:

  • Plug the USB cable into the camera and the computer
  • Turn on the camera (uh, duh)
  • With no other SCSI device connected to the system, the camera shows up as /dev/sda1. So, as root,
  • mkdir /mnt/camera (if you haven't done it already)
  • mount -t vfat /dev/sda1 /mnt/camera
  • Your pictures will now be in a subdirectory of /mnt/camera (which one depends on the camera)
  • Copy the pictures to a convenient location. Until you do this, the pictures are only in the camera's memory
  • as root, do a umount /mnt/camera. If you've got a window open to a subdirectory of /mnt/camera you may have to close it before this works.

Questions to be answered:

  • Can you edit /etc/fstab may make this a little more automatic? If so, then all you have to do is plug in the camera and mount /mnt/camera. Possibly you don't even have to be root.
  • If you have a disk mounted in the cd, does the camera still show up under /dev/sda1?

I'll have some photos up in a few days, and post a link to them.

Friday, December 26, 2003

Ring, Ring, Ring, Ring of Fire

Burning CDs is essential for backups, and maybe other things (ahem). When I was running Mandrake 9.1, my favorite CD burning tool was K3b. It's not included in the Fedora Core (perhaps because it's at version 0.10.3), but the download section on the K3b site has instructions on updating /etc/yum.conf to check for K3b upgrades. With that in place installation was easy.

One quirk: when you first install K3b, permissions aren't set for a user to create CDs. The solution is to run K3b in GNOME or KDE, and click on Settings ==> K3b Setup. This will prompt you for the root password, and then (hit return) change the permissions on several programs to allow the user to write CDs. IIRC, the Mandrake version was already set up with user permissions enabled.

I tested K3b by doing a backup of my home directory. Under version 0.10(.3), you just click on the "Create Data CD Project" button, then drag the files or directories you want onto the CD image that says "K3b data project". I ran the burn at 24X, which seems to be a little fast for this machine, as the buffer would sometimes go down to 10-20% full. Zero, of course, means that you've created a new coaster. Next time I'll try 16X.

To read data CDs from FVWM, you need to issue an explicit

$ mount /mnt/cdrom

from a shell prompt to be able to read the disk, and then

$ umount /mnt/cdrom

to free the disk. If you don't do the later you can press the eject button or

$ eject

as much as you want and the CD will remain locked in the drive. GNOME and KDE don't have this limitation, they automatically mount and unmount the CD. Point for them.

I tested the CD by reading different files off of it from this computer and from an XP box. Works fine.

Thursday, December 25, 2003

fvwm

FVWM ("FVWM" Virtual Window Manager) is rather old, but quite useful. It's a lot lighter weight than GNOME (actually sawtooth) or KDE. It is realtively easy to setup and manage by editing the ~/.fvwm/.fvwm2rc file.

You can set up a virtual desktop. I use one that's 3x3, meaning that the desktop is 9 times the size of my screen. I can move open applications between the screens by dragging them with a mouse.

There is a fully configurable button bar. Mine includes a load meter, a map of the virtual desktop, a clock, and quick launch buttons for the fortune program, an xterm, MozillaFirebird, and a kill button.

There is also a configurable Win95-like TaskBar, which shows all open windows and allows quick navigation between them. Unfortunately, I haven't been able to get it working here, though it works out of the box in older RedHat versions and in SUSE Linux.

Unfortunately, fvwm is not included in the Fedora distribution. To get it, you must:

  1. Download the program from the Offiicial FVWM Home Page or from another source. The official FVWM page includes RPMs, Deb packages and tarballs. You can also download various themes and icons.
  2. Install in the usual way
  3. Create a file ~/.xsession in your home directory. In it put the full path to your copy of fvwm. If you install from an RPM, it's in /usr/bin/fvwm2.
  4. Run this command from a terminal window: $ chmod 555 ~/.xsession This makes ~/.xsession executable, and insures that it won't be overwritten. (See man chmod for more details.)
  5. Log out of whatever WindowManager you are using.
  6. Before logging in again, click on the Session button on the login screen and set it to default.
  7. Log in. You should be running FVWM. There is a default menu, which will have an option which saves the configuration information into the file ~.fvwm/.fvwm2rc. You can edit this to get the behavior you want. When I get my file satisfactorily adjusted I'll post a link to it.

That should be all you need to use FVWM. Look at the FVWM pages and man fvwm for more details.