ElasticSearch: https://www.mediafire.com/?2o1y58vilz32st4
Kibana: http://www.mediafire.com/?11undfyc3dtkea9/
Extract both of these tools , now go into
for elasticsearch
| /* Useful celery config. | |
| app = Celery('tasks', | |
| broker='redis://localhost:6379', | |
| backend='redis://localhost:6379') | |
| app.conf.update( | |
| CELERY_TASK_RESULT_EXPIRES=3600, | |
| CELERY_QUEUES=( | |
| Queue('default', routing_key='tasks.#'), |
ElasticSearch: https://www.mediafire.com/?2o1y58vilz32st4
Kibana: http://www.mediafire.com/?11undfyc3dtkea9/
Extract both of these tools , now go into
for elasticsearch
| stage { "pre": before => Stage["main"] } | |
| class python { | |
| package { | |
| "build-essential": ensure => latest; | |
| "python": ensure => "2.6.6-2ubuntu1"; | |
| "python-dev": ensure => "2.6.6-2ubuntu1"; | |
| "python-setuptools": ensure => "latest"; | |
| } | |
| exec { "easy_install pip": | |
| path => "/usr/local/bin:/usr/bin:/bin", |
| # This is the settings file | |
| # Rabbitmq configuration | |
| BROKER_URL = "amqp://abcd:abcd@localhost:5672/abcd" | |
| # Celery configuration | |
| CELERY_ACCEPT_CONTENT = ['json'] | |
| CELERY_TASK_SERIALIZER = 'json' | |
| CELERY_RESULT_SERIALIZER = 'json' | |
| CELERY_TIMEZONE = 'Asia/Kolkata' | |
| CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend' |
| The python module basic commands | |
| to clean and remove the module | |
| $ python setup.py sdist (this command will remove the module from your systems python) | |
| $ python setup.py install ( this command will install the module to your system's python) | |
| $ python setup.py register ( this command will register your module to the pypi) | |
| $ python setup.py sdist upload ( this command will upload your newer module version) |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #!/bin/bash | |
| NAME="hello_app" # Name of the application | |
| DJANGODIR=/webapps/hello_django/hello # Django project directory | |
| SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
| USER=hello # the user to run as | |
| GROUP=webapps # the group to run as | |
| NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
| DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
| DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
| server { listen 80; | |
| server_name example.com; | |
| access_log /var/log/example.com/nginx.access.log; | |
| error_log /var/log/example.com/nginx.error.log; | |
| root /var/www/apps/example.com/public; | |
| charset utf-8; | |
| location / { | |
| rewrite ^ https://$host$request_uri? permanent; | |
| } |