Yuzhe's Blog

yuzhes

Tools and configuration

Posted at # OJ # Tools
EN ·

Super concise version

Installing WSL2 on Windows

First install WSL2. In an elevated terminal:

wsl -install [<version>]

Press Win+R and run OptionalFeatures, then check Hyper-V, Virtual Machine Platform, and WSL.

Then wait.

Afterwards start WSL2 terminal, and after a short while you will enter the system.

Configure your Linux

Configure network (if needed)

Sensitive topic; research on your own.

Configure Git

Git is already available, no need to install. Use the links below to configure SSH; you will need this later.

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account?platform=linux

Optional GPG setup:

https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key

Set username and email:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Note: this email should preferably be the GitHub assigned noreply email. Find it here

Install node.js

OJ runs on node, so it must be installed.

You can use Node Version Manager (NVM).

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Then install Node.js 20 with nvm.

nvm i 20

Run Leverage

Note: configure SSH first and add yourself to be able to clone this organization’s repository.

git clone git@github.com:ThinkSpiritLab/leverage.git

Backend package manager is pnpm, frontend is yarn.

npm install -g pnpm yarn
cd leverage
pnpm install
cd frontend
yarn install

For details, see the repository README.

To run it fully, you still need additional setup. We will cover that later.