Shortcuts 4: Location Aware RTM

While adding items to my shopping list this morning to Remember The Milk, my favorite To-Do App, it occurred to me that I could maybe make a Shortcut which leveraged Location Services and RTM together. Often times I’m moving from place to place, especially on Saturdays to do grocery shopping. RTM is very nice to use, but it is slightly annoying to have to navigate to specific lists when you get to a new place. RTM does have a Nearby option, but I haven’t really noticed it until right before I started with this Shortcut, so this could just be extra-on-top of what RTM could already do.

This Shortcut begins with the Location object from the Location group.

I looked at all the output from Location and for my needs, Street seemed to be the most useful.

I used the If object from the Scripting group. Chained together, one inside the next.

If Street contains your home street, then Open RTM from the Apps group with the “View Today” object.

If Street contains your work street, open RTM from the Apps group with the SmartList “Today At Work” (I created this SmartList, it’s all the tasks in the Work context, due Today.)

This theme keeps going, I go to Costco, the street there is Century Ave and my local Meijer is on Gull Road in Kalamazoo Township, near where I live.

Each time I call this Shortcut, it will poll Location Services, then figure out where I am and then open RTM right where I want to be.

Shortcuts 3: Coffee Timers

Every morning I prepare my coffee using my grinder and AeroPress. Usually I resort to using Google Home to provide me two timers, a twenty second timer for the grind, and a thirty second timer for the brewing. Most mornings the Google Home is fine, but sometimes the Google Home gets profoundly hard of hearing, or won’t stop the alarm, a whole host of irritating behaviors. So I thought, maybe I could get a Shortcut to do this task for me, some tapping and a convenient run of the single-shot iOS timer per task. Here’s how I got it to work:

I created a new Shortcut, starts with “Show Alert” from the Scripting Group. The phone waits until I measure out my coffee beans to grind. Once this alert gets a tap, it calls Clock from the Apps Group, runs a timer for 20 seconds, then opens the Clock app, which shows the time count down there, and the script itself waits 20 seconds for the timer to expire before moving forward.

The next task is to “Ask for Input” from the Scripting group, “Ready to Brew?”, when the tap is Yes, which is the default, the Shortcut returns control back to Shortcuts app, then opens Clock again. This was oddly necessary because without Shortcuts getting a shot at the foreground, it just wandered off, functionless.

The next task is to start the Clock timer for 30 seconds. If the user taps anything but Yes to “Ready to Brew” the Shortcut ends.

I already used this particular Shortcut this morning and it worked delightfully well! I didn’t have to have a screaming match with Google Home, and the phone behaved pretty much as I wanted it to.

iOS Shortcuts 2: Automation

On the heels of the first foray into Shortcuts with iOS, I happened to stumble across a suggestion in Shortcuts Gallery, that seemed to suggest that the phone could perform functions if it discovered itself in a particular environmental situation. Specifically, When AndysiPhone connects to “Mazda” and pointing to Bluetooth connections themselves. I poked around in this suggestion to learn there was an entire “Automation” section that I had completely glanced over.

I lease my Mazda CX-5, best car I’ve ever owned, by the way, and so I have a strict limit on the miles for the vehicle. Every morning when I use the car, I record the mileage so I can track it. Originally this was on pen-and-paper, but then I moved it into a text file, and after that, to Google Sheets. Then I discovered the Notes widget in IFTTT, and for the longest time I would call on the Notes widget in IFTTT, type in the mileage, and then hand it to IFTTT to add the mileage I entered, along with the date and time, to my Google Sheets. This worked well, when I had the presence of mind to remember to fire off the IFTTT widget, that is. Then after I had my first foray into Shortcuts, I discovered that my phone could recognize when it connected to my Mazda’s Bluetooth system. That event is the perfect trigger to ask for mileage! I knew that IFTTT was still good to help me automate Google Sheets, but I had to reconfigure how IFTTT worked so it would work with Shortcuts and not IFTTT’s own Notes widget. Here’s how I did it:

In the Automation section of Shortcuts, I created this. If the “When” section is met, the “Do” section executes. In this case, it’s a Shortcut.

The Shortcut begins with a “Ask for Input” from the Scripting group. Ask for a Number, because all I care about is mileage, and I only want a handy number entry pad.

Next I went to IFTTT, created a WebHook which is linked to my Google Sheets Mileage Intake Log. The WebHook is called “mileage_log”, and the key is a private string that you get from the WebHooks documentation in IFTTT. The Text object lets me configure the URL with the mileage added after “?value1=” at the end of the URL.

Then I set a variable based on the text in the Text Object, so it can be used as a variable moving forward.

Next is to grab the “URL” object from the Web group. I feed it the variable from above, which is really just making my phone emit a WebHook call to IFTTT with my mileage in it.

Next I use “Get Contents of URL” from the Web group to fetch the response from the WebHook call. I’m looking for “Congratulations” in the response from IFTTT.

The Text object is set to get this response from IFTTT, and there is a trick here, you need to set the type of the data for the Text object as Text, not URL, or anything else, it takes a long tap to find this hidden setting. Tricky…

I next used the If object from Scripting group. Here is where the trick gets you. If you don’t change the type of data that If receives, you will only get “If there is something” vs. “If there is nothing” and that’s it. What you want is “If A contains B” and the only way to get “contains” is if the input data is text! So here is where we evaluate the IFTTT WebHook response, find the “Congratulations” in the output, and then using the “Show Notification” from the Scripting group, I pop up a little alert showing “Success!”, then the If ends, and the Shortcut ends.

So now I won’t have to remember to hit a IFTTT Widget button when I start my car in the morning. The Bluetooth itself will be enough for my phone to notice and ask me for my mileage, and then pass everything to IFTTT, so it can add a timestamp, and pass that onto Google Sheets.

iOS Shortcuts

Apple’s Hidden Pot Of Gold

Two days ago I found myself hip deep in IFTTT settings, in their Button Widgets trying to find a way to make individual posts to my work log in my journal software, Bear.app.

I keep two tracks of logs, and they both share similar structures. I have a Personal Log, and a Work Log. They look like this in Bear.app: “August 7, 2021 – Personal Log” and then have space below where I journal my day. Usually I find myself forgetting to actually write anything and so I have days that go by where there is nothing in there. Sometimes I’ll turn to my Signal app, try to scroll back and see what I was posting to all my friends in our group Signal chat, and use that to help me remember. I’ve been wanting, for the longest time, a way to press a button and enter quickly some commentary, and then have it associated with a timestamp for me and added to my Bear log.

This all started with IFTTT. I know that Bear.app doesn’t have any connectivity to IFTTT, but Remember The Milk does, so I thought I could use IFTTT to write journal entries into RTM, and then at least I’d have them captured so I could eventually copy and paste them into Bear.app. It wasn’t elegant, but it was a workaround that could work. As I was looking around Google seeing how other people did things like this, I started noticing some references to Shortcuts. I had always thought of Shortcuts as this kind of Siri-linked simple tinker toy thing, Apple’s way of getting Siri to be more than it is. How wrong I was!

Turns out that Shortcuts has it’s own programming language, access to a shocking amount of iOS functionality that I previously never thought Apple would willfully reveal to end users, in the iOS platform, and the answer to this particular need of mine. This is how I did it.

It all starts inside the Shortcuts app. Older versions of iOS didn’t include this by default, but since iOS 13, I think, Shortcuts has been a stock app preloaded on every iOS device. Tap on Shortcuts, then create a new Shotcut, and here’s the screen shots:

The first item was to “Get A Variable” from the Scripting group. This lets you pick “Current Date” and if you press there, you can pick the format of the timestamp. I wanted a simple short time-only stamp, so setting Date to None was the key.

The “Text” object was next, from the Documents group. I don’t know why I needed it, but I think it draws the variable into the scope of the rest of the project.

Then “Ask for Input” from the Scripting group presents a small dialog box so you can type in whatever entry you like.

Next I created a new Text object, with the text I entered from the Scripting object. This is how I introduced a hyphen between the time entry and the text entry, formatted the way I wanted in my Bear journal entry.

Some apps have Shortcut-enabled controls provided to the system, in this case, Bear definitely has a lot of controls available. I was gratified to see an append-to-note function, so I added it to my Shortcut. This particular control creates a Bear entry for the entire day, gives it a special name, “Work Log Inbound” so that when I am in Bear, I can just copy and paste items from the Inbound daily item into my real work log bear entry, then throw away the “Work Log Inbound” entry.

