Tips and Tricks tags
Bluetooth Devices keep disconnecting
It all started when I installed Windows Update 20H2 in October 2020. I’ve had a stable machine (HP ZBook laptop for reference) for months and months with the same Bluetooth hardware, no issues. But that fateful day I installed the 20H2 update from Microsoft, everything changed. Suddenly I was having disconnect …
Sharing audio to Google Hangouts (or Meets)
I work remotely, and I’ve used a bunch of solutions over the last few years to be able to route audio from my computer into a meeting call in Google Hangouts. From hardware to virtual audio cable software, every solution has been finicky at best, and wrecks day-to-day audio and video at worst, and requires a …
NuGet Packing on Linux
For anyone who has been cutting-edge with .Net for a while will know that the nuget.exe runs under mono. And that you can use nuget.exe to package *.nuspec files into *.nupkg files. Anyone who has been doing dotnet cross-platform will also know that you can use dotnet pack on both Windows and Linux to package your …
HostBuild your dotnet Consoles like you WebHostBuild your web apps.
I wrote a while back on getting your Windows Services building with .Net Core which is a nice way to use the new SDK pipeline but still host on Windows without much fuss. But what If you like the approach but want to run on Linux? Well after some stumbling around in the dotnet core docs, I found information about …
Some cool tricks with your Windows Shells
I’ve been getting more and more back to the command line, doing more with PowerShell and even Bash scripting on Docker and WSL (Windows Subsystem for Linux). There are a few of the tricks I have learned recently that help me every day. F8 searches history! That’s right! When you type into the command line …
A Windows Service using netcoreapp on dotnet
I wrote Building a Windows Service with .Net Core and had a bit of flack because I was only using .Net core to build a .Net 4.5.2 application. Technically the title is still valid, it was a windows service, and I built it using .Net Core tools. But since people came looking for the answer to actually hosting a …
My C# naming conventions
I have opinions! I’ve been meaning to write this article for a while. I have various opinions about code formatting, and they may or may not conform to the norm. Also, they change occasionally as and when I get a good explanation of why a different way is better, or when I discover a technique while learning a …
On Screen Shortcut keys for presentations and recordings
I used this tool a while ago that let me show on-screen what keyboard shortcuts and combinations I was pressing so that others could see them, especially during presentations, and on video recordings. But for the life of me today, on a new machine, I couldn’t remember what it was called. Searching didn’t …
A PowerShell Watch Command
I use dotnet-watch a bunch and have used a version via grunt/gulp a little in the past as well. In front of me, I had some TypeScript, tsc and an app.ts file. I wanted to watch it and trigger tsc automatically. But there was no csproj, no NuGet, and no npm in sight. I went searching far and wide for solutions, and some …
There can be only one return; 0 RLY?
My opinions and choices on style of coding evolves and changes over time. By blogging about this now, I can refer back later when I change my mind. I can also elicit the opinions of others to influence me to change my ways if I happen to be wrong and not know it yet. Lets talk about returns. There is an opinion that …
In C#, your structs should be immutable.
I wrote some code. It was simple code. I had a collection. I iterated over the collection and updated the values. I did this several times in an outer loop. The code didn’t work. Why didn’t it work? My collection was an array of Structs. When I pulled an item out in the for loop, it was copied. When I …
dotnet build, targeting full .Net 4.5.1 on nanoserver docker
I have been struggling to get dotnet build to work on nanoserver via docker. I had already given up on git, because I can perform git tasks outside the container first. Basically I was trying this: docker run -v "$(pwd):C:/work" -w C:/work -it --rm microsoft/dotnet:1.1.1-sdk-nanoserver powershell build.ps1 This …
"failed to peek context header from STDIN" and how to fix
The docker guidance says you can run docker build piping the dockerfile: #On linux $ docker build - < Dockerfile and on Windows it says to do this: #PowerShell Get-Content Dockerfile | docker build - Nice. But I’ve been getting this error all day… > Get-Content Dockerfile | docker build - unable to …
Form posts with PowerShell
This article is based on an answer found and updated on StackOverflow. I’f you have used PowerShell for much at all, you are probably familiar with Invoke-WebRequest. But did you know you can carry around a session and have it automatically add and update cookies for you? The Scenario I had an API I wanted to …
Manage your hosts entries better
If you are working with a lot of sites in IIS then you will be familiar with the hosts file on your computer. %SystemRoot%\System32\drivers\etc\hosts, usually found in C:\Windows\System32\drivers\etc\hosts. This file acts as a DNS mapping table used by your computer. As a developer, you will often want to tinker with …
A couple of debugging tips
I had an idea of something I wanted to post, but a quick google turns up I posted it 6 months ago, so here are some debugging tips. Console Break So you are writing a console app? Cool. Want to see the output? Of course, you do. But when you run it, the app pops up then disappears really quickly right? No? Have you a …
Make me a sandwich
A lesson in powershell. I typed this: > iisreset Which responded with this: Access denied, you must be an administrator of the remote computer to use this command. Either have your account added to the administrator local group of the remote computer or to the domain administrator global group. So I typed this: > …
F5 VPN and Windows 10
I recently had the need to VPN into a network using an F5 Networks VPN. Turns out the provided BIG-IP Edge Client installs ok on Windows 10 but doesn’t connect. I kept getting the “Network Access Connection Device was not found.” error at the last step of connecting. Turns out that it was adding a …
Keyboard shortcuts for Windows 10 Power Users - Part 2
When Windows 8 came out, I got really into the new shortcuts and found out some had been there for a while that I never knew about. Windows 10 is out now and I’ve learned a few more that have been around just as long that I never knew. Since there are a lot of shortcuts, I’ve split this into two parts. Part …
Keyboard shortcuts for Windows 10 Power Users - Part 1
When Windows 8 came out, I got really into the new shortcuts and found out some had been there for a while that I never knew about. Windows 10 is out now and I’ve learned a few more that have been around just as long that I never knew. Since there are a lot of shortcuts, I’ve split this into two parts. Part …