Skip to content

Instantly share code, notes, and snippets.

View janaz's full-sized avatar

Tomasz Janowski janaz

View GitHub Profile
# 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 ec2-user@ec2...compute.amazonaws.com
# update
@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)