Skip to content

Instantly share code, notes, and snippets.

@raelyard
Last active September 22, 2024 21:49

Revisions

  1. raelyard revised this gist Sep 22, 2024. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,6 @@ choco install -y git
    choco install -y docker-desktop
    choco install -y vim
    choco install -y powershell-core
    choco install -y lastpass
    choco install -y visualstudiocode
    choco install -y ngrok.portable
    choco install -y ConEmu
    @@ -99,7 +98,6 @@ choco install -y kindle
    choco install -y lockhunter
    choco install -y notepadplusplus
    choco install -y poshgit
    choco install -y powertoys
    choco install -y Slack
    choco install -y sysinternals
    choco install -y windirstat
  2. raelyard revised this gist Dec 2, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ sudo ln -s ~/.tfenv/bin/* /usr/local/bin
    tfenv install latest
    tfenv use latest

    sudo apt install -y dotnet-sdk-7.0
    sudo apt install -y dotnet-sdk-8.0
    sudo apt-get install -y powershell

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
  3. raelyard revised this gist May 1, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,8 @@ choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures

    wsl --update

    # .NET, IIS and friends
    # 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 IIS-WebServerRole -source WindowsFeatures
    @@ -80,7 +81,6 @@ choco install -y sysinternals
    choco install -y visualstudiocode
    choco install -y windirstat
    choco install -y winmerge
    choco install vmwareworkstation

    RefreshEnv
    az config set auto-upgrade.enable=yes
  4. raelyard revised this gist Mar 31, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -80,6 +80,7 @@ choco install -y sysinternals
    choco install -y visualstudiocode
    choco install -y windirstat
    choco install -y winmerge
    choco install vmwareworkstation

    RefreshEnv
    az config set auto-upgrade.enable=yes
  5. raelyard revised this gist Mar 31, 2023. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -87,3 +87,6 @@ git config --global alias.lgr 'lg -20'
    # 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

    sudo apt install zsh -y
    sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
  6. raelyard revised this gist Mar 30, 2023. 2 changed files with 10 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -5,9 +5,13 @@
    Disable-MicrosoftUpdate
    Disable-UAC


    choco feature enable -n=allowGlobalConfirmation

    powercfg /change standby-timeout-ac 0
    powercfg /change standby-timeout-dc 0
    powercfg /change hibernate-timeout-ac 0
    powercfg /change hibernate-timeout-dc 0

    # Windows Explorer has undesirable defaults - fix for this installation:
    Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess

    5 changes: 5 additions & 0 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,11 @@ Disable-UAC

    choco feature enable -n=allowGlobalConfirmation

    powercfg /change standby-timeout-ac 0
    powercfg /change standby-timeout-dc 0
    powercfg /change hibernate-timeout-ac 0
    powercfg /change hibernate-timeout-dc 0

    # Windows Explorer has undesirable defaults - fix for this installation:
    Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess

  7. raelyard revised this gist Mar 30, 2023. 2 changed files with 6 additions and 3 deletions.
    6 changes: 5 additions & 1 deletion MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,8 @@ Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtec
    # Windows Subsystem For Linux
    choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures

    wsl --update

    # .NET, IIS and friends
    choco install -y Containers -source WindowsFeatures
    choco install -y dotnetfx
    @@ -152,7 +154,9 @@ $WSLProvision | Ubuntu run 'cat - > /home/raelyard/provision.sh'
    Ubuntu run 'chmod +x /home/raelyard/provision.sh'
    Ubuntu run '/home/raelyard/provision.sh'

    wsl --set-default Ubuntu

    Enable-UAC
    Enable-MicrosoftUpdate
    $Updates = Start-WUScan -SearchCriteria "Type='Software' AND IsInstalled=0"
    Install-WUUpdates -Updates $Updates
    Install-WindowsUpdate -Full
    3 changes: 1 addition & 2 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -81,8 +81,7 @@ Ubuntu run '/home/raelyard/provision.sh'

    Enable-UAC
    Enable-MicrosoftUpdate
    $Updates = Start-WUScan -SearchCriteria "Type='Software' AND IsInstalled=0"
    Install-WUUpdates -Updates $Updates
    Install-WindowsUpdate -Full

    # now start the other software packages
    choco install -y googlechrome
  8. raelyard revised this gist Mar 30, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ sudo ln -s ~/.tfenv/bin/* /usr/local/bin
    tfenv install latest
    tfenv use latest

    sudo apt install -y dotnet-sdk-6.0
    sudo apt install -y dotnet-sdk-7.0
    sudo apt-get install -y powershell

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
  9. raelyard revised this gist Mar 30, 2023. 2 changed files with 5 additions and 3 deletions.
    4 changes: 3 additions & 1 deletion MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -75,6 +75,7 @@ choco install -y visualstudiocode
    choco install -y windirstat
    choco install -y winmerge

    RefreshEnv
    az config set auto-upgrade.enable=yes

    # Visual Studio and friends
    @@ -153,4 +154,5 @@ Ubuntu run '/home/raelyard/provision.sh'

    Enable-UAC
    Enable-MicrosoftUpdate
    Install-WindowsUpdate -acceptEula
    $Updates = Start-WUScan -SearchCriteria "Type='Software' AND IsInstalled=0"
    Install-WUUpdates -Updates $Updates
    4 changes: 2 additions & 2 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -81,8 +81,8 @@ Ubuntu run '/home/raelyard/provision.sh'

    Enable-UAC
    Enable-MicrosoftUpdate
    Install-WindowsUpdate -acceptEula

    $Updates = Start-WUScan -SearchCriteria "Type='Software' AND IsInstalled=0"
    Install-WUUpdates -Updates $Updates

    # now start the other software packages
    choco install -y googlechrome
  10. raelyard revised this gist Mar 30, 2023. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,6 @@ choco install -y electrum
    choco install -y evernote
    choco install -y fiddler
    choco install -y firefox
    choco install -y lastpass
    choco install -y vim
    choco install -y kindle
    choco install -y lockhunter
    @@ -71,7 +70,6 @@ choco install -y powertoys
    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
  11. raelyard revised this gist Mar 30, 2023. 2 changed files with 1 addition and 3 deletions.
    3 changes: 1 addition & 2 deletions MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,7 @@ Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtec
    # 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
    # .NET, IIS and friends
    choco install -y Containers -source WindowsFeatures
    choco install -y dotnetfx
    choco install -y IIS-WebServerRole -source WindowsFeatures
    1 change: 0 additions & 1 deletion Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,6 @@ choco feature enable -n=allowGlobalConfirmation
    Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess

    # Windows Subsystem For Linux
    choco install Microsoft-Hyper-V-All -source windowsFeatures
    choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures

    # essential software packages
  12. raelyard revised this gist Mar 30, 2023. 2 changed files with 43 additions and 7 deletions.
    46 changes: 41 additions & 5 deletions MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,12 @@
    # . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
    # Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/ -DisableReboots

    Disable-MicrosoftUpdate
    Disable-UAC


    choco feature enable -n=allowGlobalConfirmation

    # Windows Explorer has undesirable defaults - fix for this installation:
    Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess

    @@ -19,9 +25,6 @@ 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
    @@ -54,7 +57,6 @@ choco install -y electrum
    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
    @@ -79,7 +81,7 @@ choco install -y winmerge
    az config set auto-upgrade.enable=yes

    # Visual Studio and friends
    choco install -y visualstudio2022community --package-parameters "--allWorkloads --includeRecommended --passive --locale en-US"
    choco install -y visualstudio2022professional --package-parameters "--allWorkloads --includeRecommended --passive --locale en-US"
    choco install -y resharper
    choco install -y sql-server-management-studio

    @@ -121,3 +123,37 @@ Append-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MS
    nvm install lts
    nvm use lts


    Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx -UseBasicParsing
    Add-AppxPackage .\Ubuntu.appx
    rm .\Ubuntu.appx

    RefreshEnv
    Ubuntu install --root

    RefreshEnv
    if ((Ubuntu run getent passwd | Select-String -Pattern '^raelyard' -AllMatches).Matches.Count -ne 1) {
    Ubuntu run apt update

    # Create passwordless raelyard
    Ubuntu run 'useradd -m -s /bin/bash raelyard'
    Ubuntu run 'usermod -aG sudo raelyard'

    # supress password prompts from sudo commands
    Ubuntu run "echo 'raelyard ALL=(ALL) NOPASSWD: ALL' | sudo EDITOR='tee -a' visudo"

    # Switch default user from root to raelyard
    Ubuntu config --default-user raelyard
    }

    # Copy and run provisioning script as raelyard
    # sudo is can be used and script MUST be repeatable!
    $WSLProvisionURL = "https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/machine-setup.sh"
    $WSLProvision = (Invoke-WebRequest -UseBasicParsing "$WSLProvisionURL").Content.Replace("{{home_folder}}", $Home.Replace("\", "/").Replace("C:/", "/mnt/c/"))
    $WSLProvision | Ubuntu run 'cat - > /home/raelyard/provision.sh'
    Ubuntu run 'chmod +x /home/raelyard/provision.sh'
    Ubuntu run '/home/raelyard/provision.sh'

    Enable-UAC
    Enable-MicrosoftUpdate
    Install-WindowsUpdate -acceptEula
    4 changes: 2 additions & 2 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ sudo apt install helm

    # Azure Kubernetes Service authentication tool for Azure Active Directory
    # (use `kubelogin convert-kubeconfig -l azurecli` after authenticating with a cluster with az `az aks get-credentials -g <resource group> -n <cluster>`)
    wget https://github.com/Azure/kubelogin/releases/download/v0.0.20/kubelogin-linux-amd64.zip
    wget https://github.com/Azure/kubelogin/releases/download/v0.0.28/kubelogin-linux-amd64.zip
    unzip kubelogin-linux-amd64.zip
    rm kubelogin-linux-amd64.zip
    sudo mv bin/linux_amd64/kubelogin /usr/bin
    @@ -50,7 +50,7 @@ tfenv use latest
    sudo apt install -y dotnet-sdk-6.0
    sudo apt-get install -y powershell

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
    source ~/.profile
    nvm install node
    nvm use node
  13. raelyard revised this gist Feb 3, 2023. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ choco install -y vim
    choco install -y kindle
    choco install -y lockhunter
    choco install -y ngrok.portable
    choco install -y nodejs
    choco install -y nvm
    choco install -y notepadplusplus
    choco install -y nuget.commandline
    choco install -y papercut
    @@ -118,3 +118,6 @@ set-location Setup\PowerShell
    refreshenv
    . C:\Code\setup\Powershell\Functions\Windows.ps1
    Append-Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin"
    nvm install lts
    nvm use lts

  14. raelyard revised this gist Dec 26, 2022. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -57,6 +57,11 @@ nvm use node

    rm packages-microsoft-prod.deb

    # Kind for clusters with Docker container nodes
    curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.17.0/kind-$(uname)-amd64"
    chmod +x ./kind
    sudo mv ./kind /usr/local/bin/kind

    # set up a local Nuget package source
    mkdir ~/packages
    nuget source add -Name Local -source ~/packages
  15. raelyard revised this gist Sep 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ sudo apt install -y azure-cli
    sudo apt install -y awscli
    sudo apt install -y lastpass-cli
    sudo apt install -y jq
    sudo apt-get install helm
    sudo apt install helm


    # Azure Kubernetes Service authentication tool for Azure Active Directory
  16. raelyard revised this gist Sep 7, 2022. 1 changed file with 12 additions and 3 deletions.
    15 changes: 12 additions & 3 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,18 @@ sudo apt install -y jq
    sudo apt-get install helm


    # Azure Kubernetes Service authentication tool for Azure Active Directory
    # (use `kubelogin convert-kubeconfig -l azurecli` after authenticating with a cluster with az `az aks get-credentials -g <resource group> -n <cluster>`)
    wget https://github.com/Azure/kubelogin/releases/download/v0.0.20/kubelogin-linux-amd64.zip
    unzip kubelogin-linux-amd64.zip
    rm kubelogin-linux-amd64.zip
    sudo mv bin/linux_amd64/kubelogin /usr/bin
    kubelogin convert-kubeconfig -l azurecli


    # Azure Artifacts Credential Provider
    wget -qO- https://aka.ms/install-artifacts-credprovider.sh | bash

    az config set auto-upgrade.enable=yes

    # tfenv to enable setting up different versions of terraform (and installing and setting latest as default)
    @@ -45,9 +57,6 @@ nvm use node

    rm packages-microsoft-prod.deb

    # Azure Artifacts Credential Provider
    wget -qO- https://aka.ms/install-artifacts-credprovider.sh | bash

    # set up a local Nuget package source
    mkdir ~/packages
    nuget source add -Name Local -source ~/packages
  17. raelyard revised this gist Sep 6, 2022. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,12 @@
    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
    curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
    curl -sL https://packages.microsoft.com/keys/microsoft.asc |
    gpg --dearmor |
    sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
    AZ_REPO=$(lsb_release -cs)
    echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" |
    sudo tee /etc/apt/sources.list.d/azure-cli.list
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
    sudo apt update
    sudo apt install -y apt-transport-https
  18. raelyard revised this gist Sep 4, 2022. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    #!/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
    curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
    sudo apt update
    sudo apt install -y apt-transport-https

    @@ -16,6 +18,8 @@ sudo apt install -y azure-cli
    sudo apt install -y awscli
    sudo apt install -y lastpass-cli
    sudo apt install -y jq
    sudo apt-get install helm


    az config set auto-upgrade.enable=yes

  19. raelyard revised this gist Aug 29, 2022. 1 changed file with 2 additions and 9 deletions.
    11 changes: 2 additions & 9 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -26,20 +26,13 @@ tfenv install latest
    tfenv use latest

    sudo apt install -y dotnet-sdk-6.0
    sudo apt-get install -y powershell

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
    source ~/.profile
    nvm install node
    nvm use node

    sudo mkdir /usr/share/PowerShell
    pushd /usr/share/PowerShell
    sudo wget https://github.com/PowerShell/PowerShell/releases/download/v7.2.5/powershell-7.2.5-linux-x64.tar.gz
    sudo tar xzvf powershell-7.2.5-linux-x64.tar.gz
    sudo rm powershell-7.2.5-linux-x64.tar.gz
    popd
    echo 'PATH="$PATH:/usr/share/PowerShell"' >> ~/.profile
    source ~/.profile

    rm packages-microsoft-prod.deb

    # Azure Artifacts Credential Provider
  20. raelyard revised this gist Aug 8, 2022. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -37,19 +37,16 @@ choco install -y IIS-WebSockets -source WindowsFeatures
    # now start the software packages
    choco install -y git
    choco install -y powershell-core
    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
  21. raelyard revised this gist Aug 8, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures
    choco install -y git
    choco install -y docker-desktop
    choco install -y vim
    choco install -y powershell-core
    choco install -y lastpass
    choco install -y visualstudiocode
    choco install -y ngrok.portable
  22. raelyard revised this gist Aug 8, 2022. 2 changed files with 31 additions and 33 deletions.
    1 change: 1 addition & 0 deletions MachineSetup.ps1
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,7 @@ choco install -y IIS-WebSockets -source WindowsFeatures

    # now start the software packages
    choco install -y git
    choco install -y powershell-core
    choco install -y tortoisehg
    choco install -y microsoft-edge
    choco install -y googlechrome
    63 changes: 30 additions & 33 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -15,30 +15,16 @@ Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtec
    choco install Microsoft-Hyper-V-All -source windowsFeatures
    choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures

    # now start the software packages
    # essential software packages
    choco install -y git
    # choco install -y googlechrome
    # choco install -y 7Zip
    # choco install -y ConEmu
    # 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 lastpass
    # choco install -y vim
    # choco install -y kindle
    # choco install -y lockhunter
    # choco install -y ngrok.portable
    # choco install -y notepadplusplus
    # choco install -y poshgit
    # choco install -y powertoys
    # choco install -y Slack
    # choco install -y sysinternals
    # choco install -y visualstudiocode
    # choco install -y windirstat
    # choco install -y winmerge
    choco install -y docker-desktop
    choco install -y vim
    choco install -y lastpass
    choco install -y visualstudiocode
    choco install -y ngrok.portable
    choco install -y ConEmu
    choco install -y dropbox
    choco install -y winmerge

    RefreshEnv

    @@ -63,12 +49,9 @@ git config --global alias.lgf 'lg --first-parent'
    git config --global alias.lgfr 'lgf -20'
    git config --global alias.lgr 'lg -20'

    Enable-UAC
    Enable-MicrosoftUpdate
    Install-WindowsUpdate -acceptEula

    Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx -UseBasicParsing
    Add-AppxPackage .\Ubuntu.appx
    rm .\Ubuntu.appx

    RefreshEnv
    Ubuntu install --root
    @@ -96,9 +79,23 @@ $WSLProvision | Ubuntu run 'cat - > /home/raelyard/provision.sh'
    Ubuntu run 'chmod +x /home/raelyard/provision.sh'
    Ubuntu run '/home/raelyard/provision.sh'

    #--- Rename the Computer ---
    # Requires restart, or add the -Restart flag
    $computername = "raelyard"
    if ($env:computername -ne $computername) {
    Rename-Computer -NewName $computername
    }
    Enable-UAC
    Enable-MicrosoftUpdate
    Install-WindowsUpdate -acceptEula


    # now start the other software packages
    choco install -y googlechrome
    choco install -y 7Zip
    choco install -y curl
    choco install -y evernote
    choco install -y fiddler
    choco install -y firefox
    choco install -y kindle
    choco install -y lockhunter
    choco install -y notepadplusplus
    choco install -y poshgit
    choco install -y powertoys
    choco install -y Slack
    choco install -y sysinternals
    choco install -y windirstat
  23. raelyard revised this gist Aug 8, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -40,6 +40,7 @@ choco install -y git
    # choco install -y windirstat
    # choco install -y winmerge

    RefreshEnv

    # configure git identity and defaults (want to prune on fetch, etc.)
    git config --global user.name "Dave Rael"
  24. raelyard revised this gist Aug 8, 2022. No changes.
  25. raelyard revised this gist Aug 8, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    # Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/Minimal.ps1 -DisableReboots


    Disable-WindowsUpdate
    Disable-MicrosoftUpdate
    Disable-UAC

    choco feature enable -n=allowGlobalConfirmation
  26. raelyard revised this gist Aug 7, 2022. 1 changed file with 22 additions and 22 deletions.
    44 changes: 22 additions & 22 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -17,28 +17,28 @@ choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures

    # now start the software packages
    choco install -y git
    choco install -y googlechrome
    choco install -y 7Zip
    choco install -y ConEmu
    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 lastpass
    choco install -y vim
    choco install -y kindle
    choco install -y lockhunter
    choco install -y ngrok.portable
    choco install -y notepadplusplus
    choco install -y poshgit
    choco install -y powertoys
    choco install -y Slack
    choco install -y sysinternals
    choco install -y visualstudiocode
    choco install -y windirstat
    choco install -y winmerge
    # choco install -y googlechrome
    # choco install -y 7Zip
    # choco install -y ConEmu
    # 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 lastpass
    # choco install -y vim
    # choco install -y kindle
    # choco install -y lockhunter
    # choco install -y ngrok.portable
    # choco install -y notepadplusplus
    # choco install -y poshgit
    # choco install -y powertoys
    # choco install -y Slack
    # choco install -y sysinternals
    # choco install -y visualstudiocode
    # choco install -y windirstat
    # choco install -y winmerge


    # configure git identity and defaults (want to prune on fetch, etc.)
  27. raelyard revised this gist Aug 7, 2022. 2 changed files with 51 additions and 4 deletions.
    47 changes: 47 additions & 0 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,17 @@
    # . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
    # Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/Minimal.ps1 -DisableReboots


    Disable-WindowsUpdate
    Disable-UAC

    choco feature enable -n=allowGlobalConfirmation

    # Windows Explorer has undesirable defaults - fix for this installation:
    Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess

    # Windows Subsystem For Linux
    choco install Microsoft-Hyper-V-All -source windowsFeatures
    choco install -y Microsoft-Windows-Subsystem-Linux -source WindowsFeatures

    # now start the software packages
    @@ -54,3 +61,43 @@ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Crese
    git config --global alias.lgf 'lg --first-parent'
    git config --global alias.lgfr 'lgf -20'
    git config --global alias.lgr 'lg -20'

    Enable-UAC
    Enable-MicrosoftUpdate
    Install-WindowsUpdate -acceptEula

    Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx -UseBasicParsing
    Add-AppxPackage .\Ubuntu.appx

    RefreshEnv
    Ubuntu install --root

    RefreshEnv
    if ((Ubuntu run getent passwd | Select-String -Pattern '^raelyard' -AllMatches).Matches.Count -ne 1) {
    Ubuntu run apt update

    # Create passwordless raelyard
    Ubuntu run 'useradd -m -s /bin/bash raelyard'
    Ubuntu run 'usermod -aG sudo raelyard'

    # supress password prompts from sudo commands
    Ubuntu run "echo 'raelyard ALL=(ALL) NOPASSWD: ALL' | sudo EDITOR='tee -a' visudo"

    # Switch default user from root to raelyard
    Ubuntu config --default-user raelyard
    }

    # Copy and run provisioning script as raelyard
    # sudo is can be used and script MUST be repeatable!
    $WSLProvisionURL = "https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/machine-setup.sh"
    $WSLProvision = (Invoke-WebRequest -UseBasicParsing "$WSLProvisionURL").Content.Replace("{{home_folder}}", $Home.Replace("\", "/").Replace("C:/", "/mnt/c/"))
    $WSLProvision | Ubuntu run 'cat - > /home/raelyard/provision.sh'
    Ubuntu run 'chmod +x /home/raelyard/provision.sh'
    Ubuntu run '/home/raelyard/provision.sh'

    #--- Rename the Computer ---
    # Requires restart, or add the -Restart flag
    $computername = "raelyard"
    if ($env:computername -ne $computername) {
    Rename-Computer -NewName $computername
    }
    8 changes: 4 additions & 4 deletions machine-setup.sh
    Original file line number Diff line number Diff line change
    @@ -26,16 +26,16 @@ tfenv install latest
    tfenv use latest

    sudo apt install -y dotnet-sdk-6.0
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
    source ~/.profile
    nvm install node
    nvm use node

    sudo mkdir /usr/share/PowerShell
    pushd /usr/share/PowerShell
    sudo wget https://github.com/PowerShell/PowerShell/releases/download/v7.2.3/powershell-7.2.3-linux-x64.tar.gz
    sudo tar xzvf powershell-7.2.3-linux-x64.tar.gz
    sudo rm powershell-7.2.3-linux-x64.tar.gz
    sudo wget https://github.com/PowerShell/PowerShell/releases/download/v7.2.5/powershell-7.2.5-linux-x64.tar.gz
    sudo tar xzvf powershell-7.2.5-linux-x64.tar.gz
    sudo rm powershell-7.2.5-linux-x64.tar.gz
    popd
    echo 'PATH="$PATH:/usr/share/PowerShell"' >> ~/.profile
    source ~/.profile
  28. raelyard revised this gist Aug 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # to execute:
    # . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
    # Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/56a0e14c372b10780b3b81d04462039eef4e23b2/Minimal.ps1 -DisableReboots
    # Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/Minimal.ps1 -DisableReboots

    # Windows Explorer has undesirable defaults - fix for this installation:
    Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess
  29. raelyard revised this gist Aug 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # to execute:
    # . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
    # Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/ -DisableReboots
    # Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/raelyard/6783972a17ba1bc14e83/raw/56a0e14c372b10780b3b81d04462039eef4e23b2/Minimal.ps1 -DisableReboots

    # Windows Explorer has undesirable defaults - fix for this installation:
    Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -DisableOpenFileExplorerToQuickAccess -EnableShowFrequentFoldersInQuickAccess
  30. raelyard revised this gist Aug 7, 2022. 1 changed file with 56 additions and 0 deletions.
    56 changes: 56 additions & 0 deletions Minimal.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,56 @@
    # 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

    # now start the software packages
    choco install -y git
    choco install -y googlechrome
    choco install -y 7Zip
    choco install -y ConEmu
    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 lastpass
    choco install -y vim
    choco install -y kindle
    choco install -y lockhunter
    choco install -y ngrok.portable
    choco install -y notepadplusplus
    choco install -y poshgit
    choco install -y powertoys
    choco install -y Slack
    choco install -y sysinternals
    choco install -y visualstudiocode
    choco install -y windirstat
    choco install -y winmerge


    # 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 aliases
    git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset %Cgreen%cd%Creset %s %C(bold blue)<%an>%Creset %C(auto)%D%Creset' --abbrev-commit --date local --date=format:'%Y-%m-%d %H:%M'"
    git config --global alias.lgf 'lg --first-parent'
    git config --global alias.lgfr 'lgf -20'
    git config --global alias.lgr 'lg -20'