Skip to content

Instantly share code, notes, and snippets.

@maanavshah
Last active September 23, 2019 13:19
Show Gist options
  • Save maanavshah/73756d0283d2e4113cd7bbd152f25041 to your computer and use it in GitHub Desktop.
Save maanavshah/73756d0283d2e4113cd7bbd152f25041 to your computer and use it in GitHub Desktop.
Install and Configure Ruby on Rails, MongoDB, PostgreSQL, Git, Sublime Text, Oh-my-zsh and Deepin on Ubuntu
#!/bin/bash
sudo apt-get update
# To make sure we have everything necessary for Webpacker support in Rails, we're first going to start by adding the Node.js and Yarn repositories to our system before installing them.
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn
# Installing Ruby 2.4.4 using RVM
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.4.4
rvm use 2.4.4 - default
ruby -v
gem install bundler
# Installing Rails 4.2.2
gem install rails -v 4.2.2
# Installing MongoDB 3.2
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo systemctl start mongod
sudo systemctl status mongod
sudo systemctl enable mongod
# Installing PostgreSQL 9.5
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget - quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
# The PostgreSQL installation doesn't setup a user for you, so you'll need to follow these steps to create a user with permission to create databases. Feel free to replace Chris with your username.
sudo -u postgres createuser chris -s
# If you would like to set a password for the user, you can do the following
sudo -u postgres psql
postgres=# \password chris
# Installing and Configuring Git
git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -b 4096 -C "YOUR@EMAIL.com"
# The next step is to take the newly generated SSH key and add it to your GitHub account. You want to copy and paste the output of the following command and paste it here.
cat ~/.ssh/id_rsa.pub
# Once you've done this, you can check and see if it worked:
ssh -T git@github.com
# You should get a message like this:
# Hi excid3! You've successfully authenticated, but GitHub does not provide shell access.
# Installing sublime text
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt-get update
sudo apt install sublime-text
# Installing and configuring Oh-my-zsh
sudo apt-get install zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# And, to make zsh as the default shell:
chsh -s $(which zsh)
# without sudo should work.
# Finally, log out of your computer and log back in.
# Installing Deepin Desktop Environment in Ubuntu
# Deepin is an attractive, unique alternative to GNOME Shell, Cinnamon and other DEs. It will allow your ubuntu to look-like macOS.
# (https://www.omgubuntu.co.uk/2018/06/how-to-install-deepin-desktop-environment-on-ubuntu-18-04)
sudo add-apt-repository ppa:leaeasy/dde
sudo apt install dde dde-file-manager
sudo apt install deepin-gtk-theme
@RashneetR
Copy link

This is great! Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment