Thursday, May 4, 2023

File Systems and Archives: An Anecdotal Usability Note

In my day job as a database administrator, objects like tables are stored in extents (blocks of contiguous bytes), typically grouped with those of related objects in tablespace datafiles. If and when an object needs to grow to accommodate more records it tries to find available space in already allocated resources; if not, it tries to find big enough free spaces in preallocated existing datafiles. Traditionally we had to resize or add datafiles to accommodate database growth. Oracle made things more user-friendly for DBA's by allowing existing datafiles to autoextend on storage devices subject to available capacity/quota constraints, subject to certain design constraints, or add new datafiles across storage devices. By design constraints, I'm referring to classic structures like up to 4 million or so datafile blocks (lowest unit of bytes), with a default 8K block size. This led to de facto maximum 32 GB datafiles, even if there was additional storage capacity on relevant devices. So typically to avoid a showstopper failure of an object not being able to grow, I might define new extendible datafiles within or across accessible storage devices. I still needed to monitor storage utilization and fragmentation of free spaces in tablespace datafiles, but less "busy work" of manually maintaining datafiles than in earlier times, not to mention reorganizing datafiles across devices.

There are multiple approaches to securing sensitive files; for example, you can password-protect Word documents and pdf files.  There are system volume tools like Bitlocker. And then there are virtual encryption volume software tools like VeraCrypt and SafeHouse Explorer. Now there are a couple of analogous concepts at play, the volume, roughly comparable to concept of a tablespace datafile, and file system support for very large files vs. the 32 GB limit. In the case of the former, you create a volume or logical disk of a specified size, e.g., 10G, which you can mount on a drive letter by supplying a predefined password. In the latter case you may need a file system like NTFS if you're trying to store very big (>4 GB) on the volume. Some media, e.g., flash drives, may by default use a legacy file system NOT supporting very large files. Usually, I try to store redundant backup and/or volumes. I noticed VeraCrypt explicitly during volume creation asked if I needed very large file support .SafeHouse Explorer didn't.

So, here's the setup for my usability incident. I use a very nice freeware product, MailStore Home as my email archive. My principal email client is Thunderbird which uses an MBOX format for email folders. There are Thunderbird add-ons which enable import and export MBOX files. Mailstore has an archiving solution which is proprietary but can archive newer emails.  Usually, I'll do a daily archival into Mailstore and manually consolidate them into categories monthly. Mailstore also allows me to export/restore email folders back to email clients (including Outlook and its similar PST file construct).

So, I recently exported some of my consolidated folders for dedupping and trimming, saving the results in MBOX format. It turned out, and I didn't notice, that 2 of those files were over 6 GB .

I created a 40 GB VeraCrypt volume, mounted it , and copied my relevant MBOX and PST files to it without incident. I created a slightly larger SafeHouse volume. So, I was puzzled why Windows argued  my finance file was "too big" for my virtual SafeHouse  volume; I had more than enough slack space on the volume but the file was "too big" for the file system; I then checked the file systems under the two volumes; indeed the SafeHouse volume was using a legacy MS file system without very large file. Support.

There are some easy workarounds. For example, I could use the Thunderbird export/import add-on to dump folder eml files and run a simple bash script assigning even and odd numbered emails to separate directories and then importing the directories and exporting them as separate MBOX files.

But is there a way to change the volume to a different, nondestructive, accommodative file system? Yup.

C:\Windows\system32>convert J: /fs:ntfs
The type of the file system is FAT32.
Enter current volume label for drive J: MBOX23A
Volume MBOX23A created 5/3/2023 6:23 PM
Volume Serial Number is 2CCC-EAD4
Windows is verifying files and folders...
File and folder verification is complete.
Windows has scanned the file system and found no problems.
No further action is required.
   52,415,984 KB total disk space.
   29,836,240 KB in 66 files.
   22,579,728 KB are available.
       16,384 bytes in each allocation unit.
    3,275,999 total allocation units on disk.
    1,411,233 allocation units available on disk.
Determining disk space required for file system conversion...
Total disk space:              52428800 KB
Free space on volume:          22579728 KB
Space required for conversion:   131576 KB
Converting file system
Conversion complete

I was then able to copy over my two 6 GB MBOX files without issue;

Saturday, April 8, 2023

Notes on Dedupping a VLC Playlist on Android

 I have an extensive library of licensed music tracks stored on my Android SD card. I connect my phone to my car by Bluetooth, and I use VLC to play custom playlists, added to from searched track options. I usually play my core playlist in random order. Somehow my core playlist had ballooned to over 500 tracks, many of which I suspected to be duplicates. I later confirmed that there were only 188 unique tracks. I was annoyed this had happened. (Oddly, when I recently added some Carpenters tracks onto the playlist, I did get prompted in trying to add a duplicate track from my card to the same playlist, which I would expect. However, the popup query seems to suggest duplicates are allowed. I don't recall seeing popup warnings adding tracks in the past.)

I was more familiar with specific playlist files on my Windows PC. For example, I have a backlog of over 3000 Cato Institute podcast episodes and I have a playlist arranged in a certain order, which I can update after episodes are played. On Android, however, VLC stores playlists in a sqlite database.

Now SQL (structured query language) is the lingua franca for relational databases (originally developed by IBM); I took a couple of graduate school database classes at UH, taught undergrad DBMS at UTEP, and wrote a minimal manual on SQL for a research project I did with Minnie Yen (Alaska-Anchorage). In addition, I've spent almost all my post-academic career as a DBA, predominantly Oracle but some exposure to SQL Server. I really haven't dealt with sqlite but I was confident I could figure out to get what I wanted.

The basic solution was:

  • dump the media database on Android and transfer it to my PC
  • download sqlite tools to my PC
  • load/mount the database, identify the target table and columns, and execute a relevant query to identify duplicated tracks.
Note this still left a manual task of doing identified duplicate track searches on the playlist in VLC Android and deleting the duplicate references. This is largely a workaround because more direct access would likely involve rooting the phone.

In VLC Android you can dump a copy of VLC database by going to app settings, advanced settings and select the dump media DB option. On my phone, the generated file was vlc_media.db. I transferred the file to my PC. in Windows.

If your PC doesn't have the sqlite3 command, you may need to download it, e.g., sqlite-tools-win32-x86-3410200.zip from https://www.sqlite.org/download.html (pan down to Precompiled Binaries for Windows) [note the link is valid at post publication].

I unzipped the file and navigated to the folder at the command prompt.

sqlite3 [path]\vlc_media.db

where [path] is the location for your dumped media database 

SQLite version 3.41.2 2023-03-22 11:56:21
Enter ".help" for usage hints.
sqlite>

To get a list of tables:

sqlite> .tables
Album                   FolderFts_segments      Movie
AlbumFts                Genre                   Playlist
AlbumFts_content        GenreFts                PlaylistFts
AlbumFts_segdir         GenreFts_content        PlaylistFts_content
AlbumFts_segments       GenreFts_segdir         PlaylistFts_segdir
Artist                  GenreFts_segments       PlaylistFts_segments
ArtistFts               Label                   PlaylistMediaRelation
ArtistFts_content       LabelFileRelation       Settings
ArtistFts_segdir        Media                   Show
ArtistFts_segments      MediaArtistRelation     ShowEpisode
AudioTrack              MediaFts                ShowFts
Bookmark                MediaFts_content        ShowFts_content
Chapter                 MediaFts_segdir         ShowFts_segdir
Device                  MediaFts_segments       ShowFts_segments
DeviceMountpoint        MediaGroup              SubtitleTrack
File                    MediaGroupFts           Task
Folder                  MediaGroupFts_content   Thumbnail
FolderFts               MediaGroupFts_segdir    ThumbnailCleanup
FolderFts_content       MediaGroupFts_segments  ThumbnailLinking
FolderFts_segdir        Metadata                VideoTrack

To describe a table, I use: pragma table_info(my table name);

There are 3 tables I'm particularly interested in: Playlist; Media; PlaylistMediaRelation.

sqlite> pragma table_info(playlist);
0|id_playlist|INTEGER|0||1
1|name|TEXT|0||0
2|creation_date|UNSIGNED INT|1||0
3|artwork_mrl|TEXT|0||0
4|nb_video|UNSIGNED INT|1|0|0
5|nb_audio|UNSIGNED INT|1|0|0
6|nb_unknown|UNSIGNED INT|1|0|0
7|nb_present_video|UNSIGNED INT|1|0|0
8|nb_present_audio|UNSIGNED INT|1|0|0
9|nb_present_unknown|UNSIGNED INT|1|0|0
10|duration|UNSIGNED INT|1|0|0
11|nb_duration_unknown|UNSIGNED INT|1|0|0

sqlite> pragma table_info(media);
0|id_media|INTEGER|0||1
1|type|INTEGER|0||0
2|subtype|INTEGER|1|0|0
3|duration|INTEGER|0|-1|0
4|last_position|REAL|0|-1|0
5|last_time|INTEGER|0|-1|0
6|play_count|UNSIGNED INTEGER|1|0|0
7|last_played_date|UNSIGNED INTEGER|0||0
8|insertion_date|UNSIGNED INTEGER|0||0
9|release_date|UNSIGNED INTEGER|0||0
10|title|TEXT|0||0
11|filename|TEXT|0||0
12|is_favorite|BOOLEAN|1|0|0
13|is_present|BOOLEAN|1|1|0
14|device_id|INTEGER|0||0
15|nb_playlists|UNSIGNED INTEGER|1|0|0
16|folder_id|UNSIGNED INTEGER|0||0
17|import_type|UNSIGNED INTEGER|1||0
18|group_id|UNSIGNED INTEGER|0||0
19|forced_title|BOOLEAN|1|0|0
20|artist_id|UNSIGNED INTEGER|0||0
21|genre_id|UNSIGNED INTEGER|0||0
22|track_number|UNSIGEND INTEGER|0||0
23|album_id|UNSIGNED INTEGER|0||0
24|disc_number|UNSIGNED INTEGER|0||0
25|lyrics|TEXT|0||0


sqlite> pragma table_info(PlaylistMediaRelation);
0|media_id|INTEGER|0||0
1|playlist_id|INTEGER|0||0
2|position|INTEGER|0||0

The last table is where I'll find the duplicates; I use the media table to identify the track, and I use the playlist table to get the id for what I call the playlist in VLC:

sqlite> select id_playlist, name from playlist;
1|rag001
2|rag003
3|rag002
4|xmas
 
RAG001 is what I call the long playlist in VLC, so 1 is the id I what I want to use in querying PlaylistMediaRelation.

So here is the query I'm using to identify the duplicate tracks in my playlist:

sqlite> select filename from media where id_media in (select media_id from playlistmediarelation
(x1...> where playlist_id=1 group by media_id having count(*) >1);
03 If I Thought You'd Ever Change Yo.m4a
001 Feels So Right.m4a
002 Love in the First Degree.m4a
001 Rock Me Gently.m4a
01 (Where Do I Begin) Love Story.mp3
06 Speak Softly Love (Love Theme fro.mp3
11 A Song For You.mp3
03 Don't Worry Baby.mp3
001 Woman in Love.m4a
002 Somewhere [From West Side Story].m4a
[and the list goes on...)

Thursday, March 16, 2023

Some Notes on Migrating Thunderbird

It just occurred to me I haven't posted here in over a year. Just a related note: I'll often post shorter usability segments in my signature blog (rguillem.blogspot.com) journal posts (#xxxx J)

To begin this post, the context is a workhorse laptop that has seen better days. On a trip to Texas, the power button dislodged and I now have to use a narrow-tip screwdriver to manually restart the system. I started running into baffling issues with USB devices, and my touchpad and touchscreen stopped working. (I thought initially they were driver issues one day when I had disconnected devices in dealing with reboot issues, functionality returned). I had started using a new computer for browsing and already designated it for my new workhouse. One of the first steps was migrating my email client, Thunderbird, with various local folders and related filters.

Looking over past posts. one particular focus has been emails. For the longest time I used email clients as a bridge solution to an email archive. I used Outlook Express during its 1996-2008 lifetime and developed my own corruption/archiving/migration tools. Mozilla Thunderbird started in 2003. When Microsoft transitioned to Vista and Outlook Express' successor, Microsoft Mail, I ran into chronic usability issues starting MS Mail with any nontrivial number of emails, and I soon thereafter migrated to Thunderbird, which provided startup times comparable to what I was used to with Outlook 

My archiving solution used to be AskSam, a freestyle database software I first licensed in the late 1980's. Probably my biggest use was to store my emails and write some powerful and flexible queries on contents, sender, dates, etc. It's last version (7) was released in 2008 and I think its websites had stopped to function by some time in 2013 (by a user observation I found via Google) I know I had an operational copy on one of my PC's and had exported some of my askSam files as of 2016 in text format. I had tried to reinstall on this PC I'm drafting this post and failed, even though I was sure I had my legitimate serial number. It wasn't clear why it was failing. I hypothesized it was doing some validation through the Internet to some server online no longer operable. I couldn't find a copy of the free viewer--in my files or via Google. [MyInfo implied it had an add-on that could read *.ASK files. Very misleading: you have to export data in a specific format, which means chicken-or-the-egg: you have to have a functioning version of AskSam to generate the data in the required format. Not very helpful,]

It had struck me I hadn't tried to install AskSam on the existing laptop. I didn't expect any difference since both PCs run essentially the same version of Windows. To my surprise, I was able to install and get it to accept my license number; there are some quirks, e.g., I got a popup to register online, which didn't work, of course, but it allows you to register offline. I'm not going back to resume archive at least the bulk of my emails, but back around 2016, I had exported only a fraction of my files, so I may export the remaining files which I haven't done to date

Now, of course, Thunderbird has rudimentary search utilities plus useful add-ons. For example, occasionally I have seen redundant emails downloaded, and so one add-on allows us to dedup emails. Another is an export-import tool which in theory would allow me to bridge restoring groups of emails back up to Gmail.

But in a manner similar to how I used to archive emails in AskSam, I started using free (for personal use) MailStore Home, which supports Thunderbird emails to local directory clones, typically on external drives (and these are periodically replicated elsewhere). So, I'll typically update Mailstore daily. The MailStore local folders are monthly transferred to perm folders. Hence, if my PC dies, I shouldn't lose more than a day of emails. This does not control geographical risk or home loss, but I do maintain some cloud archives.

So how did I migrate? Well, first, you need to install at least one email address for the Thunderbird install, typically my core gmail account. [Note: I use the POP vs. IMAP download messages to PC option.] Typically, I store my local folders on a cloud-mirrored mount point and override the local default. in Thunderbird. The message filter file exists but doesn't seem to work until I replace the target Appdata\Roaming\Thunderbird\Profiles\xxxxx-default-release with a copy of the corresponding contents from the source. After a restart you should see all your email accounts from the source and you may need to update passwords.

I ran into two practical problems: configuration of my Microsoft (live.com) email account and a problem with saving drafts in my core gmail account.

I followed an analogous procedure to this University of Texas manual configuration for my outlook.com account. I think the default configuration gives you a separate popup of your emails.

In a past post I discussed Enigmail, a PGP add-on to Thunderbird. More recently, Thunderbird has built in support for OpenPGP. Almost no one I correspond with has set up puhlic/private key pairs, so I've mostly used it among my own accounts. more for a proof of concept/demo case. Anyway, I think I first got a hint it was encryption-related here. At some point I got the a more explicit key message and ended manually deleting referenced lines in prefs.js in the profile release directory. In hindsight, it may have been all that was needed was to disable the option in the end-to-end encryption panel for the gmail account and/or export/copy the certs in question from the source and import them on the target.


Friday, February 5, 2021

A User Note on the VTIN Micro Bluetooth Speaker and the TF Slot

 I may well be the last person to have bought a bluetooth speaker. Things have certainly changed since my latter graduate school days well I used to jog with a clip-on cassette player (if I was lucky it would auto-reverse) with headphones or wire my stereo speakers to my receiver jacks. 

The victim of one too many freakish coffee spills on notebook computer keyboards. I have for years routinely bought laptop stands and used USB devices, more recently wireless ones with receivers that clip onto available USB slots. I only recently transitioned from my old 2016 laptop computer to my most recent one which has an SD slot and bluetooth technology. One of the advantages of bluetooth technology as a wireless concept is that you can connect devices without a receiver taking up one of your valuable USB slots. Bluetooth goes beyond connections to a PC and cellphone. I use it to connect music stored on my cellphone SD card to my 2019 auto sound system. It's still odd going from my 2000 car system which had a cassette player as well as a CD player (which sometimes balked at CD inserts and/or was unreliable in cold weather). Don't get me started on cassette tapes sometimes getting getting caught on ejection, etc. I've got hundreds of pop songs (few over the last decade; I don't like rap or hip hop or any recent pop music that I've heard.) on SD I can shuffle automatically via my Youtube Music app without having to change media, listen to commercial interruptions, etc. Now when I go shopping I stick on my wireless ear buds connecting to my phone, without bothering other shoppers. (There are minor nuisances like an ear bud popping off every once in a while.)

It hasn't been into recently that I've gotten more interested in updating my sound system. I live in an integrated neighborhood where, say, they listen to loud "music", which probably serves to sterilize frogs within 100 yards. (That's a line I adapted I think from a Doonesbury strip years back, which I found hilarious.) It's not so much I want to impose my musical preferences on the rest of the world, but I wanted something to mask the noise rude neighbors impose on the rest of us. It isn't even melodic but often inconsiderate disruptive percussion rubbish that makes it all but impossible to hear my own TV. (I also own ear plugs.)

Now one of my favorite daily emails is CNET Cheapskate which often spotlights bargain quality products on sale complete with Amazon/other coupon codes. I've bought multiple items over the last year or two, including my ear plugs, a surge outlet tower, power banks, etc. One item that caught my attention was the VTIN R4  bluetooth micro speaker. I think with all discounts, etc., it cost less than $10. I know what you're probably thinking: you get what you pay for, and it's probably a low-quality piece of crap. Actually you get quite decent sound, maybe not as good as a $400 Bose-type system, but as good if not better than my TV or PC. It's a snap to connect to your cellphone, and of course I can play the music stored on my phone SD card/

One of the more intriguing and confusing features is a TF/SD slot (up to 32 GB); an interesting observation is that buying a compatible card was almost as expensive as the speaker itself (but note that I can also mount the card in my PC or cellphone as well). This was interesting, but how did it work? I mean the interface/controls have a power button, up/down (volume) buttons and a play/pause toggle switch. The power button by default (no memory card) tries to make a bluetooth connection. I know some other bluetooth speakers come with a mode toggle switch where, say, you could switch between bluetooth and SD card. But I don't see a mode switch on the VTIN (unless one of the existing controls has a dual purpose). I saw no discussion of the TF slot anywhere in product packaging (beyond maximum capacity) or Amazon or customer reviews. I did a Google search, checked Youtube videos, etc. Maybe it was an artifact of bad searches or I overlooked something obvious. My only hypothesis was that the speaker defaults to playing an inserted memory card. It was a logical inference; obviously I could connect to bluetooth on my cellphone and play what's mounted on its own SD card slot but why then would I need an SD card for my speaker unless it could play the card directly? And I think my inference is correct as it turned out. 

What muddied the water a lirrle was this one dude's tutorial video on Youtube. He demonstrates inserting a TF card into the slot (but doesn't show the speaker playing it). Then in an spliced clip  he shows his cellphone app playing one of his favorite songs, purportedly from the speaker SD card. Dude, what magic happened? You mean to tell me you are controlling/accessing the TF card mounted on the speaker from your cellphone? Or did you mount the same card into your smartphone and are playing it there?  Are you really trying to suggest that I need another device to play music on the speaker's TF card? How does the speaker distinguish playing music concurrently by bluetooth and on the device itself? The clip raised more questions than answers.

So I got my TF card from Amazon, mounted it onto my PC, loaded some tunes on it, and then inserted it into the speaker. I turned on the speaker and noticed it wasn't connecting on bluetooth on my cellphone (from the cellphone's bluebooth connection screen) . And then after a few seconds a Christmas tune (from the TF card) started playing over the speaker. Apparently one drawback to this functionality is I don't have playlists  so I'll have to curate the music on my TF card more carefully.

The memory card feature does enable standalone use of the speaker, e.g., when my cellphone isn't available or in airplane mode.


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.