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 sys | |
| import boto | |
| import pprint | |
| del_flag = '' | |
| if len(sys.argv) > 1: | |
| del_flag = sys.argv[1] |
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
| # -*- coding: utf-8 -*- | |
| import signal | |
| import boto.sns | |
| def timeout(limit, topic, subject='Execution Timeout.', body='Please check program.', region='us-east-1'): | |
| ''' | |
| 使い方:指定した実行時間に終了しなかった場合、awsのsnsで通知するデコレータです。 | |
| @timeout(limit=3600, topic='arn:aws:sns:xxxxxxxx:yyyyyyy') | |
| def long_time_function(): | |
| very_very_long_calc() |
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 time import strftime,gmtime,time | |
| import urllib2 | |
| import hmac | |
| import hashlib | |
| import base64 | |
| import string | |
| def publishAmazonSnsMsg(Subject,TopicArn,Message,AWSAccessKeyId,privatekey): | |
| #http://docs.amazonwebservices.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/ | |
| amzsnshost = 'sns.us-east-1.amazonaws.com' |
NewerOlder