Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View yanshengjia's full-sized avatar
🏠
Working from home

Shengjia Yan yanshengjia

🏠
Working from home
View GitHub Profile
@yanshengjia
yanshengjia / tornado_cookie_secret_generator.py
Created March 20, 2018 01:11 — forked from didip/tornado_cookie_secret_generator.py
Generates secure cookie secret for Tornado Web Framework
@yanshengjia
yanshengjia / mongo_backup.sh
Last active April 23, 2018 06:01 — forked from sheharyarn/mongo_backup.sh
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="annotation"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%Y-%m-%d-%H-%M-%S`
MONGODUMP_PATH=/usr/bin/mongodump
BACKUPS_DIR=~/sjyan/data/mongodb-backup/
BACKUP_NAME=$TIMESTAMP
SCRIPT_DIR=~/sjyan/scripts/
@yanshengjia
yanshengjia / update_fork.md
Last active April 8, 2018 03:10 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream