Skip to content

Instantly share code, notes, and snippets.

@International
Last active December 13, 2019 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save International/b4e527d5dd0cab702e01b6e16e112ee1 to your computer and use it in GitHub Desktop.
Save International/b4e527d5dd0cab702e01b6e16e112ee1 to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:keithw/mosh
sudo apt-get update
sudo apt-get -y install mosh
mkdir -p .config/nvim
curl -L https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage > /tmp/nvim.appimage
sudo mv /tmp/nvim.appimage /usr/bin/nvim
chmod +x /usr/bin/nvim
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
apt -y install tree
wget -O .config/nvim/init.vim https://gist.githubusercontent.com/International/4a94c418888b71a1fdc214943ea7771c/raw/1c3ee9ff8a310ef354c2c72cb5172a6c577f704b/Vimconf
# tools: NODE
apt -y install openjdk-8-jdk
existing_node_version="$(node -v)"
good_version="${existing_node_version:0:3}"
echo "existing_node_version: ${good_version}"
if [[ "${good_version}" == "v12" ]]; then
echo "Skipping node installation, already here"
else
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt-get update
apt-get -y install nodejs
fi
# tools: python
apt-get -y install python3.6
# tools: scala
scala_version="2.13.0"
existing_scala="$(scala --version 2>&1)"
scala_substr="${existing_scala:0:5}"
echo "scala_substr: ${scala_substr}"
if [[ "$scala_substr" == "Scala" ]]; then
echo "Scala already installed"
else
wget "www.scala-lang.org/files/archive/scala-${scala_version}.deb"
dpkg -I "scala-${scala_version}.deb"
fi
if ! which sbt; then
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt-get update
sudo apt-get install sbt
else
echo "sbt already installed"
fi
if ! which metals-vim; then
curl -L -o coursier https://git.io/coursier
chmod +x coursier
./coursier bootstrap \
--java-opt -Xss4m \
--java-opt -Xms100m \
--java-opt -Dmetals.client=coc.nvim \
org.scalameta:metals_2.12:0.7.6 \
-r bintray:scalacenter/releases \
-r sonatype:snapshots \
-o /usr/local/bin/metals-vim -f;
else
echo "metals-vim already installled"
fi
# tools: go
existing_go_version="$(go version 2>&1)"
go_substr="${existing_go_version:0:10}"
go_version="1.13.3"
if [[ "$go_substr" == "go version" ]]; then
echo "go already installed"
else
wget "https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz"
sudo tar -xvf go${go_version}.linux-amd64.tar.gz
sudo mv go /usr/local
ln -s /usr/local/go/bin/go /usr/bin/go
fi
# swap
sudo fallocate -l 1G /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile swap swap defaults 0 0'>>/etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment