Skip to content

Instantly share code, notes, and snippets.

@kolosek
Last active May 1, 2020 08:49
Show Gist options
  • Save kolosek/98c00f1431d5305593aa1fe638d7999d to your computer and use it in GitHub Desktop.
Save kolosek/98c00f1431d5305593aa1fe638d7999d to your computer and use it in GitHub Desktop.
#!/bin/bash
echo 'This script will set up your Ubuntu 18.04 for Rails development.'
echo 'Press ENTER to continue with installation, press ^C to cancel.'
read
# Install required software
echo "------Installing requirements------"
sudo apt install -y curl git-core gdebi-core gdebi rar unrar gnupg2 vim
sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
sudo apt-get install curl ruby-bundler ruby-full ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby libxslt-dev libxml2-dev zlib1g-dev ruby-dev ruby-dev gcc libffi-dev make ruby-dev libpq-fe.h libpq ruby-dev
sudo apt install -y build-essential libssl1.0-dev libssl-dev libreadline-dev libyaml-dev libxslt1-dev software-properties-common
sudo apt install -y libcurl4 libcurl4-openssl-dev libcurl3-dev
# Install RVM
echo "------Installing rvm------"
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source ~/.bashrc
#To install Ruby prior to 2.4 version
#$ rvm pkg install openssl
#$ rvm reinstall 2.3.3 --with-openssl-dir=$HOME/.rvm/usr
# Install bundler
echo "-----Installing bundler------"
gem install bundler
# Add shortcuts and aliases
echo "------Configuring .bashrc------"
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
echo "# Bundle aliases" >> ~/.bashrc
echo "alias be='bundle exec'" >> ~/.bashrc
echo "alias bi='bundle install --path vendor/bundle'" >> ~/.bashrc
echo "# Git aliases" >> ~/.bashrc
echo "alias gc='git commit'" >> ~/.bashrc
echo "alias ga='git add'" >> ~/.bashrc
echo "alias gaa='git add --all'" >> ~/.bashrc
echo "alias gp='git push'" >> ~/.bashrc
echo "Adding git branch info to command line"
echo "Add Following line to .bashrc, then press ENTER to continue"
echo PS1='[\u@\h \W$(__git_ps1 \" (%s)\")]\$ '
#In order to listen to larger amout of files
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
read
source ~/.bashrc
mkdir ~/projects
echo "Installing Java JRE and Java JDK"
sudo add-apt-repository ppa:openjdk-r/ppa
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install software-properties-common default-jre default-jdk -y
# Install SQLite
echo "------Installing SQLite------"
sudo apt-get install -y sqlite3 sqlitebrowser libsqlite3-dev
# Install MySQL
echo "------Installing MySQL------"
sudo apt install -y mysql-server libmysqlclient-dev expect mysql-client
echo "Steps after mysql installation, for example.."
echo "sudo mysql -u root"
echo "CREATE USER 'ubuntu'@'localhost' IDENTIFIED BY 'password';"
echo "GRANT ALL PRIVILEGES ON *.* TO 'ubuntu'@'localhost' WITH GRANT OPTION;" #if you want to grant ubuntu super user privileges, ok for local dev
echo "FLUSH PRIVILEGES;"
echo "Follow above commands to create potgres user, you can do this later"
echo "ENTER to continue"
# Install POSTGRES
echo "------Installing POSTGRES------"
sudo apt install -y postgresql postgresql-contrib pgadmin3 libpq-dev
#Setup user
#Additional optional software
echo 'Configure potgres in separate window, afteter that..'
echo 'Press ENTER to continue with installation, press ^C to cancel.'
echo 'sudo -u postgres psql'
echo "CREATE USER ubuntu WITH PASSWORD 'password';"
echo "ALTER ROLE ubuntu SUPERUSER;"
echo "Follow above commands to create potgres user, you can do this later"
#psql -d template1 -U ubuntu -h localhost
#CREATE DATABASE some_database;
#GRANT ALL PRIVILEGES ON DATABASE some_database to ubuntu;
echo "ENTER to continue"
read
# Install REDIS
echo "------Installing REDIS------"
sudo apt-get install redis-server
#Install Yarn
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 yarn
#NodeJS additional
echo "Install webpack globally"
sudo apt-get install nodejs-dev node-gyp libssl1.0-dev
sudo apt install npm
sudo apt-get install nodejs
sudo npm install webpack -g
echo "Install nightwatch globally"
sudo npm install nightwatch -g
sudo npm install -g brunch
# Elastic search
echo "ElasticSearch install: Make sure you have JAVA installation, press enter"
read
sudo apt-get purge elasticsearch
sudo su -c "echo 'deb https://artifacts.elastic.co/packages/6.x/apt stable main'>> /etc/apt/sources.list.d/elastic-6.x.list"
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get update
sudo apt-get install elasticsearch
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
#Additional optional software
echo 'Installing additional software'
echo 'Press ENTER to continue with installation, press ^C to cancel.'
read
# Install Chrome
echo "------Installing Chrome------"
sudo apt-get install -y libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo gdebi -n google-chrome*.deb
echo "Install nightwatch globally - Needs to be installed after Chrome"
sudo npm install nightwatch -g
sudo npm install -g brunch
#Install Brave
sudo apt install apt-transport-https curl
curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add -
echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
sudo apt install brave-browser
# Install Sublime text
echo "------Installing sublime------"
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-add-repository "deb https://download.sublimetext.com/ apt/stable/"
sudo apt install sublime-text
# Install VS code
echo "------Installing vscode------"
sudo snap install --classic code
# Install slack
echo "------Installing slack------"
sudo snap install slack --classic
# Install heroku cli
echo "------Installing heroku------"
sudo snap install heroku --classic
#Gnome tweak tools
sudo apt-get install gnome-tweak-tool
#http://wps-community.org/downloads
#https://rambox.pro/#home
#Enable user to create new file via right-click
touch ~/Templates/newfile
echo "------Installation finished------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment