Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Vladimiro Bellini vlasvlasvlas

🎯
Focusing
View GitHub Profile
@vlasvlasvlas
vlasvlasvlas / app.py
Created Jul 28, 2021 — forked from makotoworld/app.py
flask-uploads-sample
View app.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import *
import os
from werkzeug import secure_filename
app = Flask(__name__)
#searchword = request.args.get('q', '')
@vlasvlasvlas
vlasvlasvlas / how-to-copy-aws-rds-to-local.md
Created Jun 24, 2019 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
View how-to-copy-aws-rds-to-local.md
  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