1. Creating a new user with sudo
priviledges
sudo
: allows you to run the following command with elevated privileges (like root access).
adduser
: creates a new user account in your WSL distribution.
usermod
: modifies existing user accounts.
-aG
: adds the user to a specific group.
cut -d: -f1 /etc/passwd
: list users.
su - username
: login to username.
groups username
: groups a user belongs to.
sudo adduser tonyjustkaggles
- add usersudo usermod -aG sudo tonyjustkaggles
- add priviledgessudo visudo
- open nano- “tonyjustkaggles ALL=(ALL) NOPASSWD: ALL” - add more priviledges
Ctrl + O
,Enter
,Ctrl + X
- save and exit
3. VS Code (pre-installed on Windows)
Add PATH variable in new user so by typing code .
, VS Code opens for the existing folder.
export PATH="$PATH:/mnt/c/Users/tonyp/AppData/Local/Programs/Microsoft VS Code/bin
4. [Quick Fire] Other Useful Setup Things to do
4.1 miniforge
su - tonyjustkaggles
- loginmkdir downloads
+cd downloads
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge33-*.sh -b
- run bash script to install~/miniforge3/bin/conda init bash
- add pathswhich python
- see python is from miniforge
4.2 conda virtual environment
conda create -n kaggle_venv
- create venv for individual projects + avoid dependency issuesconda activate kaggle_venv
- create venv for individual projects + avoid dependency issuesconda install python
- install python into venv
4.3 pytorch
conda install pytorch torchvision torchaudio cpuonly -c pytorch
- install pytorch from official siteipython
->import torch
->torch + [tab]
- Test pytorch works
4.4 jupyter
conda install -c conda-forge jupyterlab
- install jlab from official site
4.5 bash shortcuts
vim ~/.bashrc
->G
,i
->alias vb="vim ~/.bashrc"
->esc :wq
- shortcut for vim bashvb
->i
->alias jl="jupyterlab --no-browser"
- jupyter lab short-cutvb
->i
->alias dl="cd ~/downloads"
->esc :wq
- downloadsvb
->i
->alias bl="cd ~/blog"
->esc :wq
- blog(or :q! - don't save)
vb
->i
->alias kv="conda activate kaggle_venv"
->esc :wq
- activate venv
4.6 kaggle
conda install conda-forge::kaggle
- install kaggle api from official siteKaggle
->Settings
->Create Token
-> Paste into:/home/tonyjustkaggles/.kaggle
4.7 ssh, github and blog
ssh-keygen
->cat pub-key
-> copy intoGithub
git clone git@github.com:tonyjustdevs/blog.git
withssh
option
4.8 visudo
sudo visudo
->User privilege specification
->tonyjustkaggles ALL=(ALL) NOPASSWD: ALL
->ctrl O + Enter + ctrl X
export PATH="$PATH:/mnt/c/Users/tonyp/AppData/Local/Programs/Microsoft VS Code/bin"