The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Category: PC Tweakage

Remembering which tweaks worked

  • Linux Install Tweaks: The Basics

    The conventional wisdom for Linux installations is to put your /home directory in a separate partition, so that your next installation won’t blow it away. The intent is to save your settings for the new installation and avoid a bunch of tedious reconfiguration.

    That probably made sense back in the day when Unix installations didn’t change very much, very often, but it seems nowadays that hulking programs use elaborate configurations and don’t take kindly to being blindsided by old config files. I can’t provide specific details, but some upgrades have gone awry for mysterious reasons; a clean install fixed everything up again.

    I now do a clean OS installation in a freshly formatted partition, then spend a day or two tweaking everything. This eliminates a tremendous amount of cruft, takes advantage of new features, and generally seems to be more productive than dicking around trying to figure out exactly which old setting pooched the new version.

    Two meta-configuration choices help a lot:

    • All our “data” files live on a file server in the basement that’s mounted via NFS, so the local system doesn’t have much more than its own configuration.
    • Hard drives have plenty of space, so slicing the drive into smaller chunks and preserving the old installations doesn’t cost anything.

    Case in point: I’m setting up Xubuntu 8.10 on a system with partitions containing Kubuntu 7.10 and 8.04. I’ve blown away several different trial installations of Kubuntu & Xubuntu in this partition already; now things are looking good. The trick is to use manual partitioning and aim the installer at the correct spot.

    Make sure you get that right and always back up your partitions first!

    The disk layout on this box:

    sudo fdisk -l /dev/sda
    
    Disk /dev/sda: 160.0 GB, 160000000000 bytes
    255 heads, 63 sectors/track, 19452 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xd0f4738c
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1           7       56196   de  Dell Utility
    /dev/sda2   *           8        2489    19928633    7  HPFS/NTFS
    /dev/sda3            2489        2973     3888569+  db  CP/M / CTOS / ...
    /dev/sda4            2974       19452   132367567+   f  W95 Ext'd (LBA)
    /dev/sda5            2974        3496     4200966   82  Linux swap / Solaris
    /dev/sda6            3497        6107    20972826   83  Linux
    /dev/sda7            6108       15245    73400953+  83  Linux
    /dev/sda8           15246       19452    33792696   83  Linux

    Yup, it has Windows on it; rarely gets booted, but it’s there. You cannot begin to imagine the number of reboots required to update even a minimal Windows install after a year.

    So, to begin…

    The first steps with a new PC:

    • back up the drive
    • shrink the Windows partition down to maybe 20 GB
    • snuggle the other pre-installed partitions next to it
    • create an extended partition over the rest of the disk
    • set up the Linux partitions

    After you’ve done that the first time, you never have to do it again… just ping-pong between two (or three!) Linux partitions with each new installation. There’s a bit of fussiness with grub, but it’s easy enough to either let the new installation capture the MBR or re-aim it at the old installation after the fact.

    For more details on partitioning & backups, particularly for laptops, go there. Use partimage (use System Rescue CD) for whole-partition backups to a USB drive and move on.

    I favor the mini.iso installation method, as it tends to install less cruft and loads the latest versions right from the start. Start from there and proceed as directed.

    Don’t do an x86_64 installation, even though you think it’d be cool. Flash doesn’t work yet and restarting Firefox a dozen times a day simply isn’t attractive. Trust me on this.

  • Xubuntu: Separate X Sessions

    Although XFCE is rather short on creature comforts, it handles my dual output video card with separate X sessions on two monitors and doesn’t fall flat on its face with the right-hand monitor rotated into portrait mode. Some apps don’t maximize quite correctly, thinking the bottom is at 1200 (1080?) rather than 1680, but overall it works fine.

    The XFCE version shipped with Xubuntu 8.10 is now backlevel, but you can fetch the latest & greatest from www.xfce.org. Add the repository (and corresponding public key), then do a normal upgrade.

    You’ll also want to install/upgrade OpenOffice 3 from the PPA repository. Do the obvious search to find the most current links. There’s no need for the manual install hocus-pocus using a tarball from the OOo site.

    You can’t have separate wallpaper on each virtual desktop, you must have the same number of desktops in each X session, and there are some other aggravations, but … no showstoppers so far.

    Bottom line: It (pretty much) Just Works.

    More on the system setup in a bit, as I get some useful results.

  • Separate X Sessions Do Not Work in Kubuntu 8.10

    I sent this in as a bug to Launchpad, where it became Bug 337777 (not octal, BTW) and was marked as a duplicate of Bug 192413. It’s been triaged as Low priority, so I think my days of using KDE are, alas, pretty much finished.

    Herewith, the straight dope, just in case you were thinking of doing the same thing.

    ————-

    In Kubuntu 7.04, I managed to manually configure separate X sessions using two nVidia video cards driving two monitors. The setup involves a 1600×1200 landscape monitor on the left and a 1680×1050 monitor rotated 90 degrees CCW on the right.

    In Kubuntu 7.10, this worked reasonably well.

    In Kubuntu 8.04 / KDE3, this works poorly. X seems to regard the right-hand monitor as being 1600 (1680?) x 1200, so all windows maximize incorrectly and “centered” dialogs appear off-center to the upper right on that screen. I installed an nVidia-based dual-head card in the hopes that it would work better, but that made no difference. The setup is usable (I’m using it now), but not desirable.

    The automatic configuration tools fall flat on their face: any attempt to use the standard KDE display tools pooches xorg.conf. I must carefully tweak xorg.conf to keep this setup working in the face of any X changes.

    In Kubuntu 8.10 / KDE4.2, this configuration flat-out doesn’t work. After considerable manual fiddling, I got a blank X session on the right with the default X cursor and a black background; the mouse pointer moves from one screen to the other, but that’s as good as it gets. The left screen works more-or-less normally, but with some weirdnesses. Diligent searching reveals this is the common endpoint for all folks attempting this configuration: KDE4 simply doesn’t support separate X sessions.

    I do not want Twinview / Xinerama (which also work poorly for this configuration), because I typically edit a single document in portrait mode on the right screen while flipping between circuit simulators / web browsers / PDF documents / PCB layout editors on the left screen. A single X session using two screens does not support that functionality; particularly in KDE4 which seems to lack the advanced window positioning controls of KDE3.

    Because KDE4 is mandatory with 8.10, I can’t downgrade to KDE3, which might work.

    Although KDE4 seems to be the future, it would be immensely more usable if it didn’t introduce serious regressions from previous functionality. I will gladly trade off all the Plasmoid foo-foos and Compiz go-fast-stripes to get stable X capabilities that work the same way as 7.04.

    The to-be-expected alpha-version issues in 9.04 prevent me from even installing it at this point, so I cannot say whether it’s an improvement or not. From what I read in the forums, things do not look promising.

    Perhaps this is less of a “bug report” and more of a plea for stability: please, first make KDE4 *work*, then make it pretty!

    ————-

    For what it’s worth, I installed Xubuntu in that partition, added one line (Option “Rotate” “CCW”) to xorg.conf, and It Just Worked. XFCE is a bit lacking in creature comforts, but it works in this configuration. I think I can get used to that.

  • Old PCs: The Gift That Keeps on Giving

    A friend gave me an old Aptiva, upon which I was going to install Puppy Linux.

    But, first I let it start up Win ME just for old time’s sake. What the heck, it’s a classic.

    The first thing up is a prompt asking permission to install Compuserve, which I really don’t need. As is usually the case with shovelware, that program doesn’t show up in the Start Menu, so I did some rummaging around.

    Firing up msconfig and looking at the auto-started stuff revealed, among the usual stuff, this interesting file:

    c:\windows\nav.exe                   .vbs

    That pretty much pushes the Compuserve popup to the back of the queue.

    Note the long string of blanks in the middle. That, in combination with Windows Explorer’s default “Hide known file extensions” setting, is an old trick, but, then, this is an old box.

    Sooo, at one time there was a virus on that box masquerading as good ol’ Norton AntiVirus. The offending file seems to be missing now, so something killed it without removing its auto-start setting.

    Either my friend removed NAV, too, or the virus shot it in the head. There’s all manner of NAV config files and clutter lying around, but no executables.

    In goes the Puppy CD, reboot, and I install its slightly backlevel ClamAV package. No problem with that; it’ll use the most recent virus signatures and, heck, any problems on this box are half a decade old.

    After mulling over the Windows ME partition for a while, ClamAV reported:

    /mnt/sda1/Program Files/Netscape/Users/Default/Mail/Trash: W95.Matrix.SCR FOUND
    /mnt/sda1/Program Files/Netscape/Users/Default/Mail/Inbox: W32.Magistr.B FOUND
    /mnt/sda1/_RESTORE/ARCHIVE/FS346.CAB: Worm.Kido-18 FOUND
    ----------- SCAN SUMMARY -----------
    Known viruses: 513471
    Engine version: 0.91.2
    Scanned directories: 1821
    Scanned files: 44557
    Infected files: 3
    Data scanned: 10721.32 MB
    Time: 73200.595 sec (1220 m 0 s)

    Feeding the obvious keywords into Google produces the comforting result that these are all old news:

    However, Kido is a Conficker / Downadup variant, which is disturbing. The hit is almost certainly a false positive, as it’s in a CAB file, we don’t run any Windows machines, and they’re behind a hardware firewall that’s in full effect.

    Handing the offending file to VirusTotal shows that ClamAV is the outlier and all the others are perfectly happy: Current status: finished Result: 1/39 (2.57%)

    To quote Ripley: “I say we take off and nuke the entire site from orbit. It’s the only way to be sure.

    Memo to Self:

    • Run ClamAV (not ClamWin) before booting Windows
    • Do not plug in the network cable until the box is known-clean
    • It’s time for a reverse wireless firewall when our young lady invites friends over

    Windows: http://www.clamwin.com/

    Linux: http://www.clamav.net/

  • X Server Auto-Configuration Requires a Monitor: Duh

    The used Optiplex GX270 that will eventually become my mother’s “new” PC has been booting absolutely reliably in the basement, so whatever was troubling it a few months ago seems to have Gotten Better By Itself. I don’t have to like that, but so far, so good.

    This morning I ssh-ed into it, as I do every few days, then fired up krdc on my desktop, which immediately complained that there wasn’t anything there to connect with. Uh-oh

    But the ssh worked, so at least there’s a Linux system at the end of that network cable.

    A changing cast of PCs has gone through the basement lab in that time and I’ve been swapping the desktop monitor among them. Most recently, a friend gave me an ancient Aptiva that might turn into a dedicated controller and I’d left the monitor connected to it.

    After I figured out that the monitor wasn’t hitched to the Optiplex, traced the cable, and fixed that oversight, I was confronted with a command-line prompt. A bit of rummaging in /var/log/Xorg.0.log turned up some useful information:

    (II) intel(0): Output VGA disconnected
    (EE) intel(0): No valid modes.
    ... <snippage> ...
    (EE) Screen(s) found, but none have a usable configuration.
    Fatal server error:
    no screens found

    In the Bad Old Days, you told X exactly what output to produce by providing modelines that specified the exact video timings. That was fraught with peril, as you could do the Digibomber thing to a fussy fixed-frequency monitor by specifying timings beyond its abilities.

    Nowadays, the X server feels around, detects the video card, asks it what it can produce, detects the monitor, asks it what it can display, figures out the best match from the ensuing matrix of possibilities, and shazam slaps up a GUI. Might not be exactly what you want, but more likely than not it’ll be pretty close and you can apply some tweakage to get it right.

    If there’s no monitor connected, then the X server doesn’t know quite what to do. I’m sure it’s possible to specify a default fallback configuration, but maybe it’s better to just ensure the monitor is always connected. Those cute little screws on the connector might be a clue, eh?

    The command line continues to work, of course, so you can figure this stuff out either locally or through ssh. Alas, it’s really hard to reconnect a monitor cable through ssh.

    If you’re still not convinced to improve your command-line chops, I commend to your attention Stephenson’s In the Beginning was the Command Line.

    Memo to Self: Use the Screws!

  • KDE Window Behavior Tweakage

    My mother does email and not much else, so I set up her PC to power on in the morning, shut down in the evening, sign her in automatically, fire up Kontact (which starts in Kmail mode), and (oh by the way) let me do remote admin via SSH from 250 miles away.

    Works like a champ.

    I’ve tweaked the KDE Window Behavior settings for Kontact so that it runs full-screen (with no border), thus eliminating a bunch of clutter and many opportunities for things to go wrong. To do this, click the small icon on the far left of the window’s title bar and select Configure Window Behavior.

    You can also fire up System Settings -> Window Behavior -> Window-Specific Settings, then use the Detect button to load the window ID stuff from the window you’re tweaking. Then select

    • Geometry tab, Fullscreen -> Force -> checkmark

    This differs in some subtle ways, which I don’t understand, from the combination of

    • Geometry tab: Maximize horizontally -> Force -> checkmark
    • Geometry tab: Maximize vertically -> Force -> checkmark
    • Preferences tab: No Border -> Force -> checkmark

    Remember this magic keystroke: Alt-F3. This pops up the same menu you get from the small icon in the far left of the title bar, which just ain’t there for borderless windows. You can also wade through System Settings, but Alt-F3 is faster.

    I also set the Kontact Composer (why not Komposer?) window to behave the same way, so that the only obvious way out is to either send the message or close the window using the toolbar icons.

    Now, I wanted to set up Firefox similarly and it looked like it should work fine.

    Alas, there’s a non-obvious interaction with new windows triggered by Javascript. If they’re the sort of pesky windows that suppress the Firefox menu & tab bar, then there’s no way out unless you happen to remember Ctrl-W or Alt-F4 will close the current window. Maybe you know that and use it every day, but it’s not reasonable to expect my mother to remember such trivia.

    So I set up Firefox thusly:

    • Geometry tab: Maximize horizontally -> Force -> checkmark
    • Geometry tab: Maximize vertically -> Force -> checkmark

    By not selecting the No Border option, Firefox and all its subsequent pop-ups fill the screen, but each window also has a normal border with the all-important Close button in the upper-right corner. Thus (desired) popups, like video players, can be killed when they’re done, even if they lack a separate Close This Window option.

    Yes, Firefox is running Adblock Plus and all the usual extensions…

  • Logitech Trackball: Tilting Thereof

    Trackball platform
    Trackball platform

    The right-hand trackball by my keyboard is a Logitech Cordless Optical Trackman, which I fixed a while ago with a laying-on-of-hands repair. If you do a lot of typing and want to save your wrists, a trackball might be just what you need.

    This trackball’s shape is strongly right-handed and I found that my wrist was happier when I tilted the trackball about 30 degrees to the right, making the ball almost vertical and the thumb buttons to the upper left. Evidently my wrist wants to work at a more clockwise angle, not at whatever Logitech found suitable.

    I made the platform from thin oak-veneer plywood left over from a bookshelf project, with oak wedges holding it up. Polyurethane glue, my favorite wood adhesive, holds everything together. I presented the bottom to the belt sander to get a nice flat surface and bevel the down-side edge of the platform, then applied non-skid rubber stair tread tape to the wedges.

    Conveniently, Logitech held the trackball’s case together with four plastic-tapping screws. I removed a screws at each end, drilled two matching holes in the platform, and used similar-size machine screws. The threads don’t quite match, but it’s close enough.

    Rotated trackball in use
    Rotated trackball in use

    Here’s what it looks like in use…

    The platform makes battery replacement a bit more tedious. Much to my surprise, the two AA cells run for half a year at a time, so that’s not a big issue.

    However, the trackball occasionally (every few weeks) loses sync with its base receiver, requiring a poke of buttons on both units. I think that’s partly due to the Logitech wireless mouse on my esteemed wife’s desk ten feet away.

    On the whole, I like it a lot. If Logitech made one for southpaws, too, I’d get a bookend set, but they don’t.

    Oh, yeah, if only evdev allowed button reconfiguration, without using a bunch of batshit kludges, I’d be ecstatic. As of the last time I fiddled with it, the standard mouse xorg driver couldn’t handle the number of buttons and evdev didn’t allow button mapping. Mostly, it works, but I’d like to reassign a few of the buttons.