Skip to content

Instantly share code, notes, and snippets.

@denisbrodbeck
Last active November 13, 2017 13:23
Show Gist options
  • Save denisbrodbeck/20b041ddebc5640189f872cb4d277b4d to your computer and use it in GitHub Desktop.
Save denisbrodbeck/20b041ddebc5640189f872cb4d277b4d to your computer and use it in GitHub Desktop.
Setup dev environment for golang and nodejs on ubuntu 16.04 vm.

How to create my dev environment for golang and nodejs on an Ubuntu 16.04 VM.

  • update os and install vm tools, git and fish
  • setup fish with oh-my-fish and theme bobthefish (bobthefish is a theme similar to agnoster)
  • install nodejs 8.x and yarn
  • fix npm permission issues
  • install go
  • install vs code

Setup base system

sudo apt update && \
 sudo apt upgrade --yes && \
 sudo apt install build-essential curl open-vm-tools-desktop git fish --yes

Terminal

Download Meslo LG M Regular for Powerline-Font and install it with double click.

curl https://raw.githubusercontent.com/powerline/fonts/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf -o ~/Downloads/meslo.ttf

Setup fish (see issue on Ubuntu 16.04):

curl -L https://get.oh-my.fish | fish
echo '
# setup npm permissions
set -xg NPM_CONFIG_PREFIX $HOME/.npm-global
set -xg PATH $HOME/.npm-global/bin $PATH
# setup go
set -xg PATH $PATH /usr/local/go/bin
set -xg GOPATH $HOME/code/go
set -xg PATH $PATH (go env GOPATH)/bin
# misc stuff
set -xg DEFAULT_USER dev
alias aptup="sudo apt update; and sudo apt upgrade"
' > ~/.config/omf/init.fish
# change to fish shell
chsh -s /usr/bin/fish
# install theme
omf install bobthefish

Pin terminal app to task bar and edit terminal profile.

Custom Font: Meslo LG M for Powerline Regular (size 14)

Terminal-Size: 140 Columns and 32 Rows

Setup node && npm && yarn

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo 'deb https://dl.yarnpkg.com/debian/ stable main' | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt update && \
 sudo apt install nodejs yarn --yes
npm install npm@latest -g

Setup Go

wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz && \
 sudo tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz && \
 rm ./go1.9.2.linux-amd64.tar.gz && \
 mkdir -p ~/code/go && \
 go get -u github.com/derekparker/delve/cmd/dlv

Install dep.

wget https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64
mv dep-linux-amd64 ~/code/go/bin/dep

Setup VS Code

Install Visual Studio Code

sudo dpkg -i Downloads/code_1.16.1-1505406497_amd64.deb

Install extensions:

  • Debugger for Chrome,
  • EditorConfig for Visual Studio Code
  • Go (reload and run init of plugin)
  • JavaScript Standard Style
  • Material Icon Theme

My default user settings:

{
    "editor.tabSize": 2,
    "editor.cursorStyle": "line",
    "editor.minimap.enabled": true,
    "explorer.autoReveal": true,
    "explorer.openEditors.visible": 0,
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 5000,
    "files.eol": "\n",
    "files.insertFinalNewline": true,
    "git.enabled": true,
    "window.zoomLevel": 1,
    "workbench.iconTheme": "material-icon-theme",
    "workbench.startupEditor": "newUntitledFile",
    "go.formatOnSave": true,
    "material-icon-theme.showUpdateMessage": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment