-
-
Save bluengreen/4ae1976d0666ee6f20d9d3b649c44191 to your computer and use it in GitHub Desktop.
Revisions
-
hummus revised this gist
Mar 24, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,7 @@ aws ec2 describe-volumes --filters \ "Name=status,Values=available" \ | jq -r ".Volumes[] | .VolumeId" \ aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.LaunchTime > "2015-01-28") | select(.State.Code != 48) | [.LaunchTime, .State.Name, (.Tags[]|select(.Key=="Name")|.Value)]' # no dotdee aws ec2 describe-instances | jq --arg yest $(python -c "import datetime; t = datetime.datetime.now() - datetime.timedelta(hours=24); print t.strftime('%Y-%m-%d')") -r '.Reservations[].Instances[] | select(.LaunchTime > $yest) | select(.State.Code != 48) | (.Tags[]//[]|select(.Key=="Name")|.Value) as $name | "Host \($name) \nHostname \(.PrivateIpAddress)"' >> ~/.ssh/config -
hummus revised this gist
Jan 30, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,6 @@ aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ aws ec2 describe-volumes --filters \ "Name=status,Values=available" \ | jq -r ".Volumes[] | .VolumeId" \ aws ec2 describe-instances | jq '.Reservations[].Instances[] | select(.LaunchTime > "2015-01-28") | select(.State.Code != 48) | [.LaunchTime, .State.Name, (.Tags[]|select(.Key=="Name")|.Value)]' -
hummus created this gist
Jan 24, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ wget http://stedolan.github.io/jq/download/linux64/jq aws ec2 describe-instances --filters "Name=tag:Name,Values=$NAME" \ "Name=instance-state-name,Values=running" \ | jq -r \ ".Reservations[] | .Instances[] | .InstanceId" \ aws ec2 describe-volumes --filters \ "Name=status,Values=available" \ | jq -r ".Volumes[] | .VolumeId" \