- jq - https://stedolan.github.io/jq/
- awscli - https://github.com/aws/aws-cli#installation
- sublime text 3 - https://www.sublimetext.com/3
$ cat ~/my_aws_stuff/bin/validate.sh
#!/bin/bash$ cat ~/my_aws_stuff/bin/validate.sh
#!/bin/bash| import Html exposing (..) | |
| import Html.Attributes exposing (..) | |
| import Html.Events exposing (onInput, onClick) | |
| import String exposing (..) | |
| import Char exposing (..) | |
| main = | |
| Html.beginnerProgram { model = model | |
| , view = view | |
| , update = update |
| package main | |
| import "fmt" | |
| import "math/big" | |
| // we can't use a reference type as a key (*big.Int) so we need to cast to string to keep track | |
| var seen = make(map[string]*big.Int) | |
| func fibo(n *big.Int) *big.Int { | |
| zero := big.NewInt(0) |
| use std::collections::HashMap; | |
| fn main() { | |
| println!("{}", sing(3, 0)); | |
| for i in (0..11).rev() { | |
| println!("{}", verse(i)); | |
| } | |
| } |
| #!/bin/bash | |
| # get the IPs for current instance in ASG | |
| region='us-east-1' | |
| asgs=$(aws --region ${region} autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?contains(AutoScalingGroupName, `stag`)].[AutoScalingGroupName][]' --output text) | |
| for asg in ${asgs[@]}; do | |
| echo "${asg}" | |
| instances=$(aws --region ${region} autoscaling describe-auto-scaling-groups --auto-scaling-group-names ${asg} --query 'AutoScalingGroups[].Instances[].[InstanceId][]' --output text) | |
| for instance in ${instances[@]}; do |
| [ | |
| { "keys": ["ctrl+0"], "command": "reset_font_size" }, | |
| { "keys": ["ctrl+\\"], "command": "toggle_side_bar" }, | |
| ] |
| extern crate rusoto_core; | |
| extern crate rusoto_ec2; | |
| use rusoto_core::{default_tls_client, DefaultCredentialsProvider, Region}; | |
| use rusoto_ec2::{Ec2Client, Ec2, DescribeInstancesRequest}; | |
| fn main() { | |
| let dispatcher = default_tls_client().unwrap(); | |
| let provider = DefaultCredentialsProvider::new().unwrap(); |
| extern crate rusoto_core; | |
| extern crate rusoto_ec2; | |
| use rusoto_core::{default_tls_client, | |
| EnvironmentProvider, | |
| Region}; | |
| use rusoto_ec2::{Ec2Client, | |
| DescribeInstancesRequest, | |
| Ec2}; |
| extern crate bcrypt; | |
| use bcrypt::{DEFAULT_COST, hash, verify}; | |
| fn main() { | |
| let hashed = hash("hunter2", DEFAULT_COST).unwrap(); | |
| let valid = verify("hunter2", &hashed); | |
| println!("{:?}", hashed); | |
| println!("{:?}", valid); | |
| } |
| """create instances for | |
| https://github.com/Praqma/LearnKubernetes/blob/master/kamran/Kubernetes-The-Hard-Way-on-AWS.md""" | |
| # stdlib | |
| import logging | |
| # 3rd party | |
| import boto3 | |
| #local |