This file contains 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/bash | |
# gets iam security credentials from instance metadata and writes them to | |
# awscli environment variables and .s3cfg (for s3cmd) | |
# Usage: ec2-get-security-credentials ROLENAME DEFAULT_REGION | |
# ROLE=$1 | |
# DEFAULT_REGION=$2 | |
This file contains 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 socket | |
def find_open_port(): | |
""" | |
Use socket's built in ability to find an open port. | |
""" | |
sock = socket.socket() | |
sock.bind(('', 0)) |
NewerOlder