Skip to content

Instantly share code, notes, and snippets.

@ryanrolds
Last active October 11, 2015 22:18
Show Gist options
  • Save ryanrolds/3928594 to your computer and use it in GitHub Desktop.
Save ryanrolds/3928594 to your computer and use it in GitHub Desktop.
# Log in to root user
apt-get update && apt-get install git-core build-essential emacs authbind runit scons libssl-dev curl -y
su - <unprivileged user>
git clone https://github.com/creationix/nvm.git ~/nvm && . ~/nvm/nvm.sh && nvm alias default v0.6.21 && nvm install v0.6.21
# Add to .profile, .bashrc or equiv.: . ~/nvm/nvm.sh
curl http://files.cast-project.org/install.sh | sh
# Setup files needed for cast agent and runsvdir
mkdir -p $HOME/cast-data/services-enabled/
mkdir $HOME/.cast
touch $HOME/.cast/config.json
echo {\"data_root\":\"$HOME/cast-data\"} > $HOME/.cast/config.json
# Use cron to start cast services on boot
echo "@reboot /usr/bin/runsvdir $HOME/cast-data/services-enabled/ > $HOME/runsvdir.log 2>&1" | crontab
crontab -l > crons
echo "@reboot /usr/local/bin/cast-agent > $HOME/cast-agent.log 2>&1" >> crons
crontab crons
rm crons
# Start Cast services
nohup /usr/bin/runsvdir $HOME/cast-data/services-enabled/ > $HOME/runsvdir.log 2>&1 &
nohup /usr/local/bin/cast-agent > $HOME/cast-agent.log 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment