Журнал лабораторных работ

Содержание

Журнал

Среда (12/19/18)

/dev/pts/2
12:24:38
$aws configure
AWS Access Key ID [****************XQQQ]:
AWS Secret Access Key [****************O5re]:
Default region name [eu-west-1]:
Default output format [json]:
12:25:04
$aws configure
AWS Access Key ID [****************XQQQ]: AKIAIPTEFNENKAHEXQQQ
AWS Secret Access Key [****************O5re]:
Default region name [eu-west-1]:
Default output format [json]:
/dev/pts/4
12:25:33
$sudo cat /root/credentials.csv | TR , '/n'
bash: TR: command not found
12:25:37
$sudo cat /root/credentials.csv | tr , '/n'
user4/}E-(C9rwuVY&/AKIAIPTEFNENKAHEXQQQ/tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re/https://chubin.signin.aws.amazon.com/console
12:25:44
$sudo cat /root/credentials.csv | tr , '\n'
user4
}E-(C9rwuVY&
AKIAIPTEFNENKAHEXQQQ
tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re
https://chubin.signin.aws.amazon.com/console
/dev/pts/2
12:26:54
$aws ec2 describe-instances
{
    "Reservations": [
        {
            "Groups": [],
            "ReservationId": "r-0ebb430cd3f1917cf",
            "OwnerId": "886677986286",
            "Instances": [
                {
                    "InstanceId": "i-080515adaa7956592",
                    "AmiLaunchIndex": 0,
...
                    "Placement": {
                        "AvailabilityZone": "eu-west-1a",
                        "GroupName": "",
                        "Tenancy": "default"
                    }
                }
            ]
        }
    ]
}
12:26:59
$aws ec2 describe-instances | jq
{
  "Reservations": [
    {
      "Groups": [],
      "OwnerId": "886677986286",
      "ReservationId": "r-0ebb430cd3f1917cf",
      "Instances": [
        {
          "SourceDestCheck": true,
          "SecurityGroups": [
...
          ],
          "PrivateDnsName": "ip-10-1-1-251.eu-west-1.compute.internal",
          "AmiLaunchIndex": 0,
          "RootDeviceType": "ebs",
          "SubnetId": "subnet-060d8c5c243f86664"
        }
      ]
    }
  ]
}
12:27:45
$aws ec2 describe-instances | jq[0]
bash: jq[0]: command not found
12:27:54
$aws ec2 describe-instances | jq.[0]
bash: jq.[0]: command not found
12:28:03
$history | grep jq
   52  sudo apt install jq
   54  cat 1.json | jq
   57  cat 1.json | jq
   58  cat 1.json | jq .[1].computer
   59  cat 1.json | jq .[2].name
   60  cat 1.json | jq .[1].name
   61  cat 1.json | jq .[1]
   62  cat 1.json | jq .[0].name
   63  cat 1.json | jq .[0].computer
   64  curl -s https://uinames.com/api/?region=belarus\&amount=5 | jq
   65  curl -s https://uinames.com/api/?region=poland\&amount=5 | jq
   66  curl -s https://uinames.com/api/?region=poland\&amount=5 | jq '.[] | .name + " " + .surname'
   67  curl -s https://uinames.com/api/?region=poland\&amount=5 | jq '.[] | .name + " " + .surname'
  246  aws ec2 describe-instances | jq
  247  aws ec2 describe-instances | jq[0]
  248* aws ec2 describe-instances | jq
  249  history | grep jq
12:28:59
$aws ec2 describe-instances | jq .[1]
jq: error (at <stdin>:1666): Cannot index object with number
12:29:06
$aws ec2 describe-instances | jq
{
  "Reservations": [
    {
      "ReservationId": "r-0ebb430cd3f1917cf",
      "OwnerId": "886677986286",
      "Groups": [],
      "Instances": [
        {
          "InstanceId": "i-080515adaa7956592",
          "RootDeviceName": "/dev/xvda",
...
                "DeleteOnTermination": true,
                "AttachTime": "2018-12-19T09:42:51.000Z"
              }
            }
          ]
        }
      ]
    }
  ]
}
12:29:52
$aws ec2 describe-instances | jq .Reservations
[
  {
    "Groups": [],
    "Instances": [
      {
        "Monitoring": {
          "State": "disabled"
        },
        "State": {
          "Code": 16,
...
        "StateTransitionReason": "",
        "Architecture": "x86_64",
        "InstanceType": "t2.micro",
        "AmiLaunchIndex": 0
      }
    ],
    "ReservationId": "r-0c0e59eec99ee07d6",
    "OwnerId": "886677986286"
  }
]
12:30:48
$aws ec2 describe-instances | jq .Reservations | less -R
12:31:15