Skip to content

Instantly share code, notes, and snippets.

@alysbrooks
Last active December 20, 2015 14:48
Show Gist options
  • Save alysbrooks/6149124 to your computer and use it in GitHub Desktop.
Save alysbrooks/6149124 to your computer and use it in GitHub Desktop.
#!/bin/sh
# aws_provision_dev.sh
# Setup and configure a server
EMBED=0
NAME=""
while getopts ie o
do case $o in
(i) EMBED=0;; #(i)ndependent mode (default)
(e) EMBED=1;; #(e)embeded mode
(n) NAME="${OPTARG}";; #set name
esac
done
yes| sudo apt-get update
yes| sudo apt-get upgrade
###
#Username, etc.
###
yes| sudo adduser ${NAME}
yes| sudo usermod ${NAME} -a -G sudo
#echo "${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
sudo touch /etc/sudoers.d/${NAME}
sudo echo "${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/${NAME}
sudo -v
###
#Python
###
yes| sudo apt-get install ipython ipython-notebook python-setuptools
yes| sudo easy_install pip
sudo -v
###
#R
###
yes| sudo apt-get install r-base-core
###
#Misc. Development
###
yes| sudo apt-get install mercurial git
###
#Misc.
###
yes| sudo apt-get install aptitude
yes| sudo apt-get install tree
###
#Abschluss
###
if [ "$EMBED" -eq 0 ]
then
sudo -k #Require a password for next sudo command
su ${NAME}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment