Skip to content

Instantly share code, notes, and snippets.

View naushadzaman's full-sized avatar

Naushad UzZaman naushadzaman

View GitHub Profile
@naushadzaman
naushadzaman / flask_restart.py
Created November 8, 2016 14:06
Reload python flask server by function / API endpoint
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Reload python flask server by function / API endpoint
# References:
# https://docs.python.org/3/library/multiprocessing.html
# http://stackoverflow.com/questions/27723287/reload-python-flask-server-by-function
import os
@naushadzaman
naushadzaman / elasticsearch_backup.py
Created July 23, 2016 01:16
Backup Data and Mapping from one Elastic Search server to another
import json
from elasticsearch import Elasticsearch
from elasticsearch import helpers
from elasticsearch.client import IndicesClient
source = '192.131.117.237:9200/' # example
dest = '192.226.457.547:9200/' # another example
es_source = Elasticsearch([source])
es_dest = Elasticsearch([dest])