Skip to content

Instantly share code, notes, and snippets.

@satchinjoshi
Last active September 20, 2017 09:37
Show Gist options
  • Select an option

  • Save satchinjoshi/d04c2db48d6da953454894eb76626ccf to your computer and use it in GitHub Desktop.

Select an option

Save satchinjoshi/d04c2db48d6da953454894eb76626ccf to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo apt -y update
# make swap of 1GB
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# install nodejs 7, npm, phantomjs, yarn
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt install -y nodejs
sudo apt install -y npm
sudo npm i -g phantomjs
sudo npm i -g yarn
sudo apt install -y libfontconfig1
# cronjob
crontab <<EOF
*/9 * * * * cd /home/ubuntu/phantom && phantomjs index.js
EOF
# get the code
git clone https://gitlab.com/satchinjoshi/random.git /home/ubuntu/phantom
cd /home/ubuntu/phantom && yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment