Skip to content

Instantly share code, notes, and snippets.

@ld100
Last active April 2, 2024 19:11
Show Gist options
  • Save ld100/e2f6a1ad5e2e09a8dacd47c209743e00 to your computer and use it in GitHub Desktop.
Save ld100/e2f6a1ad5e2e09a8dacd47c209743e00 to your computer and use it in GitHub Desktop.
Settingh up development environment on Kali Linux (with WSL2 extras)

Installing Kali Linux for WSL2 and setting up a development environment

Preconditions

Follow official Microsoft guide called Windows Subsystem for Linux Installation Guide for Windows 10 to install WSL2.

Setting up the user

In case you are using Linux outside WSL, you'll need to create a user for yourself. Assuming you have sudo permissions already, adding user is:

sudo adduser username

And follow the instructions.

To grant sudo rights to your user do following:

sudo usermod -aG sudo username

To make zsh your default shell do following:

sudo usermod -s /usr/bin/zsh username

Main installation

sudo apt update && sudo apt upgrade

Installing goodies

sudo apt install git git-flow zsh mc htop vim pv ccze wget tmux nano -y

Installing XFCE and XRDP

NOTE: This section could be omited, since VSCode and Jetbrains IDEs enabled full-fledged integration with WSL.

sudo apt install kali-desktop-xfce dbus-x11 xrdp -y

sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak

sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini

sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini

sudo service xrdp start

Installing Docker

sudo apt install docker.io docker-compose -y

sudo usermod -aG docker ${USER}

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

sudo service docker start

sudo chmod 666 /var/run/docker.sock

docker run hello-world

Installing Kubernetes

sudo apt install kubernetes-client

sudo git clone https://github.com/ahmetb/kubectx /opt/kubectx

sudo ln -s /opt/kubectx/kubectx /usr/local/bin/kubectx

sudo ln -s /opt/kubectx/kubens /usr/local/bin/kubens

Install Protobuf Compiler

sudo apt install protobuf-compiler-grpc protobuf-compiler -y

Buf build

Download latest 64 bit binary from the github releases page. An example: Install the binaries to /opt and make symlinks from /usr/local/bin or put the binaries to /usr/local/bin directly.

sudo mkdir -p /opt/buf && cd /opt/buf
sudo wget https://github.com/bufbuild/buf/releases/download/v1.30.0/buf-Linux-x86_64 -O buf
sudo chmod +x buf
cd /usr/local/bin && sudo ln -s /opt/buf/buf

Installing Go

sudo apt install golang

go install github.com/golang/protobuf/protoc-gen-go@latest

go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

Add GOHOME env var

Installing Ruby

sudo apt install ruby ruby-grpc-tools -y

Installing .NET

Just follow official Microsoft Guide for Debian.

Installing Java

sudo apt install -y default-jdk gradle

Add JAVA_HOME env var

Installing NodeJS & Node Version Manager

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

nvm install 16.9 or similar to install the specific version or nvm install node to get a default version.

To make sure you're using the latest NVM version, follow its github page instructions.

Installing Python

Python is already installed in the system, let's just add protobuf/grpc support.

sudo apt -y install python3-protobuf python3-grpcio python3-grpc-tools

Install virtualenv sudo apt -y install python3-pip python3-virtualenv python3-virtualenvwrapper

Pipenv OBSOLETE sudo apt -y install pipenv

Installing Ansible

sudo apt install ansible

Installing Jetbrains IDEs

Download Jetbrains Toolbox from Jetbrains website, extract the archive contents to /opt. Run Toolbox app from the /opt via the GUI and pick which IDEs to install.

Installing Visual Studio Code

Usually Kali Linux has relatively old versions of VSCode, so it is reasonable to use recommended Microsoft guideline for installing VSCode.

Installing Hashicorp products

Nomad is available using sudo apt install nomad consul, but the version is obsolete. So it is recommended to download the binary yourself, just like for Nomad and Terraform.

Consul

Follow the official Consul recommendations for Debian/Ubuntu: Install the binaries to /opt and make symlinks from /usr/local/bin or put the binaries to /usr/local/bin directly.

sudo mkdir -p /opt/consul && cd /opt/consul
sudo wget https://releases.hashicorp.com/consul/1.18.0/consul_1.18.0_linux_amd64.zip
sudo unzip consul_1.18.0_linux_amd64.zip
cd /usr/local/bin && sudo ln -s /opt/consul/consul
sudo rm -rf /opt/consul/consul_1.18.0_linux_amd64.zip

Nomad

Follow the official Nomad recommendations for Debian/Ubuntu: Install the binaries to /opt and make symlinks from /usr/local/bin or put the binaries to /usr/local/bin directly.

sudo mkdir -p /opt/nomad && cd /opt/nomad
sudo wget https://releases.hashicorp.com/nomad/1.7.5/nomad_1.7.5_linux_amd64.zip
sudo unzip nomad_1.7.5_linux_amd64.zip
cd /usr/local/bin && sudo ln -s /opt/nomad/nomad
sudo rm -rf /opt/nomad/nomad_1.7.5_linux_amd64.zip

Terraform

Download latest 64 bit binary from the official page. An example: Install the binaries to /opt and make symlinks from /usr/local/bin or put the binaries to /usr/local/bin directly.

sudo mkdir -p /opt/terraform && cd /opt/terraform
sudo wget https://releases.hashicorp.com/terraform/1.7.4/terraform_1.7.4_linux_amd64.zip
sudo unzip terraform_1.7.4_linux_amd64.zip
cd /usr/local/bin && sudo ln -s /opt/terraform/terraform
sudo rm -rf /opt/terraform/terraform_1.7.4_linux_amd64.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment