This file contains hidden or 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
| #!/usr/bin/env python | |
| import argparse | |
| import sys | |
| import logging | |
| from boto.ec2 import regions, connect_to_region | |
| def main(): |
This file contains hidden or 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 | |
| sudo apt-get install python-virtualenv | |
| virtualenv tosca-dev | |
| source tosca-dev/bin/activate | |
| git clone https://github.com/stackforge/heat-translator.git | |
| # Edit access | |
| git clone [email protected]:juju/juju-tosca.git |
This file contains hidden or 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
| #!/usr/bin/python | |
| """ | |
| Simple usage to log into a container via ssh | |
| $ lxc-host -s -n container_name | |
| Simple usage to query the addresses of a container | |
| $ lxc-host -n container_name |
This file contains hidden or 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
| kube: | |
| series: trusty | |
| services: | |
| kubernetes-master: | |
| charm: kubernetes-master | |
| flannel: | |
| charm: flannel | |
| num_units: 2 | |
| options: | |
| container_type: docker |
This file contains hidden or 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
| 2014-10-26 02:33:12 INFO network-relation-changed Registering machine | |
| 2014-10-26 02:33:12 INFO network-relation-changed registration request | |
| {'kind': 'Minion', 'id': u'10.132.218.156', | |
| 'resources': {'capacity': {'mem': '2049988 K', 'cpu': 2}}, 'hostIP': u'10.132.218.156'} | |
| 2014-10-26 02:33:12 INFO network-relation-changed registration result | |
| {"kind":"Status","creationTimestamp":null,"selfLink":"/api/v1beta1/minions", | |
| "apiVersion":"v1beta1","status":"Failure", | |
| "message":"The requested resource does not exist.", | |
| "code":500} |
This file contains hidden or 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 subprocess | |
| import re | |
| regex = re.compile('([A-Z]+)=(?:"(.*?)")') | |
| parts = "NAME,KNAME,MODEL,UUID,SIZE,ROTA,TYPE,MOUNTPOINT,MAJ:MIN" | |
| def blocks(): | |
| blocks = [] | |
| output = subprocess.check_output([ | |
| "sudo", "lsblk", "-P", "-o", |
This file contains hidden or 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 os | |
| import subprocess | |
| import yaml | |
| from charmhelpers.core import hookenv | |
| LATEST = "latest" | |
| class Service(dict): |
This file contains hidden or 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 csv | |
| import pythonkc_meetups.client | |
| from pythonkc_meetups import PythonKCMeetups | |
| pythonkc_meetups.client.GROUP_URLNAME = "Ansible-NOVA" | |
| m = PythonKCMeetups('API_KEY') | |
| events = m.get_upcoming_events() | |
| attendees = m.get_event_attendees(events[0].id) | |
| with open('attendees.csv', 'w') as fh: |
This file contains hidden or 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
| from datetime import datetime, timedelta | |
| import boto3 | |
| import pprint | |
| import os | |
| def main(): | |
| bucket = os.environ.get('BUCKET') |
This file contains hidden or 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
| Log output | |
| The area below shows the logging calls in your code. These correspond to a single row within the CloudWatch log group corresponding to this Lambda function. Click here to view the CloudWatch log group. | |
| START RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0 Version: $LATEST | |
| Unable to import module 'lambda_function': No module named lambda_function | |
| END RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0 | |
| REPORT RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0 Duration: 72.41 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 8 MB |