Skip to content

Instantly share code, notes, and snippets.

@ericbaranowski
Last active December 1, 2021 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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

# 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