Skip to content

Instantly share code, notes, and snippets.

@dprabu17
Created November 18, 2016 06:58
Show Gist options
  • Save dprabu17/87980d2b60e595192ca580c0b0a824bc to your computer and use it in GitHub Desktop.
Save dprabu17/87980d2b60e595192ca580c0b0a824bc to your computer and use it in GitHub Desktop.
# Welcome to the spritle laptop script!
echo_display() {
printf "\n%b\n" "$1"
}
echo_display "Welcome to Spritle laptop init script!"
echo_display "We are going to prepare an awesome development machine for you. \n Lets begin."
echo_display "Updating system packages ..."
if command -v aptitude >/dev/null; then
echo_display "Using aptitude ..."
else
echo_display "Installing aptitude ..."
sudo apt-get install -y aptitude
fi
sudo aptitude update
### end linux-components/debian-package-update
echo_display "Installing libraries for common gem dependencies ..."
sudo aptitude install -y libxslt1-dev libcurl4-openssl-dev libksba8 libksba-dev libqtwebkit-dev libreadline-dev build-essential libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext
echo_display "Installing curl ..."
sudo aptitude install -y zip unzip
echo_display "Installing curl ..."
sudo aptitude install -y curl
echo_display "Installing git, for source control management ..."
sudo aptitude install -y git gitk
echo_display "Installing sqlite3, for prototyping database-backed rails apps"
sudo aptitude install -y libsqlite3-dev sqlite3
echo_display "Installing MySQL, a good open source relational database ..."
sudo aptitude install -y mysql-server libmysqlclient-dev
echo_display "Installing Postgres, a good open source relational database ..."
sudo aptitude install -y postgresql postgresql-server-dev-all
echo_display "Installing Redis, a good key-value database ..."
sudo aptitude install -y redis-server
echo_display "Installing node, to render the rails asset pipeline ..."
sudo aptitude install -y nodejs nodejs-legacy npm
echo_display "Installing harp server "
sudo npm install -g harp
### end linux-components/debian-derivative-packages
echo_display "Installing RVM with lastest ruby version..."
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash
echo_display "Load RVM into a shell session *as a function"
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
echo_display "First try to load from a user install"
source "$HOME/.rvm/scripts/rvm"
\curl -sSL https://get.rvm.io | bash -s stable --ruby
echo_display "Updating to latest Rubygems version ..."
gem update --system
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
echo_display "Then try to load from a root install"
source "/usr/local/rvm/scripts/rvm"
\curl -sSL https://get.rvm.io | bash -s stable --ruby
echo_display "Updating to latest Rubygems version ..."
gem update --system
else
printf "ERROR: An RVM installation was not found.\n"
fi
#git config --global user.email "GITHUB EMAIL"
#git config --global user.name "GITHUB FULLNAME"
#ssh-keygen -t rsa -C "[email protected]"
#cat ~/.ssh/id_rsa.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment