Skip to content

Instantly share code, notes, and snippets.

@beeman
Last active February 11, 2017 07:36
Show Gist options
  • Save beeman/d516cea2f469c9850a7d78da1d19cff2 to your computer and use it in GitHub Desktop.
Save beeman/d516cea2f469c9850a7d78da1d19cff2 to your computer and use it in GitHub Desktop.
Custom user data script for dply.co https://dply.co/b/FVl9WY5k
#!/bin/sh
# Create and activate swap
dd if=/dev/zero of=/swapfile bs=256M count=4
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# Activate swapfile on boot
echo "" >> /etc/fstab
echo "/swapfile none swap sw 0 0" >> /etc/fstab
# Update Debian packages
export DEBIAN_FRONTEND=noninteractive;
apt-get update;
apt-get -y upgrade;
# Install and update Node + NPM
apt-get -y install nodejs-legacy npm
npm install -g n
n latest
# Install the latest Angular CLI
# npm install -g @angular/cli@latest
# Install Yarn
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
apt-get update && apt-get install yarn
# We done...
touch /root/user-data-done.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment