-
-
Save lipex360x/5f8fb16902377a731d501a01568e36e0 to your computer and use it in GitHub Desktop.
Right Button in Menu
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Set-ExecutionPolicy AllSigned
Get-ExecutionPolicy
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco --version
- Choco Store
-
FiraCode:
choco install firacode -y
-
Windows Terminal:
choco install microsoft-windows-terminal -y
-
Gsudo (Exec Apps as Admin in W. Terminal):
choco install gsudo -y
-
VSCode Configs:
choco install vscode -y
-
BeeKeeper:
choco install beekeeper-studio.install -y
-
DBeaver:
choco install dbeaver -y
- Configurations
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart Windows
-
WSL Update Download WSL Update
-
Set WSL Default Version
wsl --set-default-version 2
- Ubuntu Download
All Versions (amd64-wsl.rootfs.tar.gz)
- Distro Import
wsl --import <DISTRO_NAME> <FOLDER_DESTINATION [exp: c:\wsl]> .<FILE_PATH>\ubuntu.gz
- Example
wsl --import ubuntu . ubuntu.gz
- Terminal Download (alternative)
cd c:\ ; mkdir wsl ; cd wsl ;
Invoke-WebRequest -Uri https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-wsl.rootfs.tar.gz -OutFile ubuntu.tar.gz -UseBasicParsing
- Uninstall WSL Distro:
wsl --terminate distroName
wsl --unregister distroName
- Create
.wslconfig
function touch {set-content -Path ($args[0]) -Value ($null)}; cd $home; touch .wslconfig ; code .wslconfig
[wsl2]
memory=3GB # Limits VM memory in WSL 2 up to 3GB
processors=4 # Makes the WSL 2 VM use two virtual processors
swap=2GB # Swap Memory
-
Ubuntu Icon Download Here
-
Terminal Settings (JSON)
"profiles":
{
"defaults": {
"colorScheme": "Dracula",
"face": "Fira Code",
"size": 10
},
...
- WSL Launch
{
"name": "distroName",
"icon": "c:/wsl/ubuntu.ico",
"startingDirectory": "//wsl$/ubuntu/home/<user_name>/",
"commandline": "wsl.exe -d distroName"
}
- PowerShell Admin Startup
{
"commandline": "powershell.exe gsudo",
...
}
- Git Bash
{
"commandline": "%PROGRAMFILES%/git/usr/bin/bash.exe -i -l",
"guid": "{00000000-0000-0000-ba54-000000000002}",
"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
"name": "GIT Bash",
"startingDirectory": "%USERPROFILE%"
},
- Dracula Theme - More Themes Here
{
"background": "#1E1F29",
"black": "#000000",
"blue": "#BD93F9",
"brightBlack": "#555555",
"brightBlue": "#BD93F9",
"brightCyan": "#8BE9FD",
"brightGreen": "#50FA7B",
"brightPurple": "#FF79C6",
"brightRed": "#FF5555",
"brightWhite": "#FFFFFF",
"brightYellow": "#F1FA8C",
"cursorColor": "#BBBBBB",
"cyan": "#8BE9FD",
"foreground": "#F8F8F2",
"green": "#50FA7B",
"name": "Dracula",
"purple": "#FF79C6",
"red": "#FF5555",
"selectionBackground": "#44475A",
"white": "#BBBBBB",
"yellow": "#F1FA8C"
}
๐ Go to Content Index
- Set User Name
export NEWUSER=<user_name>
- Create User
adduser $NEWUSER
usermod -aG sudo $NEWUSER
- Grant Sudo Access with No Password
echo "$NEWUSER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$NEWUSER
- Set Default Terminal User
echo -e "[user]\ndefault=$NEWUSER" > /etc/wsl.conf
cut -d : -f 1 /etc/passwd
- Go to root user in Terminal
sudo su -
whoami
- Start WWW Folder
sudo apt update && sudo apt upgrade -y && sudo apt install build-essential net-tools zip -y && cd && mkdir www
- Optional
cd /mnt/c/ && mkdir www && cd
- Install ZSH
sudo apt install zsh -y
- Oh-My-ZSH Install
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- ZINIT Install
sh -c "$(curl -fsSL https://git.io/zinit-install)"
- Spaceship Theme: Edit Theme
sudo git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
sudo ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
ssh-keygen -t rsa -b 4096 -C "mail@mail"
cd ~/.ssh && more id_rsa.pub && cd
chmod 400 ~/.ssh/id_rsa
- GitHub test Connect
ssh -T git@github.com
- ASDF Install
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
- Install Node Plugin :
asdf plugin add nodejs
- List Node Versions:
asdf list-all nodejs
- Install Node LTS Version:
asdf install nodejs lts
- Set Global Node LTS Version:
asdf global nodejs lts
- Set Local Node Version:
asdf local nodejs XX.XX.X
npm install -g pnpm
-
Create an account in Docker Hub
-
Docker Install
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io -y && sudo usermod -aG docker $USER
- Start Docker
sudo service docker start
- Docker Login
sudo docker login --username USERNAME
- Docker Hello World
sudo docker run hello-world
- Clear Docker
sudo docker system prune -a
- Docker User Permission (alternative)
sudo chmod 666 /var/run/docker.sock
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "/home/$USER/.docker" -R
- Docker Compose Install
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo docker-compose -v
Execute curl command in Terminal
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
-
Restart Windows Terminal
-
Update Version
(
cd "$NVM_DIR"
git fetch --tags origin
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
) && \. "$NVM_DIR/nvm.sh"
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && sudo apt update && sudo apt install yarn -y && sudo apt remove nodejs -y && yarn --version
code ~/.zshrc
curl https://cli-assets.heroku.com/install.sh | sh
heroku login
๐ Go to Content Index
- Shutdown all WSL distros
wsl --shutdown
- Export distro to .gz file
wsl --export <distro_name> <path>\<filename>.gz
- Remove Distro (optional)
wsl --unregister <distro_name>
- Import from .gz file
wsl --import <distro_name> <FolderName [exp: c:\wsl]> .\filename.gz
- Install Online
wsl -l --online
wsl --install -d distro-name
WSL Clean 20.04 with Docker and Yarn
-
Download .gz Here. Them, configure:
-
Docker Login:
sudo docker login --username USERNAME
๐ Go to Content Index
choco install docker-desktop -y
-
Restart Windows
-
Settings
General : [ ] Start Docker Desktop when you log in
General : [x] Use the WSL 2 based engine
Resources > WSL Integration : [x] Enable integration with my default WSL distro
- Docker Compose:
choco install docker-compose -y
๐ Go to Content Index
choco install firacode -y;
choco install microsoft-windows-terminal -y;
choco install vscode -y;
choco install dbeaver -y;
choco install beekeeper-studio -y;
choco install mongodb-compass-isolated -y;
choco install insomnia-rest-api-client -y;
choco install docker-desktop -y;
choco install docker-compose -y;
choco install lightshot -y;
choco install vlc -y;
choco install winrar -y;
choco install spotify -y;
choco install gsudo -y;
choco install git -y;
choco install office365proplus --params '/Language: pt-BR';
choco install qbittorrent -y;
choco install teamviewer -y;
choco install vnc-viewer -y;
choco install discord -y;
choco install anki -y;
๐ Go to Content Index