Why?
Because we wanted to achive the following while developing a webapp using websockets:
Static serving (nginx), Django application (gunicorn) and Websockets service (twisted)
- on the same IP
| import boto3 | |
| import botocore | |
| from boto3.s3.transfer import S3Transfer | |
| def lookup(s3, bucket_name): | |
| try: | |
| s3.meta.client.head_bucket(Bucket=bucket_name) | |
| except botocore.exceptions.ClientError as e: | |
| error_code = int(e.response['Error']['Code']) |
| import sys | |
| import time | |
| import logging | |
| from watchdog.observers import Observer | |
| from watchdog.events import * | |
| #http://stackoverflow.com/questions/18599339/python-watchdog-monitoring-file-for-changes | |
| class MyHandler(LoggingEventHandler): | |
| #this creates the list of paths | |
| def __init__(self): |
| # sms.py | |
| # Sends sms message to any cell phone using gmail smtp gateway | |
| # Written by Alex Le | |
| import smtplib | |
| # Use sms gateway provided by mobile carrier: | |
| # at&t: [email protected] | |
| # t-mobile: [email protected] | |
| # verizon: [email protected] |