Skip to content

Instantly share code, notes, and snippets.

@scheng123 scheng123/run
Last active Oct 8, 2019

Embed
What would you like to do?
Install AnyProxy with NVM and execute it with crontab too on bootup
#!/bin/bash
#AWS User Data: sudo -H -u ubuntu bash -c 'curl -o- https://gist.githubusercontent.com/scheng123/7985bbac79c0dc34c2c3a8f044ac066f/raw/run | bash'
#EXECUTE COMMAND: curl -o- https://gist.githubusercontent.com/scheng123/7985bbac79c0dc34c2c3a8f044ac066f/raw/run | bash
touch ~/.bashrc
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
. ~/.nvm/nvm.sh
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.