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

  • Xubuntu 12.04: Some Steps Forward, Some Steps Back

    The continuing saga of trying to run a Linux desktop with two monitors (one rotated in portrait mode), separate X sessions, two trackballs, and a Wacom graphics tablet continue with Xubuntu 12.04. KDE continues to not work quite right with dual monitors, Gnome seems to be dead in the water, Unity wants to be a touch-screen UI when it grows up, and Linux Mint introduces yet another not-quite-baked UI. The breathtaking churn in Linux infrastructure continues, rendering everything I’d figured out with respect to FDI / HAL / udev configuration lagely irrelevant.

    For lack of a better alternative, I’ve installed Xubuntu, which is now a deprecated (available, but unsupported) version of Ubuntu. Configuring separate X sessions on two monitors requires the proprietary nVidia driver. The XFCE display configurator falls over dead when confronted with two screens and the xrandr extension seems unworkable. Fortunately, I’d left a bit of commented-out cruft in the xorg.conf file that worked in Xubuntu 10.10 and could copy the whole file over with only one change:

    Section "Screen"
        Identifier     "Portrait"
        Device         "GF9400_1"
        Monitor        "Dell2005FP"
        DefaultDepth    24
        Option         "TwinView" "0"
        Option         "metamodes" "DFP-1: 1680x1050 +0+0"
        Option         "NoLogo" "Off"
    #    Option         "RandRRotation" "On"
        Option         "Rotate" "CCW"
        SubSection     "Display"
            Depth       24
        EndSubSection
    EndSection
    

    Configuring two trackballs with the XFCE utility remains surprisingly easy: the Kensington is left-handed and the Logitech is right-handed.

    Swapping buttons 2 and 3 on the Wacom stylus poses a bit more of a challenge. Doing it on a per-session basis seems straightforward:

    xsetwacom set "Wacom Graphire3 6x8 stylus" button 2 3
    xsetwacom set "Wacom Graphire3 6x8 stylus" button 3 2
    

    You’d put those into a script and tell XFCE to auto-run it when you sign in, but that doesn’t handle hotplugging. I don’t hotplug the tablet, but random static glitches knock the USB hub into a tailspin and cause the same effect, so I jammed the lines that used to be in xorg.conf into /usr/share/X11/xorg.conf.d/50-wacom.conf:

    Section "InputClass"
            Identifier "Wacom class"
            MatchProduct "Wacom|WACOM|Hanwang|PTK-540WL|ISD-V4"
            MatchDevicePath "/dev/input/event*"
            Driver "wacom"
            Option "Button2" "3"
            Option "Button3" "2"
    EndSection
    

    I’m certain there’s a different location for those that fits in with whatever the overall design might be these days, but I’m kinda tired of figuring this stuff out.

    The Wacom drivers in Ubuntu 12.04 no longer permit restricting the tablet’s range to a single X session (xsetwacom set ... MapToOutput "HEAD-0" assumes you’re using xinerama with a single X session across two monitors), which sprawls the tablet’s limited resolution across both screens and leaves a big unusable rectangle in the lower third of the left side. This is not progress in a positive direction, but there’s no workaround.

    That workaround for the upstart Pachinko machine also applies to this box. The minute-long pause while NFS hauls itself to its feet isn’t attractive: you see VT 1 with the bare white-on-black command-line login prompt, but if you actually log in, things get very ugly, very quickly.

    Restoring the usual verbose Unix-oid startup messages requires tweaking /etc/default/grub to set noquiet nosplash, then running update-grub.

    Search the blog with the obvious keywords to get my earlier posts on all these topics…

  • ThinkPad 560Z BIOS Battery Replacement

    Quite some time ago I picked up a trio of IBM Thinkpad 560Z laptops from the usual eBay suppliers as part of a DDJ column project. One turned into a digital picture frame, our Larval Engineer has another (because it was maxed out with 128 MB of RAM), and I just fired up the third (96 MB!) to discover whether it could serve as a text-only terminal without too much trouble.

    Alas, the BIOS battery was dead. I’d replaced the dead OEM cell some years back with a (surplus) lithium cell that’s a bit too small, so it only lasted a few years rather than a decade, but the cells were on the shelf. Soooo, I put in another one, just like the other one:

    Thinkpad 560Z BIOS battery
    Thinkpad 560Z BIOS battery

    After nudging the date & time into the current millennium, it then failed to boot Ubuntu 8.04: evidently the mighty 4 GB CompactFlash drive (jammed into a CF-to-IDE adapter) has bit rot.

    It’s a prime candidate for the text-only version of Tiny Core Linux, except that a 560Z can’t boot from either USB or CD-ROM, which means getting the files on the “hard drive” requires extraordinary fiddling. Drat!

    FWIW, when this battery fails, I think the (empty) main battery compartment has room for a CR123A cell that should outlast the rest of the hardware. I could blow two bucks on a replacement from eBay, but what fun is that?

  • Could This Be A Hacked Router?

    Found this interesting SSID on a drive up Albany way:

    Hacked router SSID
    Hacked router SSID

    I wonder how long it’s been like that? If the router’s owner doesn’t use WiFi, then it could last forever.

    Rule of Thumb: Disabling admin access from the router’s WiFi port is just good practice…

  • Sherline CNC Mill Y Axis Home Switch: To The Front!

    Reassembling the mill provided an opportunity to move the Y axis Home switch from the rear of the axis to the front. The key discovery happened during the teardown: I can get the saddle off the Y axis dovetail by removing the gib, without sliding it off the front, which means a front switch can remain firmly glued in place.

    A few random hunks of steel and a wire nut held the switch in position while the epoxy cured:

    Mounting Y axis home switch
    Mounting Y axis home switch

    The switch actuator bottoms out with the saddle just touching the preload nut, so the saddle can’t dislodge the switch: the switch trips just before the saddle hits the nut, at which point all motion stops and the motor stalls.

    Moving the switch means I can remove all the gimcrackery that poked the rear switch with the tooling plate in place; I was never happy with that setup. I also removed the small block that trapped the rear end of the Y leadscrew, under the assumption that, as I haven’t yet dropped anything on the leadscrew, I probably won’t. That adds about 1/4 inch to the maximum travel and allows the tooling plate to whack into the column.

    The switch wire runs along the stepper cable, a tidy technique that hasn’t introduced any glitches into the shared Home signal from the X axis drivers:

    Sherline mill - X and Y axis home switches
    Sherline mill – X and Y axis home switches

    The Y axis now seeks the Home switch in the positive Y direction, so that stanza in Sherline.ini looks like this:

    [AXIS_1]
    TYPE = LINEAR
    MAX_VELOCITY = 0.400
    MAX_ACCELERATION = 5.0
    STEPGEN_MAXACCEL = 10.0
    SCALE = 16000.0
    FERROR = 0.05
    MIN_FERROR = 0.01
    MIN_LIMIT = -0.5
    MAX_LIMIT = 4.90
    BACKLASH = 0.003
    HOME_IS_SHARED = 1
    HOME_SEQUENCE = 2
    HOME_SEARCH_VEL = 0.3
    HOME_LATCH_VEL = 0.016
    HOME_FINAL_VEL = -0.4
    HOME_OFFSET = 5.125
    HOME = 5.0
    
  • Mis-wiring a CAT5 Connector

    Mis-wired CAT5 connector
    Mis-wired CAT5 connector

    What’s wrong with this picture?

    Yeah, the blue-stripe and green-stripe wires should be interchanged. Turns out the Link indicators on both ends lit up just fine, but no bits made it across the wire. Took quite a while to figure that one out, alas.

    Turns out I was moving that router upstairs to get a better signal for folks out in the driveway and snaking the cable through the only suitable (i.e., existing) hole in the floor required cutting the molded-in-place connector off, then crimping a new one on. Both you and I know those wires must cross, but in the excitement of pushing all those wires into the connector, well … so it goes.

    A useful explanation, including crossover and POE cable arrangements, lives there.

    I did wrap silicone tape around the cable and connector butt for strain relief.

    Memo to Self: just verifying the colors on the existing cable sometimes isn’t good enough!

  • NIC Backpanel Shortening

    Actually, that NIC didn’t slip right into place, because its backpanel plate was sized for a full-height PC case. Unlike the cheap stamped steel you find these days, NetGear used much thicker metal that required an attack with the bandsaw, a hammer, and some files to clean up the raw edges.

    But it fit pretty well after all that:

    Shortened NIC backplate
    Shortened NIC backplate

    You can just barely see the NetGear logo wrapped around the right-angle bend…

  • Upstart vs. rc.local

    In the process of figuring out how to set up the isolated WiFi Internet link on the file server, I discovered that the /etc/rc.local file runs before the eth0 interface that connects to the outside world comes up. As a result, my DynDNS host address hadn’t been updated in quite some time.

    Worse, trying to set up eth1 failed, apparently because there’s a bunch of other network infrastructure that doesn’t start until eth0 comes online. Part of that infrastructure involves iptables; the added rules simply vanished.

    The solution seems to require writing an upstart script that waits for whatever events it needs, does what needs to be done, and then goes away. The whole upstart mechanism and its event list seems, um, lightly documented, as I discovered there, but the custom setup formerly in /etc/rc.local now lives in /etc/init/local.conf:

    description "Stuff that used to be in /etc/rc.local"
    author "Ed Nisley - KE4ZNU"
    
    start on (local-filesystems and net-device-up IFACE=eth0)
    stop on shutdown
    
    script
    
    logger Starting local init...
    
    logger Updating dyndns
    ddclient -force
    
    logger Bringing up eth1
    ifconfig eth1 192.168.3.1 netmask 255.255.255.0 up
    
    logger Setting iptables
    iptables -A FORWARD -i eth1 --destination 192.168.0.0/16 -j REJECT
    iptables -A INPUT -i eth1 --destination 192.168.0.0/16 -j REJECT
    iptables -A POSTROUTING -t nat -j MASQUERADE
    
    logger Ending local init
    
    end script
    

    That code assumes the outbound network interface will be eth0, which won’t work on a system using a pure wireless connection on, say, wlan0 or anything more exotic. I haven’t a clue how to parameterize that selection. Most likely, one would write another upstart script that would emit a custom signal based on the usual suspect …

    It also assumes the networking infrastructure triggered by eth0 lighting up has hauled itself to its feet and is ready to roll. That seems to be true, although I’ll admit the script is, at best, lightly tested.

    With the eth1 NIC up and iptables rules added, I think this script will restart eth1 when it goes down, but it’s not clear where the requisite network-device-down event comes from (certainly not from any script in /etc/init/*conf):

    description "Restart eth1 when it dies"
    author "Ed Nisley - KE4ZNU"
    
    start on net-device-down IFACE=eth1
    stop on net-device-up IFACE=eth1
    
    script
    
    logger Restarting eth1...
    ifconfig eth1 192.168.3.1 netmask 255.255.255.0 up
    
    logger Ending eth1 setup
    
    end script
    

    But, eh, at least the isolated interface comes up and packets go where they should (and not where they shouldn’t). Early results are encouraging…