Skip to content

Instantly share code, notes, and snippets.

View letsgogeeky's full-sized avatar
🌍
Spinning the planet

Ramy letsgogeeky

🌍
Spinning the planet
View GitHub Profile
@letsgogeeky
letsgogeeky / date_palindromes.py
Created February 2, 2020 20:51
Starting the date 01-01-500, I find all the palindrome dates.
import sys
from datetime import datetime, timedelta
date_string = lambda date: date.strftime('%d%m%Y')
date_readable_format = lambda date: date.strftime('%d-%m-%Y')
def is_palindrome(text):
left_position = 0
right_position = len(text) - 1
@letsgogeeky
letsgogeeky / how-to-copy-aws-rds-to-local.md
Last active April 1, 2019 15:06 — forked from syafiqfaiz/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
    • to create the db use $ createdb -h localhost -p 5432 -U <local_server_name> <new_db_name>
  • $ psql -U -d -f