Final medals for 2016 Rio Olympiad

I watch very little television these days.  Besides having better things to do with my life, there are several reasons, among which are the fact that the prime-time sitcoms and shows have become so inane, raunchy and uninteresting.  Another reason is that there’s very little left worth watching on free TV.  Nearly all the sports, save the NFL, have moved to Pay TV, which I refuse to pay for and set up.  I just have a very hard time paying for something I used to get free, particularly when Pay TV is just as larded up with commercials as free TV (When I was younger and cable (only) channels first came out they were commercial-free!)  Also, when was the last time you saw a good movie or miniseries made for TV?  I believe TV has indeed become a “vast wasteland.” There is one time though that I do take in some serious TV watching, and that is the Olympics!  I know many of you youngsters won’t grasp this, but for me, it’s always been like binge-watching the classic “ABC’s Wide World of Sports” (ABC’s WWOS crew USED to cover the Olympics and always did an excellent job).  NBC’s Rio coverage did take a lot of criticism, but in my opinion, they did a pretty good job of covering it.  They covered all the main sports I was interested in and had the right mixture of “puff pieces” interspersed with actual event coverage, interviews and stories with key athletes.  My favorite things to watch are track and field, swimming, beach volleyball and women’s gymnastics, which were all covered very well.  Of course, I would like to see a little Badminton, but I understand why they wouldn’t bother with that, however, it’d been nice to have seen a little more soccer and basketball in place of some of the volleyball and water polo.  My only other complaint is the fact that they spent half their time playing the same half-dozen sappy, cheesy commercials ad nauseam.  Olympic commercials should be like super-bowl commercials, considering what advertisers have to pay for Olympic airtime, especially if they’re going to run over and over again!  Despite this, I can understand that NBC didn’t have much choice considering the billion$ they had to pay for the rights to broadcast the games, so I can’t really fault NBC for the mass-commercialization necessary to do the broadcast.  Unlike past olympiads, I forwent awarding medals for commercials, since none of them were particularly interesting, with honorable mention to AT&T for the lone exception of the internet service commercial with the frustrated guy who’s internet service is down desparately firing a flair gun out the window while yelling to the sky “WE’RE OVER HERE, INTERNET!”  So, overall I give NBC a silver medal for their quality and professional Olympic coverage, especially for us old farts with slow, crappy U.S. internet services for whom trying to stream things from the internet is just not nearly as good as watching on the ol’ big screen high-def. TV!

I thought Rio and Brazil did a bronze medal job of hosting the games, especially for a second/third world country in rather dire economic straits (except for the inability to timely provide a clean diving well).  I thought the games went very smoothly except for the requisite “ugly Americans” episode at a local Rio gas station.  There were very few controversies involving the competitions, officiating, and judging (except for boxing), which I felt were professional and well done.  One thing I would consider changing would be the false start rules in track.  I understand the reason for DQ-ing a false starter is to prevent repeated false starts which can result for pulled muscle injuries for athletes, but I think that an immediate DQ after four years of full-time hard work is just a little harsh.  My proposal would be to assess something like a one meter penalty in the runner’s starting position, maybe, or adding a time penalty based on a percentage of the world-record time for the particular event.  This would also work in swimming and would strongly discourage false starting, but still allow an athlete to participate.  It should also more than compensate for any possible advantage the athlete would have gained from the false start while still preventing the need to do repeat starts and completely crush an athlete’s dream for what often is just an inadvertent flinch.

Pierre de Coubertin MedalNikki Hamblin (New Zealand) encourages Abbey D’Agostino
“Nikki Hamblin (New Zealand) encourages Abbey D’Agostino”
Photo (2016) by -unknown-
I really felt for American 5k runner Abbey D’Agostino and New Zealand’s Nikki Hamblin who tripped over each other in a qualifying heat.  I was planning to award them the Pierre de Coubertin medal myself, but the IOC did the right and awesome thing beating me to it!  They also qualified both through to the final, but D’Agostino was unable to compete in the final due to the torn ACL injury she sustained in the collision.  Read more!

I felt really bad for, but also angry with the US. 4×100 sprint relay team.  This is like the third or fourth Olympics in a row they have failed to turn in a valid time in this race!  We used to OWN this event!  WHY can’t they practice teamwork in handing off the baton a little more during four years of training?  On the other hand, I thought the DQ this time was simply a little ticky-tack.  I know that “inconclusive replays” generally can not overturn “the call on the field”, but when the call involves the question of whether or not a rule was violated (as opposed to whether a score or other athletic goal was achieved), the rule of “innocent until proven guilty” should prevail and (as in this case), since the replay was inconclusive that the hand-off actually took place “outside the zone” the call should’ve been overturned and the hand-off allowed as legal.  To be DQ’d, the replay should’ve had to shown conclusively that it was illegal, especially since it could’ve had zero impact on the race time or upon any other team. 

I was very impressed with the US team’s improved performance in distance running (being a miler and distance runner myself back in the day)!  To see Matthew Centromites win Gold in the Mile (1500m) was really sweet with a time of 3′:50.0″, and then to also see Ashton Eaton become the “worlds greatest athlete” by running away with the gold in the Decathlon!  Then Evan Joger and Paul Chelino took silver in the steeple chase and 5k respectively and Galen Rupp grabbed the bronze in the Marathon finally overcoming the long history of Kenyan dominance in distance running.  In addition we dominated the relays (the men’s 4×100 excepted) by piling up even more gold.  US women dominated the sprints and also won field events and the triathlon too!

Overall, it was an outstanding Olympics for the U.S. AND Texas too!  The U.S. swept the “Medaling Events” taking gold in both “Gold Medaling” and “Overall Medaling” with 46 gold, 37 silver, 38 bronze, 121 total medals.  In “Overall Medaling”, China took silver with 26 gold, 18, silver, 26 bronze, 70 total, and Great Britain took bronze with 27 gold, 23 silver, 17 bronze, 67 total.  In “Gold Medaling”, Great Britain took silver with 27 and our “Republic of Texas” – YES! – Texas, our TEXAS tied with China, the most populous nation on Earth for bronze with 26 gold medals!  The home team of Brazil fared well for their size with 7 gold, 6 silver, and 6 bronze for nineteen medals, including the coveted men’s soccer and both team and beach volleyball medals.  It was also cool to see the tiny country of Fiji win gold in 7-man Rugby too!  Overall 54 countries had at least one gold medal athlete or team to celebrate and 78 had athletes or teams bring home at least one Olympic medal!  America’s Matt Kuchar took bronze in Olympic Golf.  It was sad to see Jordan Spieth awol fearing Zika though.  I bet he wishes now that he’d shown up and played! 

Mutley with Medals
(©) Hanna Barbera
And now the event y’all been waiting for, per tradition, it’s time for me to award the final three Olympic medals for this Olympiad to several very distinguished and deserving athletes:

Oksana Chuchovitina, 2016 Olympic Vault
by (© 2016) FIG Channel via marca
1) The “Iron Medal” (for sheer grit, determination, exceptional effort, overcoming long odds, good bull, etc.) goes to Forty-one-year-old Uzbekistan gymnast Oksana Chusovitina! She made history by qualifying for her SEVENTH Olympics in gymnastics, as the oldest qualifying female gymnist. She also attempted the “Produnova”, which many have deemed the “Vault of Death” due to it’s risk and difficulty. She clinched the medal by landing it in perfect tumbling fashon unscathed!

Shaunae Miller Dives for Olympic Gold
Photo by (© 2016) Adrian Davis, Getty Images
Honorable mentions go to Mike Phelps for being able to continue to own the Olympic Swimming Podium for 5 olympiads spanning over 16 years winning 5 golds and 2 silvers at the ripe old age (for a swimmer) of 31 (28, 23 gold lifetime) and now having more medals than Mutley; and Shaunae Miller (Bahammas, women’s 400m) literally diving for gold to edge out favored Allyson Felix (US) at the line sacraficing the skin on her hands, elboes and knees showing literally “true grit” on the track!

Wooden Medal
by (©) Clara & Macy
DQ (Dairy Queen) Grill and Chill
“DQ (Dairy Queen) Grill and Chill”
Photo by (©) Bryanna LeBron,
Confessions Of A DQ Employee
2) The “Wooden Medal” (for underwhelming underperformance, bad luck, lack of preparation, embarassment, bad bull, bad juju, and otherwise snatching defeat from the jaws of victory, etc.) goes equally to Ryan Lockne, Jack Conger and Jimmy Feigen (US Swimming) and to the US 4×100 sprint relay team of Justin Gatlin, Rodgers, Tyson Gay and anchor Trayvon Bromell. The swimmers for lying and making general arses of themselves, in their OOP (out of pool) antics. The relay team gets it for ongoing total lack of preparation in baton-passing, since this is the 3rd Olympics they have foobarred. I caught up with them at a nearby DQ chilling out while wolfing down “Blizzards” (ice cream) and “Hungerbusters” (burgers), to award them their well-earned medals! They said that that had become a post-meet tradition for them.

Hope Solo and Chewbacca
“Hope Solo and Chewbacca”
by (© 2016) me; from:
Hope Solo photo by (© 2016) AP Photo/Eugenio Savio
Chewbacca photo by (© 2010) Christian Liendo
3) The “Plastic Medal” (for sore losers, and other unsportsmanlike and embarassing behavior): Co-winners: Hope Solo (US Soccer) for calling the Lady Swedes “Cowards” b/c they found a strategy for beating her team and Islam El Shehaby (Egyptian Judoka wrestler) for refusing to shake his Isralite opponant’s hand after losing a match to him. A big hairy dude going by the name of “Chewbacca” agreed to present Hope Solo with her medal while Iran’s President Hassan Rouhani gladly stepped forward to present El Shehaby with his honors! The two shook hands afterwards in a show of unity, good will and (Muslim) brotherhood.

Congratulations to these fine Olympic athletes for accomplishing what few athletes ever do:  winning an Olympic medal!  H. Solo and Chewbacca were kind enough to pose for me after the ceremony! Chewbacca insisted on posing, but Solo tried at the last moment to block my shot with her free hand, but was too late!

TBT – My Favorite ’80s Software (WinDOS and PC-Write)

MS-DOS Executive Main Screen
MicroSoft Windows “MS-DOS Executive” main window (courtesy Wikipedia)
Today, I decided to take a walk down memory lane and dust off one of my oldest and favorite programs that I wrote back in the late ’80s:  “WinDOS(tm)”.  This was my first semi-graphical application and my first “file-manager”.  This was during the heady days of MS-DOS.  Children, if you don’t know what MS-DOS was, ask your folks!  At that time, Windows was new and at version 3.  There was no internet, very little graphical software for personal computers (Windows was coming onto the scene to change all of that forever though)!  My computers at the time (at home and at work) were still running “MS-DOS 5” and few had Windows, which (as Windows always does) required purchacing new, beefier (and pricier) hardware.  There were one or two computers at work that had Windows and so I got to play around a bit with it, but the interface was clunky and different and I was still USED to working in DOS which involved working a lot from the command line (what was known then as the “C> Prompt”)!  Meanwhile, Windows had this interesting little “app” called “MS-DOS Executive“, which was their early attempt at what we would now call a “file manager”.  I liked the new “mouse-based” interface that Windows offered.  In my daily workflow I found myself as a software developer often repeating a handful of commands with different files, ie. “Copy, Edit, Compile, Link, and Execute”, etc.  I looked at MS-DOS Executive to make this simpler, but alas, it didn’t really seem to work at all the way I was used to in DOS and besides, it was only for Windows, and I couldn’t afford Windows anyway, nor had it at work.
WinDOS Main Screen
WinDOS “WinDOS Executive” main screen
I wanted something similar for MS-DOS, something that would allow me to select a command (or “.BAT” script), select a file (or more than one file for commands like COPY) with a mouse, and click and run.  I also wanted to be able to do the same with the keyboard when my hand wasn’t on the mouse, and be able to click once on a list of the last dozen or so commands I had just executed to repeat them (or make a slight edit to one and run it again).  There was a cool program called “Norton Commander” (now the free “Midnight Commander” for Windows and Linux) which provided this capability, but it (like nearly all software applications and utilities at the time) cost money!  I was already writing some programs at home using the “Modula II” language and the $89 Logitech Modula II compiler (Yes, boys and girls, Logitech USED to make software back in the day, not just mice and keyboards!) for personal computers and MS-DOS!  So (being me) I decided to write my own program for MS-DOS and call it “WinDOS” (a combination of Windows and DOS, sort of a “poor man’s version of MS-Windows”).  I even patterned the main screen to look something like Windows’ “MS-DOS Executive” window but instead captioned “WinDOS Executive” and including the date and time and a “C> Prompt” for quick-typing and editing DOS commands (when my hand was on the keyboard).  WinDOS permitted me to greatly automate my workflow using a mouse to launch commands and programs while still providing enhanced keyboard-editing and entry of DOS commands!  MS-DOS Executive provided customized “.PIF” files as an early version of file/mime type associations and I quickly found myself needing something similar so I created text-based “.CIF” files (Command Information Files) to handle that in WinDOS, for example COPY.CIF configured WinDOS to prompt for TWO arguments for the COPY command.  I also created a “GUI” for creating and editing “CIF” files and an “installer” program and made it available as share-ware (open-source) and installable from a single floppy-drive!  One interesting programming feature was that I wrote WinDOS with an executable and a looping batch script to invoke it so that when the user executed a command, the WinDOS executable would exit freeing up nearly all of the 640K of system memory to run the program, then restart the WinDOS executable after the command finished.  This freed a lot of memory without noticably sacrificing speed.  My effort was not in vain as WinDOS quickly became one of my most-used programs for several years (along with the shareware / open-source editor “PC-Write(tm)”, which I also ended up purchasing the paid version because I loved and used it so much) until I finally moved my world to Linux in the mid ’90s (I pretty much skipped Windows all together)!  Heck, I even had several coworkers using WinDOS on their machines too!
Now that I’ve been on Linux for nearly twenty years now, I’ve long since developed my own file-manager (since I couldn’t find one that I liked) that incorporates the same basic principles as WinDOS, but also all the modern features one would want in a file-manager.  This is “JFM4“.  You can get it and see a screenshot on my download site.

Spiral-bound PC-Write(tm) Users’ Manual
PC-Write(tm)“, by Quicksoft (Bob Wallace and his wife Megan Dana) was my other fav. app. in my MS-DOS years as it provided a very nice and customizable full-screen (and full-color) text editor that was great for editing program source-files and writing letters, etc.  It was both a good code-editor and (for the time) a full-featured auto and manual-formatting word-processor, and it was free and shareware, and fit on a single floppy disk, so I could carry it anywhere with me!  I liked and used it so much, I ponied up the $69 (I believe) for the “fully-registered” (paid) version for which Quicksoft sent me a fully spiral-bound 426 page plus index manual (fully written and illustrated in PC-Write itself by Bob’s wife Megan Dana, seen on the cover), a free one-year subscription to their (paper) newsletter “Quicknotes”) and two free update coupons!

I got more than my money’s worth out of this program too using it for all my code development and word-processing needs for nearly ten years until I switched from DOS to Linux.  I wrote a full customization file (text file) with the colors and keyboard sequences all set the way I wanted to facilitate my work in the ways most natural to me.  After moving to Linux, I ended up writing my own full-color text editor named “E Editor” taking many ideas from this one and adding language-specific syntax-colorizaton, code-evaluation, and quick-compile that I still use today and you can get it (and JFM4) here from my download site for Windows and Linux.  “E” is not a full-blown word-processor though (I use LibreOffice for that).

PC-Write(tm) Intro screen
PC-Write(tm) Intro screen
PC-Write(tm) Editer screen
PC-Write(tm) Editer screen (editing an ancient FORTRAN program)

Fauxdacious For Windows (with executable installer) Released!

