Accessing Printer Press ESC to cancel

ESC

Minutes spent so far this year waiting for Excel to talk to a printer: about 290.

Lifetime Excel print jobs: maybe 2?

Do you want me to use Edge, Microsoft?

Updated on Wednesday, July 1, 2020

Do you want me to use Edge, Microsoft?

If you're going to ask for something be direct, don't beat around the bush.

So I'm confused, Microsoft. Do you want me to use Edge? After installing updates Edge wants to 'Get started', on a nice modal with no cancel button or even any little x to close it. Must be some mistake right, not quite ready for prime time if they forgot the 'Don't get started' button. Maybe I'll try it when the kinks are worked out.

Ah, right clicking the icon and choosing close would work, right? Nope. Feels more and more like malware.

You can kill it from task manager so at least someone was paying some attention to usability.

Don't I remember some settlement with the DOJ after an antitrust judgement for forcing browsers on someone? That was a while back, must be remembering a different company.

Using the Azure Monitor REST API from Google Apps Script

Updated on Sunday, November 15, 2020

Average Server Response Time in Azure Metrics

This post describes how to get metrics (in this case average response time) from an Azure App Service into a Google Sheet. I’m doing this so I can go from the sheet to a Data Studio dashboard. I already have a report in Data Studio that pulls from Ads, Analytics and other sources. I’d rather spend hours adding Azure there than be forced to have one more tab open. You might have different reasons. Read on. 

  1. Create a Google Sheet and give it a memorable name. Rename the first sheet to AvgResponseTime and put ‘Date’ in A1 and ‘Average Response Time’ in B1.
  2. Create a script (Script editor from the Tools menu) and give that a good name as well.
  3. In the script editor pick Libraries from the Resources menu. Enter 1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF which is the Google OAuth library, pick the latest version and click Save.
  4. Select Project properties from the File menu and make a note of the Script ID.
  5. Log into your Azure Console and then go to https://resources.azure.com/. You are looking for a metricdefinitions node for the resource that you want to monitor. In my case it’s subscriptions / MyName Subscription / resourceGroups / providers / Microsoft.Web / sites / MySite / metricdefintions. Browse through this list to find the id of the metric you’re interested in. For me it’s AverageResponseTime. Finding this was the hardest part. Microsoft’s documentation for resourceUri is literally ‘The identifier of the resource.’ Why even bother Microsoft? Make a note of the id and remove the ‘metricDefinitions/AverageResponseTime’ from the end, because of course the ID isn’t quite right for some reason. Mine looks something like this: /subscriptions/mylongid/resourceGroups/mysomethingResourceGroup/providers/Microsoft.Web/sites/mysiteid
  6. Go back to the Azure Console and open Azure Active Directory. Select App registrations under Manage and create a New registration. Time to come up with another name. You probably want ‘Accounts in this organizational directory only’. The redirect URL is https://script.google.com/macros/d/SCRIPTID/usercallback - replace SCRIPTID with the Script ID you made a note of in step 4.
  7. Click the View API permissions button, then Add a permission and then pick Azure Service Management. I’m using Delegated permissions and the user_impersonation permission. Then click Grant admin consent for Default Directory.
  8. Go to Certificates & secrets (under manage) and create a new client secret. Make a careful note of it.
  9. Go to Authentication (under Manage), check Access tokens under Implicit grant and then click Save at the top of the page.
  10. Go to Overview and make a note of your Application (client) ID and Directory (tennant) ID.
  11. You are getting close! Go to the script editor (from step 2) and paste in the code at the bottom of this post. There are four variables to enter at the top of the script. ClientID and TennantID are from step 10. ClientSecret is from step 8. ResourceID is from step 5. Save the script.
  12. Reload the spreadsheet (back from step 1). You should get an Azure Monitor menu item. Choose Authorize from this menu. Google will ask you to authorize the script, do this for the Google account you’re using. Choose Authorize again, this time a sidebar will appear with a link. Follow the link and authorize against Azure (if you’re logged in this might just go directly to success). If you get authorization errors in the future run this step again. If that does help use Reset Settings and then try again.
  13. You should be ready to get data. Choose Fetch Data from the Azure Monitor menu. If this doesn’t work check through steps 1-12 carefully again!
  14. Last step - automate. Go back to the script editor. Choose Current project’s triggers from the Edit menu. Add a trigger (the small blue button hidden at the bottom right of the screen - not everything needs a floating action button Google!) to run fetchData daily at some reasonable time.
You should now have a daily record of average response time flowing to a Google sheet. This can easily be extended to support other metrics, and other time periods (you could get data by minute and run the script hourly for instance. See the metrics documentation for more ideas. I got this working for an App Service but it should be roughly the same flow for anything that supports metrics, you’ll just need to work on finding the right resourceUri / ID.

BadImageFormatException for a 64-bit ASP MVC web application

System.BadImageFormatException for a 64-bit web application in IIS Express

I converted an ASP.NET MVC web application to 64-bit in order to use dlib and it immediately died with a System.BadImageFormatException (Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format.)

Assuming I must have a stray wrong-bittedness something lying around I spent way to long with the assembly binding log viewer (Fuslogvw.exe) trying to figure out what I had messed up. But eventually I realized that Visual Studio was launching a 32-bit version of IIS Express to debug a 64-bit web application.

To fix this select Options from the Tools menu, expand Projects and Solutions, choose Web Projects and then check Use the 64-bit version of IIS Express for  web sites and projects. Problem solved.

(Probably shouldn't have this component in the web application - the plan longer term is to move it to an asynchronous process somewhere instead.)

I just want to get rid of Windows 10 Notifications with one click

Updated on Thursday, May 3, 2018

I just want to get rid of Windows 10 Notifications with one click

910 days ago I vented my frustration at Windows 10 notifications.

Well someone in Redmond must be listening. They 'fixed' it.

The problem was that dismissing a notification did not actually get rid of it. Clicking the little x in the corner just sent it to the Action Center where you could enjoy reading it and dismissing it again.

Like some kind of cargo cult Toyota, Microsoft asked the one why, and changed the little x to an arrow. Now it's more obvious that you're just shuffling the notification around the desktop. Ticket closed. But I still have to handle every fucking notification twice.

Which makes the announcement of the April 2018 Update especially ironic:

"With this update, available as a free download today, you get new experiences that help minimize distractions and make the most of every moment by saving you time. Our hope is that you’ll have more time to do what matters most to you whether that’s to create, play, work, or simply do what you love."

I'm guessing they're all on Macs?

The Trust Project, Fake News and a Partial Facebook Uninstall

Updated on Thursday, May 3, 2018

No Facebook app to be found here

The Trust Project is a well meaning but doomed attempt to deal with fake news.

Facebook, Google, Bing and Twitter are all on board because it's important to be seen to be doing something about the problem. Sarah Perez at TechCrunch writes:

"Here’s how this will work in practice: starting today on Facebook, an icon will appear next to articles in the News Feed. When you click on this icon, you can read information the publisher has shared related to their organization’s “ethics and other standards, the journalists’ backgrounds, and how they do their work,” according to an announcement from The Trust Project."

Please take a minute to scroll through the Trust Protocol Phase I MVP. Yes, this is a minimal viable product where your most recent Diversity Staffing Report is required. I don't think they understand what an MVP is. Which would be fine if they understood how to fix the problem. They don't.

Back in January I wrote this about fake news on Facebook:

"The horrible danger is that if you don't fact check every stupid quote on image meme the power of repetition lodges them somewhere in your subconscious where they become that thing that you read somewhere. Which is OK if you only read quality news but deadly if you want to catch up on old friends quickly."

And back in 2010 on cable news and the Fairness Doctrine:

"24-hour news stations are especially bad because most days there just isn’t that much news. This leaves a choice between repeating the news that exists which is boring, or making stuff up which is a lot more fun. Unfortunately It’s also corrosive."

Yes, it would be nice to have a set of standards around more easily vetting the provenance of "news" that you find on the internet. But the problem is with people taking bullshit at face value (myself sometimes included). When you scroll by something that meets the loose standards of your confirmation bias the damage is done. You're not clicking any Trust Project icon and you're sure as fuck not upgrading Acrobat just to read the Breitbart Diversity Staffing Report.

The Trust Project isn't the answer. Facebook just pulled their disputed flag. The Fairness Doctrine isn't coming back. Is there a technology based fix that might work?

"That’s not going to happen, argues Data & Society founder and Microsoft researcher danah boyd. Google, Facebook, Twitter—none of these companies is sitting on a silver-bullet solution. As boyd wrote for us earlier this year, we have more than a technology problem: “[W]e have a cultural problem, one that is shaped by disconnects in values, relationships, and social fabric."

From The Fake News Culprit No One Wants to Identify: You on Backchannel recently. I see. It's up to me. I have to fix it.

I uninstalled Facebook and Twitter from my phone just over a week ago. I'm not abandoning social media entirely (although I toy with this regularly). Just pulling back a bit.

For the first few days I'd regularly find my finger headed to launch Facebook. Every time I had a minute to kill. Facebook has no end (usually) so it works even when my RSS feed is empty. I stocked Feedly up with more wholesome content (Trust Project approved no doubt). By the end of the first week I was sometimes even leaving my phone in my pocket.

Now I catch up on Facebook on my laptop every day or two. It's a much better experience - when you check 200 times a day the feed algorithm gets increasingly desperate to please you. It panics and serves up lame memes from someone who you think must have been a coworker at some point but don't really remember. I get through a few updates from friends that I'm actually interested in and bail before hitting the questionable stuff.

It's up to you too.

Why Microsoft is Likely Doomed Based on one Email Folder

Close up of the useless Junk folder in Microsoft Outlook

When you get a piece of spam in Outlook you move it to Junk or block the sender. And then, even if that junk mail is marked as read, the Junk folder has a BOLD MESSAGE COUNT. It's the only folder that does this. I cannot do any other work while I have a bold message count and so I have to switch to the Junk folder and delete the message to get rid of it.

Regular email: read, file, done.

Junk email: recognize as spam, click block sender, confirm that I really want to block the sender, switch to Junk folder, mark as read, delete.

Something is really wrong with this workflow. It's a lens through which you can view the ultimate demise of the company. Sure, Office isn't going away soon and Azure is growing like crazy and SQL Server runs on Linux. But somewhere in Redmond 5,000 people designed a Junk email folder that is the MOST IMPORTANT folder in Outlook. The rest were presumably too busy making Windows Update worse to stop this.

My Google experience is that I really don't get much spam. The spam that I do get is hidden from me unless I actually need to rifle through it for some reason. On the occasion I actually get legitimate junk I just flag it as such and never have to touch it or it's ilk again.

Reading and Writing Office 365 Excel from a Console app using the Microsoft.Graph C# Client API

Updated on Sunday, September 30, 2018

I needed a console app that reads some inputs from an online Excel workbook, does some processing and then writes back the results to a different worksheet. Because I enjoy pain I decided to use the thinly documented new Microsoft.Graph client library. The sample code below assumes that you have a work or education Office 365 subscription.

Paste the code into a new console project and then follow the instructions at the top to add the necessary NuGet packages. You'll also need to register an application at https://portal.azure.com/. You want a Native application and you'll need the Application ID and the redirect URL (just make up some non-routable URL for this). Under Required Permissions for the app you should add read and write files delegated permissions for the Microsoft Graph API.

Hope this saves you a few hours. Comment below if you need a more detailed explanation for any of the above.

Updates were installed...

Updated on Wednesday, February 22, 2017

Microsoft you are literally killing me. Please tell me there is a reason.

Windows 10 has had a reorg of notifications. People in Redmond have spent quality time thinking about how and when to bother me. User experiences have been imagined, focus grouped, re-imagined, tested, pushed out to beta, revised, polished and finally shipped in a heaping turd of time wasting.

After one of the never ending reboots following some critical update or other I get a nice popup to let me know that updates were installed:

Updates were installed...

I'm not sure this is the most important news I'll read all day but fine, thank you and I click the little x to dismiss.

Windows at this point knows that it's told me about the updates, and it knows that I've seen the message because I took the time to actively dismiss it.

So why is this now in the Action Center:

Updates were installed...

I have to acknowledge my latest helping of updates all over again. It's the sort of double confirmation I'd really value before inadvertently nuking Belgium but for pretty much anything I've ever seen in Action Center it's overkill. It's causing the most anger I've had with an Operating System since I had to Google how to shut down Windows 8.

Windows 10 is on 110 million devices. Assuming a reboot a week and three seconds per device spent dismissing the extra message we're looking at a cost of $28 million a year (at US GDP). Microsoft has said it expects a billion Windows 10 devices in 2-3 years. Even at global average GDP that's $64 million down the drain.

It's not a quirky design decision, it's a class action lawsuit waiting to happen.

Smart people must have spent time on this. Please tell me why?

Leaving Chrome

Updated on Wednesday, February 22, 2017

Leaving Chrome

My Chromebook was stolen over the weekend. The good news is that I didn't lose anything given the cloud only nature of the device. The bad news was that I didn't really want to get a new one.

I loved the cost and the boot speed and being able to do nearly everything I needed to with a browser-in-a-box.

But the nearly was a deal breaker. I sometimes need to VPN and the Chromebook wouldn't. It just wasn't compatible with our flavor of VPN and I didn't want to buy another Chromebook on the off chance that Google would eventually fix this. I also have to use Skype (I'd rather not) and this isn't really possible on the Chromebook either. Imo.im was good while it lasted. IM+ is horrible.

I've abandoned the Chrome dream and picked up a Surface Pro 3.

(Read the full Chromebook adventure: Part 1: Going Chrome, Part 2: Staying Chrome? and Part 3: Leaving Chrome)