How can I tell how many objects I’ve stored in an S3 bucket?

Using AWS CLI aws s3 ls s3://mybucket/ –recursive | wc -l or aws cloudwatch get-metric-statistics \ –namespace AWS/S3 –metric-name NumberOfObjects \ –dimensions Name=BucketName,Value=BUCKETNAME \ Name=StorageType,Value=AllStorageTypes \ –start-time 2016-11-05T00:00 –end-time 2016-11-05T00:10 \ –period 60 –statistic Average Note: The above cloudwatch command seems to work for some while not for others. Discussed here: https://forums.aws.amazon.com/thread.jspa?threadID=217050 Using AWS Web … Read more

How to read/write from/to a file using Go

Let’s make a Go 1-compatible list of all the ways to read and write files in Go. Because file API has changed recently and most other answers don’t work with Go 1. They also miss bufio which is important IMHO. In the following examples I copy a file by reading from it and writing to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)