Dec 23, 2012

Apple System Status Notifier released

I have released a chrome extension Apple System Status Notifier. This extension is quite simple. It periodically checks Apple System Status and displays number of issues recently happened.

This extension uses event pages feature. It consumes less resources than background pages. I hope many other extensions adopt this feature.

Dec 18, 2012

monogusa Released

Last Sunday, I have released monogusa gem.

Its purpose is to list your usage of AWS resources. When you use Management Console, you have to click and click the icons of AWS services you would like to check. If you are running instances across the regions, you have to click more.

Monogusa is trying to make it easier. At the moment is does not list statuses across regions, next version will do it. This is screen shot of next version.


Dec 1, 2012

Create a URL Signature for Amazon CloudFront Using Python

There is no official document to create a url signature for Amazon CloudFront in Python. I found an easy way to do it.

from tlslite.utils import keyfactory
from base64 import b64encode
import time

url = "http://d3iwlid5dsmdb3.cloudfront.net/_default_san.png"
expires = int(time.time() + 60)
privkey_file = "pk-APKAJ4YNPASFVCNBXK3A-cloudfront.pem"
key_pair_id = "APKAJ4YNPASFVCNBXK3A"

policy = '{"Statement":[{"Resource":"%s","Condition":{"DateLessThan":{"AWS:EpochTime":%d}}}]}' % (url, expires)
privkey = keyfactory.parsePrivateKey(open(privkey_file).read())            
print '%s?Expires=%d&Signature=%s&Key-Pair-Id=%s' % (url, expires, b64encode(privkey.hashAndSign(policy)), key_pair_id)

The library tlslite is very easy to use. boto also has a method to create signed url but it uses M2Crypto. To install M2Crypto, swig command is required but my OSX does not have it. If you do not like to install swig, tlslite is a good option.