diff --git a/scripts/archive.tar.gz b/scripts/archive.tar.gz index 34f7585..b4bb1e8 100644 Binary files a/scripts/archive.tar.gz and b/scripts/archive.tar.gz differ diff --git a/scripts/userdata.sh b/scripts/userdata.sh new file mode 100644 index 0000000..01d71b3 --- /dev/null +++ b/scripts/userdata.sh @@ -0,0 +1,29 @@ +#!/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