start new:
tmux
start new with session name:
tmux new -s myname
| # Count total EBS based storage in AWS | |
| aws ec2 describe-volumes | jq "[.Volumes[].Size] | add" | |
| # Count total EBS storage with a tag filter | |
| aws ec2 describe-volumes --filters "Name=tag:Name,Values=CloudEndure Volume qjenc" | jq "[.Volumes[].Size] | add" | |
| # Describe instances concisely | |
| aws ec2 describe-instances | jq '[.Reservations | .[] | .Instances | .[] | {InstanceId: .InstanceId, State: .State, SubnetId: .SubnetId, VpcId: .VpcId, Name: (.Tags[]|select(.Key=="Name")|.Value)}]' | |
| # Wait until $instance_id is running and then immediately stop it again | |
| aws ec2 wait instance-running --instance-id $instance_id && aws ec2 stop-instances --instance-id $instance_id | |
| # Get 10th instance in the account |
| namespace Alphabet | |
| { | |
| public class AlphabetTest | |
| { | |
| public static readonly string Alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; | |
| public static readonly int Base = Alphabet.Length; | |
| public static string Encode(int i) | |
| { | |
| if (i == 0) return Alphabet[0].ToString(); |
| curl -XPUT 'http://localhost:9200/us/user/1?pretty=1' -d ' | |
| { | |
| "email" : "[email protected]", | |
| "name" : "John Smith", | |
| "username" : "@john" | |
| } | |
| ' | |
| curl -XPUT 'http://localhost:9200/gb/user/2?pretty=1' -d ' | |
| { |
As configured in my dotfiles.
start new:
tmux
start new with session name: