Skip to content

Instantly share code, notes, and snippets.

@pjbgf
Last active February 23, 2019 06:50
Show Gist options
  • Save pjbgf/9235c7766b2b2fd53b342a0303de1ed7 to your computer and use it in GitHub Desktop.
Save pjbgf/9235c7766b2b2fd53b342a0303de1ed7 to your computer and use it in GitHub Desktop.
Setup linux dev machine
[user]
email = [email protected]
name = Paulo Gomes
# signingkey = 08523F6EF8967D22
[alias]
co = checkout
# cms = commit -S -m
cm = commit -m
d = diff
s = status
br = branch
a = add .
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
type = cat-file -t
dump = cat-file -p
up = push
#[commit]
# gpgsign = true
[core]
filemode = false
#[gpg]
# program = gpg
#cloud-config
package_upgrade: true
runcmd:
- wget https://gist.githubusercontent.com/pjbgf/9235c7766b2b2fd53b342a0303de1ed7/raw/974efac9c6bf4a01a90fd54577a45efed19511e3/setup-linux-dev-machine.sh
- chmod +x ./setup-linux-dev-machine.sh
- ./setup-linux-dev-machine.sh
echo Setting up Development Machine for Ubuntu 18.04LTS
echo .
echo It includes: ZSH, Golang, .Net, Kubectl + minikube + kvm, VSCode, Azure CLI
mkdir $HOME/git/
mkdir $HOME/go/
mkdir $HOME/go/src/
mkdir $HOME/go/bin/
mkdir $HOME/go/pkg/
echo Updating OS Packages...
sudo apt update
sudo apt upgrade -y
echo Ensure pre-reqs are installed
sudo apt install curl vim -y
command -v sudo >/dev/null 2>&1 || { apt install sudo -y; }
echo Installing ZSH and its Dependencies
sudo apt install zsh -y
sudo apt install powerline fonts-powerline -y
echo Configuring ZSH
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
sed -i 's/robbyrussell/agnoster/g' $HOME/.zshrc
sed -i 's/plugins=(git)/plugins=(git kubectl last-working-dir minikube vscode golang docker)/g' $HOME/.zshrc
echo "DEFAULT_USER=$(whoami)" >> $HOME/.zshrc
echo Install Zsh Syntax Highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.zsh-syntax-highlighting" --depth 1
echo "source $HOME/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> "$HOME/.zshrc"
echo Install Zsh Kubectl Prompt
git clone https://github.com/superbrothers/zsh-kubectl-prompt.git "$HOME/.zsh-kubectl-prompt" --depth 1
echo "source $HOME/.zsh-kubectl-prompt/kubectl.zsh" >> "$HOME/.zshrc"
echo "RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}'" >> "$HOME/.zshrc"
autoload -U colors; colors
source $HOME/.zsh-kubectl-prompt/kubectl.zsh
RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}'
sudo chsh -s /bin/zsh root
source $HOME/.zshrc
echo Install GO
sudo apt install golang-go -y
echo "export GOPATH=$HOME/go" >> "$HOME/.zshrc"
echo "export PATH=$PATH:$GOPATH" >> "$HOME/.zshrc"
echo Install dep
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
echo Install VSCode
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get install apt-transport-https -y
sudo apt-get update
sudo apt-get install code -y
echo Install .Net Core
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2 -y
echo Install KVM
sudo apt-get install libvirt-clients libvirt-daemon-system qemu-kvm ubuntu-vm-builder bridge-utils virt-manager -y
sudo usermod -a -G libvirt $(whoami)
newgrp libvirt
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
&& sudo install docker-machine-driver-kvm2 /usr/local/bin/
echo Kubectl
sudo apt-get update && sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl
echo Install minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.34.1/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
minikube config set vm-driver kvm2
echo Install HELM
sudo snap install helm --classic
echo Install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce -y
sudo usermod -a -G docker $(whoami)
newgrp docker
echo Install azure cli
sudo apt-get install apt-transport-https lsb-release software-properties-common dirmngr -y
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
sudo apt-key --keyring /etc/apt/trusted.gpg.d/Microsoft.gpg adv \
--keyserver packages.microsoft.com \
--recv-keys BC528686B50D79E339D3721CEB3E94ADBE1229CF
sudo apt-get update
sudo apt-get install azure-cli -y
echo Input gesture
sudo gpasswd -a $USER input
newgrp input
sudo apt-get install xdotool wmctrl -y
sudo apt-get install libinput-tools -y
git clone https://github.com/bulletmark/libinput-gestures.git $HOME/git/libinput-gestures
cd $HOME/git/libinput-gestures
sudo make install
libinput-gestures-setup autostart
libinput-gestures-setup start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment