Skip to content

Instantly share code, notes, and snippets.

Run this
"sudo -u postgres psql"
in your terminal to get into postgres
postgres=#
Run "CREATE USER new_username;"
Note: Replace new_username with the user you want to create,
@nitsx2
nitsx2 / ror_setup.rb
Created July 9, 2018 08:46 — forked from rahulpuroht/ror_setup.rb
ROR_setup at amazon
1. sudo apt-get update
2. sudo apt-get install curl
3. Install RVM -
\curl -sSL https://get.rvm.io | bash
4. source ~/.rvm/scripts/rvm
5. rvm install 2.1.5
6. gem install rails --version=4.2.2
7. gem install passenger
8. sudo apt-get install libcurl4-openssl-dev
9. Adding SWAP -
@nitsx2
nitsx2 / fix-ssl-cert-snakeoil.key-ubuntu-postgresql.sh
Created July 7, 2018 10:42 — forked from GabLeRoux/fix-ssl-cert-snakeoil.key-ubuntu-postgresql.sh
Fix postgresql error FATAL: could not access private key file "/etc/ssl/private/ssl-cert-snakeoil.key": Permission denied
# > It happened to me and it turned out that I removed erroneously the postgres user from "ssl-cert" group, set it back with
gpasswd -a postgres ssl-cert
# Fixed ownership and mode
sudo chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
sudo chmod 740 /etc/ssl/private/ssl-cert-snakeoil.key
# now postgresql starts! (and install command doesn't fail anymore)
sudo /etc/init.d/postgresql start