Thursday, February 4, 2021

Unix Commands and a Typo: An Example of a Usability Problem

 Not that anyone has ever asked me, but what college course was my favorite to teach in my 8 years in academia, the last 5 as a junior MIS professor?  A Human Factors in IS graduate course I taught at Illinois State as a visiting professor at Illinois State in the fall of 1990. Technically, ISU didn't have an MIS program--they had a hybrid applied computer science department. BB normally taught the class, but I believe she took a sabbatical year off to set up a research lab. The availability of the gig came to my attention from Jane Carey, an Arizona State professor who had organized an annual symposium in human factors I had regular attended during my last few years in academia. At that time, I was one of the few MIS professors with a research interest in human factors/ergonomics.  I have to smile because a lot of people think human factors must be some kind of pop psychology course in interpersonal relationships. I had run into a similar misconceptions years earlier while working on my first Master's (in math); I bought a group theory book, and the bookstore clerk asked me what psychology class I was taking: too cute! (Groups are a topic in abstract algebra.)

I had come across cognitive psychologist Donald Norman's book, The Psychology of Everyday Things (later renamed The Design of...) /One of the things he discussed in his writings was the construct of designing for error. One of his stories I love to retell (and closely related in concept to the issue I described below) involved a word processing machine, before the emergence of today's PC writing software. He noticed that a key to delete a document was next to a carriage return/enter key. He told the vendor in effect this was an accident waiting to happen; he was sure that typists would hit the delete document key by accident. The vendor was in a state of denial and so they went to an experienced typist and Don asked if she ever hit the key by accident. "Oh yes, all the time." The vendor incredulously asked, "Why didn't you ever say anything?" "Because I had ben trained on the key's functionality and figured it was my fault."

A related incident I have often retold I think comes from one of Lynne Markus' books. I often have to struggle to maintain my exposure in saying it without laughing. I think it's an old MIT legend behind the idiom "ir's not a bug, it's a feature". The lab was testing a compiler, and one of the testers forgot to include an END card to his program deck. To their shock, the mistake resulted in unintended consequences, like wiping out memory or tapes. They dutifully reported the problem to the vendor. So after the vendor released the final version, the lab replicated the incident, to ensure the problem had been addressed. To their amazement, the same result happened. Stunned, they went to the documentation and found the following note: "Normally you would have to spend extra money to get a useful erase utility. We include one for FREE! It is also very efficient: you don't have to include a long program deck to achieve the desired effect."

I have worked on Unix/Linux systems since 1994. You normally have a cron scheduled job daemon running in the background. For an enabled user, you schedule a particular script/process to run per line entries of a specified time according to a a certain syntax in a crontab text file.

The salient point is, you normally edit your user crontab through "crontab -e" (and presumably your environment specifies a vi editor, and you edit using commonly known vi operations). I've probably edited crontabs hundreds of times over the years without incident. Now the "e" key is next to the "r" key on your standard QWERTY keyboard layout. Guess what "crontab -r" does?... Oh yes, I did. Do you think you get a warning like, "Are you sure you want to remove all your crontab entries?" Of course not. I accidentally fat-fingered my scheduled jobs.

I had literally dozens of scheduled jobs in my crontab and no local backup of the text file. Fortunately, my Unix system administrator had a backup. And of course the very first thing I did after restoration  was to enter a vi command like :1,$w ~/crontab.bak  .

One of the things you learn in the human factors literature is even experts make mistakes, although at a less frequent basis. You need to plan for human error. I seriously doubt in the future I'll ever modify crontab again without specifically first backing it up in an archive directory.

Sunday, December 13, 2020

Microwave Ovens, The Internet, Automated Attendants, and Bluetooth

Automated Attendants and the Internet

I have a well-known cable/ISP provider. About 3.5 years back when I moved back to Maryland, I ran into too many interruptions in Internet and/or cable issues which could not be explained by infrequent area outages. I recall back then they explained I was experiencing a cable issue, they did some temp fix and promised to replace the (outside) cable. To this day, I'm not sure that ever happened. I seem to recall their original partner to lay down the replacement had some sort of issue, and the provider never followed up. And when I've inquired about it since, the analysts will not comment.

And I've had spotty service issues on and off since then. Now I really don't watch that much TV, mostly things like "Blue Bloods", live football or baseball, maybe some pro wrestling. But over the last 6 months or so, it seemed after the service did its overnight reset, I would lose my connection on the cable cable box probably once or twice a week. It would eventually reconnect, often after I did the recommended provider suggestion of disconnecting the cable box, pausing for 30 seconds, and reconnecting the power; on occasion it took up to hours to get reconnected. The Internet interruptions weren't quite as bad; I have a Google Hub at my living room computer table, which is my canary in the coal mine. I'll catch it in my peripheral vision switching from a screensaver to a screen where it's lost its connection and cycling to reconnect. (The spooky thing is I experienced one of these glitches seconds after writing the above.) Now weather-related outages are longer but rarer.

