Skip to content

Instantly share code, notes, and snippets.

# List all security Groups with GroupName SSH
aws --profile sandbox ec2 describe-security-groups --query SecurityGroups[?GroupName=='SSH']
# Launch Instance
aws --profile sandbox ec2 run-instances --image-id ami-48c62427 --key-name sandbox --security-group-ids sg-XXXXXXXX --instance-type t2.small --subnet-id subnet-XXXXXXX
# Describe Public IP of running instances
aws --profile sandbox ec2 describe-instances --query Reservations[*].Instances[?State.Name=='running'].{PublicIp:PublicIpAddress}
# Authorize Ingress Security Group for SSH to ALL
AWSKMSClient awskmsClient = new AWSKMSClient();
awskmsClient.setRegion(Region.getRegion(Regions.EU_CENTRAL_1));
String token = "Dummy";
ByteBuffer plainText = ByteBuffer.wrap(token.getBytes());
EncryptRequest encryptRequest = new EncryptRequest().withKeyId(keyId).withPlaintext(plainText);
EncryptResult encryptResult = awskmsClient.encrypt(encryptRequest);
String kmsEncryptedToken = Base64.getEncoder().encodeToString(encryptResult.getCiphertextBlob().array());
System.out.println(kmsEncryptedToken);
@o-can
o-can / gpg.conf
Created April 6, 2016 15:26 — forked from stansidel/gpg-with-key
Setting up GPG signature on Mac OS X with Xcode
# Add these lines
batch
passphrase-file <Full path to the key.txt file (without tilda)>