Skip to content

Instantly share code, notes, and snippets.

View DandikUnited's full-sized avatar
:shipit:
:shipit: :shipit: :shipit:

Bedi Egilmez DandikUnited

:shipit:
:shipit: :shipit: :shipit:
View GitHub Profile
0-mail.com
001.igg.biz
027168.com
0815.ru
0815.ry
0815.su
0845.ru
0box.eu
0clickemail.com
0u.ro
from airflow.exceptions import AirflowException
from airflow.contrib.hooks.aws_hook import AwsHook
from io import StringIO
import time
import logging
TYPES_MAP = {
"integer": "INT",
"boolean": "BOOLEAN",
"bigint": "BIGINT",
@DandikUnited
DandikUnited / en-stopwords.txt
Last active January 11, 2019 18:11
english stopwords
a
able
about
above
abst
accordance
according
accordingly
across
act
@DandikUnited
DandikUnited / sqlalchemy_utils.py
Last active January 28, 2019 18:42
sqlalchemy_utils postgresql
import os
from sqlalchemy import create_engine
DEFAULT_CONN_STR = 'postgresql://{0}:{1}@{2}:5432/{3}?client_encoding=utf8'
DB_USER = os.environ.get('DB_USER')
DB_PASS = os.environ.get('DB_PASS')
DB_HOST = os.environ.get('DB_HOST')
DB_DB_NAME = os.environ.get('DB_DB_NAME')
@DandikUnited
DandikUnited / how-to-copy-aws-rds-to-local.md
Created January 8, 2019 18:09 — 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
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@DandikUnited
DandikUnited / Dockerfile
Created March 2, 2018 00:43 — forked from multidis/Dockerfile
Cron job scheduling inside a Docker container.
# phusion baseimage initiates cron properly
# Use phusion/baseimage as base image. To make your builds reproducible, make
# sure you lock down to a specific version, not to `latest`!
# See https://github.com/phusion/baseimage-docker/blob/master/Changelog.md for
# a list of version numbers.
FROM phusion/baseimage:0.9.16
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]