So I was regularly calling my cable service with its annoying automated attendant system; it's somewhat sophisticated because it can detect issues with signals getting through to my cable box or modem respectively. At least the interface has limited voice recognition, so you don't have a press a digit on your phone, and it's able to recognize me from my registered cellphone number. But if it detects signals having difficulty getting through, it'll prescribe the reboot regimen earlier discussed and/or remind me to check cable connections, etc. And it'll basically drop the call saying that a live support agent couldn't help me until I did the above; you can argue, "Dude, I did that before I called" to no avail. Sometimes it would promise to text/call 10 minutes later (half the time it never happened); other times it might text me after I finally got a connection, saying "I see you're fixed" as if the provider was taking credit for the fix! Usually though I would call back and finally the attendant would let me through to tech support.

About 2-3 months back I got connected to sort of a sales guy rather than a techie, and when I explained the frequency of my issues, he said, "Dude! Let me schedule a technician; this isn't normal." The technician came days later and said, "Dude! Your outside cable sucks! Let me arrange to get it replaced; they'll be in touch." This was back in October. I got one text to ensure someone would be in my apartment when they replaced the cable and then nothing. So for weeks after the cable was supposedly replaced, I continued having the same old issues; I kept saying "What happened to the cable replacement? Nothing's changed." No comment; I can't even get closure if the cable guys ever came. I finally get a commitment for another technician visit and to bring a replacement cable with him.

For some reason some provider manager (?) started calling me and screaming at me about how it was my responsibility for letting the cable guys leave without getting the job done. Seriously, dude? I never saw or talked to them; I never knew if they ever showed up. I never got an installation date; they don't report to me--they report to you. Long story short, the guy arrives and eventually tells me yes they had installed a fresh cable in October, but they had left a filter in an end of the cable; he said when he checked, his instrument showed all red, meaning little if any signal was getting to me. So he extracted the filter. The question is how they finished laying and attaching the cable without checking on signals getting through the cable effectively.

In the few weeks since then, no major interruptions overnight--I think I was up when the daily reset happened last weekend, and the cable reconnected within a minute or two, which I suspect is normal. Since then just a minor temporary glitch or two, which for all I know is some minor area maintenance, as discussed above.

Alexa, Microwave 3 Minutes

I recently tweeted I never imagined 10 years years ago I would be troubleshooting why my microwave oven wasn't connecting to my WIFI. A couple of months back my old microwave oven finally died. I was well aware as a long-time Amazon customer, they had introduced a budget microwave model (about $60) that came integrated with its infamous Alexa voice recognition interface.

It was surprisingly easy to set the microwave up through the Alexa app assuming you've connected other Amazon devices, e.g., my Amazon Echo Dot. And if you've dealt with traditional microwaves and having to reset the clock after a power blip, the microwave sets the clock when it connects to your WIFI. I  haven't even used the Ask Alexa button. Almost immediately I tested the integration by "Alexa, microwave 1 minute" loud enough for my Echo Dot to hear. Now that's not complicated (some microwaves do that as fast as touching the 1 button), but Alexa could handle "Defrost 1-lb. of frozen sausages" without my having to adjust power et al. I could have sworn I heard someone say Alexa can handle commands like "Warm my coffee"; Alexa seemed confused when I tried to say that, but I could easily give her a command to "microwave X seconds".

Until one day I gave Alexa a microwave command and after a long pause, it come back and told me it couldn't connect to the microwave. There were other indications somehow it had gotten disconnected from WIFI, e.g., the clock was off. Besides the typical timer set for microwave on high, it was not at all clear how to manually do anything beyond that like setting the clock, defrosting, etc. And trying to tweak the current microwave in the Alexa app I found to be frustrating. Online resources at Amazon weren't that helpful other than instructions on resetting the microwave. Long story short, eliminating the existing microwave device in the Alexa app in and creating a new microwave device, in conjunction with a reset seemed to resolve the issue. 

Bluetooth and Windows

I suspected that my old workhorse 2016 laptop that I'm finally transitioning from (long story, but migrating my applications is a hassle, but still the newer laptop has more memory and storage). I knew the new one did have Bluetooth capabilities. Still I was confused by the Windows 10 Bluetooth presentation on the workhorse; I could try (unsuccessfully) to add the new Bluetooth keyboard I bought for the new laptop on my workhorse. The point that confused me was that Windows seemed to allow me to try to add a Bluetooth device in Settings, even if the laptop didn't have Bluetooth capabilities. Why didn't it provide a visual cue, e.g., a grayed-out Bluetooth interface with inputs disabled?

When I looked at the new laptop's Settings, I noticed its Bluetooth settings includes a toggle switch for Bluetooth, while the older laptop doesn't. You really need to know if you don't have a toggle switch, you don't have Bluetooth functionality. I think it would be more usable if the Bluetooth settings had a more consistent appearance and used a visual cue to identify whether Bluetooth is supported. (It does--for Bluetooth-capable laptops.) 


Thursday, October 1, 2020

Running a Cygwin Bash Script in Task Scheduler

 Familiar readers may know the context. I have a textfile full of famous/other quotations, one per line. I deployed a freeware product Qliner Quotes which provided a way of generating HTML/other format signature formats which could be used to select a random quote from my custom or other quote files snd to attach the filled boilerplate to the bottom of my Thunderbird emails. I later basically wrote a bash script which could separately fill the html boilerplate file and also would read my latest quote html file into a browser tab and use it to headline my latest daily miscellany political post. I ran the bash script in Windows' Ubuntu interface, later putting it into Windows Task Scheduler to generate a new quote html file every 30 minutes. No major problems but it helped set my expectations into performance.

I'm not sure exactly what happened but probably recent Windows patching caused a functionality problem. I know there was a recent Linux-related patch, but my issue predated that implementation. I recall 2 or 3 weeks back updating my Ubuntu stack. So my scheduled task was no longer working, and I decided to install or reinstall cygwin. (I may have last reinstalled cygwin on an earlier PC.) There were various practical uses for using cygwin, like dealing with naming conflicts in merging file directories, attaching timestamps to certain files, etc. Yes, there are freeware renaming utilities, etc.; Windows has powershell, etc. But there are things I can do in seconds based on writing Unix scripts for over 20 years. I had to slightly tweak the bash script I had written for Windows linux subsystem but no major effort.

What I didn't expect were issues implementing my cygwin shell script into Task Scheduler. There were minor tweaks (like dealing with embedded spaces in directory paths, the arguments to the bash command to use, i.e., -c -l, specification of the target script reference, etc.) But one of the most irritating things was how long it took for the job to run out of the scheduler, e.g., up to an hour or longer vs. several seconds in a regular bash session. While I could launch a bash session if and when I wanted to rotate quotation html files used in emails and blog posts, I don't recall running into these kinds of delays when I was running a similar script in Task Scheduler with the Windows integration of Ubuntu, and I didn't want to  launch a session just to run a script.

I finally got the performance issue resolved using a tip from the third source below: export the task xml file from Task Scheduler, edit the priority from 7 to 4, drop the old task in Scheduler, and import the edited xml file back into Task Scheduler. Now if and when my bash session launches every half hour, the session completes within several seconds.

Note: I found the following sources useful in troubleshooting my issues: 1, 2, 3.


Friday, September 25, 2020

Robocopy and a Weird Quirk in its Utilization

 As a professional (Oracle) database administrator, I'm obsessed with backups, including for my own personal computing. I have a strategy that includes backups across applications (e.g., a permanent email repository for my email client), multiple PC's/external drives/flash drives and multiple cloud storage vendors. Some might call me a digital packrat of sorts. But it does have its positive sides; I occasionally needed to pull up an old proof of payment, my updated Security+ certificate, a software utility I can no longer find online, etc. I have a collection of pdfs, certain video clips, political cartoons, embedded charts, etc. used in my signature political blog.

So frequently I have a cloud source directory including things like email files/folders, podcasts, etc. And usually I want to synchronize these files. Obviously I want to propagate the latest version of my resume and workfiles, emails, etc. On the other hand, once I've heard one of the podcast clips and delete it (I sometimes save a noteworthy episode, but that's the exception), I no longer need the old backup copy.

There are synchronization software products (I still have one or 2 installed on my workhorse PC), but occasionally I ran into usability issues (like the process getting hosed in the middle of a lengthy synchronization). I don't remember when exactly I learned about the Windows utility robocopy (certainly an improvement over my writing complicated XCOPY commands and the like), but I worked with some Windows administrators at work maybe 4 years back who heavily relied on it, and I've used it since then to some extent.

So suppose my C drive folder ccdrive is my source, and I want to synchronize it to my hard drive E. So I would enter a command like robocopy c:\ccdrive  e:\ccdrive /mir.

There is a complication to this strategy when you extend this process to flash drive. I have a large-capacity flash drive on which I've installed a large number of portable applications and various key backups in part designed to get a backup PC up to speed as quickly as possible in the event of a workhorse failure. Naturally, I want a backup of my flash drive, say F.

So I use a command like the one above to backup F: to e:\fdrive. Here's the counterintuitive thing: You can navigate to e:\fdrive just fine postcopy, but you may not see fdrive in Windows Explorer or other tools. You can fix this in two ways: (1) you can add  /A-:SH preventively to your flashdrive robocopy command, and/or (2) attrib -h -s -a  e:\fdrive. (You can find a related discussion here.)



Friday, August 21, 2020

A Quick Followup on Thunderbird 78 and OpenPGP

 I had not tested OpenPGP capabilities in my last post for a new account and suggested a followup. I'm doing so here.

Actually it's fairly straightforward. I clicked on my second gmail account (without a key pair ). I went to the options menu, clicked on OpenPGP key manager and selected Generate on the popup window. It was easy to submit the new key request. Interestingly, I'm not prompted for a passphrase.  (I am if I want to store a backup copy of my key files.) And then I write a new email choosing Security/Require Encryption to one of my other email accounts, and it's a breeze to read at the other end with the lovely padlock in the upper right.

I do believe that you would have had to install OpenPGP for Windows/Kleopatra. And there are still questions, e.g., why my new key didn't appear in Kleopatra although I seemed to be able to import it into Kleopatra?


Tuesday, August 18, 2020

Thunderbird 78, Enigmail and Secure Emails

 I migrated to Thunderbird after Microsoft desupported Outlook Express around the mid-2000's. Dealing with large email folders in Windows Mail tested my patience. I also didn't want to upgrade to licensed Outlook. So Thunderbird has been my primary desktop email client during the life of this blog, and it's no accident that multiple posts have touched on Thunderbird.

This week I upgraded to Thunderbird 78; upgrades are always risky since some of your add-ons may not be compatible with the new release. So, for example, a plug-in I was using to access at least a half dozen Google calendars isn't currently available. Of course, I can easily check Google Calendar on my desktop or Android, but it's convenient in my email client if I see, say, a grandniece is celebrating her birthday.

One thing I've looked at doing is improving my email security through PKI technology. Basically there are public/private key pairs that you can use to encrypt and/or establish nonrepudiation of an email source. For example, I can use your public key to encrypt an email so only you can view its content, e.g., by providing a correct passcode/PIN. I can also apply my private key to the email which you could use my public key to verify that I sent said email. (For a related discussion, see here.)

Government (especially military) personnel often use smart tokens/smartcards known as CAC's. (I've discussed CAC's in recent posts.) Basically there are PKI certificates which are paired with your passcode/PIN to work with secure emails, network access and/or endpoint devices, etc.,It's a form of multi-factor authentication: something you have (a token), something you know (the passcode).

In legacy Thunderbird one add-on, Enigmail, has provided an implementation of PKI through integration with OpenPGP (pretty good privacy). I muddled through its implementation. All of this is freeware, no out-of-pocket costs including limited-term certificates, Now I have a large number of email accounts for various purposes, but there are 3 external providers I primarily use (an arbitrary order: hormail/outlook.com, gmail, and yahoo). And so I configured key-pairs for each of the accounts, and tested the functionality among the accounts.

The biggest problem I have with the technology is almost no personal contact or other (business) emails deploy PKI. I use it so infrequently (mostly to check functionality after various upgrades), I'll sometimes have to check one of my password stores to recall my different passphrases for the accounts.

One of the key new features of Thunderbird 78 is native support for OpenPGP, which basically means Enigmail is redundant.  It's fairly straightforward to create a new keypair through OpenPGP Kleopatra, but I haven't come across any tutorials on implementing them in Thunderbird. As time permits, I'll try to add a fourth keypair and perhaps document it in a future post.

One nice thing in Thunderbird for past Enigmail users is they provide a migration option I believe in the options menu. At least the initial steps of the migration were fairly obvious; in my case, in the order yahoo, gmail and outlook.com. What completely threw me off was the fourth prompt, which prompted me for the password for a long randomized alphanumeric string. What the hell? Is it prompting me for some password I forgot to capture in configuring Enigmail a while back?

I noticed there \were 3 such prompts\, so the obvious inference is I had to reenter the same passwords. In what order? I guessed in the earlier migration sequence. Good guess. I'm not sure why the interface was designed that way, but it wasn't obvious.

