Skip to content

Instantly share code, notes, and snippets.

View janaz's full-sized avatar

Tomasz Janowski janaz

View GitHub Profile
@janaz
janaz / cors_server.py
Last active April 23, 2016 14:37 — forked from enjalot/cors_server.py
Allow CORS with python simple http server
import sys
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
path = self.translate_path(self.path)
f = None
if os.path.isdir(path):
if not self.path.endswith('/'):
# redirect browser - doing basically what apache does
self.send_response(301)
# http://aws.amazon.com/amazon-linux-ami/
# http://aws.amazon.com/amazon-linux-ami/faqs/
# Boot up a machine with at least 1.5 to 2 GB Ram
# login
chmod 600 key.pem
ssh -i key.pem [email protected]
# update