Skip to content

Instantly share code, notes, and snippets.

@scheng123 scheng123/run
Last active Oct 8, 2019

What would you like to do?
Install AnyProxy with NVM and execute it with crontab too on bootup
#AWS User Data: sudo -H -u ubuntu bash -c 'curl -o- | bash'
#EXECUTE COMMAND: curl -o- | bash
touch ~/.bashrc
curl -o- | bash
. ~/.nvm/
nvm install 10.16.3
npm install -g anyproxy
sudo bash -c "echo \"@reboot tmux new-session -d -s pRunner 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/lib/node_modules/anyproxy/bin/anyproxy -p 8080 -w 80'\" > /var/spool/cron/crontabs/ubuntu"
sudo chmod go=,+rw /var/spool/cron/crontabs/ubuntu
sudo chown ubuntu:crontab /var/spool/cron/crontabs/ubuntu
tmux new-session -d -s pRunner 'sudo /home/ubuntu/.nvm/versions/node/v10.16.3/bin/node /home/ubuntu/.nvm/versions/node/v10.16.3/lib/node_modules/anyproxy/bin/anyproxy -p 8080 -w 80'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.