Last active
September 20, 2017 09:37
-
-
Save satchinjoshi/d04c2db48d6da953454894eb76626ccf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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