Quantcast
Channel: Scott Hanselman's Blog
Viewing all 1148 articles
Browse latest View live

How to deal with Extreme Physical Pain

$
0
0

francisco-gonzalez-M8UEJd58GcE-unsplashI'm in a LOT of pain right now. It's hard to say that, especially considering that everyone experiences pain be it emotional or physical. I don't want to make unneeded comparisons or consider my pain as being more important than anyone else's. I'm not burned. I'm not dying of cancer. I am blessed.

But I'm hurting. A lot. It's mine and it's now and it's not clear when it will stop.

It's hard to think. It's hard to move. I can't sleep. Oxycodone makes me feel sick. Advil does nothing.

I've just had my second frozen shoulder surgery (adhesive capsular release) in 4 years. Frozen shoulder is idiopathic (who knows why it happen) and it's known to be quite painful. I can attest that it is. I've been unable to move my right arm for nearly a year. Not just that I couldn't move it, I mean it couldn't be moved by anyone. I couldn't fit the deodorant in to my armpit because the whole join was hardened.

I had cortisone shots. No result. I finally had formal capsular release surgery where the surgeon goes in there and tidies up, removes scar tissue.

Then the months of physical therapy and forced stretching starts.

I'm going to physical therapy five days a week for an hour a day, and working at home stretching myself for an other 1-2 hours. It's overwhelming and consuming. I just want to be able to pick up a cup from a high shelf. I have basic arm-usage requirements. This is going to be a marathon, and this is the second time this has happened.

Why am I telling you this?

A few reasons. I need the outlet. It's my blog. Because I appreciate you all and you've been here, some of you, for nearly 20 years. Not everything is code.

I had a nerve block in my neck that turned off my right side for a week. That was an extraordinary experience as it was an opportunity to experience a significant, albeit temporary, physical disability. Before I had no ability to move my arm but I had feeling. Now I had zero use of my right arm. It was a numb cadaver arm - dangerously dead weight. I used the time to play Xbox with my feet using the Xbox Adaptive Controller.

This nerve block is wearing off and it's gone from itching, to tingling, to the feeling of an ice pick shoved into my deltoid and armpit every few minutes.

I burst into tears at physical therapy today. The year just hit me all at once. It hurts. Between diabetes and this temporary paralysis, it’s been a week. 2020 is ass. It’s OK. Happens a few times a decade. Maybe it happens to you twice a week. Let it out, listen to your body.

Why am I telling you this?

It's OK to tell people you hurt. You're human. Talk about your pain. Cry. Yell. Sob. Talk some more.

When I'm done yelling, I'm trying to sit quietly and meditate about this pain. What is it trying to tell me? Can I mentally follow the nerve from the location (referred pain or otherwise) to my brain and determine what the boy wants me to know? Am I being told there's danger?

I'm finding that there is soft tissue tolerance - what I can handle - and that doesn't always line up with what I'm feeling. I'm feeling near intolerable pain in PT (physical therapy). Like torture with an unknown end date, it's taken me to the level of pain where vomiting is the only escape and then it starts again. However, I persist. I breathe. I try to listen and trust the process and know that if I want to regain the full use of my arms, this is a medically known and studied process. Physical therapy works if you do it.

The cognitive dissonance is overwhelming. Your body says you're actively dying but your conscious brain can - must - override it and let the pain flow freely. You observe it, rather than obstruct it.

I hate this process but I'm going to learn from it. I'm learning and listening to my body and how I react to something so extreme.

The pain is important to acknowledge because this pain is gonna make me better and stronger. But it still hurts. Here we go.

I hope that you, Dear Reader, are not in pain. But if you are, I hope it passes and that you come out better on the other side. I'm going to use this Bad Input for Good.

BTW: Thanks to Volterra for sponsoring the blog this week. I suspect they didn't know what blog post(s) their ad would land on, but I appreciate their support and understanding as not every blog post is about code. This one is about people and their pain. Give them a click.


Sponsor: Need a multi-cluster load balancer and API gateway? Try VoltMesh: built for modern and distributed apps that require automation, performance and visibility. Start for free today.



© 2020 Scott Hanselman. All rights reserved.
     

Using an Xbox Adaptive Controller and Xbox Copilot to get back into gaming after surgery

$
0
0

Xbox Adaptive Controller addonsThanks for the kind words on my post earlier this week. Lots of great tips both in the comments and were sent to me privately. I'm still alternating meds, struggling at physical therapy every day, but I'm fortunate to have my wife (a medical/surgical nurse) here to tell me when it's supposed to hurt and when it's not.

That said, BEFORE the pain started I had a nerve block in my neck and my right side was basically "turned off" for a week. It's definitely preferable to the current pain situation but one of the bright spots is that it give me extreme compassion for those who are missing or unable to use one or more limbs.

I was hoping to use some of my convalescent time to play Xbox but I quickly discovered that it's VERY hard to play a FPS (first-person shooter) with one hand. Of course, tell an engineer that they can't do something and they'll just take it as a challenge, right?

I happened to have an Xbox Adaptive Controller (I bought a few just in case I wanted to set up some relatives or new friends who might need one, never realizing it would be me that needed one) so I hooked it up and tried to figure out how I could game given my paralyzed arm and a lot of free time.

The easiest and clearest way I can example the Xbox Adaptive Controller this - It's an Xbox Controller that pairs and talks to an Xbox like any other controller...but it's not a controller.

It's an Xbox Adaptive Controller Construction Kit.

It has headphone jacks - just 1/8" standard jacks - for every possible input, along with USB ports for Joysticks. You build - adapt - a controller that's ideal for you! It's magical.

Then, combine it with built in Xbox software called Copilot and you can link two controllers so that two can play as one. I was able to use an a standard Xbox Controller in my left hand while using the Xbox Adaptive Controller with my feet. Within an hour I was playing Call of Duty quite competently, I might say.

I even recorded it and put it in my YouTube so I have proof that I got at least one shot in during this round, LOL.

Go learn all about it, the Xbox Adaptive Controller is an extraordinary advice. Then go set it up for a friend or family member, they'll appreciate it very much.

Please take a moment to explore and subscribe to my YouTube. I'm nearing 100k subscribers there and I was told there would be snacks.


Sponsor: Need a multi-cluster load balancer and API gateway? Try VoltMesh: built for modern and distributed apps that require automation, performance and visibility. Start for free today.


© 2020 Scott Hanselman. All rights reserved.
     

How to allow executable .exe files to be downloaded with ASP.NET Core and UseStaticFiles middleware

$
0
0

In the long process of upgrading this blog and moving it to Azure I've been slowly fixing small bugs and also dealing with the dozens of microsites I have hanging off of hanselman.com. Some were forgotten, and some just keep chugging along. https://www.babysmash.com/ is one of them.

BabySmash is a silly WPF app I wrote 15 years ago for my baby, natch. He's now learning to drive a car, but it still gets thousands of downloads a month. The code is on Github.

The ClickOnce application and manifests hangs off of http://hanselman.com/babysmash, but the /setup.exe returns a 404.

I had assumed that using this simple code in my Startup.cs's Configure() method would enable static files like setup.exe:

app.UseDefaultFiles();

app.UseStaticFiles();

This was naive I suppose as ASP.NET Core is very much locked down by default so you are really encouraged to be specific and there are few unsafe defaults.

UseStaticFiles includes a parameter for options, so I needed to update the list of mappings from extension to mime/type. So this little helper function:

private StaticFileOptions GetStaticFileOptions()

{
var p = new FileExtensionContentTypeProvider();
p.Mappings[".exe"] = "application/octect-stream";
return new StaticFileOptions { ContentTypeProvider = p };
}

and then you pass that StaticFileOptions class into UseStaticFiles.

app.UseStaticFiles(GetStaticFileOptions());

Clearly a "secure by default" decision, but also one that's easily extended for my needs.


Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!



© 2020 Scott Hanselman. All rights reserved.
     

Creating a question friendly environment

$
0
0

christina-wocintechchat-com-MkxWUzCuYkE-unsplashA few years back I had a lovely podcast conversation with technical leader Keavy McMinn.

Sometimes I wonder if anyone listens to the show. Then a nice comment will come in when someone listen to an episode years ago and is still thinking about particular quote or line.

Last week I got an email asking about a blog post or podcast that I might have written, and the person wanted me to dig up the quote on a specific topic. It turns out it was from that podcast episode with Keavy. Keavy talks a lot about technical leadership on her blog and you should check it out.

I recently added Transcripts to all 400 HOURS of the podcast and you can search the entire 15 year episode archive in one place at Podscribe!

One of the topics around leadership I've been thinking about a lot lately is how to make work a "question friendly environment." You may hear the term "safe space" to refer to this kind of thing.

"We are missing out on valuable opportunities to connect and grow in our understanding of people if we aren’t giving one another permission to ask each other ignorant questions" - from Viewpoint

Some people come up at your later in career might say, "you should just ask your question don't be a wimp." However, when we do this I think we forget what it was like to be just a few years out of school. You know you don't know anything, but you really don't know how much you don't know.

In my opinion, the number one thing that we can do make more senior engineers, is to give the junior engineers a really good place to ask lots of dumb questions. That means replying to them with patience, providing them with resources to learn and explore, not scoffing or rolling our eyes. You too were once early in career, Dear Reader. Being given a place and permission to ask questions without judgment is a huge gift!

Permission to ask

As a manager, we need to explicitly offer the permission to ask. Talk about permission to ask questions up front, and model that behavior so that others know it's OK. Make sure that folks know you're not going to "flip the bozo bit" just because someone asked a question about DNS.

From Scott Ginsberg, If you want to build this type of environment, there are four key tasks ahead:

1. List the reasons why employees might (not) ask questions.
2. Maintain a question-friendly attitude.
3. Affirm your employees when they ask questions.
4. Reinforce a question-friendly environment.

Make it so that questions can also be asked anonymously. Take their technical questions and consider them from their perspective. They may be missing historical context but they add a new diverse point of view or a fresh technical spin.

What are you doing in your technical teams and at your company to make sure that folks feel they can ask technical questions without judgment?


Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!



© 2020 Scott Hanselman. All rights reserved.
     

How to change the background of your Windows Terminal settings

$
0
0

I've often asked for my Windows Terminal's settings.json (formerly profiles.json) so I keep it up on GitHub. The thing is, all my machines are different. I mix it up, I change it.

Remember that the Windows Terminal is approaching version 1.5 today! Make sure you upgrade and read about the new features! This version includes clickable hyperlinks! UPGRADE NOW.

Get Windows Terminal free from the Store. You can also get it from GitHub's releases but I recommend the store because it'll stay up to date automatically.

Here's what my Terminal looks like today! I've added transparent PNGs in the lower right corners of each shell so I can keep track, but it's also nice for teaching folks how to use the Command Line.

Here's the settings block for PowerShell, for example. Note the backgroundImage* items:

{

"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"backgroundImage": "D:\\Dropbox\\utils\\TerminalBackgrounds\\powershell-2-400x225.png",
"backgroundImageStretchMode": "none",
"backgroundImageAlignment": "bottomRight",
"colorScheme": "Campbell Powershell"
},

I keep my background images in DropBox or OneDrive so they can be referred to from any of my computers. You can make stretch wallpaper-like images, or you can make subtle (or less subtle, like mine) logo watermarks.

Lovely backgrounds for your Windows Terminal

Here's the PNG backgrounds for these images. I also put this images at https://github.com/shanselman/PrettyWindowsTerminalThings and you're welcome to put nice ones and your own tips up there as well!

dos

powershell-2-400x225

ubuntu_white-orange_hex_su

Thanks to https://www.powershellmagazine.com/ for the use of their PowerShell Logo! Also check out How to make a pretty prompt in Windows Terminal with Powerline, Nerd Fonts, Cascadia Code, WSL, and oh-my-posh.


Sponsor: Have you tried developing in Rider yet? This fast and feature-rich cross-platform IDE improves your code for .NET, ASP.NET, .NET Core, Xamarin, and Unity applications on Windows, Mac, and Linux.



© 2020 Scott Hanselman. All rights reserved.
     

Your dotnet outdated is outdated! Update and help keep your .NET projects up to date

$
0
0

I've talked about the dotnet-outdated tool before but now it's, ahem, outdated. It's moved to new owners so head over to your command line and update "dotnet-outdated" like this:

dotnet tool uninstall --global dotnet-outdated

dotnet tool install --global dotnet-outdated-tool

Just copy paste those and you'll be updated. Yes, it's changed it's moniker but the tool is the same and you still invoke it with "dotnet outdated." You can learn more about the wonderful dotnet outdated tool on their GitHub! Take a moment, Dear Reader, and give them a GitHub Star!

Now, here's the output of dotnet outdated on my own podcast's website

dotnet outdated finds older NuGet packages

I enjoy the use of color with this command line tool. Note that it's calling out that there may be some real Breaking Changes with some of these version number moves. Updating to a major version could be scary, so I'll take extra care there.

If I was feeling super lucky, I could do a dotnet outdated -u and have it automatically upgrade all my references and then test the resulting project. I could also update just a few, or do them one at a time. If you combine dotnet outdated with Github bots like Dependabot you can really get a handle all libraries updates once and for all.

dotnet outdated

No outdated dependencies were detected

Woohoo!


Sponsor: Have you tried developing in Rider yet? This fast and feature-rich cross-platform IDE improves your code for .NET, ASP.NET, .NET Core, Xamarin, and Unity applications on Windows, Mac, and Linux.



© 2020 Scott Hanselman. All rights reserved.
     

Spectre.Console lets you make beautiful console apps with .NET Core

$
0
0

I've long said, as a fan of the console and text mode, that the command line is underloved. You can do accelerated 3D VR, sure, but impress me with a nice ASCII progress bar or spinner and oh my! *Chef's kiss*

Enter yet another lovely Console library in the form of Spectre.Console. You may know Patrik Svensson as the creator of the wonderful Cake build system. He is also enhancing our consoles with Spectre.Console. It even has support for Figlet! What's FIGlet you say?!? Well, it's giant fonts with ASCII, of course!

 _____ ___ ____ _      _   

| ___|_ _/ ___| | ___| |_
| |_ | | | _| |/ _ \ __|
| _| | | |_| | | __/ |_
|_| |___\____|_|\___|\__|

Not very accessible, to be sure, but super impactful for the sighted. I encourage you to make apps that include everyone.

How cool is to bring such madness to C# and .NET!

var font = FigletFont.Load("starwars.flf");


AnsiConsole.Render(
new FigletText(font, "Hello")
.LeftAligned()
.Color(Color.Red));

That's just the start! Who ever said ASCII/ANSI style tables needed to be hard and ugly? Spectre says nay nay!

Nice Spectre.Console Animated Gif

You don't need to be fancy if you don't want to. You can just do some ANSI which is supported by nearly every console out there. Just bring in dotnet add package Spectre.Console and

using Spectre.Console


public static class Program
{
public static void Main(string[] args)
{
AnsiConsole.Markup("[underline red]Hello[/] World!");
}
}

You can render calendars!

var calendar = new Calendar(2020,10);

AnsiConsole.Render(calendar);

Giving you

         2020 October

┌─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│ Sun │ Mon │ Tue │ Wed │ Thu │ Fri │ Sat │
├─────┼─────┼─────┼─────┼─────┼─────┼─────┤
│ │ │ │ │ 1 │ 2 │ 3 │
│ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │
│ 11 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │
│ 18 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │
│ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │
│ │ │ │ │ │ │ │
└─────┴─────┴─────┴─────┴─────┴─────┴─────┘

But tables are where Spectre.Console really shines!

There is so much good stuff in there. I wish the .NET command line would use the AnsiConsole.WriteException method, just to make my failures that much prettier!

Pretty exceptions

Regardless, get over to https://github.com/spectresystems/spectre.console and give this team a Star or two. And go make your utilities, your console apps, those little apps that are just gray and sad...go make them awesome!


Sponsor: Need a multi-cluster load balancer and API gateway? Try VoltMesh: built for modern and distributed apps that require automation, performance and visibility. Start for free today.



© 2020 Scott Hanselman. All rights reserved.
     

How to make a WinForms app with .NET 5 entirely from the command line and publish as one self-contained file

$
0
0

I got a lovely email from a reader named Steven who has been doing .NET for many years and is excited about .NET 5. He has an interesting perspective:

I really like the .NET library.

During 2020, I've taught myself enough Windows Forms to write my own JPG photo viewer.  Sorry but I'm not a fan of XAML, so I just write and compile raw Windows forms in C#.

Now before we start, I would offer that XAML is how you express your UI in WPF, and there is a WinForms designer for .NET Core in the latest version of Visual Studio so if you do want to mix and match using a designer and also writing your WinForms straight you can do that these days.

Steven asks:

I wonder if you could help me with a good recipe for command line compile on C#9 / .NET 5 to make a .exe?

More specifically he adds:

I want to be able to:
- from a command line
- without Visual Studio
- create a standalone .exe file for Windows
- from csharp myprog.cs
- where I don't mind if installing the Windows .NET runtime is a prerequisite
- Using C# 9 and .NET 5

Cool, I can help with that. Using only the .NET 5 SDK which you can install from http://www.dot.net, you can make a single EXE that will run on any Windows Machine in two commands, assuming you are already in a new empty folder.

~\Desktop\forsteven>

dotnet new winforms
The template "Windows Forms App" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on C:\Users\scott\Desktop\forsteven\forsteven.csproj...
Determining projects to restore...
Restored C:\Users\scott\Desktop\forsteven\forsteven.csproj (in 56 ms).
Restore succeeded.

~\Desktop\forsteven>
dotnet publish -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
Restored C:\Users\scott\Desktop\forsteven\forsteven.csproj (in 94 ms).
forsteven -> C:\Users\scott\Desktop\forsteven\bin\Debug\net5.0-windows\win-x64\forsteven.dll
forsteven -> C:\Users\scott\Desktop\forsteven\bin\Debug\net5.0-windows\win-x64\publish\

First I say dotnet new winforms which is the command line equivalent for "File | New Project in Visual Studio.

Next I dotnet publish -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true which is a little extra with that last bit, but look at the design for the single file feature you'll see that if you want all the native libraries linked in you have suck in more.

Personally, I think that the last two in the list should just be one. It's not obvious but it turns out it's quite hard as you move into things like WinForms that require some native libraries. Those native libraries don't like being run while embedded in an EXE. To solve this, you can either use IncludeAllContentForselfExtract or IncludeNativeLibrariesForSelfExtract.

Self-Contained Publish

  • Normal publish: dotnet publish -r win-x64
    • Published files: HelloWorld.exe, HelloWorld.pdb, and 224 more files
  • Single-file publish Linux: dotnet publish -r linux-x64 /p:PublishSingleFile=true
    • Published files: HelloWorld, HelloWorld.pdb
  • Single-file publish Windows: dotnet publish -r win-x64 /p:PublishSingleFile=true
    • Published files: HelloWorld.exe, HelloWorld.pdb, coreclr.dll, clrjit.dll, clrcompression.dll, mscordaccore.dll
  • Single-file publish Windows with Extraction: dotnet publish -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true
    • Published files: HelloWorld.exe, HelloWorld.pdb

So that "WithExtraction" means things get unzipped and run, while the other Single File isn't really single file (because some native bits are outside) but it avoids the temporary directory and just unfolds into memory. So it's more "Single small folder."

The resulting app is one 145 meg EXE that can be run anywhere without installing .NET 5 because we included it all in the EXE.

You can also add /p:PublishTrimmed=true and it's just 83 megs, again, just one EXE.

image

Hope this helps!


Sponsor: Need a multi-cluster load balancer and API gateway? Try VoltMesh: built for modern and distributed apps that require automation, performance and visibility. Start for free today.



© 2020 Scott Hanselman. All rights reserved.
     

The 2020 Christmas List of Best STEM Toys for Kids

$
0
0

Hey friends, another year, another list of Great STEM Christmas Toys for Kids (and people who are kids at heart)! In case you missed them, here's the previous years' lists! Be aware I use Amazon referral links so I get a little kickback (and you support this blog!) when you use these links. I'll be using the pocket money to...wait for it...buy STEM toys for kids! So thanks in advance! Apparently I missed 2019, but I don't remember missing it. Hm.

Let's get to it!

The Piper Mini Computer

I've talked about my appreciation for the Piper Raspberry Pi-based Computer before, but some folks have felt it's a little expensive. It's not just a Raspberry Pi, it's a wooden laptop and some extraordinary software that bridges the virtual and physical words with Minecraft.

However, this year they've introduced the Piper Mini at just $99. It's all the stuff you usually get with a Piper with no frills. Same software, same breadboard and Raspberry Pi, but you'll need to provide the monitor and HDMI cable and optional keyboard.

I can't say enough nice things about the software - it's a highly customized version of Minecraft that includes voiceover work and electronics lessons and a virtual Pi where you can check your work on a physical breadboard. Great for 10 and up, or clever 7-8 year olds.

Piper Mini Raspberry Pi Kit

A Kids Book About...

These aren't technically STEM but "A Kids Book About..." are great for kids and both my boys appreciate the series. This is a series of 26 (so far!) books about all kids of things from Creativity to Cancer, Money to Death, Racism to Privileged. Priced at just $9.99 each on Kindle and written by kids with adults helping, these books debuted on Oprah's Favorites List this year and they are on mine as well. She beat me to it but I had the idea first, so I'm taking full credit. Call me, Oprah!

You can also get A Kids Book About as a Subscription, with a new book showing up on your preferred schedule.

A Kids Book About

A Day in Code: An illustrated story written in the C programming language

The #1 new release in Children's Computer Programming on Amazon, "A Day in Code" is an illustrated story written in C by Shari Eskenas. In fact, it's told in a series of C programs, with teach C program presented next to a full page illustration showing that event described in the code.

It started as a popular and successful Kickstarter and now it's available on Amazon and elsewhere!

image

LEGO Boost Creative Toolbox

I've had a few folks from LEGO on the Podcast lately, and they've really been doing a great job moving into the connected tablet world. LEGO Boost is 847 LEGO elements that talk to your iPad and enable you to build a robot that's over 10" tall, as well as a 4 other models and robots. Good for 7 to 12 year olds.

Also, kids can combine their kit with LEGO City 60194 Arctic Scout Truck or LEGO NINJAGO 70652 Stormbringer and use the LEGO BOOST app to control their own original electronic creations.

image

AmScope 1200X Kids Beginner Microscope

In a world of connected phones and tablets I have to admit I'm a sucker for a microscope and lab kid. Pick up one of Microscope STEM kits and send you kid out into the backyard or park to find stuff to look at under the microscope! It's not expensive but for the price it includes a case and goes from 120x to 1200x magnification. Another option, if you'd prefer to use that tablet or PC is a USB Microscope camera that goes up to 1000x.

image

Elenco Building STEM Kits and Snap Circuits

I'm a fan of the Elenco Company, they have no-nonsense tools for makers like Soldering Iron Kits to build an FM Radio and the joyous and ALWAYS a good STEM gift Snap Circuits. The 300 Project Snap Circuits is a good place to start, but if you're obsessed as my kids are, you'll quickly graduate to the 500 Project Snap Circuits set or add on the Snap Circuits LIGHT with 175 additional light-related projects. They are safe for kids 7 or 8 and up, and even adults and my 15 year old can learn a LOT about electronics, safely.

image

LEGO MINDSTORMS updated for 2020 with nearly 1000 pieces

LEGO aren't cheap but they are timeless and last forever. Our investment in Mindstorms from many years ago still works and is still played with today. Once the boys followed an online tutorial and build a LEGO Mindstorms Rubik's Cube solver. I was surprised it was possible with the original LEGO Mindstorms EV3 base kit. Updated for 2020, the new Mindstorms Robot Kit includes a robot over a foot call and a visual scratch-like programming language for phones or tablets.

If something like this is too much, check out the Klutz LEGO Chain Reactions book for under $20. It's got 10 moving machines and 30 LEGO elements for trying out physics experiments from home! Or the Klutz LEGO Science Gadgets with double the pieces for $25.

image

Engino Discovering STEM Structures Constructions & Bridges

I love kits that make real engineering visible and understandable for kids. This kit has 9 working models like a suspension bridge, Truss bridge, and more. I used to built things like this with popsicle sticks! Additionally, the Models are illustrated online at the Engino website or using the Engino 3D app downloadable free for Android or iOS. Affordable and fun.

image

Chess.com membership

And last but not least, the first virtual thing on my list, a Chess.com membership. For $29 a year you can learn Chess and this amazing website. That's cheaper than your average chess set (which are all sold out anyway!) You can learn chess at your own pace, play safely online in real time or asynchronously,

Check it out and watch for my interview with International Master Danny Rensch, the Chief Chess Officer of Chess.com coming soon on the Hanselminutes Podcast!

image


Sponsor: Me! I've recently started a YouTube at http://youtube.com/shanselman and I'm nearing 100k subscribers. I'd love it if you were a subscriber also! Check out http://www.computerstufftheydidntteachyou.com for a playlist of some of my best episodes. See you there!



© 2020 Scott Hanselman. All rights reserved.
     

You should be customizing your PowerShell Prompt with PSReadLine

$
0
0

I use PowerShell 7 (cross platform, open source, runs on .NET Core) as my main shell of choice at the Windows command line. I use it in the Windows Terminal and I have a pretty prompt thanks to OhMyPosh. I've also set up autocomplete in PowerShell (type something, then TAB) with git and dotnet!

Do make sure you know the difference between a console, terminal, and shell.

PowerShell baby

I thought I had things pretty well dialed in. I even used PSReadLine, a bash inspired readline implementation for PowerShell.

But was I REALLY USING IT? No. Honestly, at the time I wouldn't be able to tell you what it offered me as a command line users. Wow was I wrong.

Don't sleep on PSReadLine if you use PowerShell as your preferred prompt. Head over there and give them some love and a star and buckle up, friends!

Head over to a prompt and run

Install-Module PSReadLine -AllowPrerelease -Force
If you want the latest, otherwise remove the Prerelease.

Then edit your $profile. I usually do this:

notepad $PROFILE

And add

if ($host.Name -eq 'ConsoleHost')

{
Import-Module PSReadLine
}

First, PSReadLine makes everything better with sprinkles of color everywhere automatically. But the thing I was not really digging into was customizing my $profile to light up cool features and set keybindings that made sense to me.

Colorful Prompts

It was this totally configured and blinged out sample PSReadline Profile that made me realize I wasn't doing enough. I cherry-picked the best parts out of this and I recommend you do the same!

You get nice improvements with bash-like command line editing. The most important one being the PowerShell equivalent of ctrl-r "bck-i-search" that bash users enjoy.

You can also set command line handlers so pressing "up arrow" with some existing text will find that item in history. Set it up once in your $profile.

Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward

Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward

Like Emacs but want PowerShell to be more like Emacs? It's possible!

Set-PSReadLineOption -EditMode Emacs

Got PSReadLine already but you're not sure what is key bindings are set up today?

Get-PSReadLineKeyHandler

This will give you a complete picture

 

You know how you can "ctrl shift b" in Visual Studio to build your project? I made ctrl shift b type "dotnet build" for me in PowerShell! Muscle memory for the win!

# This is an example of a macro that you might use to execute a command.

# This will add the command to history.
Set-PSReadLineKeyHandler -Key Ctrl+Shift+b `
-BriefDescription BuildCurrentDirectory `
-LongDescription "Build the current directory" `
-ScriptBlock {
[Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()
[Microsoft.PowerShell.PSConsoleReadLine]::Insert("dotnet build")
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
}

Check out the really advanced stuff in the sample $profile. I like the Smart Insert/Delete. It will take over your ' quotes and quotes " and braces { and ) parens and make them auto matching! That means you can type a variable or string, select it with Shift Arrow Key or Ctrl Shift Arrow Key, then typeover it with a " and it'll automatically quote the whole string. A very nice command line experience that you may enjoy in other shells but you never really set up PowerShell. Even more useful is Alt+' that will take a string and change it from a 'string' to a "string."

Take a few moments and think about the things you type too often. The things you type twice, or ten times a day. Check out your $profile, consider your aliases, and tidy up. I suspect PSReadLine could help. It was great for me!

While you are at it, also pick up PSColors! Next post I'll talk about Oh my Posh 3!


Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!



© 2020 Scott Hanselman. All rights reserved.
     

The art of Rubber Ducking or Rubber Duck Debugging

$
0
0

It works. Really.

"Put a rubber duck on your monitor and tell it how the code is supposed to work."

Rubber Ducking - Pic used under CCThe Rubber Duck can be your disinterested roommate, non-technical spouse, or your work-spouse. I call Damian Edwards or Tara Walker all the time and they just listen to me explain how it should work and somewhere in the middle of explaining it out loud I'll go...OOOOOOOOHHHH...and then I've solved it.

If you are new to programming, go check out my YouTube, specifically this one about being Overwhelmed with Programming. I talk about the importance of Rubber Ducking and verbalizing how your code should work.

This can be challenging in these remote times, so I recommend that you try to build a small community of like minded friends and developers. You can find folks on Discord and other community sites or consider reaching out to a friend on Twitter or from work and say "I can use you as a rubber duck sometimes?"

I have little Gundam and Gunpla (Amazon link) robot models on my desk and I'll use them to help me debug.

This might sound silly but it ABSOLUTELY works. Ask around. Try it.

You'll find that getting the problem outside your head, via your mouth, and then back into your ears is often enough to shake brain cells loose and help you solve the issue.

Rubber Ducking also is great practice in technical communication! Have you ever given a technical talk? There's actually not much distance between explaining a technical issue clearly, correctly, and concisely and giving a talk at a user group or conference!

Have you tried Rubber Duck Debugging? Let us know AND encourage early in career Code Newbies to consider (and normalize) this technique!


Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!



© 2020 Scott Hanselman. All rights reserved.
     

The regular joy of the Adafruit AdaBox Subscription and exploring IoT with the family

$
0
0

I'm a fan of Adafruit and all their products. There's no referral links here, just fandom and a personal recommendation from me. I've been a long-time subscriber of the AdaBox. The AdaBox is "Curated Adafruit products, unique collectibles, and exclusive discounts. All delivered quarterly."

You can give Adaboxs (Adaboxen?) as a gift one time, or you can sign up for the regular subscription like I did.

How much do I love them? I actually did a pilgrimage to New York and visited them in person. It's as amazing as you'd imagine and Lady Ada is epic.

Scott Hanselman visits Adafruit

Back to the AdaBox! Check out the list of previous Adaboxes (and order one if it's not already sold out!)

As of this writing there are just 2 left of AdaBox007, the SPY box. This one was a hit with my kids as it included a full lockpicking kit! I literally taught them about the internals of a lock and how it works. The AdaBox015 was also cool as it included the CLUE sensor development board that was the same size and shape as the popular BBC micro:bit. The kids made a DIY soil moisture sensor and with the included Water Pump, set up autowatering for our plants!

AdaBoxes are always solderless (unless you want to do something advanced!) and great for kids to explore electronics. You'll get things like IR sensors, Buzzers, LEDs, and full instructions on how to build that box's project!

Every quarter you get a new box and it's a joyful surprise every time. Adabox017 just showed up yesterday at my house! It included a cool MagTag with a 2.9" grayscale E-Ink display! It has an ESP32-S2 wireless module and uses CircuitPython so I, I mean, the children, can easily create a low-power IoT display. The display will even stay on when power is removed. They'll be doing a live unboxing on December 23rd at 8pm ET so subscribe to their YouTube.

We could make a weather display! Internal climate? What's on Netflix? A tiny Dakboard? Show my blood sugar? The possibilities are endless.

AdaBox is available in the United States, Puerto Rico, Canada, the UK, France, Germany, Netherlands, Norway, and Switzerland.  They are signing up for AdaBox018 that will ship in March 2021.

BTW if you are looking for other holiday shopping ideas, check out Adafruit's Holiday Shipping Guide here. Anyway, enough of my rant. Their stuff is a joy, go check it out.


Sponsor: Have you tried developing in Rider yet? This fast and feature-rich cross-platform IDE improves your code for .NET, ASP.NET, .NET Core, Xamarin, and Unity applications on Windows, Mac, and Linux.



© 2020 Scott Hanselman. All rights reserved.
     

Taking your PowerShell prompt to the next level with Windows Terminal and Oh my Posh 3

$
0
0

I love my pretty prompt that I use with Windows Terminal and Powershell. I also like using PSReadline to bring even more cool features to the CLI (Command Line Interface).

One of the best and easiest ways to get an awesome looking prompt on Windows is with Oh My Posh, and there's now Oh My Posh 3! Now, to be clear, you get to be pretty extra with these prompts and some people find them to be a turn off if there's too much bling. Remember: It's your prompt and you are in control. It's totally configurable - so configure it!

What do you need to start?

  • Windows Terminal
  • A super charged Cascadia Code font.
  • PowerShell (works on Windows, Linux, and Mac and is open source) and Oh my Posh
    • Now, to be clear, you can use Oh My Posh on zsh, bash, fish, nu and other shells also, but I like PowerShell as my main shell.

Let's upgrade my Oh My Posh installation to Oh My Posh 3 and see what's new and changed, shall we?

Here's my current prompt:

There's an upgrading section in the docs, if you are going from an existing installation of Oh My Posh to v3. Let's check it out.

Looks like I just need to do this:

Update-Module -Name oh-my-posh -AllowPrerelease -Scope CurrentUser

That's...suspiciously...not difficult. Now, just add this text to your $profile (again, there are instructions for other prompts).

NOTE: Be sure to make sure that your paths are correct. The example assumes a c:\tools folder AND it assumes you have a ~\.poshthemes folder. Change those paths however you want, but if it doesn't work, it's likely a pathing issue.

Here's a clever feature, you can call "Get-PoshThemes" and see a PREVIEW of different prompt themes and pick one!

Get-PoshThemes

Hey that "jandedobbeleer" font is as extra as I am. I like it.

Set-PoshPrompt -Theme jandedobbeleer

The fun stuff is where you can add things like your current Azure subscruption, or your current kubectl, or even YouTube music. I like the dotnet option. Let me see how to change that.

There is an OhMyPosh executable you can get that will print your current config that you can then modify. Download the right version of that and put it in your PATH somewhere. I put mine in my sync'ed d:\dropbox\utils which makes it available on any machine, but that's just me.

NOTE: If it's a new release of OhMyPosh, it may not have built up reputation without a code signing cert, but ignore that for now. I submitted it as safe in smartscreen and you can too if you like.

I will get the current config and put it in the clipboard, then paste it into VS Code and modify it.

posh-windows-amd64.exe -print-config 

Unicode! Note that you may not be able to | pipe this to clip.exe or > to a file as there's fancy Unicode in there and your shell may mangle the glyphs. I ended up copying the JSON manually directly by selecting it in Windows Terminal.

If you want to copy in your own fancy glyph, use charmap.exe to copy the one you want. There's lots of choices in nerdfonts.

Charmap

Pretty fancy! I've got the path, my git, and the current .NET Core SDK version in that path, as well as a heartbeat of the current CLI error code.

My new OhMyPosh prompt

I've uploaded my ohmyposhv3.json as a Gist on GitHub. Next I think I'll look into how to make my own custom segment and make a Nightscout Blood Sugar segment and show my blood sugar in real time as I used to.


Sponsor: Have you tried developing in Rider yet? This fast and feature-rich cross-platform IDE improves your code for .NET, ASP.NET, .NET Core, Xamarin, and Unity applications on Windows, Mac, and Linux.



© 2020 Scott Hanselman. All rights reserved.
     

Scott Hanselman's 2021 Ultimate Developer and Power Users Tool List for Windows

$
0
0

Can you believe it's been 6 years since my last Tools list? Tools have changed, a lot are online, but honestly, it's just a LOT OF WORK to do the tools list. But here's one for 2020-2021. These are the tools in my Utils folder. I made a d:\dropbox\utils folder and I added it to my PATH. That way it's on all my computers and in my path on all my computers and I can get to any of them instantly.

This is the Updated for 2020-21 Version of my 2003, 2005, 2006, 2007, 2009, 2011, and 2014 List, and currently subsumes all my other lists. I’ve been doing this for over 17 years. Wow. I need to do better, I guess. 

Everyone collects utilities, and most folks have a list of a few that they feel are indispensable.  Here's mine.  Each has a distinct purpose, and I probably touch each at least a few times a week.  For me, "util" means utilitarian and it means don't clutter my tray.  If it saves me time, and seamlessly integrates with my life, it's the bomb. Many/most are free some aren't. Those that aren't free are very likely worth your 30-day trial, and very likely worth your money.

These are all well loved and oft-used utilities.  I wouldn't recommend them if I didn't use them constantly. Things on this list are here because I dig them. No one paid money to be on this list and no money is accepted to be on this list.

Personal Plug: If this list is the first time you and I have met, you should subscribe to my blog, and check out my podcasts, and sign up for my newsletter of Wonderful Things.

Please Link to http://hanselman.com/tools when referencing the latest Hanselman Ultimate Tools List. Feel free to get involved here in the comments, post corrections, or suggestions for future submissions. I very likely made mistakes, and probably forgot a few utilities that I use often.

THE LIFE AND WORK-CHANGING UTILITIES

"If everything was perfect, you would never learn and you would never grow." - Beyoncé

  • Windows Subsystem for Linux - It really can't be overstated how WSL/WSL2 has put the cherry on top of Windows 10. It runs on any build 20262 or higher as it was recently backported and it's integration with Windows is fantastic. It's also WAY faster than running a VM. Go learn more on my YouTube
  • Windows Terminal - Finally Windows has a modern terminal. You can run shells like Command Prompt, PowerShell, and Windows Subsystem for Linux (WSL). Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and the ability to create your own themes and customize text, colors, backgrounds, and shortcuts. It also includes a pseudo-console so 3rd party Terminals like hyper, conemu, terminus and more work better!
  • Windows PowerToys - They are back and they should be built into Windows. Install them here and get a color picker, fancy zones, file explorer addons, image resizers, keyboard manager and remapper, an Apple Spotlight-like running in the form of PowerToyrs Run, the Shortcut Guide and more!
    • Also check out Ueli as a great launcher/spotlight for Windows!
  • VS Code - Visual Studio Code is hella fast and is my goto text and code editor. I still use notepad sometimes and I'm in full Visual Studio a lot, but VS Code is like the Tesla of code editors. Check out my Favorite VS Code Extensions below.
  • PowerShell/OhMyPosh/PoshGit/Cascadia Code - I've had a blast this year taking my console prompt to the next level. Try these out but also look at Starship. Whatever you do, play! Don't accept the defaults!
  • ZoomIt - A true classic but also the answer to the #1 question I'm asked. How do you draw on the screen when you're sharing your screen? ZoomIt has been THAT TOOL in my toolbox. Really take some time and learn how to do boxes, arrows, colors and more and you'll be a more effective screen-sharer. In fact, just go get the whole SysInternals suite and put it all in your PATH.
  • Winget - It's apt-get for Windows. Similar to choco which I've used in the past, WinGet is going to be included in Windows 10 and has a ton of nice features. I use it to setup a machine in an hour from the command line, versus a day before doing it manually. Just add your MSA (Microsoft login) to the Package Manager Insiders Program and get it from the Store. It's bundled with the Windows App Installer. Then just "winget search <tool>" and winget install whatever!
  • QuickLook - Free in the Windows Store, just highlight a file in Explorer and press Space to get a preview!

Amazing .NET and Developer utilities

"Power means happiness; power means hard work and sacrifice." - Beyoncé

  • CodeTrack - CodeTrack is a free .NET Performance Profiler and Execution Analyzer. It works on basically every version of .NET and will give you massive insight into how your code is running! The flamegraph view is fantastic. It's free but you should donate as it's a one-person amazing app!
  • LINQPad - Interactively query your databases with LINQ with this tool from Joseph Albahari. A fantastic learning tool for those who are just getting into LINQ or for those who want a code snippet IDE to execute any C# or VB expression. Free and wonderful.
  • WinMerge - WinMerge just gets better and better. It's free, it's open source and it'll compare files and folders and help you merge your conflicted source code files like a champ. Also see Perforce Visual Merge which free and also can diff images, which is pretty amazing.
  • WinDbg - Low-level and classic but also new and fresh! WinDbg (Wind-bag?) is now in the Windows Store with ALL NEW VISUALS and more!
  • Insomnia and Nightingale are great alternatives to Postman for doing REST APIs!
  • NuGet Package Explorer - This app allows browsing NuGet packages from an online feed and viewing contents of the packages
  • WireShark - What's happening on the wire! WireShark knows!
  • GitHub Desktop - Gits, ahem, out of the way! Watch my Git 101 on YouTube!

Useful Windows Utilities that should be built in

"I love my job, but it’s more than that: I need it" - Beyoncé

  • Ear Trumpet - Fantastic advanced volume control for Windows! If you have ever wished that volume on Windows could turn their UI up to 11, Ear Trumpet is that app.
  • Teracopy - While I use the excellent built in copy features of Windows 10 the most, when I want to move a LOT of files as FAST as possible, nothing beats TeraCopy, an app that does just that - move stuff fast. The queue control is excellent.
  • AutoHotKey - This little gem is bananas. It's a tiny, amazingly fast free open-source utility for Windows. It lets you automate everything from keystrokes to mice. Programming for non-programmers. It's a complete automation system for Windows without the frustration of VBScript. This is the Windows equivalent of AppleScript for Windows. (That's a very good thing.
  • 7-Zip - It's over and 7zip won. Time to get on board. The 7z format is fast becoming the compression format that choosey hardcore users choose. You'll typically get between 2% and 10% better compression than ZIP. This app integrates into Windows Explorer nicely and opens basically EVERYTHING you could ever want to open from TARs to ISOs, from RARs to CABs.
  • Paint.NET - The Paint Program that Microsoft forgot, written in .NET. It's 80% of Photoshop and it's free. Pay to support the author by getting the Windows Store version AND it will auto-update! It's only $7, which is an unreal value.
  • NimbleText - Regular Expressions are hard and I'm not very smart. NimbleText lets me do crazy stuff with large amounts of text without it hurting so much.
  • Markdown Monster - While I love VSCode, Markdown Monster does one thing incredibly well. Markdown.
  • Fiddler - The easy, clean, and powerful debugging proxy for checking out HTTP between here and there. It even supports sniffing SSL traffic.
  • NirSoft Utilities Collection - Nearly everything NirSoft does is worth looking at. My favorites are MyUninstaller, a replacement for Remove Programs, and WhoIsThisDomain.
  • Ditto Clipboard Manager - WindowsKey+V is amazing and close but Ditto keeps pushing clipboard management forward on Windows.
  • TaskbarX - It literally centers your Taskbar buttons. I love it. Open Source but also $1 in the Windows Store.
  • ShellEx View - Your Explorer's right click menu is cluttered, this can help you unclutter it!
  • OneCommander and Midnight Commander and Altap Salamander - As a long time Norton Commander user (google that!) there's a lot of great "reimaginings" of the Windows File Explorer. OneCommander and Altap Salamander does that, and Midnight Commander does it for the command line/CLI.
  • WinDirStat - A classic but still essential. What's taking up all that space? Spoiler - It's Call of Duty.
  • FileSeek and Everything - Search it all, instantly!
  • I like Win+Share+S for Screenshots but also check out ShareX, Greenshot, and Lightshot
  • Alt-Tab Terminator - Takes your Alt-Tab to the next level with massive previews and search
  • PureText - PureText pastes plain text, purely, plainly. Free and glorious. Thanks Steve Miller
  • I still FTP and SCP and SFTP and I use WinSCP to do it! It's free or just $10 to get it from the Windows Store and support the author!
  • VLC Player - The best and still the best. Plays everything, everywhere.
  • PSReadline - Makes PowerShell more Bashy in the best way.
  • Yori and all Malcolm Smith's Utilities - Yori is a reimagning of cmd.exe!

Visual Studio Code Extensions

"I use the negativity to fuel the transformation into a better me." – Beyoncé

There's a million great Visual Studio Extensions. The ones I like won't be the that ones you like. But, go explore.

  • GitLens - Glorious. Just makes Git and VS a joy and adds a thousand tiny lovely features that will make you smile. You'll wonder why this isn't built in.
  • Version Lens - Do you have the latest package versions? Now you know
  • CodeSnap - Screenshots specifically tailored to make your code look nice.
  • .NET Core Test Explorer - Makes unit testing with .NET on VS Code so much nicer
  • Arduino for VS Code - The Arduino extension makes it easy to develop, build, deploy and debug your Arduino sketches in Visual Studio Code! So nice.
  • Coverage Gutters - This amazing extension highlights what code is covered with Unit Test and what's not. Ryan is looking for help, so go see if this is a great OSS project YOU can get started with!
  • Docker for VS Code - Container explorer and manager and deployer, directly from VS
  • GitHistory - Another nice add-on for Git that shows your Git Log
  • HexDump - I need this more than I would like to admit
  • LiveShare - Stop screen-sharing and start code and context sharing!
  • PowerShell for VS - A great replacement for the PowerShell ISE
  • Remote Containers - This is an AMAZING EXTENSION you have to try if you have Docker but it has a horrible non-descriptive name. But must be seen to be believed. Perhaps it's "Visual Studio Development Containers," I'm not sure. Open a folder and attach to a development container. No installs, just you debugging Rust, Go, C#, whatever whilst installing NOTHING. Amazing.
  • Remote SSH - Another in the VS Remote Family of Extensions, this one lets you use any remote SSH Server as your development environment.
  • Remote WSL - Edit and debug and build code from Windows...using Linux!
  • And finally, Yoncé, my current VS Code theme. Beyoncé inspired.

Things I enjoy

“We all have our purpose, we all have our strengths.” – Beyoncé

  • RescueTime - Are you productive? Are you spending time on what you need to be spending time on? RescueTime keeps track of what you are doing and tells you just that with fantastic reports. Very good stuff if you're trying to GTD and TCB. ;
  • Carnac - This wonderful little open source utility shows the hotkey's you're pressing as you press them, showing up as little overlays in the corner. I use it during coding presentations.
  • DOSBox - When you're off floating in 64-bit super-Windows-10-Pro land, sometimes you forget that there ARE some old programs you can't run anymore now that DOS isn't really there. Enter DOSBox, an x86 DOS Emulator! Whew, now I can play Bard's Tale from 1988 on Windows 10 in 2021! Check out Gog.com for lots of DOSBox powered classics

Oh yes, and finally Windows Sandbox - You already have this and didn't even know it! You can fire up in SECONDS a copy of your Windows 10 machine in a safe sandbox and when you close it, it's gone. Poof. Great for testing weird tools and utilities that some rando on a blog asks you to download.


Sponsor: IDC Innovators Report: Multicloud Networking--Read the latest from IDC and discover one of the premier platforms addressing the rise of multicloud architectures and cloud-native apps. Download now.



© 2020 Scott Hanselman. All rights reserved.
     

Microsoft Teams Buttons for Stream Deck to Mute, Share, Hang up, and Manage Cameras

$
0
0

The Stream Deck! (amazon link) is a lovely little device with bright LCD buttons that you can program to do basically anything. I decided to finally add a few hotkeys for Microsoft Teams.

I wanted pretty icons, so I used the same ones that Teams uses! The images in a Stream Deck are 144x144 so I used Ctrl-PLUS in Teams to scale the Teams interface up to a large size. The icons look great since Teams uses SVGs (scalable vector graphics).

Paint.NET making Teams buttons for Stream Deck

I saved each icon in its own PNG and put it in DropBox/OneDrive so I can sync it to all my machines.

NOTE: I put the ZIP file with my Teams Stream Deck icons here for you, if you want it.

Here's the icons in my folder.

Stream Deck Icons for Teams

Next just go into Stream Deck's editor and make a new Hotkey button for each.

Making a Stream Deck Teams Row

The Hotkeys are like Ctrl+Shift+B to leave and Ctrl+Shift+M for mute. Your Teams (or zoom) has to be the topmost app for the Hotkey buttons to work as Stream Deck is just "pressing the keys" for you when you press the Stream Deck button. There's no Universal Mute button in Windows...yet.

NOTE: There are some 3rd party utilities you can use to change your systems mic and speakers and make system wide changes with a Stream Deck. I've blogged about how.

It takes just a few minutes, but this little quality of life change makes daily Teams calls just a little nicer. I'd encourage you to take a moment and do the same if you have a Stream Deck! (amazon link)

A few minutes of work up front will make each day a little nicer and that time adds up!


Sponsor: IDC Innovators Report: Multicloud Networking--Read the latest from IDC and discover one of the premier platforms addressing the rise of multicloud architectures and cloud-native apps. Download now.



© 2020 Scott Hanselman. All rights reserved.
     

Looking back on Software Development in 2020 and forward to 2021

$
0
0

Together mode in TeamsI think we can all agree 2020 sucked. Hopefully 2021 will be better.

I've been a remote worker for 13 years by choice but in 2020 I HAD TO DO IT because, well, most programmers and tech workers did. I wrote about how Remote work != Quarantine Work while our whole division and then the whole company moved back home! We were a fairly remote-friendly company before but I have to admit I didn't always think my coworkers had really deep empathy for the remote...until they, too, were forced to be remote.

Last week on the podcast, I got to speak with Amanda Silver. She's a CVP in the Microsoft Developer Division who has been coding and thinking deeply about coding for many years. She's leading the creation of tools like Visual Studio, Visual Code, Live Share, Code Spaces, IntelliCode, and other collaborative productivity products. She's always thinking about what coding will look like in 1, 5, and even 10+ years.

We talked about her thoughts on moving the division remote and whether it would slow us down. Would it change how we develop software? What about when everyone comes back? After talking to her about her thoughts on 2020 and where she thinks we're heading, I got to thinking myself and wanted to put those thoughts down.

2020 broke everything, and developers like to fix things

Somewhere in the spring as we started into lockdown, developers started making sites. Sites to track COVID, GitHub projects with scripts to scrape data and analyze it. Javascripters started making D3.js visualizations and codepen users started building on top of them. Bots on twitter would tweet out updates and parse new data.

When there's a problem - especially a scary or untenable one - developers run towards the challenge. Necessity breeds invention and 2020 was definitely a year where we were collectively reminded there was a bunch of stuff that was always possible, but we needed a push. Cameras and mics were upgraded, ring lights were purchased, home networks got fancier, and everyone who could called their ISP and got an upgraded plan. We could have done all this before, but why? Remote work happened for the first time in 2020, and I say that having worked remotely forever.

We HAVE to collaborate remotely now

Back in 2010 I spoke to PhDs at Microsoft Research about how people feel when they are remote and what they can do to be more connected. Ten years! Folks thought it was pretty "out there" but I sure needed my virtual cubicle buddy this year.

2020 accelerated what was possible with remote collaboration. I spent hours coding with Live Share, pushing text and coding context over the wire, not a ridiculous 4k worth of pixels. Having two cursors (mine and my friends) - or even 10! - in one Visual Studio seemed like magic. Even more magic is me pressing F5 and my coworker hitting their localhost and seeing our app running! We needed tech like this more than ever in 2020.

I heard one story where a company sent everyone home but folks had disparate desktops and laptops so they set up 100s of Virtual Desktops over a weekend so everyone was able to log into secure work systems from their home machines.

For us, since we use Github and Azure DevOps here in DeviDiv, our collaboration model is asynchronous and distributed whether we are in the office or not. Can you imagine everyone working remotely while using a locking source control system in 2020? I feel bad for those who are in that predicament.

Can something be BETTER remotely?

Many of us miss being in the same room with co-workers, and we will be together again one day, but are there some things that the constraint of being remote can make better? In the podcast episode Amanda said that our new hire bootcamp was so much better remotely!

She said (paraphrasing a bit):

We have a bootcamp for anybody who's newly started on the team. They actually fly out for two weeks. And the first week is introduction and the second week is our customer driven workshop. And our customer driven workshop is basically this really intense team project where you break up into groups of five to six people, and you're given a business assignment like - how could we double the number of Python developers using Visual Studio Code.

You're basically doing like stickies on the wall the entire week - that's how you collaborate. I've been so amazed that that has transitioned to be remote first. And it's better. It's better. That was a brainstorming process that I thought was only possible in person it's better.

When we moved remote, we had to essentially reboot the way that we thought about our meeting culture to actually make it much more inclusive. And if we go from 40 to 50% of the people participating to just 2 people participating, that's a huge, not only degradation, but you're wasting people's time. Right?

Now if we can actually take six people who've never met each other before and get them to work super collaboratively on a new problem area that they've never worked on before. It's incredible. And the thing that's also really awesome about it is they are forced by nature of the fact that this is remote to actually create it as digital content. Whereas in the beginning they would literally walk us through sticky notes on the wall and they had fantastic ideas, but it was really kind of somewhat unorganized and, and it was hard to be able to see and, and retain and share out afterwards what these incredible ideas were that they came up with.

But when remotely starts with this digital format by necessity because everyone is remote first, we actually now have all of these things archived. We can come back to them, we can go back and actually see, you know, what was the genesis of the thought and, and pursue a lot of these things that we really weren't being able to pursue previously.

Constraints breed innovation!

It was nice to be reminded that People are People

2020 normalized being a person. Having a boss welcome a sad child to sit with them during a meeting reminded me that, what, my boss is a person? With a life and kids? Having meetings while going for walks, talking about treadmill desks, and video called parties with family, and OMG when will this be over is the most horrible team building exercise ever.

It's forced us to rethink our group's culture, how our interpersonal dynamics work, how many meetings we have (let's have less), and it's given everyone the joy of somewhat flexible hours. We talk more now about 'is everyone in this meeting being heard?' than ever before. We use the "hand raising" tool in Teams to make sure all voices get a chance to speak.

If 2020 hadn’t happened, we may not have made these important leaps forward. MAYBE this would have happened by 2025 or 2030 but COVID was the pivot point that forced the issue.

Here's some other blog posts that are both reflecting on our last year and hopeful for the coming year:


Sponsor: Looking for free secure coding training but don’t know where to turn? Check out Veracode Security Labs Community Edition to start hacking and patching real apps online. Try it today.



© 2020 Scott Hanselman. All rights reserved.
     

Exploring my creativity through TikTok and YouTube technical education videos

$
0
0

Last year kind sucked, and the end of last year was particularly lame. I got off Twitter for a while and discovered TikTok. I went there as a creative outlet. If you choose to sign up you may get inundated with a bunch of stuff that makes no sense or has no relevance. However, within just a few days by searching for an “liking” topics that I wanted to hear about, I found a wonderful, joyful, diverse TikTok and have learned about everything from Sea Shanties to Indigenous Dances to Woodworking. It’s a lovely little community and I’ve enjoyed my week on it.

I've been trying out video lately, during these trying times, and have very much enjoyed both TikTok and YouTube as creative outlets. I sent out some of my favorite TikTok videos in my occasional newsletter this week.

Here’s some highlights of lovely things on TikTok I’ve found:

I also recently hit 100,000 subscribers on YouTube which is fun. Apparently they are sending me a plaque, so more on that soon. My most recent video is here What happens when you type a URL in the browser and press enter? I encourage you to go subscribe. You can get to my main playlist with the alias http://www.computerstufftheydidntteachyou.com

What kinds of creative outlets have you been exploring (to stay sane or otherwise) last year, and what are your plans for this year?


Sponsor: Looking for free secure coding training but don’t know where to turn? Check out Veracode Security Labs Community Edition to start hacking and patching real apps online. Try it today.



© 2020 Scott Hanselman. All rights reserved.
     

Using Tailscale on Windows to network more easily with WSL2 and Visual Studio Code

$
0
0

Tailscale is a zero config mesh "VPN" that runs atop other networks and effectively "flattens" networks and allows users/services to more easily (and securely) communicate with each other.

For example, I've written extensively on how to SSH into WSL2 on Windows 10 from another machine and you'll note that there is not only a ton of steps but there's more than one way to do it!

I have talked about this for SSH, but if you're an active developer and want to share the services and sites you're working on with your coworkers and collaborators, there's a non-trivial amount of setup, management, and maintenance to deal with.

Phrased differently, "wouldn't it be easier if we were all just on the same network and subnet?"

WSL1 shares its networking stack with Windows 10, so the "machine" is the same. Whatever YourMachineName is, running a service on 5000 is the same if it's a Windows service or an app running in Linux under WSL1. However, in WSL2, your Linux environment is "behind" your Windows host. While WSL2 makes it easy to hit http://localhost:5000 by transparent port-forwarding, your WSL2 Linux machine isn't really a peer on the same network as your other devices.

Using a zero-configuration networking system like Tailscale (and similar services) levels the playing field - and the network. Due to some characteristics of WSL2 there are a few gotchas. Here's how I got it working for me.

Tailscale on WSL2

Get WSL

Get Tailscale

Modify WSL2

  • I can't get Tailscale today to startup on WSL2 with ipv6 install, so I disable it.
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1

sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

Run Tailscale

Here you startup the daemon. There's no systemd (yet) on WSL2, but if you're on a version over Windows 10 build 21286, there are ways run commands on startup in the Windows Subsystem for Linux. Personally, I just do this in a bash script.

sudo tailscaled 

WSL doesn't have a way to do an interactive login process, so you wan tot create a pre-authentication key to authenticate a single machine. Then use that key, as I do here, to bring up Tailscale within WSL:

tailscale up --authkey=tskey-9e85d94f237c54253cf0

I like to keep this open in another Terminal Tab or Window Pane so I can watch the logs. It's interesting and verbose!

Within the Tailscale machines admin panel, you can see all the machines living on your new Tailscale network. Note that I have scottha-proto listed as Windows, and scottha-proto-1 listed as Linux. The first is my Host machine and the second (the -1) is my Linux WSL2 instance! They are now on a flat network! 

A list of all my Tailscale machines

I was also able to invite a user from outside my network with the new (coming soon) Tailscale node sharing feature. My friend Glenn is NOT in my organization, but just like I use OneDrive or DropBox to create a link to access ONE entity but not the WHOLE system, I can do the same here.

Shared my node with someone outside my network

Now I can have Glenn hit a service running in WSL2 from his house.

Make a Service and Bind it to the Tailscale Network

I've installed .NET 5 in my WSL2 Ubuntu system, made a folder, and run dotnet new web to make a Hello World microservice.

When I run the service - .NET or Node, or whatever - it essential that the service listen on the Tailscale network. Your Linux system in WSL2 is 'multi-homed' and is connected to multiple networks. By default my developer systems listen only on localhost.

For .NET there's several ways to listen on all networks (including Tailscale) but I used this one:

dotnet run --urls http://*:5100;https://*:5101

So here I've got myself connecting to the Tailscale IP that's associated with my WSL2 instance and hitting my Linux service running within:

Image

How far can we take this? Well, since I'm on the Tailscale network and Glenn has connected to it, the whole network is flat, so hitting my service is trivial! Here I am on Teams with my desktop on the bottom and Glenn's desktop on the top.

My service in WSL2 being hit my Glenn from a remote system

Cool. How far can we go?

Add Visual Studio Code and the Remote Development SSH Extension

Ok, so flat secure network, no limits! Can I make my WSL2 instance be treated as a remote development system for Glenn? Sure, why not?

To be clear - this is just me talking and experimenting, but there's something here. This can also be cross platform, Mac to Windows to WSL2, etc. You can also certainly use this section to create a VM in any cloud host or hoster, install Tailscale, stop worrying about port forwarding, and use it as a development box. Yes, you can just use WSL local, but this is fun and can be exploited in other cool ways.

On my WSL2 machine, I'll start up the ssh service. I could share public keys and do proper key-based login, but for this I'll do it by username.

I'll edit /etc/ssh/sshd_config and set the port, ListenAddress, and PasswordAuthentication to Yes. Here's an example:

Port 22

#AddressFamily any
ListenAddress 0.0.0.0
ListenAddress ::

PasswordAuthentication yes

I made glenn a local super user just in my WSL2 instance:

sudo adduser glenn

usermoid -aG sudo glenn

Glenn then installs the VS Code Remote Development pack and connects using Remote via SSH to my Tailscale IP. Here you can see VS Code from Glenn's machine is actually installing the VS Code Server and remote developers, and Glenn and code with VS Code architecturally split in half with the client on his Windows machine and the server on my WSL2 instance.

Note in the lower left corner, you can see his VS Code is connected to my WSL2 Linux instance's Tailscale IP!

Connected to Tailscale with VS Code

What do you think?

You may compare Tailscale to things like NGrok which offers a developer-oriented localhost tunneller, but there are some important differences. Do your research! I have no relationship with this company other than I'm a fan.


Sponsor: This week's sponsor is...me! This blog and my podcast has been a labor of love for 19 years. Your sponsorship pays my hosting bills for both AND allows me to buy gadgets to review AND the occasional taco. Join me!



© 2020 Scott Hanselman. All rights reserved.
     

Hack a TV into a Teams and Zoom Computer with EpocCam and Miracast

$
0
0

If you have a TV, you can turn it into a fancy conference room monitor and pretend you have a Surface Hub 2S. Let's see the different ways we can make Teams/Zoom meetings more a "walking around and thinking" experience, and less a "hunched in front of the laptop" experience.

Cheapest/Good - Wire up to a big TV

You can just get a nice HDMI cable and plug it into your TV and duplicate or extend your laptop's screen. In this simple scenario you're using your Laptop's mic and webcam, and just using the screen of your TV. You can also check your audio output and use the TV speakers as output if you like.

Doing this is not just a nice change of pace, but it reminds you of the options you have to hold meetings! It's your space...how many ways can you change your boring meeting into a new perspective by using the same space in a new way?

Cheap/Better - Wireless to a big TV

If you want to be wireless, you can use Miracast (if your computer/laptop/Surface supports it) or AirPlay or AirServer to "throw" your screen wirelessly to your TV. Some Samsung Smart TV support wireless communications built-in!

  • You may be able to throw from Windows to a Smart TV with AirServer software. You may be able to throw with AirPlay on your Mac to an Apple TV.
  • You may be able to get a Miracast HDMI dongle (amzn link) and make a dumb TV smart. This is the solution I use. I throw my Surface screen over Miracast to the TV.

Less Cheap/Best (for me) - Wireless to a big TV with a wireless Webcam via my iPhone

I have a TV on my wall in my office, but it doesn't lend itself to wires and moving my laptop. I wanted to throw the screen over there AND also have a webcam on top of the TV. Ideally there'd be a webcam in the bezel of the TV, but there isn't.

What's an ideal and cheap webcam? My iPhone is already a great device with a long life battery, it's portable, and a webcam. You can get a number of apps that will enable you to use your iPhone (or Android) as a webcam.

I decided on Elgato EpocCom to turn my iPhone into a webcam.

Troubleshooting: The docs aren't amazing, so you'll want to not only install the software, but confirm that the EpocCamService is enabled in the Windows Firewall for both Private AND Public Networks (or ensure your network is the same type as the type that's enabled for this service.) I had to manually allow the EpocCam Service to work on Private Networks.

Then you'll get the iPhone side of the app and your iPhone will show up as a camera. With the Pro version ($7.99) you'll get higher quality and microphone support.

Now I just put my iPhone on the top of the TV, run the EpocCam software, and then on my PC I throw my video to the TV and select the EpocCam virtual Camera. Now I can wander around my office and pace and talk and think, which is great!

Here I've got my Samsung Frame TV (amzn link) (I got it for just $600 as it's the 2018 model, I love it) and I've hooked up the Microsoft Wireless Display Adapter v2 (amzn link).

Using an iPhone as a Teams Camera

Other Alternatives

Once you familiarize yourself with these wireless options for throwing video and audio around, you'll find there is no right answer. There's only the answer that works for you! The results will be similar, but some of the solutions will fit better into your system or setup.

Here's some other ideas.

  • Use NDI Tools to throw formally throw video around your office and catch it with OBS or XSplit
  • Use a really long USB extension code and mount a cheap webcam on the top of the TV
  • Just use your iPhone or iPad or Android device and join Teams or Zoom with the phone itself! Then either wired (via adapter and HDMI) or wirelessly connect the device to your TV!

Leave your solutions in the comments!

There also appear to be Teams devices that will take a TV or Display and Teamsify it! I'll go educate myself about those as well!


Sponsor: Protect your apps from reverse engineering and tampering with PreEmptive, the makers of Dotfuscator. Dotfuscator has been in-the-box with Microsoft Visual Studio since 2003. Visit preemptive.com/hanselminutes for a professional-grade trial.



© 2020 Scott Hanselman. All rights reserved.
     

Get on the Windows Terminal PREVIEW train - now with Settings UI

$
0
0

Turns out you can install both the Windows Terminal AND the Windows Terminal Preview side by side! This will let you try out all the upcoming features in this "skip next" version. You can grab the next version of the Windows Terminal at https://aka.ms/terminal-preview now.

The two Terminals can be pinned side by side if you like. Here you can see the Preview Terminal has a "Pre" badge in the taskbar.

Windows Terminal rocks

Historically you've had to edit a settings.json file - usually with Visual Studio Code and it's lovely json schema support, natch - but as of Windows Terminal 1.6, you've got a preview of the long-awaited Settings UI.

Get the Terminal 1.6 Preview, press Ctrl+, to get your settings.json, then paste this down by the actions array at the bottom:

{ "command": { "action": "openSettings", "target": "settingsUI" }, "keys": "ctrl+shift+," },

That'll make Ctrl+Shift+, bring up the new Settings UI!

Here is just one section! I thought I know all the settings but there's a TON I missed. You'll also notice all my Profiles on the left PLUS a Base Layer for inheritance. I was pleased to see the Grayscale vs ClearType (subpixel rgb anti-aliasing) choice, as well as some of the more obscure cursor options.

Windows Terminal Settings UI

A real color schema editor is also overdue, so it was awesome to see that as well.

Color schemes

You can, of course, hop between JSON the UI. Here's the UbuntuLegit (from Kayla!) color schema as a UI, above, and as JSON, below.

{

"background": "#2C001E",
"black": "#75F50A",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEE",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#EEEEEE",
"green": "#300A24",
"name": "UbuntuLegit",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},

I've been using Windows Terminal Preview as my primary lately, even over the "more stable" released version. Fortunately I can run both, but the Preview is my go-to right now.

Related Links


Sponsor: Protect your apps from reverse engineering and tampering with PreEmptive, the makers of Dotfuscator. Dotfuscator has been in-the-box with Microsoft Visual Studio since 2003. Visit preemptive.com/hanselminutes for a professional-grade trial.


© 2020 Scott Hanselman. All rights reserved.
     
Viewing all 1148 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>