This document has now been incorporated into the uWSGI documentation:
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Steps with explanations to set up a server using:
| import ctypes, sys | |
| from ctypes import windll, wintypes | |
| from uuid import UUID | |
| class GUID(ctypes.Structure): # [1] | |
| _fields_ = [ | |
| ("Data1", wintypes.DWORD), | |
| ("Data2", wintypes.WORD), | |
| ("Data3", wintypes.WORD), | |
| ("Data4", wintypes.BYTE * 8) |
| #!/usr/bin/env python | |
| # Install fake factory at first. Helps us create 50k customers in odoo | |
| # pip install fake-factory | |
| # Documentation for odoo is listed here | |
| # https://www.odoo.com/documentation/9.0/api_integration.html#calling-methods | |
| # MIT License | |
| # Copyright (c) 2016 Jasim Muhammed |
| # PS: | |
| # - Extract your own kaskus oauth consumer_key & consumer_secret frm native app. Ref: http://seriot.ch/abusing_twitter_api.php#3 | |
| # - No public doc found, but here i attach an api sample sniffed from mitmproxy | |
| import urllib, urllib2 | |
| import time | |
| import oauth.oauth as oauth | |
| import string | |
| import random | |
| import sys, json |
| #!/bin/bash | |
| echo "Start Export Process" | |
| echo "Log into Keybase..." | |
| keybase login | |
| echo "Exporting your PGP keys..." | |
| keybase pgp export -o keybase.public.key | |
| keybase pgp export -s -o keybase.private.key |
Here you may see about bi-directional replication we have used http://2ndquadrant.com/en/resources/bdr/
We use here 64bit ubuntu 14.04 with docker to demonstrate our replication solution. First we need to install docker .
sudo su apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
| #!/usr/bin/python | |
| # Quick and (very) dirty script to send emails when a user gets a message and is away from HUD | |
| from base64 import b64decode | |
| from hashlib import sha256 | |
| import sqlite3 | |
| import datetime | |
| import itertools | |
| import os |
| filter { | |
| if [type] == "odoo" { | |
| grok { | |
| match => { "message" => "%{ODOOLOG}" } | |
| } | |
| date { | |
| match => [ "timestamp", "yyyy-MM-dd HH:mm:ss,SSS" ] | |
| } | |
| } | |
| } |
| # WSGI Handler sample configuration file. | |
| # | |
| # Change the appropriate settings below, in order to provide the parameters | |
| # that would normally be passed in the command-line. | |
| # (at least conf['addons_path']) | |
| # | |
| # For generic wsgi handlers a global application is defined. | |
| # For uwsgi this should work: | |
| # $ uwsgi_python --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py | |
| # |
| #!/bin/bash | |
| # | |
| # Backup a Postgresql database into a daily file. | |
| # | |
| BACKUP_DIR=/pg_backup | |
| DAYS_TO_KEEP=14 | |
| FILE_SUFFIX=_pg_backup.sql | |
| DATABASE= | |
| USER=postgres |