Skip to content

Instantly share code, notes, and snippets.

# install packages
sudo apt-get update
sudo apt-get install nload htop -y
# if your user doesn't exists then remove sudo passwords
USERNAME=$(whoami)
sudo grep -qxF "${USERNAME} ALL=(ALL) NOPASSWD: ALL" /etc/sudoers || echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers
# install reqs docker
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
#Elevated Shell
param([switch]$Elevated)
function Check-Admin {
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Check-Admin) -eq $false) {
if ($elevated) {
# could not elevate, quit
} else {
wsl -u root ip addr add 192.168.1.225/24 broadcast 192.168.1.255 dev eth0 label eth0:1
netsh interface ip add address "vEthernet (WSL)" 192.168.1.220 255.255.255.0
#source https://github.com/docker-library/golang/blob/ee2d52a7ad3e077af02313cd4cd87fd39837412c/1.15/alpine3.12/Dockerfile
#custom
rm -rf /usr/local/go/src/*
apk add build-base
apk add gnupg go bash
apk add --no-cache \
ca-certificates
# set up nsswitch.conf for Go's "netgo" implementation