Create a gist now

Instantly share code, notes, and snippets.

@nchapman /setup.sh
Last active Oct 13, 2015

Ubuntu setup
# wget -O - https://raw.github.com/gist/4211882/<REVISION>/setup.sh | bash
# Get updates
apt-get -y update
apt-get -y upgrade
# Install build tools
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev curl git-core mysql-client libmysqlclient-dev libxslt-dev libxml2-dev python-software-properties
# Install Ruby
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz
tar -xvzf ruby-2.0.0-p353.tar.gz
cd ruby-2.0.0-p353/
./configure
make
make install
cd ..
rm -rf ruby-2.0.0-p353/
rm ruby-2.0.0-p353.tar.gz
gem install bundler --no-ri --no-rdoc
# Install node.js
apt-add-repository ppa:chris-lea/node.js
apt-get -y update
apt-get -y install nodejs
# Install coffeescript
npm install -g coffee-script
# Setup users
adduser ubuntu
usermod -aG sudo ubuntu
# Configure ssh keys
echo "Upload your ssh public key"
echo "scp ~/.ssh/id_rsa.pub ubuntu@123.45.67.890:/home/ubuntu/"
read
mkdir /home/ubuntu/.ssh
mv /home/ubuntu/id_rsa.pub /home/ubuntu/.ssh/authorized_keys
chown -R ubuntu:ubuntu /home/ubuntu/.ssh
chmod 700 /home/ubuntu/.ssh
chmod 600 /home/ubuntu/.ssh/authorized_keys
# Configure SSH
nano /etc/ssh/sshd_config
service ssh restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment