Set Windows Terminal to use your user HOME directory

Cross-posted from wsl.tips/tips/windows-terminal-start-directory Windows Terminal is the new Terminal experience from the Windows team. It’s open source and iterating quickly. As a WSL user, a really nice feature is that it auto-detects the WSL distros you have installed. By default, when you launch Windows Terminal for a WSL distro it puts you in the /mnt/... path for your Windows user profile (e.g. /mnt/c/Users/stuart). As this post by Simon Ferquel suggests: “Fully embrace WSL2”! [Read More]

Forwarding SSH Agent requests from WSL to Windows

Background As I mentioned in my previous post, I switched to using SSH key auth for GitHub and Azure DevOps Repos a long time ago and found it a positive experience. At first I was a bit lazy and didn’t use passphrases on my keys, and just kept a copy of my keys in the .ssh folder in my User folder in Windows and another copy in ~/.ssh in WSL. [Read More]

Fun with Git for Windows, SSH Keys and Passphrases

Disclaimer: this post is one to file under “things I’m blogging in the hope that I find the answer more quickly next time”. Background I switched to using SSH key auth for GitHub and Azure DevOps Repos a long time ago and never looked back. For a while I was using SSH keys without passphrases but got round to adding passphrases a while back. I set up the Windows OpenSSH Authentication Agent - the service defaults to Disabled so I set it as Automatic start and nudged it to Running. [Read More]

Fixing Clock Skew with WSL 2

Background to the problem I’m quite a fan of the Windows Subsystem for Linux (WSL), especially WSL version 2 which addresses a bunch of feedback I had for WSL 1. (There’s even a link to a recording of a lightning talk I gave on WSL 2 on the speaking notes page). However, there’s one issue that continues to bite me: clock skew. With WSL 2 there’s a special VM that Linux runs in that has a bunch of magic sauce applied to make it meld into the Windows environment in ways that a standard VM simply can’t/doesn’t (can you tell that I’m not in the WSL engineering team from that description? [Read More]

Visual Studio Code and Devcontainers in the Windows Subsystem for Linux (WSL)

NOTE at the time of writing, several of the features/components mentioned in this post are in preview, but will hopefully hit GA soon. As with all preview bits there can be rough edges so follow these steps at your own discretion! UPDATE (2020-04-08): With the 1.44 release of Visual Studio Code (and the corresponding Remote Containers release), the Insiders release is no longer needed as the . I have updated the post to reflect this (update made in vscode devcontainer on stable release 😁). [Read More]

Visual Studio Code and Devcontainers

Visual Studio Code has support for Remote Development which is a really cool feature. You can connect to another machine via SSH and work with code there (the language services etc run remotely which is the really cool part!), connect to the Windows Subsystem for Linux, or run your development environment in containers (aka devcontainers). The last of these is the topic for this post. My team has been using devcontainers quite heavily for the last few months and found a lot of benefits with them. [Read More]

Error Back-off with Controller Runtime

Kubebuilder provides tooling to help get you started quickly writing operators for Kubernetes, and builds on top of controller-runtime. I’ve been looking at how errors are handled in a couple of Kubebuilder projects recently. I’d seen a couple of GitHub issues that mentioned that controller-runtime has back-off behaviour for errors so started looking through the docs to find out more, but didn’t find anything. If I get chance, I’d like to find a suitable place to send a PR to add some details in the docs, but for now I’m collating my notes here as a reference for future me! [Read More]

Working With Multiple Kubernetes Contexts

If you’re working with Kubernetes then there’s a pretty good chance that you’ve been working with kubectl! There’s also a pretty good chance that you end up working with more than one cluster context. So, how do you manage multiple contexts? KUBECONFIG One way that you might have encountered is obtaining a kubeconfig file that contains the details of how to connect to a cluster. kubectl allows you to pass a --kubeconfig option to commands to specify which kubeconfig should be used to connect to a cluster to execute the command. [Read More]

Working With Git Rebase in Visual Studio Code

Following the git theme for mini-posts, I thought I’d give git rebase a mention this time. When I first started working with git I found a way to pretend that it was a source control system like any other that I’d used. Eventually, I was working on a pull request for an OSS project and a maintainer asked me to rebase my changes. Now, I’d heard of rebase at that point but I hadn’t used it, so I was a bit daunted. [Read More]

Setting Visual Studio Code As Your Git Editor

My last post seemed to go down quite well, so I’m going to try a few mini-posts with a ‘tips-and-tricks’ theme. This works well for me as I’d started making some notes about productivity tips I use as part of my prep for an internal no-prep presentation ;-) This one is a really small tip that is covered in the Visual Studio Code docs, but lots of people using Visual Studio Code seem to have missed it so I’m going to mention it here: you can set Visual Studio Code to be your git editor. [Read More]