Last active
May 7, 2021 01:19
-
-
Save wardpeet/0acdab55c8c3634bd3016f78fab261b1 to your computer and use it in GitHub Desktop.
setup new windows machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable executionpolicy | |
Set-ExecutionPolicy RemoteSigned -scope CurrentUser | |
# install scoop | |
iwr -useb get.scoop.sh | iex | |
# setup applications | |
scoop bucket add github-gh https://github.com/cli/scoop-gh.git | |
scoop bucket add extras | |
scoop install aria2 | |
# install all applications | |
scoop install curl git gpg windows-terminal nvs yarn 7zip sudo pwsh vscode slack ditto gh vim fontbase putty firefox gcloud insomnia teamviewer vlc nmap openvpn | |
# Exclude scoop dirs from Windows Defender | |
sudo Add-MpPreference -ExclusionPath "$env:USERPROFILE\scoop" | |
sudo Add-MpPreference -ExclusionPath "$env:ProgramData\scoop" | |
# Exclude node from Windows Defender | |
sudo Add-MpPreference -ExclusionProcess "node.exe" | |
# Exclude npm/yarn from Windows Defender | |
sudo Add-MpPreference -ExclusionPath (Resolve-Path (Join-Path (yarn global bin) '../')) | |
sudo Add-MpPreference -ExclusionPath "$env:APPDATA\npm-cache" | |
# exclude projects folder | |
sudo Add-MpPreference -ExclusionPath "$env:USERPROFILE\projects\*" | |
sudo Add-MpPreference -ExclusionPath "$env:USERPROFILE\projects\*\*" | |
sudo Add-MpPreference -ExclusionPath "$env:USERPROFILE\projects\*\*\*" | |
sudo Add-MpPreference -ExclusionPath "$env:USERPROFILE\projects\*\*\*\*" | |
# setup nvs | |
nvs add lts | |
nvs link lts | |
yarn global add windows-build-tools | |
yarn global add cross-env gatsby-cli gatsby-dev-cli lighthouse source-map-explorer netlify-cli | |
[environment]::setenvironmentvariable('PATH', "$env:PATH;" + (yarn global bin), 'USER') | |
# Install python to make sure v3 is installed | |
scoop install python | |
# Enable ssh-agent | |
sudo Set-Service ssh-agent -StartupType Manual | |
# open powershell and install pshazz | |
pwsh scoop install pshazz | |
pshazz use ys | |
# Use ssh server from windows | |
[environment]::setenvironmentvariable('GIT_SSH', (resolve-path (scoop which ssh)), 'USER') | |
# Git | |
git config --global core.editor vim | |
git config --global core.fileMode false | |
git config --global core.eol lf | |
git config --global core.autocrlf false | |
git config --global user.name "<name>" | |
git config --global user.email "<email>" | |
git config --global cmder.status false | |
git config --global diff.tool vimdiff | |
git config --global merge.tool vimdiff | |
git config --global pull.ff only | |
git config --global alias.save "!git add -A && git commit -m 'SAVEPOINT'" | |
git config --global alias.undo "reset HEAD~1 --mixed" | |
git config --global alias.wipe "!git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard" | |
git config --global alias.stash-all "stash save --include-untracked" | |
git config --global alias.sync "!git fetch upstream && git pull --ff-only upstream $(git branch --show-current)" | |
# Setup gpg | |
git config --global commit.gpgsign true | |
git config --global gpg.program (scoop which gpg) | |
gpg --full-generate-key | |
gpg --armor --export [email protected] | clip | |
ssh-keygen -t rsa -b 4096 -C "<email>" | |
cat $env:USERPROFILE/.ssh/id_rsa.pub | clip | |
ssh -T [email protected] | |
# setup gh cli | |
gh config set git_protocol ssh | |
# Long Paths | |
sudo Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 | |
# Install WSL | |
## Enable virutal machine platform | |
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
## Enable wsl | |
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
--- reboot | |
wsl --set-default-version 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK thank you :) :🤗 You scared me 😅