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
sudo apt remove docker docker-engine docker.io containerd runc | |
sudo apt update -y | |
sudo apt install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common -y | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository \ |
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
upstream elasticsearch { | |
server 127.0.0.1:9200; | |
keepalive 15; | |
} | |
upstream kibana { | |
server 127.0.0.1:5601; | |
keepalive 15; |
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 celery import Celery | |
from celery.schedules import crontab | |
import MySQLdb | |
import random | |
import string | |
import time | |
app = Celery('db_update', broker="pyamqp://guest@localhost//") | |
# disable UTC to use local time | |
app.conf.enable_utc = False |
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
# virtual my_project | |
<VirtualHost *:80> | |
ServerName localhost | |
WSGIPassAuthorization On | |
ErrorLog "C:/Users/Administrator/Desktop/my_project/my_project.error.log" | |
CustomLog "C:/Users/Administrator/Desktop/my_project/my_project.access.log" combined | |
WSGIScriptAlias / "C:/Users/Administrator/Desktop/my_project/my_project/wsgi_windows.py" | |
<Directory "C:/Users/Administrator/Desktop/my_project/my_project"> | |
<Files wsgi_windows.py> | |
Require all granted |
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
[Unit] | |
Description=Celery Service | |
After=network.target | |
[Service] | |
Type=simple | |
User=sajid | |
Group=sajid | |
EnvironmentFile=/etc/default/celeryd | |
WorkingDirectory=/home/sajid/Projects/simple-celery |
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
[Unit] | |
Description=Celery Service | |
After=network.target | |
[Service] | |
Type=forking | |
User=sajid | |
Group=sajid | |
EnvironmentFile=/etc/default/celeryd | |
WorkingDirectory=/home/sajid/Projects/simple-celery |
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
# The names of the workers. This example create one worker | |
CELERYD_NODES="worker1" | |
# The name of the Celery App, should be the same as the python file | |
# where the Celery tasks are defined | |
CELERY_APP="db_update" | |
# Log and PID directories | |
CELERYD_LOG_FILE="/var/log/celery/%n%I.log" | |
CELERYD_PID_FILE="/var/run/celery/%n.pid" |
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 celery import Celery | |
from celery.schedules import crontab | |
import MySQLdb | |
app = Celery('db_update', broker="pyamqp://guest@localhost//") | |
# disable UTC to use local time | |
app.conf.enable_utc = False | |
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 os | |
import sys | |
import site | |
from django.core.wsgi import get_wsgi_application | |
# add python site packages, you can use virtualenvs also | |
site.addsitedir("C:/Program files/python36/Lib/site-packages") | |
# Add the app's directory to the PYTHONPATH | |
sys.path.append('C:/Users/Administrator/Desktop/my_project') |
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
LoadFile "c:/Program Files/python/python36/python36.dll" | |
LoadModule wsgi_module "c:/Program Files/python36/lib/site-packages/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd" | |
WSGIPythonHome "c:/Program Files/python/python36" |