Tuesday, January 27, 2009

"Oranzova vznikne kdyz se nachcije do rudy."



Czech proverb very pertinent to the current Czech Democratic party leaders - dr. Rath & mr. Paroubek (not your average Obama). They are recalling Hitler's way to get out of the economic crisis. Unbelievable! I feel really ashamed for them and only hope that Czechs can't be so stupid to let them back to our government.

P.S.: I still can't believe I blogged Czech politics.

Setting Amazon S3 ACLs Programatically

I recently wrote a simple Python script for setting Amazon S3 ACLs. You might find it useful.

Usage:

setS3acl.py -a $AWS_ACCESS_KEY -s $AWS_SECURE_KEY -b "myBucket" -f myfile.txt -o $OWNER_AWS_ID "$USR1_AWS_ID:FULL_CONTROL" "$USR2_AWS_ID:READ"

Options

-a - your AWS access key
-s - your AWS secure access key
-b - AWS bucket name (no s3:// nor any other slashes)
-f - file name (no s3:// nor bucket prefixes, just the filename)
-o file owner (AWS ID)

Parameters:

[AWS_ID:FULL_CONTROL|READ|WRITE]

You'll need to use the AWS IDs to identify the user (the long and ugly Amazon account identifiers - e.g. a382d287d4d58222758254ddebac103f70e6f5b).

There are two Python files that you'll need:

* setS3acl.py
* S3.py

Look at the URL to find out where I store the scripts ($0.15 / GB / month) ;-)

Enjoy!

Wednesday, January 21, 2009