How can I use boto to stream a file out of Amazon S3 to Rackspace Cloudfiles?

Other answers in this thread are related to boto, but S3.Object is not iterable anymore in boto3. So, the following DOES NOT WORK, it produces an TypeError: ‘s3.Object’ object is not iterable error message: s3 = boto3.session.Session(profile_name=my_profile).resource(‘s3’) s3_obj = s3.Object(bucket_name=my_bucket, key=my_key) with io.FileIO(‘sample.txt’, ‘w’) as file: for i in s3_obj: file.write(i) In boto3, the contents … Read more

Nginx no-www to www and www to no-www

HTTP Solution From the documentation, “the right way is to define a separate server for example.org”: server { listen 80; server_name example.com; return 301 http://www.example.com$request_uri; } server { listen 80; server_name www.example.com; … } HTTPS Solution For those who want a solution including https://… server { listen 80; server_name www.domain.com; # $scheme will get the … Read more