It's fairly easy to toggle on the signature and/or encryption options (I think through a security menu in the compose window), not to mention adding your public key to the email. And when I opened the email at the target I noticed a nice padlock symbol in the message window.




Tuesday, August 11, 2020

The New Blogger Interface: Some First Impressions

I don't like being forced into an upgrade, especially where it violates expectations of past experience, makes things less convenient, etc. Back in the 1980's, Coca-Cola decided to change the formula of its classic soft drink to a sweeter version and would not allow the customers to choose their preferred option. Consumers rebelled, hoarding supplies of the legacy formula. To its credit, the company quickly relented, relabeling and producing "Coca Cola Classic". New Coke never did catch on and was eventually  dropped; decades later, the company dropped "classic" on packaging of its legacy formula.

Since starting work on this post, I've discussed some of the issues I have with the new Blogger interface in a segment of my signature political blog here. Ironically, one of my chief complaints, which has to do with Blogger's New Coke approach, doesn't apply to this blog; I do have a link for reverting back to Blogger Classic, although only temporarily, for this blog. I don't know why the older blog doesn't have the link. Many of my issues deal with toggling the compose and html mode. In my daily political "miscellany" post, I'll often include a number of embedded objects, primarily video clips. So typically I'll copy and  paste bits of html code from other sources into html mode. Now the classic mode of html did a beautiful job of maintaining separation of html code and preserving text lines between modes, so, for example, I could effectively insert a couple of lines between a video and the next (existing) section header while inside html mode and those blank lines would carry over to compose mode. There were various functional reasons for inserting blank lines in html mode, including it is an easier way to avoid carryover formatting while in compose mode, e.g., from headline format to normal text format. I could more easily adjust the post format without fiddling with formats in compose mode.

It also makes it easier to find and replace html code. An example is that I've sometimes thought I had copied a video's embedded code into clipboard for insertion (replacing the prior video's code) but the copy failed, and I ended up duplicating the video in the post, which I discovered after publishing the post. Under the classic html mode, it was fairly easy to locate the duplicated video code and replace it for updating the post.

Under the new html format, html code becomes more spaghetti-like in a collapsed format and you need to parse the html ball to make your changes. Spacing in draft mode doesn't map to the compose mode. For instance, my miscellany posts usually include a quote for the day and a daily older music video "interlude" at the bottom. But if the first thing I do after adding a quote is to add my music video of the day, I can separate the quote and video segments by 50 lines in html mode, but if I flip back to display mode, the music video section appears immediately after quote and I have to fuss with compose mode settings to insert intervening post segments. It adds to the busy work of writing and publishing a mixed-mode post. (It isn't as much of an issue in drafting a primarily text post like this one.)

One related aspect I didn't discuss earlier is that Blogger Classic would also provide a way of displaying an embedded video (especially Youtube clips). Now you simply see a gray blob. The (earlier) WYSIWYG compose display didn't work for all but most of the clips I would embed. There is a preview post mode (under both versions) which works to the same desired end. Occasionally I'll run into a clip where I can't see if it works until the post is actually posted. But obviously it was easier for me to verify the clip in a WYSIWYG compose view than to preview or publish the post.

There are other minor points, probably idiosyncratic to my blogging activity. One is the fact that there used to be a checkbox in the blog stats page where you could set a blocking cookie so your own pageviews wouldn't inflate statistics. (Technically, I would prefer that to be true by default without having to constantly check if the cookie is still there.) I'll often tweak a published post for various issues like typos or wording, and maybe up to a half-dozen edits (rare, but it happens) would significantly bias my reader stats. (Some of my blogs have 100 or more pageview posts, but say I probably average less than a dozen on my daily blog;) I have an informal preference to see at least double-digits, but "real" double-digits. I have probably dozens that have capped at 9, but I don't want to cheat just by viewing each post in question. So the point is, if there is a block cookie option in the new Blogger I haven't found it yet. I recall recently I had a delayed browser launch of my published post, and the browser eventually responded with 3 or 4 windows; those all factored into the post statistics.

Finally, there are a number of feature inconsistencies, not that difficult but annoying and not necessarily obvious. An example to make the point: I'll often embed a political cartoon in my miscellany daily post and use the caption function to attribute the artist and the source. I normally had to resize the embedded image under the old format and actually like the initial size under new functionality; if I had to tweak the size, the controls are obvious, while the old controls were more of a toggle switch approach. However, somehow I didn't recognize the caption option at first and ended up manually inserting a caption line in a line following the image the first few times I inserted images and eventually discovered the caption option by playing around with the interface. Maybe the interface was more natural to other people.