Skip to content

Instantly share code, notes, and snippets.

View nelsonmarcos's full-sized avatar
💭
Infrastructure, development and leading.

Nelson Almeida nelsonmarcos

💭
Infrastructure, development and leading.
  • OLX
  • Rio de Janeiro, Brazil, Earth.
View GitHub Profile
@nelsonmarcos
nelsonmarcos / how-to-copy-aws-rds-to-local.md
Created March 30, 2023 13:15 — forked from nelson-marcos-olxbr/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@nelsonmarcos
nelsonmarcos / robot.js
Created December 3, 2012 12:17 — forked from joseleme/robot.js
Merry Go round
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.clone();
robot.turn(45);
this.offset = 1;
};
Robot.prototype.onIdle = function(ev) {