This file contains hidden or 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 win32serviceutil | |
| import win32service | |
| import win32event | |
| import servicemanager | |
| import socket | |
| import time | |
| import logging | |
| logging.basicConfig( | |
| filename = 'c:\\Temp\\hello-service.log', |
This file contains hidden or 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
| # http://papercruncher.com/2013/01/15/truly-async-with-tornado/ | |
| import tornado.httpclient | |
| import tornado.ioloop | |
| import tornado.web | |
| import tornado.websocket | |
| import tornado.template | |
| import tornado.gen | |
| import tornado.autoreload | |
| import time, json | |
| import tornado.httpserver |
This file contains hidden or 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
| #!/usr/bin/env python | |
| __author__ = 'Frank Smit <frank@61924.nl>' | |
| __version__ = '0.1.0' | |
| import functools | |
| import psycopg2 | |
| from tornado.ioloop import IOLoop, PeriodicCallback |
This file contains hidden or 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 concurrent.futures import ThreadPoolExecutor | |
| from functools import partial, wraps | |
| import time | |
| import tornado.ioloop | |
| import tornado.web | |
| EXECUTOR = ThreadPoolExecutor(max_workers=4) |
This file contains hidden or 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
| # vim: ft=yaml | |
| # Elastic Load Balancer and Security Group configuration for the app | |
| # | |
| # - Allow anyone to connect to port 443 and office traffic to connect to | |
| # port 22 | |
| # - Ensure all traffic is encrypted by configuring load balancer to listen on | |
| # 443 and direct traffic to port 443 on app servers | |
| # - Enable cookie-based session stickiness | |
| # - Use /status for health check | |
| # - Enable backend authentication policy by providing public key for cert |
This file contains hidden or 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
| #!/bin/sh | |
| # IMPORTANT: Run this script as sudo or else it won't work | |
| # Original script: http://my.safaribooksonline.com/book/programming/java/9781449309558/hacking-elastic-beanstalk/hackingelectric#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTk3ODE0NDkzMDk1NTgvSV9zZWN0MTRfZDFlMjAyNQ== | |
| echo 'Installing nginx...sit tight' | |
| yum -y install nginx | |
| echo 'Fixing nginx configuration' | |
| sed -i 's/ 1;/ 4;/g' /etc/nginx/nginx.conf | |
| rm /etc/nginx/conf.d/default.conf |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # | |
| # Jamie Kirkpatrick, November 2009. <jkp@kirkconsulting.co.uk> | |
| # Released under the BSD license. | |
| # | |
| """ | |
| Experimental code to add asyncronous functionality to WSGI applications | |
| running under the Tornado webserver. Uses greenlet to spin micro-threads | |
| which can be suspended and resumed within a single thread as required. |
This file contains hidden or 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
| @ECHO OFF | |
| REM | |
| REM 01.17.2013, Requires Node.js, JSHint, Recess, and UglifyJS (installed in the path) | |
| REM Run this command after node.js is installed | |
| REM npm install -g less jshint recess uglify-js | |
| REM | |
| MKDIR bootstrap\img | |
| MKDIR bootstrap\css | |
| MKDIR bootstrap\js |
This file contains hidden or 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
| worker_processes 2; | |
| error_log /var/log/nginx/error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| use epoll; | |
| } |
NewerOlder