I’m happy to announce my latest release of the Fauxdacious Media Player (version 3.83-final) with a full-functioning Windows version complete and bundled with a simple to use executable installer program created using the free and open Inno Setup Wizard!    (Get it Here:  If you’re not familar with Audacious / Fauxdacious, it’s an audio and (with Fauxdacious) video player for both Linux/Unix and Windows.  Why use Fauxdacious instead of another video player?  With Fauxdacious, you also get one of the best audio player engines with many audiophile-ish sound-enhancing plug-ins!  Another reason is that unlike most Windows-based media players, Fauxdacious and Audacious are fully free and open-source programs with no binary blobs for malware to hide in!  One feature of interest to many Windows users is the option to use the classic “WinAmp Skins” interface, which uses the same “skins” as the old Windows “WinAmp” media player (see the bottom screenshot).  The default interface is the more modern-looking “GTK” interface, but it’s easily switchable to the WinAmp interface in [File].[Settings].(Appearance): Interface plug-in: and change the dropdown menu, then select your “skin”.  To turn on the video-playing option, simply select [Settings].[Plugins].[Input tab].[x] FFmpeg Plugin, then [Settings button] and check the box: “[x] Play video streams in popup window…”.
I understand the Audacious Team has now also created an installable version of their Windows version for v3.8.  This closes Audacious-rejected feature request #613.  This culminates nearly three weeks of hard work to build this thing for Windows.  I had held off doing this until I had a new machine with a huge hard disk that I could dedicate plenty of space for the Windows 7 partition in order to accomodate downloading the MingGW C++ compiler and compiling and installing all the three dozen or so libraries needed to compile this thing from scratch on Windows.  Thanks to the Audacious Team’s detailed and concise instructions for building on Windows, I was able to do this with only a few minor glitches (all now resolved).  For the brave techies, the gory build instruction details (including the issues I encountered and corrected) are included in the “Fauxdacious/share/” directory (fauxdacious_buildnotes.htm) created by the installer when you install (or the audacious/contrib/win32/notes.html file in the source tarballs, downloadable separately from the same site).
UPDATE (7/1/17):  Version 3.83-beta3 Released (Final 3.83 version – minor bugfixes)
UPDATE (6/5/17):  Version 3.83-beta3 Released (Adds DVD-Player Plugin!)
UPDATE (3/18/17):  Version 3.83-beta1 Released
UPDATE (3/8/17):  Version 3.82-final Released
UPDATE (2/16/17):  Version 3.82-beta2 Released
UPDATE (1/31/17):  Version 3.81-final Released!
Fauxdacious Installer
Fauxdacious Initial Setup Screen – Inno Setup Wizard
Fauxdacious Screenshot
Screenshot of Faudacious playing a video and using the default WinAmp skin with the main, playlist, and equalizer windows all displayed.
UPDATE (11/16):  Version 3.8-final Released.
UPDATE (10/25):  Version 3.8-beta1 Released.
UPDATE (5/31):  Version 3.74-beta2 Released.  Added the Inno Setup build file (Fauxdacious.iss) to the share directory.  If you don’t trust me fearing that I might’ve put any malware (I didn’t!) in Faudacious, you can download the full source and build instructions to examine and or re-build it yourself!

Make Special HP Laptop Touchpad Toggle Key Work In Linux

I recently purchased a new (refurbished) HP “Elitebook” 8440p laptop (see previous blog post) and docking station, and installed my custom “remastered” copy of Antix Linux!  Before buying, I had tried out my remastered Antix live-DVD on my wife’s laptop (same model with lower resolution screen) and everything basic seemed to check out.  As I expected, this laptop has proved to be a great laptop for Linux but I’ve been somewhat surprised at the number of additional (and difficult) issues/hacks I’ve had to resolve/make to my (already very customized) remastered linux installation.  In my previous post I described the nightmare I went through getting Linux to boot with Windows 7, though this is not at all a fault of the computer or it’s hardware, but rather owing to the way Windows 7 was partitioned and installed.  Another hack / workaround I ended up having to make (after another extended, but fruitless search) was downgrading my “AccelMethod” from “SNA” back to “UXA” in my /etc/11/xorg.conf file to stop screen corruption and lockup when exiting X without having to add a “chvt 1; sleep 2” sequence to each logout/exit/reboot command script in the window-manager, and disabling the “Ctrl-Alt-Backspace” command.  Switching to “UXA” eliminated the need for these workarounds (after I tried everything else I could come up with).  This machine has a LATER version of Intel graphics (Mesa DRI Intel Ironlake Mobile x86/MMX/SSE2).  The tradeoff is a slight reduction in video performance from up to 2000 fps to around 1700 or so, only really noticeable by running glxgears (My Dell never broke above 900 fps, but WORKED flawlessly with SNA!).
The hardware was very similar (driver-wise) to that of my old Dell D620, but more modern (Intel CPU, Intel integrated graphics, sound, and network interfaces).  The first issue that needed tweaking was to activate all the custom special-function keys.  Nearly all laptops have them and they all seem to be different not only between brands, but also between models.  I had long ago gotten the Dell’s all working using a now rather old program called “hotkeys”, however, I had not used them in ages since my Dell has not had a working battery since forever, and I’ve been using it almost exclusively docked (and the lid closed).  I’ve found that hotkeys seems to not work well anymore due to trouble staying up between suspends, etc.  I began looking for a better solution and found “xbindkeys”. This program also includes a GUI which permits you to actually press each key and then add your desired action command and builds the config. file for you!  This strategy proved successful for all the special keys, including the little “led” light-up ones above the keyboard that look more like status indicators than press-able keys.  The only ones not configurable via xbindkeys were the “wifi switch” led/key and the “touchpad toggle” led/key.


     "/usr/bin/amixer -q set Master 4- unmute"
         m:0x0 + c:122

     "/usr/bin/amixer -q set Master 4+ unmute"
         m:0x0 + c:123

     "/usr/bin/amixer -q set Master toggle"
         m:0x0 + c:121

     "sudo /usr/local/bin/"
         m:0x0 + c:235

         m:0x0 + c:180

         m:0x0 + c:160

     "/usr/local/bin/ -60"
         m:0x0 + c:232

     "/usr/local/bin/ 60"
         m:0x0 + c:233

         m:0x0 + c:248

     "sudo /usr/local/bin/s2ram"
         m:0x0 + c:150

The wifi key “works” in that it uses rfkill to toggle the wifi.  For most people, this will probably work fine out of the box, but I configure my networks manually, and need for the wifi to go off (and ethernet to come on) when docking so that my home network comes up on the ethernet connection (I needed to be able to execute a custom script whenever this key was pressed).  I ended up getting this key working by adding an ACPI event and script (see below).

     event=PNP0C14:01 00000080 00000000

In Linux Live-CD:


     event=PNP0C14:01 00000080 00000000

     test -f /usr/share/acpi-support/key-constants || exit 0

     . /usr/share/acpi-support/key-constants

     wifiblocked=`rfkill list wifi|grep "yes"`
     if [ "X$wifiblocked" = "X" ]; then
         echo "..WIFI BUTTON PRESSED: wifi not blocked!" >>/tmp/acpi.dbg
         echo "..WIFI BUTTON PRESSED: wifi BLOCKED!" >>/tmp/acpi.dbg

HP Touchpad Toggle Led/KeyI got all the special HP light-up buttons above the keyboard working with xbindkeys EXCEPT the one that looks like a tiny touchpad, that’s supposed to toggle the touchpad.  That little bugger just did not want to work, not even in Windows-7?!  The “touchpad toggle” led/key lights up cyan on startup and the touchpad is enabled.  Pressing it turns it orange and (should) disable the touchpad. Touching again turns it back to cyan (should re-enable touchpad).  In reality, it does nothing but change color when pressed.  X does not see it except the very first time it’s pressed, in which case xev sees a continuous spewing of keypresses and releases of keycode 138 killable by pressing Ctrl-C.  dmesg reveals that the kernel sees the alternate press as unassigned scancode “e058”.  Subsequent presses produce nothing visible to X until you reboot.  I tried adding the setkeycodes command the kernel suggested, googled and googled and could not find anything that would make this key visible to X. The console program showkey would show it alternately returning keycode 138 and keycode 140 (the one I assigned with setkeycodes) as I wanted, but for some reason nothing in X could see anything when the key was pressed.  Obviously, the key was seen by the kernel.  Several google pages described how to “translate” these kernel keycodes to X, including xmodmap, but nothing worked.
It was not like this particular key was very important to me, but at this point it had just become a determined challenge to force it to work!  I finally stumbled upon a tiny C program that could monitor the keyboard input device and report each key pressed.  I ended up modifying this program to look for these two keycodes and calling a command whenever one was seen.  I then set this program up as a tiny daemon so that I can now press the key and toggle the state of the touchpad!  Why?  Because I could and because I had already wasted too much time trying to figure this out!  😀
I finally found, stole and hacked up a tiny daemon C program that DOES make it work!  You need to do the following:
1)  in rc.local or somewhere in startup scripts add: /usr/bin/setkeycodes e058 140
2)  compile this little C program “keycheckd” (gcc -o keycheckd keycheckd.c) and place the compiled binary in /usr/local/bin/, and chown 4755 keycheckd
3)  In your X desktop session’s startup script do (must be started from w/n X desktop, NOT startup or console!):

     xset -r 138 -r 140 -r 146 -r 148
     keycheckPid=`pidof keycheckd`
     [[ "X$keycheckPid" == "X" ]] && /usr/bin/nice -n 10 /usr/local/bin/keycheckd &

