Skip to content

Instantly share code, notes, and snippets.

@andrescevp
Last active March 7, 2023 20:00
Show Gist options
  • Save andrescevp/5df611ddd43e7f10adfbdb2c9d17fba9 to your computer and use it in GitHub Desktop.
Save andrescevp/5df611ddd43e7f10adfbdb2c9d17fba9 to your computer and use it in GitHub Desktop.
WSL2 Ubuntu 20.04 - Dev Setup
# install https://github.com/okibcn/wslcompact
# configs if apply
cp -Rf /mnt/c/Users/%USER_NAME%/.aws ~/.aws
cp -Rf /mnt/c/Users/%USER_NAME%/.ssh ~/.ssh
# proper permissions for git key
sudo chmod -Rf 0400 ~/.ssh/id_rsa
sudo apt update
sudo apt install gedit nautilus git zip tar make fonts-powerline libfuse2 build-essential \
software-properties-common zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev \
libreadline-dev libffi-dev wget liblzma-dev tk-dev \
libsqlite3-dev libreadline-dev libbz2-dev libffi-dev libssl-dev libgdbm-dev \
zlib1g-dev libjpeg-dev libtiff-dev libpq-dev libxml2-dev libxslt1-dev libsdl2-dev \
libgstreamer-plugins-base1.0-dev libnotify-dev freeglut3-dev libsm-dev libgtk-3-dev \
libwebkit2gtk-4.0-37 libxtst-dev dpkg-dev
sudo apt-get install build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev tk-dev
# download jetbrains toolbox from: https://www.jetbrains.com/toolbox-app/download/other.html
cp /mnt/c/Users/%USER_NAME%/Downloads/jetbrains-toolbox-....tar.gz /opt/
cd /opt && sudo tar -xvzf jetbrains-toolbox... && cd jetbrains-toolbox... && ./jetbrains-toolbox # install whatever jetbrains product you want
cd ~/.local/share/applications
sudo cp *.desktop /usr/share/applications # get shortcut in windows searchbar
# git config
touch ~/.gitignore
nano ~/.gitignore
```
.DS_Store
.vscode
Thumbs.db
.idea
```
git config --global core.excludesfile ~/.gitignore
git config --global user.name "Your name here"
git config --global user.email "your_email@example.com"
# bash utils https://github.com/Bash-it/bash-it#installation
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
~/.bash_it/install.sh
sudo localedef -i en_US -f UTF-8 en_US.UTF-8
#python utils
curl https://pyenv.run | bash # follow output instructions
pyenv install 3.9
#node utils
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
#docker fixes
sudo addgroup --system docker
sudo adduser $USER docker
newgrp docker
# And something needs to be done so $USER always runs in group `docker` on the `Ubuntu` WSL
sudo chown root:docker /var/run/docker.sock
sudo chmod g+w /var/run/docker.sock
#finish in powershell
wslcompact -c -y Ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment