usefulfiles/scripts/userdata.sh
Martin Donnelly a028fbe8ee 2018-12-12
2018-12-12 16:30:23 +00:00

30 lines
710 B
Bash

#!/bin/bash
NVM="$HOME/.nvm"
NVM_VERSION="stable"
DEV="$HOME/dev"
SWAP="/swapfile"
apt-get -y -q update && apt-get -y -q upgrade
apt-get --assume-yes install build-essential git htop nodejs npm screen wget curl xorg openbox libasound2
apt-get -y -q clean
fallocate -l 1G $SWAP
chmod 600 $SWAP
mkswap $SWAP
swapon $SWAP
echo '/swapfile none swap defaults 0 0' >> /etc/fstab
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR=$NVM
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
source $HOME/.bashrc
source $NVM/nvm.sh
nvm install $NVM_VERSION
npm install -g gulp pm2@latest npm-check npm-install-missing
pm2 update
touch $HOME/martin.txt