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
RUN apt-get update && \ | |
apt-get install -y openjdk-8-jdk && \ | |
apt-get install -y ant && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/ && \ | |
rm -rf /var/cache/oracle-jdk8-installer; | |
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ | |
RUN export JAVA_HOME |
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
#app.py | |
import logging | |
from logging.handlers import TimedRotatingFileHandler | |
from flask import Flask | |
import new_module1 | |
import new_module2 | |
def create_app(): | |
app = Flask(__name__) |
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
from rq import Queue as RedisQueue | |
from redis import Redis | |
from rq.job import Job | |
from urllib.request import urlopen, Request | |
from xml.etree import ElementTree | |
def get_news(): | |
headers = {'User-Agent': 'Mozilla/5.0'} | |
url = 'https://news.yahoo.com/rss/all' |
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
class First(object): | |
def __init__(self): | |
super(First, self).__init__() | |
print("first") | |
class Second(First): | |
def __init__(self): | |
super(Second, self).__init__() | |
print("second") |
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
# install Java | |
apt-get install openjdk-8-jdk -y | |
# download and extract Kafka | |
mkdir ~/Downloads | |
curl "https://www.apache.org/dist/kafka/2.1.1/kafka_2.11-2.1.1.tgz" -o ~/Downloads/kafka.tgz | |
mkdir ~/kafka && cd ~/kafka | |
tar -xvzf ~/Downloads/kafka.tgz --strip 1 | |
# test installation with: |
NewerOlder