Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
New Dev Machine Script
#!/bin/bash
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get upgrade -y git
sudo apt-get upgrade -y
sudo apt-get install -y build-essential libssl-dev
sudo apt install -y net-tools
sudo apt-get install -y nginx
sudo apt-get install -y azure-cli
sudo apt-get install -y awscli
sudo apt-get install -y lastpass-cli
sudo apt-get install -y kubetail
sudo apt-get install -y dotnet-sdk-3.1
sudo apt-get install -y aspnetcore-runtime-2.1
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
source ~/.profile
nvm install node
nvm use node
sudo apt-get install -y nuget
# symlink to synchronize what dotnet restore uses with what nuget CLI writes https://github.com/NuGet/Home/issues/4413
mkdir -p ~/.nuget
ln -s ~/.config/NuGet ~/.nuget/NuGet
sudo mkdir /usr/share/PowerShell
pushd /usr/share/PowerShell
sudo wget https://github.com/PowerShell/PowerShell/releases/download/v7.0.0-rc.2/powershell-7.0.0-rc.2-linux-x64.tar.gz
sudo tar xzvf powershell-7.0.0-rc.2-linux-x64.tar.gz
sudo rm powershell-7.0.0-rc.2-linux-x64.tar.gz
popd
echo 'PATH="$PATH:/usr/share/PowerShell"' >> ~/.profile
source ~/.profile
rm packages-microsoft-prod.deb
# set up a local Nuget package source
mkdir ~/packages
nuget source add -Name Local -source ~/packages
# configure git identity and defaults (want to prune on fetch, etc.)
git config --global credential.helper 'cache --timeout 3600'
git config --global user.name "Dave Rael"
git config --global user.email "dave@raelyard.com"
git config --global fetch.prune true
git config --global push.default upstream
# make WinMerge my git difftool tool of choice
git config --global diff.tool "winmerge"
git config --global difftool.prompt "false"
git config --global difftool.winmerge.cmd '/mnt/c/Program\ Files/WinMerge/WinMergeU.exe -e -u -x -wl -dl base "$(wslpath -aw $LOCAL)" "$(wslpath -aw $REMOTE)"'
# useful git log alias
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr - %cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date local"
# keep sftp and ssh sessions alive https://superuser.com/questions/699676/how-to-prevent-ssh-from-disconnecting-if-its-been-idle-for-a-while/699680#699680
mkdir -p ~/.ssh
echo "ServerAliveInterval 60" >> ~/.ssh/config
# to execute:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
# Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/ -DisableReboots
# Windows Explorer has undesirable defaults - fix for this installation:
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess
# Windows Subsystem For Linux
choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures
# Hyper-V, .NET, IIS and friends
choco install -y Microsoft-Hyper-V-All -source WindowsFeatures
choco install -y Containers -source WindowsFeatures
choco install -y dotnetfx
choco install -y dotnetcore-sdk
choco install -y IIS-WebServerRole -source WindowsFeatures
choco install -y IIS-WebServer -source WindowsFeatures
choco install -y IIS-Security -source WindowsFeatures
choco install -y IIS-BasicAuthentication -source WindowsFeatures
choco install -y IIS-DefaultDocument -source WindowsFeatures
choco install -y IIS-DigestAuthentication -source WindowsFeatures
choco install -y IIS-DirectoryBrowsing -source WindowsFeatures
choco install -y NetFx4Extended-ASPNET45 -source WindowsFeatures
choco install -y IIS-ASPNET -source WindowsFeatures
choco install -y IIS-ASPNET45 -source WindowsFeatures
choco install -y IIS-ASPNET -source WindowsFeatures
choco install -y IIS-HttpRedirect -source WindowsFeatures
choco install -y IIS-ApplicationInit -source WindowsFeatures
choco install -y IIS-RequestFiltering -source WindowsFeatures
choco install -y IIS-RequestMonitor -source WindowsFeatures
choco install -y IIS-StaticContent -source WindowsFeatures
choco install -y IIS-HttpCompressionStatic -source WindowsFeatures
choco install -y IIS-HttpCompressionDynamic -source WindowsFeatures
choco install -y IIS-HttpTracing -source WindowsFeatures
choco install -y IIS-WindowsAuthentication -source WindowsFeatures
choco install -y IIS-WebSockets -source WindowsFeatures
# now start the software packages
choco install -y git
choco install -y tortoisehg
choco install -y microsoft-edge
choco install -y googlechrome
choco install -y 7Zip
choco install -y atom
choco install -y audacity
choco install -y audacity-lame
choco install -y audacity-ffmpeg
choco install -y awscli
choco install -y azure-cli
choco install -y AzureStorageExplorer
choco install -y ConEmu
choco install -y cmder -pre
choco install -y curl
choco install -y docker-desktop
choco install -y dropbox
choco install -y evernote
choco install -y fiddler
choco install -y firefox
choco install -y jetbrains-rider
choco install -y lastpass
choco install -y vim
choco install -y kindle
choco install -y lockhunter
choco install -y ngrok.portable
choco install -y nodejs
choco install -y notepadplusplus
choco install -y nuget.commandline
choco install -y papercut
choco install -y poshgit
choco install -y Posh-HG
choco install -y Roundhouse
choco install -y sendtokindle
choco install -y Slack
choco install -y skype
choco install -y sysinternals
choco install -y visualstudiocode
choco install -y windirstat
choco install -y winmerge
# Visual Studio and friends
choco install -y visualstudio2019professional --package-parameters "--allWorkloads --includeRecommended --includeOptional --passive --locale en-US"
choco install -y resharper
choco install -y sql-server-management-studio
# set up a local Nuget package source
new-item C:\packages -type directory
nuget source add -Name Local -source C:\packages
# configure git identity and defaults (want to prune on fetch, etc.)
git config --global user.name "Dave Rael"
git config --global user.email "dave@raelyard.com"
git config --global fetch.prune true
git config --global push.default upstream
# make WinMerge my git difftool tool of choice
git config --global diff.tool "winmerge"
git config --global difftool.prompt "false"
git config --global difftool.winmerge.cmd 'winmergeu.exe -e -u -x -wl -dl base \"$LOCAL\" \"$REMOTE\"'
# but also set config to switch to other difftool/mergetool options to switch when desired
git config --global difftool.vsdiffmerge.cmd '\"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t'
git config --global mergetool.vsdiffmerge.cmd '\"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\vsdiffmerge.exe\" \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\" //m'
# useful git log alias
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr - %cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date local"
# grab my standard configuration
new-item C:\Code -type directory
set-location C:\Code
git clone https://github.com/raelyard/setup
set-location Setup\PowerShell
.\SetPowerShellProfile.ps1
refreshenv
. C:\Code\setup\Powershell\Functions\Windows.ps1
Append-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.