After a short while of using this shortcut, which works really well, I must admit, it struck me that sometimes, not all the time, but I would like to maybe share my journal entry in Signal, or maybe email it, so the “Copy to Clipboard” from the Sharing group works really well. I can just ignore it, but if I want to add my journal observation to Signal, it’s waiting for me in the clipboard.

The Shortcut in the first iteration left me in Bear app. I didn’t want that. I wanted a “quick journal entry and back to the home screen” turns out, this home screen is technically called “SpringBoard”. There used to be a “Exit to SpringBoard” control in the Beta version of Shortcuts, but Apple removed it. Someone figured out a hack. The trick is to create a Shortcut to open something innocuous, like Notes, then save it as a plist file, then change it textually to force it to work for SpringBoard. Right now in iOS 14.7.1 this works, but it might break if Apple decides to be grumpy about it.

I created a duplicate Shortcut to this, called it “Personal Log” and it pretty much follows along. But that was easy since my work log and my personal log are pretty much parallel with each other in Bear. One small thing to note, this is only for basic text, there are no frills or extra neat bits, it just bangs in text chunks by button, nothing more, nothing less.

Catching Up

Welcome to the end of July 2021! So much has happened, and most of it has passed without a blog entry. Life is a box of chocolates and sometimes you run into a really thick caramel and have to slow down.

COVID-19

shallow focus photography of microscope
Photo by Chokniti Khongchum on Pexels.com

In the time I’ve been away, I discovered that on Saint Patrick’s Day 2021, March 17th, that I had contracted COVID-19 when I could no longer smell or taste anything. My test came back positive, but I didn’t have a strong illness associated with it. Then my mind cast back to January 2020, and when I thought that I had Norovirus, but upon reflection I think it might have been COVID-19 as well, except in January of 2020, COVID kicked my ass. So perhaps it was, perhaps it wasn’t, I didn’t get tested at the time. Then we all got the happy news that we were invited to have our first vaccination series with the Pfizer mRNA vaccine. Mine was on 3/30, and then subsequently again on 4/20. Now I have at least one true COVID-19 infection, and the mRNA, so that puts me in a pretty strong resistant category.

Working From Home & Working In The Office

During the entire pandemic, the state of Michigan opened and closed. We played the flirt game with spikes and surges and it was very ugly for quite a while. Restaurants closed up left and right, the only real dining game in town was those joints that decided to adopt a strong take-out offering. I bounced from Home to the Office, and in one of those bounces, I contracted COVID-19 from my workplace. Since then, I have had weight issues which naturally led to hypertensive issues as well. Since April I think, I’ve been back in the office, and back in the swing of things. I still quarantine myself, I still mask, and I still have lots of hand sanitizer. COVID-19 has changed how I behave, it created a host of new habits and since they can only help me, I have kept them going. I don’t know if I will ever let go of them.

Noom

On April 16th, 2021 I started the Noom program. I started at 331.4 pounds, and now I’m down to 291.4 pounds, on the program, with a lifetime goal of 220 pounds. The program is very good, the educational components are really quite valuable and I’m almost done with the education parts. I don’t think that I’m ready to “be free of the program” as I think what I need most is the discipline that the app offers me, the rigorous control over my food intake, and being careful so as to not over-indulge and gain back the weight I have lost so far. I definitely think that Noom is a diet that everyone could really benefit from, I don’t feel deprived or starving, and I still am losing weight.

Crochet

person holding purple and white pen
Photo by Castorly Stock on Pexels.com

Over pandemic, I picked up a new hobby. Crochet, which is a style of working with yarn to make various fabrics and items. So far I’ve made many blankets, hats, gloves, and “Cat Pads” for donation to Kalamazoo Animal Rescue. I have discovered that Bernat Blanket, which is a 100% Polyester yarn works amazingly well for animal applications. The yarn is very strong, it can stand up to sanitization methods, and it doesn’t suffer when cats dig in with their claws. I started a WordPress.com blog Bluedepth’s Crochet and there I cover all the neat things that I’m exploring with the yarn arts.

One of the obvious and unfortunate things about yarn arts, and Crochet and Knitting is the gender issues that surround them. Both are seen as “women’s work” and so, much of the education and pattern supply is led by and for women. Obviously, there are some things that are unisex, and I do wish quite often that more people would try something like crochet or knitting, they may find something they truly love and celebrate as I do when I make something beautiful and it is instantly useful.

Meraki Z1 & Cisco 2801 Link Negotiation Gremlin

Today at work I ran into a really long-standing issue that we’ve had in one of our company branches. This branch uses an EOL/EOS Meraki Z1 Teleworker Gateway and also uses a hilariously EOL/EOS Cisco 2801 Integrated Services Router.

The setup is very straightforward, on the Internet side of the Teleworker gateway is a Comcast cable modem, and it’s only capable of 60mbit downlink and 10mbit uplink for maximum speed. We rebooted everything, re-tested from the cable modem and then to the desktop itself, and the speed from the cable modem was just as we expected, 60/10, but the speed from the desktop was 4/6!

I had rebooted everything. The cable modem, the Meraki Z1 Gateway, the Cisco 2801 ISR, and the Cisco 3560 Catalyst switch. Even the Cisco IP Phone got a reset! The speed gremlin held out, 4/6. So while working with some staff in the branch, I just happened to mouse-over the graphic on the Meraki Dashboard for this device and spotted the gremlin. The mouse-over tip for LAN1, where the Cat5 cable goes from the Meraki Z1 to the Cisco 2801 showed 100mbit/half-duplex. I checked into the terminal on the 2801 and verified that the port was fixed at 100mbit/full-duplex! So, I opened the Meraki Z1 device Ethernet configuration page, found LAN1, and changed it from “Auto” to 100mbit/full-duplex.

Forcing the speed and duplex settings resolved all the problems right out to the Desktop! Hooray! And what I learned from this is that Meraki Z1 Teleworker Gateways cannot successfully auto-negotiate link speed and duplex with a Cisco 2801 Router. So if you have unexplained crappy network performance, always make sure that link speed and duplex match what you think they should. Sometimes “Auto” isn’t.

Photo Credit: Gremlin Grotesque, Winchelsea church
cc-by-sa/2.0 - © Julian P Guffogg - geograph.org.uk/p/3334405

Exhausted

The issue at the very heart of modern American life is that we are exhausted. There is no more disgust, no more shame, no more national embarrassment left. He has dug deep, he has dug all the way as far as it goes. Even Tartarus is completely tapped out. People are numb to all of this, terrorized by a political party that no longer seeks to improve life for the people, but just to accumulate political power for their own designs and line their pockets with federal money.

Where do you draw the line? Children in cages, whoring around with porn stars and paying for their silence, asking foreign leaders to interfere in our domestic elections multiple times, the fat spinning Rolodex of emolument violations, or being silently complicit in the murders of US Servicemembers for a bounty?

How about allegations of child rape, and paid abortions from those rapes? Would that do it? What would it get you, even if you could, even if you desperately wanted to see justice served, you know it isn’t going to happen. We impeached him, but all his cronies in the Senate turned their backs on justice because they are all bought men, every single one of them. They have nothing to fear from the people because trickle down economics has brought about a redistribution of wealth from the poor and middle classes to the filthy rich who then use that money to secure more political power as their vast sums of money equate to speech thanks to Citizens United. The entire government is lost to liars, cheats, and grifters who have cornered the system, maximizing their political power and squeezing the treasury dry for their troubles with outrageous no-bid contracts from practically every corner of the federal government.

Here’s a list of all of his Atrocities

We are already exhausted from dealing with a blazing public health crisis of an untreated pandemic where The Great Orange Latrine Fire and his cronies are fleecing us while we are dying in droves, profiting off of our illness and suffering and doing absolutely nothing to stop it or even slow it down. Why should they bother, when our suffering and dying is so very profitable for them all?

So where are we to draw the line?

Give me a fucking break.

Onyx

Aside

I like to run Onyx (https://www.titanium-software.fr/en/onyx.html) every few weeks to clean up all the little dingy spots that can build up in my MacBook Pro. If you have an Apple computer, I really recommend it. Just be careful, there are specific versions of Onyx for each release of Mac OS X. You can find your version in the Apple Menu, About This Mac.

Snakes In The High Grass

Today I learned a very valuable lesson at work. There are two companies, Company A and Company B, unnamed because if I were to name them there would be an endless pissing match over this blog entry and I have gone down that road in the past before in a different lifetime, so we’ll just call them A and B. These two companies have services, IT Services that are very close to one another. Company A has a product that pretty much sells itself, and I was asked to look into it. I asked the rep of Company A for a quote, easy enough, and so we moved forward. Then because I wanted to be fair, and because the relationship was technically over with Company B at the end of this month, I asked Company B for a competitive quote, thinking they would possibly come in at or maybe even below their primary competitor.

Instead of what I expected, I got a very rude and shocking awakening. Company B could meet the license levels of Company A, as the magic number was round and small. But instead of the pricetag going down, to where Company A and B would be rationally competitive with each other, Company B’s quote was the total cost of Company A’s quote on top of Company B’s original cost! This took my breath away. It was very much like a very famous brewery near to where I live. You can have a taster of beer for $12 or you can buy a pitcher of the very same beer for $3. So, what we have learned is that the margins are upside down and inverted, which in the brewery example simply means that you can buy a taster of beer for $3, take the remains to the mens room and pour the remains into the urinal. Bye, Felicia.

The shocker was still awaiting my eyes, and even still this takes my breath away. Company B reminded me that while I might be interested in changing before my renewal date, that I might have overlooked a browse-wrap Terms and Conditions item that quite clearly stated that any changes that a customer might want to do must be on-file thirty days before the due date on any agreement. This means that while all the correspondence says one date, the true date to decide came a month before-hand! Now, I’ve faced browse-wrap Terms and Conditions before, none of it is actually enforceable in a court of law, but the cost to fight it out in court is way more trouble than it is worth in the end, unless you’re seeking a pyrrhic victory. I wasn’t looking for a pyrrhic victory. So I accepted the unenforceable Terms and Conditions for what I was facing as it was already budgeted and letting it go was easier than picking a fight with Company B.

Obviously, this entire arrangement went from an innocent and even gamely effort to keep Company B relevant in the marketplace to being regarded as anti-consumer treachery. Hiding your Terms and Conditions in browse-wrap, and then trotting them out and using them when your quote already lost you the battle pretty much rendered our interest in Company B dead-on-arrival. So we have a relationship with Company B, but it isn’t a happy one. I immediately informed Company B’s renewal team that we will not be renewing next year, and I set a reminder to tell them twice more because, well, there are Terms and Conditions to meet.

Which starts a really useful conversation about these Terms and Conditions. What is the positive use of a thirty-day minimum renewal term before the actual terminal date of an agreement? What would Company B get out of those thirty days? Maybe wrangle up more sales to cover the loss? I don’t really understand what benefit comes with a thirty day term like this except to function as a hidden trap for your hapless customer. If I were really cynical, and I am, this thirty-day trap is really a kind of extortion! So that’s what we have, a poisoned relationship with Company B, turning the last year of service into a perverted period of drawn out extortion. This singular revelation has incinerated the customer relationship in this particular case with Company B. That’s what this particular Term and Condition earns a tech company, having it on your browse-wrap site is a clarion call to all your customers that you are treacherous, untrustworthy, a bad-faith actor, greedy, and actively seeking to perpetrate extortion upon your victims which used to be your customers. Now you can witness your customers fleeing from you, as is right and appropriate.

So what did I learn? I learned this single bit of advice, and it’s vital for any IT Manager to listen to what I have to share. If you have an agreement with a vendor, request their Terms and Conditions right now, have them email you everything. Read it, and keep an eagle eye out for this particular nasty little trap. If you find the keyword “days” or “renewal” anywhere in the document, highlight it, and then you will know that the renewal date that the company sends you is a prelude to this particular trap, find the day value, for me it was thirty days, and then roll that relevant and real due date forward one month, so not at the end of June, but at the end of May, for example.

If you are a company trying to do business, and you have the fantasy of being a good faith actor somewhere in your aspirations, know that these Browse-Wrap Terms and Conditions are the battleground we enter when we stop thinking of you as a partner helping us do whatever it is that you offer to us to accomplish, and we start thinking of you as a treacherous snake in the high grass, coiled up and just waiting for us to blunder by so you can strike at us. The Business To Business relationship is a wretched one, you screw us, we leave you, and we make sure that everyone we talk to knows what sort of open treachery you sustain.