The source (keycheckd.c) (note: you could add other keysyms / actions, if needed):

#include <stdlib.h>>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/input.h>
#include <string.h>
#include <stdio.h>


int main(void) {
    const char *dev = "/dev/input/event0"; /* or whatever your keyboard input is */
    struct input_event ev;
    ssize_t n;
    int fd;

    fd = open(dev, O_RDONLY);
    if (fd == -1) {
        fprintf(stderr, "Cannot open %s: %s.\n", dev, strerror(errno));
        return EXIT_FAILURE;
    while (1) {
        n = read(fd, &ev, sizeof ev);
        if (n == (ssize_t)-1) {
            if (errno == EINTR)
        } else
        if (n != sizeof ev) {
            errno = EIO;
        if (ev.type == EV_KEY && ev.value >= 0 && ev.value <= 2) {
            /* printf("0x%04x (%d)\n", (int)ev.code, (int)ev.code); */
            if ((int)ev.code == 138) {
                /* TURN ON TOUCHPAD: */
                /* printf("--138: turn touchpad ON!\n"); */
                system ("/usr/bin/synclient TouchpadOff=0");
            } else if ((int)ev.code == 140) {
                /* TURN OFF TOUCHPAD: */
                /* printf("--140: turn touchpad off!\n"); */
                system ("/usr/bin/synclient TouchpadOff=1");
    fprintf(stderr, "%s.\n", strerror(errno));
    return 0;

Now, when you press this “key”, it should turn orange and actually disable your touchpad, a second press should turn it back blue and re-enable your touchpad.  I believe you could add the “/usr/bin/synclient TouchpadOff=1” in your X session startup script above where you start this daemon, and reverse the two “TouchpadOff=#” commands in it to have it start out disabled, then toggle to enabled, then disabled, etc.

Gettin’ Down & Grubby with Grub!

Last week I broke down and bought myself a shiny new (refurbished) an HP “Elitebook” 8440p lappy! 😀  It’s been ten long years or so since my last computer purchase (also a corporate refurb).  My way is to buy a good used one from a generation or two back, put Linux on it and have a faster machine than most brand new ones whilst saving a ton of money.  My last one’s been great as a docked desktop paired w/a big monitor, but has become a very crappy laptop that runs hot, has no working battery, and the hinge won’t hold the lid up anymore.  Portability issues aside, it still performs very well, especially for its age.  I’ve even been complemented on how snappy it is, considering it’s age.
This “new” lappy came with a huge, terrabyte SCSI hard drive (the good ol’ fashioned spinning kind, which I prefer) loaded with a fresh install of Windows-7 Professional 64 bit to complement it’s eight gig of RAM.  I ended up shopping longer and paying a tad more in order to nail down one of the (apparently rare) ones that has the higher-resolution (HD+) screen sporting 1600×900 resolution (most come w/a crappy 1366×750 screen) combined w/the non-dedicated integrated Intel graphics.  The reason I wanted Intel graphics is that it’s no hassle to get to work well with Linux, runs cooler, and yields longer battery life than the Nvidia dedicated version.  The box arrived from Odyssey Computers via Amazon with free shipping in three days!  It contained a nice, shiny clean new-looking computer and 65 watt HP power supply wrapped in a generous supply of bubble wrap.  I plugged it in, opened the lid, turned it on and was greeted with Windows-7’s “First Use” screen.  I read the eula, signed over my first born to lifetime servitude to Bill Gates Inc., created an abUser account, and set it up. I confirmed the graphics, screen, hard drive, and RAM quickly through Windows’ Device Manager.  One fear that I had was that Windows would be set to boot under UEFI, making my task much more difficult, but I poked around in the bios and determined that, thank goodness, that was not the case.
Now, on to the Linux setup!  I remastered my current Antix Linux setup using Antix’s unique and very cool “snapshot” tool onto a DVD, inserted it and booted it right up.  First order of business was to run gparted and determine the partition layout for Windows.  This revealed three existing NTFS partitions: a 12 gig “Recovery”, a 150 meg “SYSTEM”, and the remaining 919 gig “Windows” (C:).  This meant we had the fourth and final partition slot available for creating an extended partition and filling it with logical partitions to our hearts content for Linux!  I then proceeded to create the extended partition and added logical Linux partitions for root, var, swap, and home in that order.  It’s fully ok and preferable (to avoid tiny slices of unusable disk space) to select “Alignment: None” for each one as you create it.
This is where the good ended and the bad began: ALL three were NTFS (INCLUDING the first) AND, the SECOND (NOT the first) one was marked as the “boot” partition.  This meant NO installing Grub boot-loader in the MBR (The normal location) and most likely having to modify the Windows boot-loader to launch Grub and Linux from the Linux “root” partition we would create.  Still no biggie, right? (WRONG!)  Fortunately for me, I started googling around BEFORE I attempted an install and found out that this might be a bit more difficult (little did I know yet!).  I had installed Antix once before on another Windows-7 machine with only a couple of minor hiccups involving Windows booting via “chainloading”, but that one was set up the “normal/proper” way with a FAT32 partition at the beginning for booting (just put Grub in MBR, add “hide/chainloader” entries for Win-7 and I was good to go).  I quickly learnt that GRUB would not play nice if put into an NTFS partition.  I also became acquainted with an obscure Windows program called bcdedit.  I went ahead and played with that and successfully added a second entry in the boot menu for Linux.  I then cautiously created all my Linux partitions using gparted and installed Antix. Then I carefully created the special “antix.bin” file and gently placed it into the Window’s C:\ directory as instructed in my research and rebooted.  I was quickly greeted again with my Windows boot menu containing two entries:  “Windows” and “Antix”.  I selected “Antix” and…BLACK SCREEN.  Tried again with “Windows”, Windows booted up as normal.  Oooo-kaaaay, back to Google . I then learnt that Grub Legacy (the version I use since I’ve found Grub 2 very hard to configure with a labyrinth of separate configuration files) also doesn’t play nice if installed into an ext4 partition (unless it’s the MBR/boot partition (hd0,0)).  So, rinse, spit, repeat – this time, tried making the root partition ext2 (ugh!)  This likewise did not work because, come to later find out, the Windows-7 boot loader does not like to talk to ext2 filesystems, even just to boot.  Then came a full twenty-four hour haze of gory details of experimentation that I won’t bore you with here, with little to show for it.  As a last resort, I ended up creating a separate 1 gig FAT32 “boot” partition and with a lot of kicking and screaming from Grub, I finally got it installed there and a working 512 byte “antix.bin” file in the Windows “boot” partition (not C:\) and was able to boot “manually” (It would boot to a cold bare “GRUB>” prompt (when “Antix” was selected), where I could type in a partition identifier (hd0,4), then a kernel line (see menu.lst), then an initrd line, and boot. More googling and T&E revealed that I could just type “configfile /grub/menu.lst” and boot right in. Still more led to making copies of everything in /boot/grub/ to /boot/boot/grub/ (guess we need two matching boots, LOL), and finally, VALA, Linux nirvana!
Lessons learned:
1)  To install Grub in a separate partition (other than the first in the MBR) and be accessible by the Windows-7 boot-loader, one needs to create a separate FAT32 partition and mount it in Linux as “/boot”.
2)  To create the “linux.bin” (I chose “antix.bin”) file for the Window boot-loader, you must first coax Grub into installing it in said FAT32 partition and then use the dd command to grab the first 512 bytes of THAT partition writing it to that file (antix.bin in the root directory of /dev/sda2).
3)  Grub Legacy expects to find it’s “menu.lst” file in /boot/grub/ off of THAT partition (/dev/sda5 or (hd0,4) in my case) even though Linux will have to mount that partition as /boot off of it’s (Linux’s) root (/dev/sda6) and will, along with “update-grub”, expect to find it, along with the other grub stuff in /boot/grub/ off of Linux’s root (/grub in the /boot partition).  Therefore, you must create a “/boot/boot/grub/” subdirectory (off of Linux root – when Linux is booted up) and copy everything in /boot/grub/* to there.  The logical thing to do would be to move it there and create a symlink (cd /boot; ln -s boot/grub grub), but this WON’T WORK because this is all in a FAT32 partition, a rickity old filesystem from the MS-DOS era, so you must COPY the grub tree. You will also need to update BOTH menu.lst files whenever you do “update-grub” or upgrade your kernel, then make sure both menu.lst files match!  NOTE:  It’s only grub that must be copied, NOT your kernels, etc.  They reside one level up in /boot/.
4)  You really should reinstall your kernel package (at least if installing via Antix remaster’s “cli-installer” installer) after you successfully get booted up, since I ran into a few devices modules missing, etc. as I tested things out.  All were fixed by reinstalling / updating my preferred kernel).
5)  Making a “bootable” USB-stick was a good way to test the bootability of my Linux install, but NOT a good way to configure Grub after booting up with it as the system came up with the USB stick seen as “sda” (the FIRST “hard drive”), and my hard drive as “sdB” (the SECOND) – NOT what neither I nor Grub were expecting, forcing manual typing in the boot entry each time!
6)  Grub Legacy is a total BEEACH when asked to configure itself in any way out of the ordinary as far as partitioning goes.  It really wants to reside in the MBR.  As a biased and unabashed Linux user, I expected Windows-7 to be the problem child in the sandbox, but no, it was grumpy, grubby ol’ Grub that had to be dragged kicking and screaming every step of the way and be absolutely beaten into submission!  All the while, Windows gave me no grief whatsoever nor even sneezed or snickered at me as I struggled and fought with Grub.
Ok, here’s the gory details that worked (NOTE, this is only for other unlucky souls who have a non-UEFI booting Win-7 installed with no FAT32 first partition with the “boot” flag” set and no Windows re-install disks).  Otherwise, IF non-UEFI booting, you can MAYBE, MOST LIKELY install Grub (at your own risk) the usual way in the MBR and (maybe) ignore all this!:

NOTE: THIS ASSUMES THE FOLLOWING PARTITION SETUP (I had the 1st three, shrank the third (using gparted), and created the rest and you’ll need to adjust as needed for yours):

     (hd0,0) /dev/sda1:  NTFS - Windows "Recovery"
     (hd0,1) /dev/sda2:  NTFS - Windows "SYSTEM" (boot flag set!)
     (hd0,2) /dev/sda3:  NTFS - Windows (C:)
     (hd0,3) /dev/sda4:  Extended
     (hd0,4) /dev/sda5:  FAT32 (mount as /boot in Linux)
     (hd0,5) /dev/sda6:  ext4 or any other Linux filesystem (mount as / (root) in Linux)

Boot up in Linux Live-CD:

1)  Use garted to shrink the Windows C: partition (I tried to do this in Windows, but it wouldn’t allow me to shrink it as much as I wanted, since Windows likes to put “immovable” – (to Windows), files in the middle or latter part of the partition) gparted SHOULD handle this without fuss (it did for me).

2)  Create an “extended” partition and then your Linux partitions (First one must be FAT32 and will later be mounted as “/boot” in Linux).  Next should be your Linux “root” (mounted as “/”) and be ext4 (my preference) or any other modern Linux filesystem.  Additional partitions are optional (I like to create ones for “/var”, swap, and “/home” in that order).  With 8 GIG of RAM, I don’t really need a swap, but I created an 8+GIG swap for hibernation perposes (Hibernate is a very useful feature on laptops).

3)  Install your Linux, but do NOT install Grub in the MBR!!!  Instead install it in “root” (Linux’s root directory – /dev/sda6 in my case)!  If you are lucky enough to be installing a distro that gives you Grub install choices OTHER than “MBR” or “root” (I wasn’t), then choose your FAT32 partition!  I had to choose “root” (and the slightly-buggy Antix “cli-installer” did not do THAT quite right either – I looked at the script’s code and it appeared designed for Grub-2 with options that Grub Legacy does not recognize), but at least it did not touch my MBR, thank goodness!.

4)  I had to do the following to get Grub Legacy properly installed:

Boot up (again) into my Antix live-CD and:

     mount /dev/sda6 /mnt
     mkdir /media/boot
     mount /dev/sda5 /media/boot
     mount /dev/sda6 /mnt
     vi /mnt/boot/grub/menu.lst:  #WE NEED TO CHANGE OUR "root"s in "menu.lst" AS SO (root=our Linux root (/), (hd0,4) IS OUR NEW /boot)!  (I use the Liquorix kernel, but you need an Antix kernel for the remaster/install):

         title Liquorix, kernel 4.4-6.dmz.1-liquorix-686
         root (hd0,4)
         kernel /vmlinuz-4.4-6.dmz.1-liquorix-686-pae root=/dev/sda6 quiet nosplash ro
         initrd /initrd.img-4.4-6.dmz.1-liquorix-686

         title Antix, kernel 4.0.5-antix.1-486-smp ro
         root (hd0,4)
         kernel /vmlinuz-4.0.5-antix.1-486-smp root=/dev/sda6 ro
         initrd /initrd.img-4.0.5-antix.1-486-smp

     vi /mnt/etc/fstab:  #THIS NEEDS TO PROPERLY MOUNT /dev/sda5 AS /boot!

         /dev/sda2  /media/Recovery  ntfs-3g noauto,noexec,...
         /dev/sda3  /media/Windows  ntfs-3g noauto,noexec,...
         /dev/sda5  /boot  vfat  defaults,noatime  0 0
         /dev/sda6  /  ext4  defaults,noatime  1 1

     cp -afv /mnt/boot/* /media/boot  #THIS COPIES ALL OUR BOOT STUFF (GRUB & KERNELS TO OUR /boot PARTITION):
     umount /media/boot  #MAKE SURE THIS IS UNMOUNTED!
     #NOTE:  OUR ROOT PARTITION (/dev/sda6) IS MOUNTED, OUR BOOT PARTITION. (/dev/sda5==(hd0,4)) IS *NOT* MOUNTED!
     for i in /sys /proc /run /dev; do mount --bind "$i" "/mnt$i"; done
     update-grub  #SO OUR UPDATED "menu.lst" GETS USED!
         grub>root (hd0,4)
         grub>setup (hd0,4)
     mount /dev/sda2 /media/Windows  #MOUNT OUR WINDOWS "BOOT" PARTITION:
         Boot   bootmgr   System Volume Information
dd if=/dev/sda5 of=/media/Windows/antix.bin bs=512 count=1  #(RE?)CREATE OUR BOOT FILE (antix.bin) FOR WINDOWS BOOT-LOADER:
     cd /mnt/boot
     mount /dev/sda5 /media/boot #/boot DIRECTORY
     cd /media/boot
     mkdir boot
     mkdir boot/grub
     cp -afv grub/* boot/grub  #VERY IMPORTANT: GRUB LEGACY WILL LOOK FOR menu.lst in "/boot/grub/" WHICH IS "/boot/boot/grub/" TO LINUX ROOT!  GRUB2 MAY NOTE NEED THIS?
     umount /media/boot

5)  Now reboot into Windows-7 and do:

Select Start.Accessories menu, then right-click on “Command Prompt” and choose “Run As Administrator”.
In the (admin) DOS window, do:

     bcdedit /export C:\originalbcd  #BACK UP YOUR ORIGINAL! (/import to restore if you should screw it up!)
     bcdedit /create /d "Linux" /Application BOOTSECTOR
     bcdedit /set {ID} device boot
     bcdedit /set {ID} PATH \antix.bin
     bcdedit /displayorder {ID} /addfirst  #THESE TWO WILL MAKE Antix THE FIRST AND DEFAULT ENTRY.
     bcdedit /default {ID}
     bcdedit /export C:\backupbcd  #BACK UP YOUR NEW ONE TOO!

6)  Now reboot and select “Linux” and (hopefully) boot up into your shiny new Antix Linux install!

7)  Re-install or update your kernel package and run “update-grub” – (I installed a PAE version so I could access my 8-GIG of RAM)  I found that the Antix installer did not seem to quite carry over all the kernel modules (my cd-rom disappeared, etc.) and this corrected everything.  I also backed up my “antix.bin” file somewhere on my Linux filesystem too!  (YMMV!!!)

Overall, I’m very pleased with this machine, all hardware seems to work well with Linux (Only thing I haven’t tested is the thumbprint reader).  Googling shows that it can be used in Linux.  The modem’s an Agere “losermodem” (winmodem).  I haven’t purchased a docking station yet).  The Intel Centrino Advanced-N 6200 wifi card needed:  “options iwlwifi bt_coex_active=0 swcrypto=1 11n_disable=8 led_mode=0” in a file I added to /etc/modprobe.d/ to work at proper speed with my 802.11G home wireless network, however.  The computer itself runs fast and fairly cool, and the fan is much quieter than any of the previous machines I’ve owned!  Here’s my /proc/cmdline:  root=/dev/sda6 quiet nosplash cgroup_disable=cpuset,cpu,cpuacct,blkio,memory ipv6.disable=1 libahci.ignore_sss=1 vga=0x365 ro
Links that I found very helpful along the way:

UPDATE:  The WIFI card, an “Intel Centrino Advanced-N 6200” is a bit wonky.  It seems to work find in Linux (no dropped connections, etc.), but there are a couple things I had to do due to the fact that I use a rickity old Linksys WRT54G (11G) router with Tomato firmware installed. Using iwconfig, the wireless card reports a pathetic “Bit Rate=1 Mb/s”. I tried everything I could think of or find to get it to work properly and have given up.  Every once in a while, it’ll come up showing a larger number (once showed 54)!  I’ve since determined that the card seems to be working properly ( shows my internet at the full 6.4 Mb/s on it!), but it’s just REPORTING the wrong value (1).  My final settings are (/etc/modprobe.d/iwlwifi.conf):  “options iwlwifi bt_coex_active=0 swcrypto=1 11n_disable=1 uapsd_disable=1“.  This tells it to ignore any blue-tooth interference, turns on software encryption capability, disables 802.11n service, and turns off an obscure power-saving capability (primary power management is off by default).  I also blacklisted all bluetooth modules (btusb, btintel, btrtl, btbcm, and bluetooth), as I don’t use any bluetooth devices, though if you do, this should not be necessary.  I also had to go into /lib/firmware/ and do:

     sudo ln -s iwlwifi-6000-4.ucode iwlwifi-6000-5.ucode
     sudo ln -s iwlwifi-6000-4.ucode iwlwifi-6000-6.ucode

to eliminate a complaint in dmesg about the kernel not being able to autoload the firmware.  Not doing this did not prevent the card from working, but I didn’t like the error (warning?) and wanted to make sure the correct and best firmware available (6000-4) was being loaded. The 5 and 6 versions do not appear to exist yet!

%d bloggers like this: