Scott Hanselman

Relationship Hacks: An Allowance System for Adults

March 7, '17 Comments [63] Posted in Musings
Sponsored By

Nintendo Switch - YOU DESERVE ONEI'm setting a goal for myself to finish my half-finished book relationshiphacks.com this year. In an attempt to make that happen (and because the recent podcast with my wife was wildly popular) I'm going to try to blog some guiding principles. Then I'll attempt to collect the feedback and comments, improve the posts, then move them into the book.

I got a Nintendo Switch yesterday. Bought it with cash, brought it home, set it up, and - with neither shame nor regret - showed my non-gamer spouse.

"That's cool," she said. "Is that the new Nintendo 64 they were talking about on the radio?"

No judgment. Not a comment about the $300 price tag. Nothing was said like "do we really need another game?" or "what credit card did you buy that with?"

How is this possible? No fight (not even a lowercase F fight) and no tension.

My wife and I give each other an allowance. In cash.

Every two weeks when our paychecks are deposited, we each get an allowance. It's a $100 a week (yes, for some that's a lot, for others, it's not. It works for us.) and it's the same for each of us. We put all our money in one account, give ourselves the allowance, pay the bills, then if there is anything left over it goes it savings.

Let me back up. We used to a bicker and judge each other for our purchases. If you'd log into our bank you'd see something like:

  • Paycheck
  • Mortgage
  • Car Note
  • $5 Starbucks
  • $3 Subway
  • $8 Chipotle
  • $60 GameStop
  • $70 Nordstrom

HOLD UP. What is that GameStop? Well, what's this Nordstrom? Did you need to be getting that [widget?]

You get the idea. We needed to remove all that noise at the bottom of the ledger as it was distracting us from the larger goals.

Then my wife had the idea that we just needed to pay ourselves first. We can spend that money however we like - with promised zero judgment from the other spouse. That's crucial, otherwise the system doesn't work.

The allowance for anything that isn't "necessarily living stuff." So it's not for toothpaste, but it IS for eating out when we don't need to eat out.

I could have eaten at Chipotle each day this week, but that would come out of my allowance. Instead, I chose to eat at home all month and save my allowance for a Nintendo Switch.

This works - of course - both ways. My wife has hobbies and social stuff that she does, and she uses her allowance for that.

If you made it this far, perhaps you're thinking, "wow, you're a wimp" or "gee, he/she has you in their pocket." Wait.

Step back and absorb. We are grown-ass people. This system works because we designed it for us. All arguments around "frivolous" spending are gone.

This allows us the best of all worlds.

  • It keeps credit card spending to an absolute minimum. 
  • We are empowered and we empower each other with this system.
  • There's a certain sense of power in carrying cash. You know exactly how much you have and exactly when you have to stop spending.
  • We can decide if we want $200 shoes or a $100 meal or a $50 game. One spouse comes home excited about their purchase while the other greets them without resentment. The fixed allowance amount handles that.
    • Additional spending is discussed on a case-by-case basis. But we've picked an amount that is large enough that I could buy something crazy like a Vive - if I am willing to forgo movies, excessive eating out, etc.
  • It sets a good example for the kids as they watch us weigh the pros and cons of a purchase. Money is spent when it's in-hand and not on credit.

My wife and I are in a mixed marriage. It's not that I'm White and she's Black, is that I'm a techie/geek/nerd and she's fairly normal. ;) Of course, this kind of mix isn't gender or race specific. I know lots of couples of varying combos and flavors that bump up against issues in their relationships because of budding resentment, missed or poorly set expectations, divergent points of view around problem solving, and more.

I'd love to hear YOUR story of your partner and your "mix" and how you (mostly) solved it with a simple Relationship Hack like this. Sound off in the comments.


Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test, build and debug ASP.NET, .NET Framework, .NET Core, or Unity applications. Learn more and get access to early builds!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Exploring the new DevOps - Azure Command Line Interface 2.0 (CLI)

March 2, '17 Comments [29] Posted in Azure
Sponsored By

Azure CLI 2.0I'm a huge fan of the command line, and sometimes I feel like Windows people are missing out on the power of text mode. Fortunately, today Windows 10 has bash (via Ubuntu on Windows 10), PowerShell, and "classic" CMD. I use all three, myself.

Five years ago I started managing my Azure cloud web apps using the Azure CLI. I've been a huge fan of it ever since. It was written in node.js, it worked the same everywhere, and it got the job done.

Fast forward to today and the Azure team just announced a complete Azure CLI re-write, and now 2.0 is out, today. Initially I was concerned it had been re-written and didn't understand the philosophy behind it. But I understand it now. While it works on Windows (my daily driver) it's architecturally aligned with Mac and (mostly, IMHO) Linux users. It also supports new thinking around a modern command line with support for things like JMESPath, a query language for JSON. It works well and clearly with the usual suspects of course, like grep, jq, cut, etc. It's easily installed with pip, or you just get Python 3.5.x and then just "pip install --user azure-cli."

Linux people (feel free to check the script) can just do this curl, but it's also in apt-get, of course.

curl -L https://aka.ms/InstallAzureCli | bash

NOTE: Since I already have the older Azure CLI 1.0 on my machine, it's useful to note that these two CLIs can live on the same machine. The new one is "az" and the older is "azure," so no problems there.

