Last active
August 9, 2016 18:16
-
-
Save kenshero/dfa15941977a4ca24f24 to your computer and use it in GitHub Desktop.
Script Rails server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 python-software-properties libffi-dev -y | |
cd | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile | |
source ~/.bash_profile | |
rbenv install -v 2.2.2 | |
rbenv global 2.2.2 | |
echo "gem: --no-document" > ~/.gemrc | |
gem install bundler | |
gem install rails | |
rbenv rehash | |
sudo add-apt-repository ppa:chris-lea/node.js -y | |
sudo apt-get update | |
sudo apt-get install nodejs -y | |
gpg --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7 | |
gpg --armor --export 561F9B9CAC40B2F7 | sudo apt-key add - | |
sudo apt-get install apt-transport-https -y | |
sudo sh -c "echo 'deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main' >> /etc/apt/sources.list.d/passenger.list" | |
sudo chown root: /etc/apt/sources.list.d/passenger.list | |
sudo chmod 600 /etc/apt/sources.list.d/passenger.list | |
sudo apt-get update | |
sudo apt-get install nginx-full passenger -y | |
sudo apt-get install postgresql postgresql-contrib libpq-dev -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DROP DATABASE xxxxx;
REVOKE CONNECT ON DATABASE database_name FROM public;
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'database_name';