Amy’s Kapers

Setting up a Windows Computer for Dev

In the past, Windows has developed a reputation for being a difficult OS to use as a developer. Things were difficult to install and run, involved complex workarounds and you could forget doing anything involving Ruby. Thankfully in recent years that’s improved, even more so with the Windows Subsystem for Linux (WSL) so it’s now possible to do pretty much everything you can on a unix system.

This is easiest when setting up a computer from scratch, but if it’s an existing computer most of this should work (I’ve had issues with installing Ruby on an existing install though).

You may not need to use all these programs, I use the following tools on a daily basis for various types of development:

WSL

The Windows Subsystem for Linux (WSL) gives the ability to run Linux bash on a Windows computer, and gives the ability to do pretty much everything you would normally do.

Make note of the password you set, you will need to use that in future (this is a mistake that I’ve only made once)

WSL2

In June 2020, Microsoft released WSL2, which you can use instead of or alongside WSL, for information on upgrading to WSL2, check out the Microsoft docs.

HomeBrew

sudo apt-get install build-essential
echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >>~/.profile
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
brew install gcc

Ruby

Ruby can be a bit tricky (but nowhere near as tricky as it used to be), and may require re-installing, so recommend you do this first when you can

sudo apt-get update -y && sudo apt-get upgrade -y

sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.5 ruby2.5-dev build-essential dh-autoreconf

fnm

Similar to NVM (Node Version Manager), fnm is a node version manager that I had recommended to me as a better alternative

Yarn

You can install yarn either with Homebrew or via apt-get, it’s a little easier using Homebrew though as Ubuntu sometimes comes pre-installed with cmdtest which conflicts with yarn

Installing with Homebrew

Installing with apt-get

If you receive an error when running yarn install about no install directory, it’s using cmdtest, uninstall that and run the yarn install scripts again

Windows Terminal

No matter whether you use WSL, Git Bash, Command Prompt or Powershell, Windows Terminal is the one for you.

Install through the Windows App Store.

You can edit the settings to customise the terminals available, the default terminal, or to change the theme and background colours. For example, I have a background image set (with a fair bit of opacity so it’s not too bright), so at a glance I can see which terminal I’m in.

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
    "requestedTheme": "dark",
    "profiles": {
        "defaults": {
            "fontFace": "Cascadia Code PL",
            "fontSize": 14,
        },
        "list": [
            {
                "guid": "{00000000-0000-0000-ba54-000000000002}",
                "commandline": "\"%PROGRAMFILES%\\git\\usr\\bin\\bash.exe\" -i -l",
                "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "name": "Git Bash",
                "startingDirectory": "%USERPROFILE%",
                "backgroundImage": "C:\\Users\\amyka\\AppData\\Local\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\git_bash.png",
                "backgroundImageStretchMode": "uniform",
                "backgroundImageOpacity": 0.1
            },
            {
                "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
                "hidden": false,
                "name": "Ubuntu 20.04 LTS",
                "source": "Windows.Terminal.Wsl",
                "startingDirectory": "//wsl$/Ubuntu/home/amy",
                "backgroundImage": "C:\\Users\\amyka\\AppData\\Local\\Packages\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\LocalState\\ubuntu.png",
                "backgroundImageStretchMode": "uniform",
                "backgroundImageOpacity": 0.1
            }
        ]
    }

}

Tunnelto

Tunnelto is a tool similar to ngrok that allows you to expose local servers to the internet. I had this pop on Twitter a while back and liked that the had the same functionality, but much more affordable to have custom subdomains and multiple servers running.