Skip to content

Instantly share code, notes, and snippets.

@asadharis
Created December 25, 2015 11:34
Show Gist options
  • Save asadharis/2e8de258a5399b674eea to your computer and use it in GitHub Desktop.
Save asadharis/2e8de258a5399b674eea to your computer and use it in GitHub Desktop.
A simple script which automates some of the commands from the tutorial http://www.stat.yale.edu/~jay/EC2/CreateFromScratch.html
#!/bin/bash
# This is a simple bash script which sets-up the things we need for running.
# We begin with generating a key pair which will be used to communicate between
# master and slove nodes.
ssh-keygen -t dsa -f .ssh/id_dsa -N ''
# Add generated key to list of authorized keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
# Change permissions
chmod 644 ~/.ssh/authorized_keys
# Change config file for ssh. This way it doesn't ask about certificates
# We need this option set up otherwise R will not be able to make a cluster.
sudo sed -i '$a StrictHostKeyChecking no' /etc/ssh/ssh_config
# Edit this line to install any number of packages:
sudo su - -c "R -e \"install.packages(c('RcppArmadillo', 'snow', 'genlasso') , repos='http://cran.rstudio.com/')\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment