Skip to content

Instantly share code, notes, and snippets.

@spjmurray
Last active August 29, 2015 14:07
Show Gist options
  • Save spjmurray/cc935c59569d1bff184d to your computer and use it in GitHub Desktop.
Save spjmurray/cc935c59569d1bff184d to your computer and use it in GitHub Desktop.
S3 Bucket Creation
#!/bin/bash
token='I858I8ZG0L80D9D8EQI8'
secret='cWIxgBEzPWmZcUsmbreXfT8gJvn9PIbCsQO9Bvtr'
query=$1
date=`date -Ru`
header="PUT\n${content_md5}\n${content_type}\n${date}\n${query}"
sig=`echo -en ${header} | openssl sha1 -hmac ${secret} -binary | base64`
curl -X PUT \
-H "Date: ${date}" \
-H "Authorization: AWS ${token}:${sig}" \
"https://storage.datacentred.io${query}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment