Skip to content

Instantly share code, notes, and snippets.

@ericbaranowski
Last active June 3, 2024 17:43
Show Gist options
  • Save ericbaranowski/5ae5caf89df40267164043b4fa0fb8ec to your computer and use it in GitHub Desktop.
Save ericbaranowski/5ae5caf89df40267164043b4fa0fb8ec to your computer and use it in GitHub Desktop.

Run Startup.ps1 as script in Azure

Then run ubuntu.sh on the WSL machine

Windows Terminal

Add Git Bash to Windows Terminal

Generate a new GUID in Powershell [guid]::NewGuid() the use it to add this to the settings, like

            {
                "guid": "{984211b2-e509-4709-91bd-814957a997f8}",
                "name": "Git-Bash",
                "commandline": "%PROGRAMFILES%\\Git\\bin\\bash.exe",
                "icon": "%PROGRAMFILES%\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "startingDirectory" : "~"
             }

Add PS7 as default

Change the GUID of default profile to the settings of Windows Terminal

Verified Commit

On windows

Use Git Bash, as Git For Windows includes gpg. It is the easiest as already included and used by git itself.

gpg --full-generate-key
gpg --list-secret-keys --keyid-format LONG

# add another email
# <id> can be email 
gpg --edit-key <id>
> adduid
> save

git config --global user.signingkey <KEY>
git config --global commit.gpgsign true
git config --global gpg.program gpg

gpg --armor --export <key>

Then put in Github: https://github.com/settings/keys

in WSL - Ubuntu 20

Credential store

WINDOWS 10

Included in git for windows

Ubuntu WSL

Use Git Credential Core - Built in Git for Windows But setup for WSL with https://docs.microsoft.com/fr-fr/windows/wsl/tutorials/wsl-git#git-credential-manager-setup

  • Install deps
sudo apt install gpg pass

How I set up my keypirinha

About

Install packages

Using pkgControl: https://github.com/ueffel/Keypirinha-PackageControl

  • Open Keypirinha then F2 and
import keypirinha as kp,keypirinha_net as kpn,os;p="PackageControl.keypirinha-package";d=kpn.build_urllib_opener().open("https://github.com/ueffel/Keypirinha-PackageControl/releases/download/1.0.2/"+p);pb=d.read();d.close();f=open(os.path.join(kp.installed_package_dir(),p),"wb");f.write(pb);f.close()

Installed packages

See list https://ue.spdns.de/packagecontrol/

  • Windows App
  • Recent Items
  • Windows Terminal Profiles
  • Git
  • todo-markdown
  • snippet
  • winsys
  • url-shortener
  • kill

Configure Extension

File Catalog

if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
function Check-Command($cmdname) {
return [bool](Get-Command -Name $cmdname -ErrorAction SilentlyContinue)
}
function Activate-Windows {
@echo off
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43 >nul||cscript //nologo slmgr.vbs /ipk DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4 >nul||cscript //nologo slmgr.vbs /ipk YYVX9-NTFWV-6MDM3-9PT4T-4M68B >nul||cscript //nologo slmgr.vbs /ipk 44RPN-FTY23-9VTTB-MP9BX-T84FV >nul||cscript //nologo slmgr.vbs /ipk WNMTR-4C88C-JK8YV-HQ7T2-76DF9 >nul||cscript //nologo slmgr.vbs /ipk 2F77B-TNFGY-69QQF-B8YKP-D69TJ >nul||cscript //nologo slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ >nul||cscript //nologo slmgr.vbs /ipk QFFDN-GRT3P-VKWWX-X7T3R-8B639 >nul||cscript //nologo slmgr.vbs /ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D >nul||cscript //nologo slmgr.vbs /ipk 92NFX-8DJQP-P6BBQ-THF9C-7CG2H >nul&goto skms) else wmic os | findstr /I "home" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 >nul||cscript //nologo slmgr.vbs /ipk 3KHY7-WNT83-DGQKR-F7HPR-844BM >nul||cscript //nologo slmgr.vbs /ipk 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH >nul||cscript //nologo slmgr.vbs /ipk PVMJN-6DFY6-9CCP6-7BKTT-D3WVR >nul&goto skms) else wmic os | findstr /I "education" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 >nul||cscript //nologo slmgr.vbs /ipk 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ >nul&goto skms) else wmic os | findstr /I "11 pro" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX >nul||cscript //nologo slmgr.vbs /ipk MH37W-N47XK-V7XM9-C7227-GCQG9 >nul||cscript //nologo slmgr.vbs /ipk NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J >nul||cscript //nologo slmgr.vbs /ipk 9FNHH-K3HBT-3W4TD-6383H-6XYWF >nul||cscript //nologo slmgr.vbs /ipk 6TP4R-GNPTD-KYYHQ-7B7DP-J447Y >nul||cscript //nologo slmgr.vbs /ipk YVWGF-BXNMC-HTQYQ-CPQ99-66QFC >nul&goto skms) else (goto notsupported)
:skms
if %i% GTR 10 goto busy
if %i% EQU 1 set KMS=s9.us.to
if %i% EQU 2 set KMS=s8.uk.to
if %i% EQU 3 set KMS=kms9.MSGuides.com
if %i% GTR 3 goto ato
cscript //nologo slmgr.vbs /skms %KMS%:1688 >nul
:ato
echo ============================================================================&echo.&echo.&cscript //nologo slmgr.vbs /ato | find /i "successfully" && (echo.&echo ============================================================================&echo.&echo #My official blog: MSGuides.com&echo.&echo #How it works: bit.ly/kms-server&echo.&echo #Please feel free to contact me at [email protected] if you have any questions or concerns.&echo.&echo #Please consider supporting this project: donate.msguides.com&echo #Your support is helping me keep my servers running 24/7!&echo.&echo ============================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto skms)
explorer "http://MSGuides.com"&goto halt
:notsupported
echo ============================================================================&echo.&echo Sorry, your version is not supported.&echo.&goto halt
:busy
echo ============================================================================&echo.&echo Sorry, the server is busy and can't respond to your request. Please try again.&echo.
:halt
pause >nul
}
function AddToPath {
param (
[string]$folder
)
Write-Host "Adding $folder to environment variables..." -ForegroundColor Yellow
$currentEnv = [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine).Trim(";");
$addedEnv = $currentEnv + ";$folder"
$trimmedEnv = (($addedEnv.Split(';') | Select-Object -Unique) -join ";").Trim(";")
[Environment]::SetEnvironmentVariable(
"Path",
$trimmedEnv,
[EnvironmentVariableTarget]::Machine)
#Write-Host "Reloading environment variables..." -ForegroundColor Green
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
}
function Remove-UWP {
param (
[string]$name
)
Write-Host "Removing UWP $name..." -ForegroundColor Yellow
Get-AppxPackage $name | Remove-AppxPackage
Get-AppxPackage $name | Remove-AppxPackage -AllUsers
}
slmgr/ipk W269N-WFGWX-YVC9B-4J6C9-T83GX >nul
Activate-Windows
Write-Host "OS Info:" -ForegroundColor Green
Get-CimInstance Win32_OperatingSystem | Format-List Name, Version, InstallDate, OSArchitecture
(Get-ItemProperty HKLM:\HARDWARE\DESCRIPTION\System\CentralProcessor\0\).ProcessorNameString
# -----------------------------------------------------------------------------
$computerName = Read-Host 'Enter New Computer Name'
Write-Host "Renaming this computer to: " $computerName -ForegroundColor Yellow
Rename-Computer -NewName $computerName
# -----------------------------------------------------------------------------
Write-Host ""
Write-Host "Disable Sleep on AC Power..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Powercfg /Change monitor-timeout-ac 60
Powercfg /Change standby-timeout-ac 0
# -----------------------------------------------------------------------------
Write-Host ""
Write-Host "Add 'This PC' Desktop Icon..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
$thisPCIconRegPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel"
$thisPCRegValname = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
$item = Get-ItemProperty -Path $thisPCIconRegPath -Name $thisPCRegValname -ErrorAction SilentlyContinue
if ($item) {
Set-ItemProperty -Path $thisPCIconRegPath -name $thisPCRegValname -Value 0
}
else {
New-ItemProperty -Path $thisPCIconRegPath -Name $thisPCRegValname -Value 0 -PropertyType DWORD | Out-Null
}
# To list all appx packages:
# Get-AppxPackage | Format-Table -Property Name,Version,PackageFullName
Write-Host "Removing UWP Shit..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
$uwpRubbishApps = @(
"Microsoft.Microsoft3DViewer"
"Microsoft.ZuneMusic"
"Microsoft.ZuneVideo"
"*549981C3F5F10*"
"Microsoft.WindowsSoundRecorder"
"Microsoft.BingWeather"
"Microsoft.BingNews"
"king.com.CandyCrushSaga"
"Microsoft.Messaging"
"Microsoft.WindowsFeedbackHub"
"Microsoft.MicrosoftOfficeHub"
"Microsoft.MicrosoftSolitaireCollection"
"4DF9E0F8.Netflix"
"Microsoft.GetHelp"
"Microsoft.People"
"Microsoft.YourPhone"
"MicrosoftTeams"
"Microsoft.Getstarted"
"Microsoft.Microsoft3DViewer"
"Microsoft.WindowsMaps"
"Microsoft.MixedReality.Portal"
"Microsoft.SkypeApp")
foreach ($uwp in $uwpRubbishApps) {
Remove-UWP $uwp
}
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
Write-Host ""
Write-Host "Installing IIS..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Enable-WindowsOptionalFeature -Online -FeatureName IIS-DefaultDocument -All
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionDynamic -All
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionStatic -All
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets -All
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit -All
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET45 -All
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ServerSideIncludes
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication
# -----------------------------------------------------------------------------
Write-Host ""
Write-Host "Enable Windows 11 Developer Mode..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
# -----------------------------------------------------------------------------
Write-Host ""
if ($true) {
Write-Host "Enable Remote Desktop..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\" -Name "fDenyTSConnections" -Value 0
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\" -Name "UserAuthentication" -Value 1
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
}
if (Check-Command -cmdname 'choco') {
Write-Host "Choco is already installed, skip installation."
}
else {
Write-Host ""
Write-Host "Installing Chocolate for Windows..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
$installerName = Read-Host 'Which installer do you prefer, choco or winget?'
Write-Host ""
Write-Host "Installing Applications using $installerName..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
if ($installerName -contains 'choco') {
$Apps = @(
"7zip.install",
"git",
"vlc",
"vscode",
"sysinternals",
"linqpad",
"postman",
"beyondcompare",
"microsoft-teams.install",
"github-desktop",
"irfanview",
"nodejs-lts",
"azure-cli",
"powershell-core",
"obs-studio")
foreach ($app in $Apps) {
choco install $app -y
}
}
else {
$Apps = @(
"Microsoft.WindowsTerminal",
"Microsoft.PowerShell",
"Git.Git",
"Microsoft.VisualStudioCode",
#"Notepad++.Notepad++",
#"SublimeHQ.SublimeText.4",
"Notion.Notion",
"Google.Chrome",
"Lexikos.AutoHotkey",
#"Microsoft.VisualStudio.2019.Community",
#"Microsoft.VisualStudio.2019.BuildTools",
"Anaconda.Anaconda3",
#"JetBrains.PyCharm.Professional",
#"Docker.DockerDesktop",
#"OpenJS.NodeJS",
#"vim.vim",
#"Mozilla.Firefox.DeveloperEdition",
#"Microsoft.SQLServerManagementStudio",
#"ImageMagick.ImageMagick",
#"TopalaSoftwareSolutions.SIW",
#"Microsoft.TeamsExploration",
#"Microsoft.TeamsContinuousDeployment",
#"LutzRoeder.Netron",
#"Sinew.Enpass",
#"Oracle.VirtualBox",
#"Microsoft.Teams",
#"stackless.stackless",
#"Microsoft.RemoteDesktopClient",
#"qBittorrent.qBittorrent",
#"Microsoft.XMLNotepad",
#"eloston.ungoogled-chromium",
"BraveSoftware.BraveBrowser",
#"Kitware.CMake",
#"Elastic.Elasticsearch",
"Microsoft.AzureCLI",
"Mozilla.Firefox",
#"beekeeper-studio.beekeeper-studio",
#"dbeaver.dbeaver",
#"BiglySoftware.BiglyBT",
#"OSGeo.QGIS",
#"HTTPToolKit.HTTPToolKit",
#"Heroku.HerokuCLI",
"Dropbox.Dropbox",
"Microsoft.PowerBI",
#"JetBrains.GoLand",
#"JetBrains.CLion",
#"JetBrains.PHPStorm",
#"JetBrains.WebStorm",
#"Files-Community.Files",
"schemacrawler.schemacrawler",
#"Glarysoft.GlaryUtilities",
#"Puppet.puppet-bolt",
#"Microsoft.PowerToys",
#"QL-Win.QuickLook",
#"sbt.sbt",
#"Postman.Postman",
#"Microsoft.OfficeDeploymentTool",
#"GLab.GLab",
#"PDFsam.PDFsam",
"WiresharkFoundation.Wireshark",
#"Google.IAPDesktop",
#"Microsoft.AzureFunctionsCoreTools",
#"GoLang.Go",
#"Rustlang.Rust.GNU",
#"Microsoft.dotnetRuntime.5-x64",
#"Microsoft.VisualStudio.2019.RemoteTools",
"Microsoft.dotnet",
"7zip.7zip",
#"Oracle.JavaRuntimeEnvironment",
"Microsoft.SharePointOnlineManagementShell",
#"Microsoft.WindowsVirtualDesktopAgent",
#"LibreOffice.LibreOffice",
#"Nlitesoft.NTLite",
"Microsoft.AzureStorageExplorer",
#"Microsoft.MouseandKeyboardCenter",
#"GitHub.cli",
#"Kubernetes.minikube",
#"AgileBits.1Password",
#"Alacritty.Alacritty",
#"Canonical.Multipass",
"JohnMacFarlane.Pandoc",
#"Joplin.Joplin",
"LyX.LyX",
#"CloudApp.CloudApp",
#"NagleCode.PacketSender",
#"Rustlang.Rust.MSVC",
#"Microsoft.WindowsAdminCenter",
#"LaurentPRenedeCotret.pandoc-plot",
#"tantowi.maven",
#"PostgreSQL.pgAdmin",
#"AlexandrSubbotin.Cerebro",
#"Zotero.Zotero",
#"Yarn.Yarn",
#"Mirantis.Lens",
"Oracle.JavaRuntimeEnvironment",
"RedHat.VirtViewer",
"RealVNC.VNCViewer",
"WinDirStat.WinDirStat",
#"RichardsonSoftware.RazorSQL",
"TorProject.TorBrowser",
"Transmission.Transmission",
"Microsoft.Office",
#"HeidiSQL.HeidiSQL",
#"Lazarus.Lazarus",
"ZAP.ZAP",
"AirVPN.Eddie")
foreach ($app in $Apps) {
winget install -e --id $app --accept-package-agreements --accept-source-agreements
}
}
if (Get-Command -Name 'scoop') {
Write-Host "Scoop is already installed, skip installation."
}
else {
Write-Host ""
Write-Host "Installing Scoop for Windows..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
#Set-ExecutionPolicy Bypass -Scope Process -Force; iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
}
if (Get-Command -Name 'sudo') {
Write-Host "Sudo is already installed, skip installation."
}
else {
Write-Host ""
Write-Host "Installing Sudo with Scoop..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
scoop install sudo -y
}
$thisPCIconRegPath = "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem"
$thisPCRegValname = "LongPathsEnabled"
$item = Get-ItemProperty -Path $thisPCIconRegPath -Name $thisPCRegValname -ErrorAction SilentlyContinue
if ($item) {
sudo Set-ItemProperty -Path $thisPCIconRegPath -name $thisPCRegValname -Value 1
}
else {
sudo New-ItemProperty -Path $thisPCIconRegPath -Name $thisPCRegValname -Value 1 | Out-Null
}
if ($true) {
Write-Host "Adding Scoop to PATH using sudo..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
sudo Add-MpPreference -ExclusionPath "C:\Users\x\scoop" -Force
sudo Add-MpPreference -ExclusionPath "C:\ProgramData\scoop" -Force
}
Write-Host "Installing Scoop Apps..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
$Apps = @(
"git",
"innounp",
"dark",
"wixtoolset",
"everything",
"jq",
"jid",
"age",
"pshazz",
"concfg",
"aria2",
"bit",
"bat",
"less",
"tldr",
"nodejs")
foreach ($app in $Apps) {
scoop install $app -g
}
if (Test-Path -Path (echo $PROFILE)) {
Write-Host "Profile exists, skipping..."
} else {
Write-Host "Creating Profile file..."
Write-Host "------------------------------------" -ForegroundColor Green
New-Item -Path $PROFILE -Type File -Force
}
if ($true) {
Write-Host "Adding Scoop Extras..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
scoop bucket add extras
Write-Host "Installing keypirinha with scoop..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
scoop install keypirinha
Write-Host "Running ketpirinha.exe..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
keypirinha.exe
Write-Host "Starting SSH Agent..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
sudo Set-Service ssh-agent -StartupType Manual
Write-Host "Backing up console config to console-backup.json..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
concfg export console-backup.json
Write-Host "Importing solarized-dark to config..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
concfg import solarized-dark
Write-Host "Adding Autocompletion..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Add-Content -Path (echo $PROFILE) -Value '# Autocompletion'
Add-Content -Path (echo $profile) -Value 'try { $null = gcm gh -ea stop; Invoke-Expression -Command $(gh completion -s powershell | Out-String) } catch { }'
Add-Content -Path (echo $PROFILE) -Value ''
}
# add autocompletion
#bit complete
if ($true) {
Write-Host "Installing fonts..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
scoop bucket add nerd-fonts
sudo scoop install FiraCode
sudo scoop install FiraCode-NF
sudo scoop install Hack-NF
sudo scoop install Hack-NF-Mono
sudo scoop install Cascadia-Code
Write-Host "Installing chexmoi..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
scoop config aria2-warning-enabled false
scoop bucket add twpayne https://github.com/twpayne/scoop-bucket
scoop install chezmoi
if (Get-Command -Name 'oh-my-posh') {
Write-Host "OhMyPosh is already installed, skip installation."
}
else {
Write-Host ""
Write-Host "Installing OhMyPosh..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force; winget install JanDeDobbeleer.OhMyPosh -s winget
}
Add-Content -Path (echo $PROFILE) -Value '# Powerline setup'
Add-Content -Path (echo $PROFILE) -Value 'oh-my-posh init pwsh | Invoke-Expression'
Add-Content -Path (echo $PROFILE) -Value '#& ([ScriptBlock]::Create((oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" --print) -join "`n"))'
Add-Content -Path (echo $PROFILE) -Value ''
. $PROFILE
#Install-Module posh-git -Scope CurrentUser -Force
#Install-Module oh-my-posh -Scope CurrentUser -Force
#Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
#Set-PoshPrompt -Theme -PowerLineFont
#Add-Content -Path (echo $PROFILE) -Value '# Powerline setup'
#Add-Content -Path (echo $PROFILE) -Value 'Import-Module posh-git'
#Add-Content -Path (echo $PROFILE) -Value 'Import-Module oh-my-posh'
#Add-Content -Path (echo $PROFILE) -Value 'Set-PoshPrompt -Theme -PowerLineFont'
}
if ($true) {
Write-Host "Activating WSL..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
## * https://docs.microsoft.com/fr-fr/windows/wsl/install-win10)
## * https://support.rstudio.com/hc/en-us/articles/360049776974-Using-RStudio-Server-in-Windows-WSL2
sudo dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
## WSL 2
sudo dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
## restart
## update kernel : https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-kernel
#sudo wsl --set-default-version 2
#sudo wsl --install -d Ubuntu
## Install ubuntu from winstore and run it to install
## Share env var (https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/)
setx WSLENV
}
Write-Host "Setting up Git for Windows..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
$gitEmail = Read-Host 'Enter email address for global git config:'
git config --global user.email $gitEmail
$gitUsername = Read-Host 'Enter username for global git config:'
git config --global user.name $gitUsername
git config --global core.autocrlf true
# FFmpeg
if ($true) {
Write-Host "Downloading FFmpeg..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
$ffmpegPath = "${env:ProgramFiles}\FFMPEG"
$downloadUri = "https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z"
$downloadedFfmpeg = $env:USERPROFILE + "\ffmpeg-git-full.7z"
Remove-Item $downloadedFfmpeg -ErrorAction SilentlyContinue
aria2c.exe $downloadUri -d $HOME -o "ffmpeg-git-full.7z"
& ${env:ProgramFiles}\7-Zip\7z.exe x $downloadedFfmpeg "-o$($ffmpegPath)" -y
$subPath = $(Get-ChildItem -Path $ffmpegPath | Where-Object { $_.Name -like "ffmpeg*" } | Sort-Object Name -Descending | Select-Object -First 1).Name
$subPath = Join-Path -Path $ffmpegPath -ChildPath $subPath
$binPath = Join-Path -Path $subPath -ChildPath "bin"
Remove-Item $ffmpegPath\*.exe
Move-Item $binPath\*.exe $ffmpegPath
Write-Host "Adding FFmpeg to PATH..." -ForegroundColor Green
AddToPath -folder $ffmpegPath
Remove-Item -Path $downloadedFfmpeg -Force
}
Write-Host "Set home path hidden folders and files..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Get-ChildItem -Path $HOME -Filter .* -Recurse -Force -ErrorAction SilentlyContinue | ForEach-Object { $_.Attributes = $_.Attributes -bor [System.IO.FileAttributes]::Hidden }
Write-Host "Avoid Edge showing sidebar..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge" -ErrorAction SilentlyContinue
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge" -Name HubsSidebarEnabled -Type DWORD -Value 0 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Edge" -Name HubsSidebarEnabled -Type DWORD -Value 0
Write-Host "Disabling Alt+Tab swiching Edge tabs..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -ErrorAction SilentlyContinue
New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name MultiTaskingAltTabFilter -Type DWORD -Value 3 -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name MultiTaskingAltTabFilter -Type DWORD -Value 3
Write-Host "Avoid shitty folder grouping..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
(gci 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags' -s | ? PSChildName -eq '{885a186e-a440-4ada-812b-db871b942259}' ) | ri -Recurse
Write-Host "Applying file explorer settings..." -ForegroundColor Green
cmd.exe /c "reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f"
cmd.exe /c "reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v AutoCheckSelect /t REG_DWORD /d 0 /f"
cmd.exe /c "reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v LaunchTo /t REG_DWORD /d 1 /f"
Write-Host "Disabling the Windows Ink Workspace..." -ForegroundColor Green
REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\PenWorkspace" /V PenWorkspaceButtonDesiredVisibility /T REG_DWORD /D 0 /F
Write-Host "Exclude repos from Windows Defender..." -ForegroundColor Green
Add-MpPreference -ExclusionPath "$env:USERPROFILE\source\repos"
Add-MpPreference -ExclusionPath "$env:USERPROFILE\.nuget"
Add-MpPreference -ExclusionPath "$env:USERPROFILE\.vscode"
Add-MpPreference -ExclusionPath "$env:USERPROFILE\.dotnet"
Add-MpPreference -ExclusionPath "$env:USERPROFILE\.ssh"
Add-MpPreference -ExclusionPath "$env:USERPROFILE\.azuredatastudio"
Add-MpPreference -ExclusionPath "$env:APPDATA\npm"
Write-Host "Syncing time..." -ForegroundColor Green
net stop w32time
net start w32time
w32tm /resync /force
w32tm /query /status
Write-Host "Setting Time zone..." -ForegroundColor Green
Set-TimeZone -Name "Eastern Standard Time"
Write-Host "Enabling Hardware-Accelerated GPU Scheduling..." -ForegroundColor Green
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\" -Name 'HwSchMode' -Value '2' -PropertyType DWORD -Force
Write-Host "Installing Github.com/microsoft/artifacts-credprovider..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1'))
Write-Host "Removing Bluetooth icons..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
cmd.exe /c "reg add `"HKCU\Control Panel\Bluetooth`" /v `"Notification Area Icon`" /t REG_DWORD /d 0 /f"
# -----------------------------------------------------------------------------
Write-Host ""
Write-Host "Checking Windows updates..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
Install-Module -Name PSWindowsUpdate -Force
Write-Host "Installing updates... (Computer will reboot in minutes...)" -ForegroundColor Green
Get-WindowsUpdate -AcceptAll -Install -ForceInstall -AutoReboot
$settingsUrl = "https://gist.githubusercontent.com/ericbaranowski/5ae5caf89df40267164043b4fa0fb8ec/raw/c3081cceace69e02d9a44a8bebfe1fa6b5584ce8/settings.json"
Write-Host "Installing Terminal Settings..." -ForegroundColor Green
Write-Host "------------------------------------" -ForegroundColor Green
iex ((New-Object System.Net.WebClient).DownloadString($settingsUrl))
# -----------------------------------------------------------------------------
Write-Host "------------------------------------" -ForegroundColor Green
Read-Host -Prompt "Setup is done, restart is needed, press [ENTER] to restart computer."
Restart-Computer
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command": "paste",
"keys": "ctrl+v"
},
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "alt+shift+d"
}
],
"alwaysShowNotificationIcon": true,
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles":
{
"defaults":
{
"adjustIndistinguishableColors": "always",
"colorScheme": "Tango Dark",
"elevate": true,
"experimental.retroTerminalEffect": false,
"font":
{
"face": "FiraCode Nerd Font",
"size": 10.0,
"weight": "normal"
},
"intenseTextStyle": "all",
"scrollbarState": "always",
"startingDirectory": "%USERPROFILE%"
},
"list":
[
{
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell 5.1"
},
{
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Command Prompt"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"commandline": "\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\" -NoLogo -NoProfileLoadTime",
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell 7",
"source": "Windows.Terminal.PowershellCore"
}
]
},
"schemes":
[
{
"background": "#0C0C0C",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#012456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell Powershell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cursorColor": "#FFFFFF",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"selectionBackground": "#FFFFFF",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cursorColor": "#4F525D",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"selectionBackground": "#4F525D",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#002B36",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#FFFFFF",
"cyan": "#2AA198",
"foreground": "#839496",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#002B36",
"cyan": "#2AA198",
"foreground": "#657B83",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#073642",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#D3D7CF",
"green": "#4E9A06",
"name": "Tango Dark",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#FFFFFF",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#000000",
"cyan": "#06989A",
"foreground": "#555753",
"green": "#4E9A06",
"name": "Tango Light",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#555753",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#000080",
"brightBlack": "#808080",
"brightBlue": "#0000FF",
"brightCyan": "#00FFFF",
"brightGreen": "#00FF00",
"brightPurple": "#FF00FF",
"brightRed": "#FF0000",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFF00",
"cursorColor": "#FFFFFF",
"cyan": "#008080",
"foreground": "#C0C0C0",
"green": "#008000",
"name": "Vintage",
"purple": "#800080",
"red": "#800000",
"selectionBackground": "#FFFFFF",
"white": "#C0C0C0",
"yellow": "#808000"
}
],
"showTabsInTitlebar": false,
"showTerminalTitleInTitlebar": false,
"startOnUserLogin": true,
"themes": []
}
# installed by winget
winget install -e --id Microsoft.WindowsTerminal
#winget install -e --id Microsoft.PowerShell
winget install -e --id Git.Git
git config --global user.name "Eric Baranowski"
git config --global user.email eric@kulado.com
winget install -e --id Microsoft.VisualStudioCode
winget install -e --id Notepad++.Notepad++
winget install -e --id SublimeHQ.SublimeText.4
winget install -e --id Notion.Notion
winget install -e --id Google.Chrome
winget install -e --id Lexikos.AutoHotkey
winget install -e --id Microsoft.VisualStudio.2019.Community
winget install -e --id Microsoft.VisualStudio.2019.BuildTools
winget install -e --id Anaconda.Anaconda3
#winget install -e --id JetBrains.PyCharm.Professional
#winget install -e --id Docker.DockerDesktop
#winget install -e --id OpenJS.NodeJS
#winget install -e --id vim.vim
#winget install -e --id Mozilla.Firefox.DeveloperEdition
winget install -e --id Microsoft.SQLServerManagementStudio
#winget install -e --id ImageMagick.ImageMagick
#winget install -e --id TopalaSoftwareSolutions.SIW
#winget install -e --id Microsoft.TeamsExploration
#winget install -e --id Microsoft.TeamsContinuousDeployment
#winget install -e --id LutzRoeder.Netron
#winget install -e --id Sinew.Enpass
#winget install -e --id Oracle.VirtualBox
#winget install -e --id Microsoft.Teams
#winget install -e --id stackless.stackless
#winget install -e --id Microsoft.RemoteDesktopClient
#winget install -e --id qBittorrent.qBittorrent
#winget install -e --id Microsoft.XMLNotepad
#winget install -e --id eloston.ungoogled-chromium
#winget install -e --id BraveSoftware.BraveBrowser
#winget install -e --id Kitware.CMake
#winget install -e --id Elastic.Elasticsearch
winget install -e --id Microsoft.AzureCLI
#winget install -e --id Mozilla.Firefox
#winget install -e --id beekeeper-studio.beekeeper-studio
#winget install -e --id dbeaver.dbeaver
winget install -e --id BiglySoftware.BiglyBT
#winget install -e --id OSGeo.QGIS
#winget install -e --id HTTPToolKit.HTTPToolKit
#winget install -e --id Heroku.HerokuCLI
winget install -e --id Dropbox.Dropbox
winget install -e --id Microsoft.PowerBI
#winget install -e --id JetBrains.GoLand
#winget install -e --id JetBrains.CLion
#winget install -e --id JetBrains.PHPStorm
#winget install -e --id JetBrains.WebStorm
#winget install -e --id Files-Community.Files
winget install -e --id schemacrawler.schemacrawler
#winget install -e --id Glarysoft.GlaryUtilities
#winget install -e --id Puppet.puppet-bolt
#winget install -e --id Microsoft.PowerToys
#winget install -e --id QL-Win.QuickLook
#winget install -e --id sbt.sbt
#winget install -e --id Postman.Postman
#winget install -e --id Microsoft.OfficeDeploymentTool
#winget install -e --id GLab.GLab
#winget install -e --id PDFsam.PDFsam
winget install -e --id WiresharkFoundation.Wireshark
#winget install -e --id Google.IAPDesktop
#winget install -e --id Microsoft.AzureFunctionsCoreTools
#winget install -e --id GoLang.Go
#winget install -e --id Rustlang.Rust.GNU
#winget install -e --id Microsoft.dotnetRuntime.5-x64
#winget install -e --id Microsoft.VisualStudio.2019.RemoteTools
winget install -e --id Microsoft.dotnet
winget install -e --id 7zip.7zip
#winget install -e --id Oracle.JavaRuntimeEnvironment
winget install -e --id Microsoft.SharePointOnlineManagementShell
#winget install -e --id Microsoft.WindowsVirtualDesktopAgent
winget install -e --id LibreOffice.LibreOffice
#winget install -e --id Nlitesoft.NTLite
winget install -e --id Microsoft.AzureStorageExplorer
#winget install -e --id Microsoft.MouseandKeyboardCenter
#winget install -e --id GitHub.cli
#winget install -e --id Kubernetes.minikube
winget install -e --id AgileBits.1Password
#winget install -e --id Alacritty.Alacritty
#winget install -e --id Canonical.Multipass
winget install -e --id JohnMacFarlane.Pandoc
#winget install -e --id Joplin.Joplin
winget install -e --id LyX.LyX
#winget install -e --id CloudApp.CloudApp
#winget install -e --id NagleCode.PacketSender
#winget install -e --id Rustlang.Rust.MSVC
#winget install -e --id Microsoft.WindowsAdminCenter
#winget install -e --id LaurentPRenedeCotret.pandoc-plot
#winget install -e --id tantowi.maven
winget install -e --id PostgreSQL.pgAdmin
#winget install -e --id AlexandrSubbotin.Cerebro
#winget install -e --id Zotero.Zotero
#winget install -e --id Yarn.Yarn
#winget install -e --id Mirantis.Lens
winget install -e --id Oracle.JavaRuntimeEnvironment
winget install -e --id RedHat.VirtViewer
winget install -e --id RealVNC.VNCViewer
winget install -e --id WinDirStat.WinDirStat
winget install -e --id RichardsonSoftware.RazorSQL
# Delphi Tools
#winget install -e --id HeidiSQL.HeidiSQL
#winget install -e --id Lazarus.Lazarus
# install scoop
iwr -useb get.scoop.sh | iex
scoop checkup
scoop install git
scoop install innounp
scoop install dark
scoop install wixtoolset
scoop install sudo
sudo Add-MpPreference -ExclusionPath 'C:\Users\EB\scoop'
sudo Add-MpPreference -ExclusionPath 'C:\ProgramData\scoop'
sudo Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
# installed with scoop
scoop bucket add extras
scoop install keypirinha
keypirinha.exe
scoop install everything
scoop install jq
scoop install jid
scoop install age
# Prefer Oh My Posh
scoop install pshazz
sudo Set-Service ssh-agent -StartupType Manual
scoop install concfg
concfg export console-backup.json
concfg import solarized-dark
scoop install aria2
# add autocompletion
Add-Content -Path (echo $profile) -Value 'try { $null = gcm gh -ea stop; Invoke-Expression -Command $(gh completion -s powershell | Out-String) } catch { }'
scoop install bit
# add autocompletion
#bit complete
scoop install bat
scoop install less
scoop install tldr
## Nodejs
scoop install nodejs
npm i -g npm
npm install -g gitmoji-cli
npm install -g standard
# Fonts
scoop bucket add nerd-fonts
sudo scoop install FiraCode
sudo scoop install FiraCode-NF
sudo scoop install Hack-NF
sudo scoop install Hack-NF-Mono
sudo scoop install Cascadia-Code
# chezmoi
scoop bucket add twpayne https://github.com/twpayne/scoop-bucket
scoop install chezmoi
# Configure powershell
## Powerline setup https://docs.microsoft.com/en-us/windows/terminal/tutorials/powerline-setup
Install-Module posh-git -Scope CurrentUser -Force
Install-Module oh-my-posh -Scope CurrentUser -Force
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
Set-PoshPrompt -Theme -PowerLineFont
Add-Content -Path (echo $PROFILE) -Value '# Powerline setup'
Add-Content -Path (echo $PROFILE) -Value 'Import-Module posh-git'
Add-Content -Path (echo $PROFILE) -Value 'Import-Module oh-my-posh'
Add-Content -Path (echo $PROFILE) -Value 'Set-PoshPrompt -Theme -PowerLineFont'
# Activate WSL
## * https://docs.microsoft.com/fr-fr/windows/wsl/install-win10)
## * https://support.rstudio.com/hc/en-us/articles/360049776974-Using-RStudio-Server-in-Windows-WSL2
sudo dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
## WSL 2
sudo dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
## restart
## update kernel : https://docs.microsoft.com/fr-fr/windows/wsl/wsl2-kernel
#sudo wsl --set-default-version 2
#sudo wsl --install -d Ubuntu
## Install ubuntu from winstore and run it to install
## Share env var (https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/)
setx WSLENV
## Configure RStudio Server on WSL
sudo apt-get update
sudo apt-get upgrade -y
## Add repo
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/Linux/ubuntu focal-cran40/'
## install R and dependencies
sudo apt install -y r-base r-base-core r-recommended r-base-dev gdebi-core build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
wget https://rstudio.org/download/latest/stable/server/bionic/rstudio-server-latest-amd64.deb
sudo gdebi rstudio-server-latest-amd64.deb
## Install tools
wget https://github.com/cli/cli/releases/download/v0.11.1/gh_0.11.1_linux_amd64.deb
## Install bit
## https://github.com/chriswalz/bit#using-curl-simplest-way-to-install
curl -sf https://gobinaries.com/chriswalz/bit | sh;
bit complete;
## install rust - https://www.rust-lang.org/tools/install
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install natls
## Add to ~/.bashrc
if [ -d "$HOME/.cargo/bin" ] ; then
export PATH=$PATH:$HOME/.cargo/bin
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment