Skip to content

Instantly share code, notes, and snippets.

Avatar

Charmy Feng fcharmy

View GitHub Profile
@fcharmy
fcharmy / sync_git.sh
Created Sep 13, 2018
auto sync github repository for whole repo or given certain directories
View sync_git.sh
#!/usr/bin/env bash
# To keep updating codes from git repository
#
# feng.charmy@gmail.com
# Nothe: please make sure git config has read permission of repository
#
# Usage ./sync_dags.sh git@github.com:user/repo.git branch_name\
# -t interval_in_seconds\
# -d sparse_checkout_directory(optional) -d more_sparse_checkout_directory ..\
# -e execute_command_after_sync
@fcharmy
fcharmy / connection.py
Created Sep 13, 2018
sqlalchemy models
View connection.py
import logging
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.engine import reflection
from sqlalchemy.orm import mapper, sessionmaker
logger = logging.getLogger(__name__)
def get_session(host=None, port=3306, db=None,
@fcharmy
fcharmy / Dockerfile
Last active Aug 31, 2018
mongodb-4.0.2
View Dockerfile
FROM python:3.7
RUN wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.2.tgz
RUN tar -zxvf mongodb-*.tgz
RUN rm mongodb-*.tgz
RUN mkdir -p /data/db
ENV PATH="/mongodb-linux-x86_64-4.0.2/bin:${PATH}"
EXPOSE 27017
ENTRYPOINT ["mongod"]
You can’t perform that action at this time.