Developer Environment Setup
Setting up WSL has certain risks. It requires an Adminstrator password to the machine for the initial steps highlighted below.
Below are instructions about how to configure a development machine. Ideally they should be followed exactly, to ensure that tests etc. are reproducible across development team members.
Given that the final resting place of standalone tools is the Linux JupyterHub server, we try to make the development environment on the users machine as close to this as it can be.
Prerequisite (admin required)
Hyper-V should already be enabled on your laptop but if you are having issues then follow this article:
- https://mashtips.com/enable-virtualization-windows-10/
Installation
Install Ubuntu on WSL (admin required)
couldn’t get wsl working on a fresh install. to fix: https://github.com/microsoft/WSL/issues/9521#issuecomment-2385289848
-install -d Ubuntu wsl -
Create the new user as jovyan
. Set password as jovyan
as default setup.
Set Up SSH To Access Repositories on Max Fordham GitHub
Create an SSH key pair using the following
ssh-keygen
This will create a public
id_rsa.pub
and private keyid_rsa
in/home/jovyan/.ssh
by default.Copy the public key onto GitHub user’s SSH keys
To show the public key:
cat /home/jovyan/.ssh/id_rsa.pub
Copy it from the command window to your clipboard by highlighting the whole key and pressing CTRL+C.
- Then go to GitHub and click on your personal account.
- Under the “Access” section there is “SSH and GPG keys”.
- Click on that, add a name for the key, paste in the public key, and save.
- Authorise the key for the
Max Fordham
organisation. You must be a member of the organisation to do this.
Optional: Permanently add SSH key to user agent
This step is only required if the file name of the SSH is something other than
id_rsa
or the other default names.nano ~/.ssh/config Host github.com IdentityFile ~/.ssh/id_custom_name
Finally set up the git config by filling in email and name:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
You should now be able to access the repositories on Max Fordham LLP, assuming that you are a member of the organisation.
Install pixi package manager
- install
curl -fsSL https://pixi.sh/install.sh | bash
<– check still current on install
- enable autocomplete
echo 'eval "$(pixi completion --shell bash)"' >> ~/.bashrc
<– check still current on install
Install some handy CLI tools
can also use pixi global to globally install useful tools.
pixi global install micromamba # micromamba pkg manager
pixi global install yazi # tui file browser
pixi global install starship # shell autocompletion
pixi global install ripgrep # searching text in files
pixi global install tree # viewing directory structures in linux
pixi global install gh # github CLI
pixi global install nodejs # for js dev. though maybe check the prefix.dev nodejs feedstock to ensure it is up-to-date.
pixi global install harlequin # TUI SQL editor IDE
pixi global install harlequin-mysql # TUI SQL editor IDE mysql connector
there are many other ways to do this. the most standard way it to use apt-get
, e.g.
sudo apt update
sudo apt-get install ripgrep
sudo apt install tree
but for simplicity we recommend using pixi-global
to manage these extra clis.
setup repos for development
gh auth # follow authentification workflow
gh repo list maxfordham
gh repo clone maxfordham/digital-schedules
Setup bash_aliases
It is also useful to add windows explorer to your linux bash_aliases. This means you can start fnm.txt
to open a file or start .
to open the folder in explorer.
sudo nano ~/.bash_aliases
alias start='/mnt/c/windows/explorer.exe'
alias mamba='micromamba'
Restart WSL for the above changes to take effect.