Skip to content

Instantly share code, notes, and snippets.

@waiteb3
Last active December 5, 2015 02:56
Show Gist options
  • Save waiteb3/d57b4df8411425962daf to your computer and use it in GitHub Desktop.
Save waiteb3/d57b4df8411425962daf to your computer and use it in GitHub Desktop.
#!/bin/bash
set -x
# only for ubuntu 14.04 LTS
start_install() {
SCALA_VERSION=${SCALA_VERSION:-2.11.4}
ACTIVATOR_VERSION=${ACTIVATOR_VERSION:-1.3.6}
CLANG_VERSION=${CLANG_VERSION:-3.6}
GO_VERSION=${GO_VERSION:-1.5.1}
GO_ENV="
export GO15VENDOREXPERIMENT=1
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin"
# $HOME/bin
mkdir $HOME/bin
# install go
install_go() {
curl -O https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz
rm -f go$GO_VERSION.linux-amd64.tar.gz
cd /usr/local/bin
sudo ln -s /usr/local/go/bin/* .
echo $GO_ENV >> ~/.profile
}
# clang
curl http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
# typescript
install_typescript() {
sudo npm install -g typescript tsd
}
# java and scala
sudo add-apt-repository -y ppa:openjdk-r/ppa
install_scala() {
curl -flo scala.deb http://downloads.typesafe.com/scala/$SCALA_VERSION/scala-$SCALA_VERSION.deb
sudo dpkg -i scala.deb
rm scala.deb
}
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
install_activator() {
curl -flo activator.zip https://downloads.typesafe.com/typesafe-activator/$ACTIVATOR_VERSION/typesafe-activator-ACTIVATOR_VERSION-minimal.zip
unzip activator.zip -d $HOME/bin
rm activator.zip
cd $HOME/bin
mv activator-$ACTIVATOR_VERSION-minimal/* .
rm -rf activator-$ACTIVATOR_VERSION-minimal/
}
# mono
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
# erl+elixir
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
rm erlang-solutions_1.0_all.deb
# nvim
sudo add-apt-repository -y ppa:neovim-ppa/unstable
# zeal
sudo add-apt-repository ppa:zeal-developers/ppa
# update all
sudo apt-get -y --force-yes upgrade
sudo apt-get -y --force-yes update
# pip stuff NOTE: must happen before tools
sudo apt-get -y --force-yes install python-pip python-dev python-pip3 python3-dev
# tools
sudo apt-get -y --force-yes install awesome vim neovim tmux htop curl make cmake unzip git mercurial subversion zeal \
traceroute libffi-dev libssl-dev libxml2-dev libxslt1-dev
sudo pip install mitmproxy virtualenv
curl https://get.docker.io/ | sudo sh
# languages
sudo apt-get -y --force-yes install build-essential mono-complete esl-erlang elixir openjdk-8-jdk maven sbt nodejs-legacy npm \
valgrind clang-$CLANG_VERSION lldb-$CLANG_VERSION
install_scala
install_typescript
install_activator
install_go
# setup clang
(
cd /usr/local/bin
sudo ln -s $(which clang-$CLANG_VERSION) clang
sudo ln -s $(which lldb-$CLANG_VERSION) lldb
)
# neovim setup
sudo pip install neovim
sudo pip3 install neovim
sudo update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60
(
cd ~
ln -s .vimrc .nvimrc
ln -s .vim .nvim
)
# vim prep
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
curl -flo ~/.vimrc https://gist.githubusercontent.com/waiteb3/1cf90a53381da79d993f/raw/5883a324cc31accda6f560f365befb5181509dbc/vimrc.vim
# TODO why is this broken.... (
# eval $GO_ENV
# sed -i 's|colorscheme|"colorscheme|g' ~/.vimrc
# vim.basic +PlugInstall +qall
# vim.basic +GoInstallBinaries +qall
# sed -i 's|"colorscheme|colorscheme|g' ~/.vimrc
#)
# intellij
(
wget https://download.jetbrains.com/idea/ideaIC-15.0.tar.gz
tar -zxf ideaIC-15.0.tar.gz
rm ideaIC-15.0.tar.gz
cat << EOF > $HOME/.local/share/applications/intellij.desktop
[Desktop Entry]
Version=15.0
Type=Application
Terminal=false
Icon[en_US]=/home/brandon/idea/bin/idea.png
Name[en_US]=IntelliJ IDEA
Exec=/home/brandon/idea/bin/idea.sh
Name=IntelliJ IDEA
Icon=/home/brandon/idea/bin/idea.png
EOF
)
}
start_install
set +x
echo "Now run:
vim -c 'PlugInstall' -c 'qall' && vim -c 'set ft=go' -c 'GoInstallBinaries' -c 'qall'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment