Skip to content

Instantly share code, notes, and snippets.

View haisamido's full-sized avatar
🎯
Focusing

Haisam Ido haisamido

🎯
Focusing
View GitHub Profile
@nfelger
nfelger / s3_down.sh
Created April 15, 2015 10:27
Quick and dirty s3 speed tests with temporary STS credentials
#!/bin/bash
# Inspired by http://dl.getipaddr.net/ and http://curl.haxx.se/mail/archive-2014-10/0006.html
file=path/to/file
bucket=your-bucket
contentType="application/octet-stream"
dateValue=`date -R`
resource="/${bucket}/${file}"
s3Key=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ec2-app-role | grep 'AccessKeyId' | sed 's/.* "\([^"]*\).*/\1/'`
s3Secret=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ec2-app-role | grep 'SecretAccessKey' | sed 's/.* "\([^"]*\).*/\1/'`
token=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ec2-app-role | grep 'Token' | sed 's/.* "\([^"]*\).*/\1/'`
@mixonic
mixonic / server.js
Created April 28, 2011 22:49
Node.js + Socket.io + Bash. A collaborative terminal for your browser.
//
// This server will start a bash shell and expose it
// over socket.io to a browser. See ./term.html for the
// client side.
//
// You should probably:
//
// npm install socket.io
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js
//