start new:
tmux
start new with session name:
tmux new -s myname
| require 'net/https' | |
| require 'base64' | |
| require 'json' | |
| require 'uri' | |
| class Catchpoint | |
| @@host = 'https://io.catchpoint.com' | |
| @@prefix = '/ui/api' | |
| @@version = 1 |
| # Find the IAM username belonging to the TARGET_ACCESS_KEY | |
| # Useful for finding IAM user corresponding to a compromised AWS credential | |
| # Requirements: | |
| # | |
| # Environmental variables: | |
| # AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | |
| # python: | |
| # boto |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| """Ansible dict filters.""" | |
| # Make coding more python3-ish | |
| from __future__ import (absolute_import, division, print_function) | |
| __metaclass__ = type | |
| from ansible.errors import AnsibleError | |
Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?
title = "TOML Example" |
| --- | |
| AWSTemplateFormatVersion: "2010-09-09" | |
| Description: "Create a Lambda function that will take a comma seperated list of key=value pairs and return an array of key value pairs that can then be used in cloudformation tags resource parameter" | |
| Resources: | |
| LambdaExecutionRole: | |
| Type: AWS::IAM::Role | |
| Properties: | |
| ManagedPolicyArns: | |
| - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole |
| import json | |
| import boto3 | |
| import paramiko | |
| def worker_handler(event, context): | |
| ALLOWED_HOSTS = [ | |
| 'host1', | |
| 'host2, |
| import boto3 | |
| codecommit = boto3.client('codecommit') | |
| codebuild = boto3.client('codebuild') | |
| def trigger_build(project, commit, branch): | |
| codebuild.start_build(projectName=project, sourceVersion=commit, | |
| environmentVariablesOverride=[ | |
| { 'name': 'ENVIRONMENT', 'value': branch, 'type': 'PLAINTEXT' } | |
| ]) |
| import boto3 | |
| def role_arn_to_session(**args): | |
| """ | |
| Usage : | |
| session = role_arn_to_session( | |
| RoleArn='arn:aws:iam::012345678901:role/example-role', | |
| RoleSessionName='ExampleSessionName') | |
| client = session.client('sqs') | |
| """ |