Snippets

Ziyang Chen Cloud9 Setup

Created by Ziyang Chen last modified

Cloud9 Setup

Move all files one folder up

mv * .[^.]* ..

PostgreSQL

Create account

$ sudo service postgresql start
$ sudo sudo -u postgres psql
postgres=# CREATE USER username SUPERUSER PASSWORD 'password';
postgres=# \q

Update template

postgres=# UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
postgres=# DROP DATABASE template1;
postgres=# CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
postgres=# UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
postgres=# \c template1
postgres=# VACUUM FREEZE;
postgres=# \q

Save credentials to env.

$ echo "export USERNAME=username" >> ~/.profile
$ echo "export PASSWORD=password" >> ~/.profile
$ source ~/.profile

Reboot server

## Rails - RubyGems ###Gemfile group :development do gem "pry" gem "better_errors" gem "binding_of_caller" end

###config/environments/development.rb BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']

###Cloud9 ENV ENV['TRUSTED_IP'] 0.0.0.0/0

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.