Code Monkey home page Code Monkey logo

matriculaweb's Introduction

MatriculaWeb

MatriculaWeb - Sec Edu DF

Scaffolds:

  1. School:
      $ rails g scaffold School name:string code:string administrative_type:string total_rooms:integer used_rooms:integer amount_employees:integer user:belongs_to
    
  2. KnowledgeAreas
      $ rails g scaffold KnowledgeArea name:string knowledge_area:belongs_to
  3. Subject (workload = total time of it subject):
      $ rails g scaffold Subject name:string description:string workload:integer online_link:string class_schedule:string user:belongs_to knowledge_area:belongs_to
  4. Subscription:
      $ rails g scaffold Subscription access_type:string user:belongs_to subject:belongs_to 

Clear Database: $ rails d scaffold School && rails d scaffold Subject && rails d scaffold Subscription *Remember to update add_school_ref_to_user migration timestamp

SSL

Localhost HTTPS para testes como o do facebook: https://rossta.net/blog/local-ssl-for-rails-5.html#resolve-a-domain-name-to-localhost --> O SSL QUE FUNCIONOU FOI O DO HEROKU: https://devcenter.heroku.com/articles/ssl-certificate-self --> O tutorial do SSL do heroku está no dropbox

Trust SSL: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain config/ssl/server.crt

Executando rails com SSL: rails s -b 'ssl://0.0.0.0:3000?key=config/ssl/server.key&cert=config/ssl/server.crt'

puma -b 'ssl://0.0.0.0:3000?key=config/ssl/server.key&cert=config/ssl/server.crt'

RUBY MINE CONFIG: Server Arguments = -b "ssl://0.0.0.0:3000?key=config/ssl/server.key&cert=config/ssl/server.crt"

--> IF locahost takes so long, it is HTTP not HTTPS, CHECK IT

RubyMine

SSL RubyMine

Add ao Server Arguments: -b "ssl://localhost:3000?key=config/ssl/server.key&cert=config/ssl/server.crt"

Docker Debug RubyMine

README-wsl-rubymine.md

PostGreSQL

  1. Install
      sudo apt update
      sudo apt install postgresql postgresql-contrib
  2. LogIn
      sudo -i -u postgres

Ubuntu Services (Databases)

  1. Status Check

       service --status-all
  2. Start MySQL

       service mysql start
  3. Start Postgres

       service postgresql start
  4. Setup AWS S3

  5. ActiveStorage Upload files: /config/storage.yml

Postgres MAC

  1. Install: brew doctor && brew update && brew install postgresql postgres
  2. Start: brew services start postgresql
  3. Access postgres and alter:
    1. Access: psql postgres
    2. Inside database:
      1. CREATE ROLE postgres WITH LOGIN PASSWORD 'postgres';
      2. ALTER ROLE postgres CREATEDB;
      3. ALTER USER postgres CREATEDB;
      4. exit \q
      5. CREATE ROLE pguser WITH LOGIN PASSWORD 'pguser';
      6. ALTER ROLE pguser CREATEDB;
      7. ALTER USER pguser CREATEDB;
      8. GRANT ALL PRIVILEGES ON DATABASE schema_migrations to pguser;
      9. exit \q

Cron Whenever

  1. install the gem
  2. write your scheduler.rb file
  3. push to the remote server
  4. login to the remote server (for example with ssh)
  5. see if whenever is good uploaded by running in terminal: whenever
  6. update whenever crontab by running: whenever --update-crontab --set environment=development
  7. restart the server crontab (for example in Ubuntu server): sudo service cron restart
  8. check if crontab is good implemented on the server: crontab -l

matriculaweb's People

Contributors

tongarcia avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.