Purchasing a Comodo PositiveSSL cert via gogetssl.com and installing it on an Nginx server.
Prior to purchasing a cert, you need to generate a private key, and a CSR file
worker_processes 2; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
use epoll; | |
} |
from time import sleep | |
from tornado import gen | |
import tornado.ioloop | |
import tornado.web | |
from tornado_threaded import threaded, inline_threaded | |
@threaded | |
def slow_func(callback): |
Copyright (C) 2012 Justin Poliey <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WIT |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
# Simple database and session wrapper. I use it in my Flask app too. | |
class Database(object): | |
def __init__(self): | |
self.session_maker = sessionmaker() | |
self.session = scoped_session(self.session_maker) | |
self.engine = None |
import os | |
import sys | |
import traceback | |
from functools import wraps | |
from multiprocessing import Process, Queue | |
def processify(func): | |
'''Decorator to run a function as a process. | |
Be sure that every argument and the return value |
#!/usr/bin/env python | |
# Thread pool based on: http://code.activestate.com/recipes/577187-python-thread-pool/ | |
from queue import Queue | |
from threading import Thread | |
from functools import partial | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options |
#!/bin/bash | |
HOST=$(hostname) | |
function install_postfix() { | |
echo | sudo debconf-set-selections <<__EOF | |
postfix postfix/root_address string | |
postfix postfix/rfc1035_violation boolean false | |
postfix postfix/mydomain_warning boolean | |
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 |
import errno | |
import signal | |
import zmq | |
def uninterruptible(f, *args, **kwargs): | |
while True: | |
try: | |
return f(*args, **kwargs) |