Or, for those of you who run individual Docker containers for your tools (or if you're just wanting to explore) you can

docker run -v ${HOME}:/root -it azuresdk/azure-cli-python:<version>

Then I just "az login" and I'm off! Here I'll query my subscriptions:

C:\Users\scott\Desktop>  az account list --output table
Name CloudName Sub State IsDefault
------------------------------------------- ----------- --- ------- -----------
3-Month Free Trial AzureCloud 0f3 Enabled
Pay-As-You-Go AzureCloud 34c Enabled
Windows Azure MSDN AzureCloud ffb Enabled True

At this point, it's already feeling familiar. It's "az noun verb" and there's an optional --output parameter. If I don't include --output by default I'll get JSON...which I can then query with JMESPath if I'd like. (Those of us who are older may be having a little XML/XPath/XQuery déjà vu)

I can use JSON, TSV, tables, and even "colorized json" or JSONC.

C:\Users\scott\Desktop> az appservice plan list --output table   
AppServicePlanName GeoRegion Kind Location Status
-------------------- ---------------- ------ ---------------- --------
Default1 North Central US app North Central US Ready
Default1 Southeast Asia app Southeast Asia Ready
Default1 West Europe app West Europe Ready
DefaultServerFarm West US app West US Ready
myEchoHostingPlan North Central US app North Central US Ready

I can make and manage basically anything. Here I'll make a new App Service Plan and put two web apps in it, all managed in a group:

az group create -n MyResourceGroup
# Create an Azure AppService that we can use to host multiple web apps 
az appservice plan create -n MyAppServicePlan -g MyResourceGroup

# Create two web apps within the appservice (note: name param must be a unique DNS entry)
az appservice web create -n MyWebApp43432 -g MyResourceGroup --plan MyAppServicePlan
az appservice web create -n MyWEbApp43433 -g MyResourceGroup --plan MyAppServicePlan

You might be thinking this looks like PowerShell. Why not use PowerShell? Remember this isn't for Windows primarily. There's a ton of DevOps happening in Python on Linux/Mac and this fits very nicely into that. For those of us (myself included) who are PowerShell fans, PowerShell has massive and complete Azure Support. Of course, while the bash folks will need to use JMESPath to simulate passing objects around, PowerShell can keep on keeping on. There's a command line for everyone.

It’s easy to get started with the CLI at http://aka.ms/CLI and learn about the command line with docs and samples. Check out topics like installing and updating the CLI, working with Virtual Machines, creating a complete Linux environment including VMs, Scale Sets, Storage, and network, and deploying Azure Web Apps – and let them know what you think at azfeedback@microsoft.com. Also, as always, the Azure CLI 2.0 is open source and on GitHub.


Sponsor: Check out JetBrains Rider: a new cross-platform .NET IDE. Edit, refactor, test, build and debug ASP.NET, .NET Framework, .NET Core, or Unity applications. Learn more and get access to early builds!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Temporary Fix: Logitech BRIO Camera broken on Windows 10 Insiders 15042

February 25, '17 Comments [10] Posted in Bugs | Win10
Sponsored By

I just updated my Windows 10 to Insiders Fast Build 15042, and suddenly my glorious new Logitech BRIO 4k webcam doesn't work! Well, it's all beta software, but it turns out the issue is with something in the Logitech INF files for their drivers. I'm assuming they'll figure it out, but the nutshell is that the first install works, but the driver gets messed up on the upgrade. You can't just pull out the camera and put it in again, you need to DELETE the drivers and have them redownloaded by Windows Update/Device Manager.

Here's a temporary fix (either until Logitech fixes it and it shows up in Windows Update or you take another Windows 10 upgrade):

Logitech BRIO stops working on Windows 10 Insiders UPGRADE

Go to device manager and right click the device and Uninstall Driver. If it has the checkbox "Delete this driver" then check it. That's required. IF (like me) you don't have that checkbox (I'm not sure why I don't) then you'll need to delete the Logitech driver from the DriverStore. You can do it manually but it's tricky and messy and hard.

We need to delete this driver so it gets reinstalled cleanly.

Driver 2/31/2017

Unplug your webcam. Then, go get the latest copy of DriverStoreExplorer from here https://github.com/lostindark/DriverStoreExplorer/releases and delete JUST this one driver.

Using the Driver Store Explorer

Now, go back to Device Manager and plug in your Logitech BRIO webcam. Note you'll get some super old 2006 driver. Right click the BRIO in Imaging Devices and Update Driver. This will get you BACK to your original state. You still have a driver that will break when you next take a "major" Windows update or Insiders Build, but at least you have a solution until it magically gets fixed.

Yay!


Sponsor: Big thanks to Progress! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is still a viable language. Check it out!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Xamarin .NET Workbooks - Interactive Computing is a stellar learning tool

February 24, '17 Comments [11] Posted in DotNetCore | Learning .NET
Sponsored By

I've been thinking a lot about how to best teach .NET and C#/F# to folks who are new to the space. We've added an in-browser no-install C# tutorial at http://dot.net. You can run through almost a few days lessons in C# without installing anything. Heck, it's useful even if you just want to brush up on your skills.

When I spoke with Safia Abdalla a few months ago she re-introduced me to the ideas behind Interactive Computing and the whole ecosystem around Jupyter Notebooks, and the Nteract project Safia works on. It's pretty amazing.

Pythonistas are familiar with Jupyter and the idea of a notebook that cleanly mixes prose and code. This ecosystem is very friendly to data scientists that are (perhaps) more scientist and less developer. People for whom an IDE is not as interesting as "electric paper."

In fact, many people don't realize that the Microsoft Azure Cloud supports hosting of Jupyter Notebooks using Python, R, and F#.

Azure Notebooks

Notebooks are a great learning resource that go beyond a REPL (an simple interactive console) in that they are effectively textbooks with islands of interactive code. It's even more powerful when you consider graphics, charts, and other interactive models.

Xamarin has a thing called Xamarin Workbooks (I'm calling them .NET Workbooks in my head) that you should download and check out RIGHT NOW. Go get Xamarin Workbooks & Inspector for Windows (or download for Mac). Start playing around with workbooks or try out the samples.

I'm going to try teaching my C# and .NET courses for at least the first day or two using Xamarin .NET Workbooks. I think they have huge potential and I'm thrilled that Miguel and friends are investing so much in them. The potential for these as a learning tool that sits between a REPL and an IDE is huge.

The page at https://developer.xamarin.com/workbooks/ is FILLED with amazing example workbooks and lessons, and it's growing. It has section not only on C# but Android, Games, Graphics as a concept, iOS, WPF, and so much more.

I run it and start here:

Xamarin Workbooks

Then I start typing...prose first! Just real sentences. Then I add some code. Notice that I'm not doing Console.WriteLine, I'm just assigning a variable. Xamarin Workbooks makes a nice visualization of my variable.

var scott = "Hanselman"

The prose is ignored (by the compiler) but the code cells and built upon each other and when you execute one you're executing up to that point. Great for building up concepts.

You can print in other libraries and built upon them like in this chart example using the Urho library.

Charts in Xamarin Workbooks

Not to put to fine a point on it, but you can write really fully featured examples or games in Xamarin Workbooks. Here's a fully 3D realized planet earth WITH SATELLITES. Again, with not just sample code but explanatory prose. It's a textbook come to life.

THIS is how I wish I learned programming 25 years ago. I'd loved to have turned (or demo'ed) a .workbook file. I'm thrilled to see C# folks be able to do simple things that Jupyter users have enjoyed for so long.

3D Earth in Xamarin Workbooks

What do you think? Would this be a good way to deliver a course on learning .NET and C#?


Sponsor: Big thanks to Progress! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is still a viable language. Check it out!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Azure App Service Secrets and Web Site Hidden Gems

February 22, '17 Comments [22] Posted in Azure
Sponsored By

I just discovered that you can see a preview (almost like a daily build) of the Azure Portal if you go to https://preview.portal.azure.com instead of https://portal.azure.com. Sometimes the changes are big, sometimes they are subtle. It feels faster to me.

Azure Preview Portal

A few days ago I blogged that I had found a number of things in Azure that I wasn't previously aware of like "Metrics per instance (App Service)" which is DEEPLY useful if you run more than one Web App inside an App Service Plan. Remember, an App Service Plan is basically a VM and you can run as many Websites, docker containers, Azure Functions, Mobile Apps, Api Apps, Logic apps, and whatever you can fit in there. Density is the word of the day.

Azure App Service Secrets and Hidden Gems

A bunch of folks agreed that there were some real hidden gems worth exploring so I thought I'd take a moment and do just that. Here's a few of the things that I'm continuously amazed are included for free with App Service.

Console

The Console option under Development Tools

There's a web-based console that you can access from the Azure Portal to explore your apps!

Live HTML5 Console within the Azure Portal

This is basically an HTML 5 bash prompt. I find it useful to double check the contents of certain files in Production, and confirm environment variables are set. I also, for some reason, find it comforting to see that my "cloud web site" actually lives on Drive D:. It calms me to know the Cloud has a D Drive.

App Service Editor

App Service Editor

App Service Editor is the editor that's codenamed "Monaco" that powers Visual Studio Code. It's amazing and few people know about it. I use it to make quick updates to production, although you do need to be aware if you have Continuous Deployment enabled that your changes will get eventually overwritten.

It's like a whole "IDE in the Cloud"

Testing in Production - (A/B Testing)

This is an amazing feature that not enough people know about. So, I'm assuming you are aware of Staging Slots? These are things like dev-, test-, or staging- that you can pull from a different branch during CI/CD, or just a separate but near-identical website that runs on the same hardware. The REAL magic is the Testing in Production feature.

Once you have a slot - I have one here for the Staging Site for BabySmash - you have the option to just "swap" between staging and production...OR...you can set a percentage of traffic you want to go to each slot!

Note that traffic is pinned to a slot for the life of a client session, so you don't have to worry about folks bouncing around if you change the UI or something.

Why is this insanely powerful? You can even make - for example - a "beta" slot and have your customers opt-in to a beta! And you don't have to write any code to enable this! MyApp.com/?x-ms-routing-name=beta would get them there and MyApp.com?x-ms-routing-name=self always points to Production.

Testing in Production 

You could also write a PowerShell script that would slowly move traffic in increments. That way you could ramp up traffic to staging from 5% to 100% - assuming you see no errors or issues.

$siteName = "yourProductionSiteName"
$rule1 = New-Object Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.RampUpRule
$rule1.ActionHostName = "yourSlotSiteName"
$rule1.ReroutePercentage = 10;
$rule1.Name = "stage"

$rule1.ChangeIntervalInMinutes = 10;
$rule1.ChangeStep = 5;
$rule1.MinReroutePercentage = 5;
$rule1.MaxReroutePercentage = 50;
$rule1.ChangeDecisionCallbackUrl = "callBackUrlOfyourChoice-OptionalThatDecidesIfYouShoudlKeepGoing"

Set-AzureWebsite $siteName -Slot Production -RoutingRules $rule1

All this stuff is built-in to the Standard Azure AppServicePlan.

Easy and Cheap Databases

A number of folks in the comments of my last post asked about the 20 websites I have running on my single App Service Plan. Some felt I may have been disingenuous about the pricing and assumed I have a bunch of SQL Server databases behind my sites, or that a site can't be useful without a SQL Server.

There's a few things there to answer. My sites are many different techs, Node.js, Ruby, C# and ASP.NET MVC, and static sites. For example:

  • Running the Ruby Middleman Static Site Generator on Microsoft Azure runs in the cloud when I check code into GitHub but deploys a static site.
  • The Hanselminutes Podcast uses WebMatrix and ASP.NET WebPage's "SQL Compact Edition." This database runs out of a single file that's stored locally.
  • One of my node.js sites uses SQL Lite for its data.
  • One ASP.NET application uses "Azure MySQL in-app" that is also included in Azure App Service. You get a single modest MySQL database that runs in the context of your App Service. It's not super fast and meant for development, but with a little caching it's very workable.
  • One node.js app thinks it is talking MongoDB but actually it's talking via MongoDB protocol support in Azure DocumentDB. You can create an Azure noSQL DocumentDB and point any app that speaks Mongo to it and it Just Works.

There's a number of options, including Easy Tables for your Mobile Apps. Check out http://mobile.azure.com to learn more about how you can get a VERY quick and easy backend for mobile (or web) apps.

Azure App Service Extensions

If you have used Git deploy to an Azure App Service, you likely noticed a "Sidecar" website that your app has. I have babysmash.com which is actually babysmash.azurewebsites.net, right? There's also babysmash.scm.azurewebsites.net that you can't access. That sidecar site (when I'm authenticated) has a ton of easy REST GET APIs I can call to get my process list, files, deployments, and lots more. This is all powered by Kudu, which is open source by the way.

The Azure Kudu sidecar site

Kudu's sidecar site is a "site extension." You can not only write your own Azure Site Extension (they are just NuGet packages!) but it turns out there are a TON of useful already vetted and published extensions you can add to your site today. Those extensions live at http://www.siteextensions.net but you add them directly from the Azure Portal. There's 84 at the time of this blog post.

Azure Site Extensions include:

  • phpMyAdmin - for Admin of MySQL over the web
  • Azure Let's Encrypt - Easy install of Let's Encrypt SSL certs!
  • Image Optimizer - Automatic squishing of your site's JPGs and PNGs because you know you forgot!
  • GoLang Support - Azure doesn't officially support Go in Azure Web Apps...but with this extension it works fine!
  • Jekyll - Easy static site generation in Azure
  • Brotli HTTP Compression

You get the idea.

Diagnostics

I just discovered this "uptime" blade within my Web Apps in the Azure Portal. It tells me my app's uptime and if it's not 100%, it tells my why not and when!

Azure Diagnostics and Uptime

Again, none of this stuff costs extra. You can add Site Extensions or explore your apps to the limit of the underlying App Service Plan. I'm doing all this on a single Standard 1 (S1) App Service Plan.


Sponsor: Excited about the future in ASP.NET? The folks at Progress held an awesome webinar which gives a 360⁰ view of the new ASP.NET Core and how it compares to WebForms and MVC. Watch it now on demand!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.