-
Place the supervisord.conf under .ebextensions/supervisor/
-
Place the supervisor.config under .ebextensions/
-
Place the data_import_consumer.conf under .ebextensions/supervisor/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
__author__ = 'Kevin Warrick' | |
__email__ = '[email protected]' | |
import cPickle | |
from functools import wraps | |
def redis_lru(capacity=5000, slice=slice(None)): | |
""" | |
Simple Redis-based LRU cache decorator *. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab as pl | |
from numpy import fft | |
def fourierExtrapolation(x, n_predict): | |
n = x.size | |
n_harm = 10 # number of harmonics in model | |
t = np.arange(0, n) | |
p = np.polyfit(t, x, 1) # find linear trend in x | |
x_notrend = x - p[0] * t # detrended x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A python script which starts celery worker and auto reload it when any code change happens. | |
I did this because Celery worker's "--autoreload" option seems not working for a lot of people. | |
''' | |
import time | |
from watchdog.observers import Observer ##pip install watchdog | |
from watchdog.events import PatternMatchingEventHandler | |
import psutil ##pip install psutil | |
import os |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A virtualenv running Python3.6 on Amazon Linux/EC2 (approximately) simulates the Python 3.6 Docker container used by Lambda | |
# and can be used for developing/testing Python 3.6 Lambda functions | |
# This script installs Python 3.6 on an EC2 instance running Amazon Linux and creates a virtualenv running this version of Python | |
# This is required because Amazon Linux does not come with Python 3.6 pre-installed | |
# and several packages available in Amazon Linux are not available in the Lambda Python 3.6 runtime | |
# The script has been tested successfully on a t2.micro EC2 instance (Root device type: ebs; Virtualization type: hvm) | |
# running Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type - ami-c58c1dd3 | |
# and was developed with the help of AWS Support |
OlderNewer