Skip to content

Instantly share code, notes, and snippets.

View ldnunes's full-sized avatar
👷
BUILDING...

Lucas Dutra Nunes ldnunes

👷
BUILDING...
  • Power Factors LLC.
  • Munich, Germany
  • 10:25 (UTC +02:00)
View GitHub Profile
#!/bin/bash
# usage: . aws-cli-enable-mfa-token.sh ONE_TIME_PASS_CODE_FROM_YOUR_MFA_DEVICE
# IMPORTANT: there's a dot before the script name, to set the variables on the current shell.
ONE_TIME_PASS_CODE="$1"
MFA_DEVICE_SERIAL_CODE="" # use "aws iam list-mfa-devices --user-name YOUR_USERNAME" to find out what is your MFA device serial number. It's also on your security credentials user page on AWS console, IAM service.
AWS_JSON=$(aws sts get-session-token --serial-number "$MFA_DEVICE_SERIAL_CODE" --token-code "$ONE_TIME_PASS_CODE")
export AWS_ACCESS_KEY_ID=$(echo $AWS_JSON | jq -r .Credentials.AccessKeyId)
@ldnunes
ldnunes / gist:5374835
Created April 12, 2013 20:21
RVM install error while using --add-to-rvm-group in a multiuser install
user@debian:~$ \curl -L https://get.rvm.io | sudo bash -s head --add-to-rvm-group deploy
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 112 0 0:00:01 0:00:01 --:--:-- 157
100 13171 100 13171 0 0 5326 0 0:00:02 0:00:02 --:--:-- 5326
Downloading RVM from wayneeseguin branch master
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 124 100 124 0 0 126 0 --:--:-- --:--:-- --:--:-- 200
100 3265k 100 3265k 0 0 307k 0 0:00:10 0:00:10 --:--:-- 571k