Skip to content

Instantly share code, notes, and snippets.

@wys1203
wys1203 / configure_proxy_protocol.md
Created February 21, 2017 13:50 — forked from pablitoc/configure_proxy_protocol.md
Configuring Proxy Protocol

##Install AWS CLI Tools##

  1. Install AWS CLI Tools. You can also use the EC2 API Tool if you are more comfortable with them. But this write-up uses the EC2 CLI.
  2. Create a user via Amazon IAM or download the security accessID and securitykey you will need it to query Amazon CLI.
  3. using Terminal cd into .aws directory cd ~/.aws edit or create new file named config paste the following contents inside.
    `[default]`
    `aws_access_key_id = ACCESS_ID`
    `aws_secret_access_key = SECRET_ID`
    `output = json OR bson OR text`
    `region = PREFERRED_AWS_REGION`

Save the file as "config"

@wys1203
wys1203 / singleton.py
Created June 2, 2016 10:06 — forked from sodastsai/singleton.py
Python singleton metaclass (thread-safe)
from __future__ import absolute_import, division, print_function, unicode_literals
from multiprocessing.dummy import Pool as ThreadPool
from multiprocessing import Lock
from threading import get_ident
class SingletonType(type):
def __new__(mcs, name, bases, attrs):
# Assume the target class is created (i.e. this method to be called) in the main thread.