``` from boto.s3.connection import S3Connection from boto.sts.connection import STSConnection sts_conn = STSConnection(aws_access_key_id=self._secret_id, aws_secret_access_key=self._access_key) # get limited privilege by policy federation_token = sts_conn.get_federation_token(user_name, duration=duration, policy=policy) sts_conn.close() s3conn = S3Connection(federation_token.credentials.access_key, federation_token.credentials.secret_key, security_token=federation_token.credentials.session_token) upload_url = s3conn.generate_url(duration, 'PUT', bucket_name, object_key) s3conn.close() ```
- Nov 27 Fri 2015 18:10
[AWS] get federation token by using boto
- Nov 20 Fri 2015 11:38
[Linux] history 查看最近 command 紀錄, fc 多行執行 history command
history ... 1119 cp a /user/a/ 1120 rm /user/a/a 1121 history fc 1100 1120
- Oct 23 Fri 2015 11:46
[C/C++] curl_slist_append example
/* Remove a header curl would otherwise add by itself */
chunk = curl_slist_append(chunk, "Accept:");
- Oct 22 Thu 2015 14:27
[轉] Linux dd 使用
- Oct 15 Thu 2015 23:08
[轉] 解決 facebook 連線超慢
- Oct 06 Tue 2015 15:18
[轉] using gcov lcov gtest
- Oct 01 Thu 2015 16:08
[轉] Linux下的UDP/TCP端口映射(netcat and socat)
- Sep 01 Tue 2015 17:13
[Linux] md5sum hash string or file
- Aug 26 Wed 2015 10:24
[轉][Safari] Failed to load resource: the server responded with a status of 412
主因就是 Safari POST header 有多加了 If-Modified-Since and If-None-Match.
但這 header 應該是給 GET 使用, 所以 Server 回 Precondiction Failed
- Aug 25 Tue 2015 16:51
[Python] pip install No matching distribution found issue