Archive

S3

How to calculate total space used by S3 ?

Here’s a little script that uses s3cmd and calculate the total data size stored in all S3 buckets for the same account #!/bin/bash for bucket in $(s3cmd ls |awk ‘{print $3}’); do size=$(s3cmd du ${bucket} |awk ‘{print $1}’) total=$(expr $total + $size); #echo $total done echo “total=$total kb” Enjoy, Lahav

Install S3FS

Introduction S3FS is a fuse filesystem you can use to mount s3 bucket on your local filesystem. In this guide I will show how to quickly install s3fs and use it in /etc/fstab to mount it on your local server. Tested On OS: Amazon Linux AMI release 2012.03 S3FS version: 1.61 Hardware: Virtual Machine (AWS …

Host a Static Website on Amazon S3

Create a bucket named the same as the domain you wish to host on S3 For the domain: www.example.com the bucket should be: www.example.com.s3.amazonaws.com Create a CNAME www.example.com that points to www.example.com.s3.amazonaws.com Define the Index and Error document Complete example on AWS blog: http://aws.typepad.com/aws/2011/02/host-your-static-website-on-amazon-s3.html As always, Enjoy!

Make S3 bucket public

Some times you want to your S3 bucket to be readable to the internet, in cases like public hosting of a web site or media. Of course S3 allows it via Bucket Policy, Here’s an example: { “Version”: “2008-10-17″, “Id”: “Policy1336627524054″, “Statement”: [ { “Sid”: “Stmt1336627519375″, “Effect”: “Allow”, “Principal”: { “AWS”: “*” }, “Action”: “s3:GetObject”, “Resource”: “arn:aws:s3:::MyBucketName/*” } …

s3cmd download is slow

I found that sometimes s3cmd can be really slow (download speed ~3.75MB/s). Here’s a tip to fix it: the s3cmd upload/download speed can be tuned by modifying send_chunk/recv_chunk variables in the s3cfg configuration file (the default is 4096 – 4KB).

Amazon Cloud Drive Download

Amazon Releases Desktop App for Its Cloud Storage Service New app makes uploading files to Amazon Cloud Drive storage handier than it used to be. If you have an Amazon account, you also have five gigabytes of free online storage for your files at your disposal through the Amazon Cloud Drive service. You may not have known …

S3 Custom security policy example

{ “Statement”: [ { "Sid": "Stmt1334692073905", "Action": [ "s3:ListAllMyBuckets" ], “Effect”: “Allow”, “Resource”: [ "arn:aws:s3:::*" ] }, { “Sid”: “Stmt1334692152097″, “Action”: [ "s3:*" ], “Effect”: “Allow”, “Resource”: [ "arn:aws:s3:::emind-test1", "arn:aws:s3:::emind-test1/*" ] } ] }

AWS Policy Generator

You probably tried to create a policy for S3 access, here’s the tool: http://awspolicygen.s3.amazonaws.com/policygen.html Here’s an example for S3 custom policy

How to manage a cloud with 410TB

A very interesting presentation about a Pinterest, an online picture pinboard for organising your favourite snaps and sharing them Enjoy: http://www.theregister.co.uk/2012/04/30/inside_pinterest_virtual_data_center/