/l3/users/slm/2018-12-minsk-aws/student06.BigClassRoom/user :1 :2 :3 :4 :5 :6 :7 |
|
$cat credentials.csv -n
1 user6,tk=l#erR3XY8,AKIAJO7Q5VCMZGOFCKXQ,xDZdIa4RXgL86vMHs1L8u1ufZMSbv81rK0D/zGMm,https://chubin.signin.aws.amazon.com/console |
$cat credentials.csv | tr , '\n'
user6 tk=l#erR3XY8 AKIAJO7Q5VCMZGOFCKXQ xDZdIa4RXgL86vMHs1L8u1ufZMSbv81rK0D/zGMm https://chubin.signin.aws.amazon.com/console |
$aws
aws/ credentials.csv .l3rc Public/ .aws/ Desktop/ .lilalo/ .ssh/ .bash_history Documents/ .local/ ssh-key .bash_logout Downloads/ m7_id_rsa.pub ssh-key.pub .bash_profile .gitconfig .mozilla/ Templates/ .bashrc github.txt Music/ test.json .cache/ .gnupg/ Pictures/ Videos/ .config/ .ICEauthority .profile .viminfo |
$aws describe-instances
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argument command: Invalid choice, valid choices are: acm | acm-pca alexaforbusiness | amplify apigateway | apigatewaymanagementapi apigatewayv2 | application-autoscaling ... support | swf transcribe | transfer translate | waf waf-regional | workdocs workmail | workspaces xray | s3api s3 | configure deploy | configservice opsworks-cm | runtime.sagemaker history | help |
$aws ec2 describe-instances
{ "Reservations": [ { "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "ec2-52-19-122-40.eu-west-1.compute.amazonaws.com", "State": { ... }, "AmiLaunchIndex": 0 } ], "ReservationId": "r-0c0e59eec99ee07d6", "Groups": [], "OwnerId": "886677986286" } ] } |
$aws ec2 describe-instances --output table
------------------------------------------------------------------------------------- | DescribeInstances | +-----------------------------------------------------------------------------------+ || Reservations || |+---------------------------------+-----------------------------------------------+| || OwnerId | 886677986286 || || ReservationId | r-0ebb430cd3f1917cf || |+---------------------------------+-----------------------------------------------+| ||| Instances ||| ||+------------------------+------------------------------------------------------+|| ... |||| State |||| |||+-------------------------------+---------------------------------------------+||| |||| Code | 16 |||| |||| Name | running |||| |||+-------------------------------+---------------------------------------------+||| |||| Tags |||| |||+-----------------------------+-----------------------------------------------+||| |||| Key | Name |||| |||| Value | user3-noIP |||| |||+-----------------------------+-----------------------------------------------+||| |
$aws ec2 help
EC2() EC2() NAME ec2 - DESCRIPTION Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing capacity in the AWS cloud. Using Amazon EC2 eliminates the need to invest in hardware up front, so you can develop and deploy applications faster. To learn more about Amazon EC2, Amazon EBS, and Amazon VPC, see the following resources: ... o Amazon VPC documentation AVAILABLE COMMANDS o accept-reserved-instances-exchange-quote o accept-transit-gateway-vpc-attachment o accept-vpc-endpoint-connections o accept-vpc-peering-connection o advertise-byoip-cidr o allocate-address o allocate-hosts o apply-security-groups-to-client-vpn-target-network |
$complete -C aws_completer aws
|
$cat .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells. . /etc/bash_completion # Note: PS1 and umask are already set in /etc/profile. You should not # need this unless you want different defaults for root. # PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ ' # umask 022 # You may uncomment the following lines if you want `ls' to be colorized: # export LS_OPTIONS='--color=auto' # eval "`dircolors`" # alias ls='ls $LS_OPTIONS' # alias ll='ls $LS_OPTIONS -l' # alias l='ls $LS_OPTIONS -lA' # # Some more alias to avoid making mistakes: # alias rm='rm -i' # alias cp='cp -i' # alias mv='mv -i' . /home/user/.lilalo/l3bashrc && _l3_start |
$vi .bashrc
|
$vi .bashrc
|
$ll
bash: ll: command not found |
$vi .bashrc
|
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws de
deploy devicefarm |
$aws ec2 describe-in
describe-instance-attribute describe-instance-credit-specifications describe-instances describe-instance-status describe-internet-gateways |
$aws ec2 describe-instance
describe-instance-attribute describe-instance-credit-specifications describe-instances describe-instance-status |
$aws ec2 describe-instance-status | jq .InstanceStatuses[0].^C
|
$aws ec2
Display all 328 possibilities? (y or n) accept-reserved-instances-exchange-quote accept-transit-gateway-vpc-attachment accept-vpc-endpoint-connections accept-vpc-peering-connection advertise-byoip-cidr allocate-address allocate-hosts apply-security-groups-to-client-vpn-target-network assign-ipv6-addresses ... cancel-spot-fleet-requests cancel-spot-instance-requests confirm-product-instance copy-fpga-image copy-image copy-snapshot create-capacity-reservation create-client-vpn-endpoint create-client-vpn-route create-customer-gateway |
$sudo pip install saws
[sudo] password for user: Collecting saws Downloading https://files.pythonhosted.org/packages/ef/7a/37581ad99e8aefc9976c463fb7741593e1ff91dea2228ec5f889ba6b9e33/saws-0.4.3.tar.gz (46kB) 100% |████████████████████████████████| 51kB 625kB/s Requirement already satisfied: awscli<2.0.0,>=1.7.46 in /usr/local/lib/python2.7/dist-packages (from saws) Collecting click<7.0,>=4.0 (from saws) Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB) 100% |████████████████████████████████| 71kB 1.4MB/s Collecting configobj<6.0.0,>=5.0.6 (from saws) Downloading https://files.pythonhosted.org/packages/64/61/079eb60459c44929e684fa7d9e2fdca403f67d64dd9dbac27296be2e0fab/configobj-5.0.6.tar.gz ... Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in /usr/local/lib/python2.7/dist-packages (from botocore==1.12.68->awscli<2.0.0,>=1.7.46->saws) Requirement already satisfied: urllib3<1.25,>=1.20; python_version == "2.7" in /usr/local/lib/python2.7/dist-packages (from botocore==1.12.68->awscli<2.0.0,>=1.7.46->saws) Building wheels for collected packages: saws, configobj Running setup.py bdist_wheel for saws ... done Stored in directory: /root/.cache/pip/wheels/d5/76/41/cd49100cd35049d460ec69eea00501e2c7805febafd26fc911 Running setup.py bdist_wheel for configobj ... done Stored in directory: /root/.cache/pip/wheels/f1/e4/16/4981ca97c2d65106b49861e0b35e2660695be7219a2d351ee0 Successfully built saws configobj Installing collected packages: click, configobj, wcwidth, prompt-toolkit, pygments, saws Successfully installed click-6.7 configobj-5.0.6 prompt-toolkit-1.0.15 pygments-2.3.1 saws-0.4.3 wcwidth-0.1.7 |
$saws
No resource cache found Refreshing resources... Refreshing instance ids... Refreshing instance tag keys... Refreshing instance tag values... Refreshing bucket names... Refreshing bucket uris... Done refreshing Version: 0.4.3 Theme: vim ... ry 'Reservations[*].Instances[*].[InstanceID,State]' - -q ery 'Reservations[*].Instances[*].[InstanceID,State]' f - uery 'Reservations[*].Instances[*].[InstanceID,State]' i query 'Reservations[*].Instances[*].[InstanceID,State]' l -query 'Reservations[*].Instances[*].[InstanceID,State]' t saws> aws ec2 describe-instances --filters "Name=key-name,Values=user6" --filt ers "State=--query 'Reservations[*].Instances[*].[InstanceID,State]' /bin/sh: 1: Syntax error: Unterminated quoted string saws> saws> |
$ll
total 60 drwxr-xr-x 3 user user 4096 Dec 17 16:45 aws -rw-r--r-- 1 root root 127 Dec 18 10:52 credentials.csv drwxr-xr-x 2 user user 4096 Dec 17 12:15 Desktop drwxr-xr-x 2 user user 4096 Dec 17 12:15 Documents drwxr-xr-x 2 user user 4096 Dec 18 12:50 Downloads -rw-r--r-- 1 user user 13 Dec 17 15:13 github.txt -rw------- 1 user user 389 Dec 19 10:57 m7_id_rsa.pub drwxr-xr-x 2 user user 4096 Dec 17 12:15 Music drwxr-xr-x 2 user user 4096 Dec 17 12:15 Pictures drwxr-xr-x 2 user user 4096 Dec 17 12:15 Public -rw------- 1 user user 1766 Dec 19 10:44 ssh-key -rw-r--r-- 1 user user 389 Dec 19 10:44 ssh-key.pub drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates -rw-r--r-- 1 user user 77 Dec 17 14:45 test.json drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos |
$vi aws/infrustructure_start.sh
|
$mv
aws/ Desktop/ .local/ .sawsrc .aws/ Documents/ m7_id_rsa.pub .saws.shortcuts .bash_history Downloads/ .mozilla/ .ssh/ .bash_logout .gitconfig Music/ ssh-key .bash_profile github.txt Pictures/ ssh-key.pub .bashrc .gnupg/ .profile Templates/ .cache/ .ICEauthority Public/ test.json .config/ .l3rc .saws-history Videos/ credentials.csv .lilalo/ .saws.log .viminfo |
$ll aws/
total 12 -rw-r--r-- 1 user user 112 Dec 17 16:45 Hello_world.md -rw-r--r-- 1 user user 14 Dec 19 15:16 infrustructure_start.sh -rw-r--r-- 1 user user 33 Dec 17 16:01 README.md |
$mkdir aws/scripts
|
$vi aws/scripts/create_infrustructure.sh
|
$vim aws/scripts/create_infrustructure.sh
|
$vi aws/scripts/create_infrustructure.sh
|
$image_id=ami-09693313102a30b2c
|
$chmod +x aws/scripts/create_infrustructure.sh
|
$aw
awk aws_bash_completer aws_completer aws/ aws.cmd aws_zsh_completer.sh |
$aws/scripts/create_infrustructure.sh
Usage: aws/scripts/create_infrustructure.sh start|stop |
$aws/scripts/create_infrustructure.sh start
|
$ssh m1
The authenticity of host 'm1 (172.20.13.180)' can't be established. ECDSA key fingerprint is SHA256:jx2YBdjhFE8f40NqCGSRZ1ZaKImHeR0PdtDd89rugeQ. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'm1,172.20.13.180' (ECDSA) to the list of known hosts. user@m1's password: Linux m1 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent ... user@m1:~/aws2/scripts$ user@m1:~/aws2/scripts$ user@m1:~/aws2/scripts$ user@m1:~/aws2/scripts$ cd ~ user@m1:~$ user@m1:~$ user@m1:~$ user@m1:~$ exit logout Connection to m1 closed. |
$ssh m0
The authenticity of host 'm0 (172.20.13.183)' can't be established. ECDSA key fingerprint is SHA256:OmAUOGefATc3fUfxoq0a8q0SorClVWEnwAh7KqphL8A. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'm0' (ECDSA) to the list of known hosts. user@m0's password: Linux instructor 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent ... stop else cat <<EOF Usage: $0 start|stop EOF fi user@instructor:~$ exit logout Connection to m0 closed. |
$aws/scripts/create_infrustructure.sh start
An error occurred (InvalidParameterValue) when calling the RunInstances operation: Address 10.3.61.1 does not fall within the subnet's address range |
$aws/scripts/create_infrustructure.sh start
An error occurred (InvalidParameterValue) when calling the RunInstances operation: Address 10.3.61.1 does not fall within the subnet's address range |
$saws
No resource cache found Refreshing resources... Refreshing instance ids... Refreshing instance tag keys... Refreshing instance tag values... Refreshing bucket names... Refreshing bucket uris... Done refreshing Version: 0.4.3 Theme: vim ... ], "vpc-0e4dfd64aef6a44fc", null ] ] ] saws> saws> exit saws> saws> |
$git sta
stage stash status |
$git staus
git: 'staus' is not a git command. See 'git --help'. Did you mean this? status |
$git status
fatal: Not a git repository (or any of the parent directories): .git |
$cd aws/
|
$git status
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) scripts/ nothing added to commit but untracked files present (use "git add" to track) |
$git add scripts/create_infrustructure.sh
|
$git push
Username for 'https://github.com': DmitrySnitko Password for 'https://DmitrySnitko@github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/DmitrySnitko/aws/' |
$git push
Username for 'https://github.com': DmitrySnitko Password for 'https://DmitrySnitko@github.com': Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 990 bytes | 0 bytes/s, done. Total 4 (delta 0), reused 0 (delta 0) To https://github.com/DmitrySnitko/aws 8a9592f..3552fde master -> master |
$push
sc scanimage scanin scour scp scp-dbus-service screen screendump script scriptreplay ... scrollkeeper-get-content-list scrollkeeper-get-extended-content-list scrollkeeper-get-index-from-docpath scrollkeeper-get-toc-from-docpath scrollkeeper-get-toc-from-id scrollkeeper-install scrollkeeper-preinstall scrollkeeper-rebuilddb scrollkeeper-uninstall scrollkeeper-update |
$sc
scanimage scanin scour scp scp-dbus-service screen screendump script scriptreplay scrollkeeper-config ... scrollkeeper-get-content-list scrollkeeper-get-extended-content-list scrollkeeper-get-index-from-docpath scrollkeeper-get-toc-from-docpath scrollkeeper-get-toc-from-id scrollkeeper-install scrollkeeper-preinstall scrollkeeper-rebuilddb scrollkeeper-uninstall scrollkeeper-update |
$pwd
/home/user/aws |
$ls
Hello_world.md README.md scripts |
$scripts/create_infrustructure.sh
Usage: scripts/create_infrustructure.sh start|stop |
$vi aws/scripts/create_infrustructure.sh
|
$vi aws/scripts/create_infrustructure.sh
|
$aws/scripts/create_infrustructure.sh
Usage: aws/scripts/create_infrustructure.sh start|stop |
$aws/scripts/create_infrustructure.sh start
An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair 'user6-vpc3' does not exist An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair 'user6-vpc3' does not exist An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair 'user6-vpc3' does not exist |
$vi aws/scripts/create_infrustructure.sh
|
${
local private_ip_addr="$1" local public_ip="$2" local name="$3" local tags=$(echo $TAGS | sed s/NAME/$name/) #local tags=$(TAGS/NAME/$name) #--elastic-gpu-specification <value> \ #--elastic-inference-accelerators <value> \ #--security-groups "$security_group" \ #--user-data <value> \ANCE_TYPE" \ #--additional-info <value> \ ... $0 start|stop EOF fi <pts/create_infrustructure.sh" 75L, 1633C written if [ "$1" < 0 ]; then echo "Number of VMs should be more then 1" elif [ "$1" = 1 ]; then start_vm 10.3.1.61 associate-public-ip ${USER_NAME}-vm1 else for i in {2..${vm_number}}; do |
$cd aws/
|
$LS
bash: LS: command not found |
$ll
total 12 -rw-r--r-- 1 user user 112 Dec 17 16:45 Hello_world.md -rw-r--r-- 1 user user 33 Dec 17 16:01 README.md drwxr-xr-x 2 user user 4096 Dec 20 11:09 scripts |
$cd ~
|
$aws/scripts/create_infrustructure.sh start
aws/scripts/create_infrustructure.sh: line 64: {2..}: syntax error: operand expected (error token is "{2..}") |
$aws/scripts/create_infrustructure.sh star
Usage: aws/scripts/create_infrustructure.sh start|stop |
$aws/scripts/create_infrustructure.sh start
null |
$man sleep
|
$aws/scripts/create_infrustructure.sh start
null |
$cat ~/aws/start_log | jq -r .Instances[0].InstanceId
i-00bd4454bf75b5769 |
$aws ec2 describe-instances --instance-ids ${instance} \
aws ec2 describe-instances --instance-ids ${instance} \ blicDnsName''.Reservations[0].Instances[0].NetworkInterfaces[0].Association.Pub ^C |
$cat ~/aws/start_log | jq -r .Instances[0].InstanceId
cDnsName''.Reservations[0].Instances[0].NetworkInterfaces[0].Association.Public |
$vi aws/scripts/create_infrustructure.sh
|
$cat ~/aws/start_log | jq -r .Instances[0].InstanceId
aws/scripts/create_infrustructure.sh stop { "TerminatingInstances": [ { "InstanceId": "i-00bd4454bf75b5769", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { ... "Code": 48, "Name": "terminated" }, "PreviousState": { "Code": 48, "Name": "terminated" } } ] } |
$cat ~/aws/start_log | jq -r .Instances[0].InstanceId
i-00bd4454bf75b5769 i-01fdcf52b7928288c |
$cat ~/aws/start_log | jq -r .Instances[0].InstanceId
vi aws/scripts/create_infrustructure.sh --image-id ($IMAGE_ID" \ ) --instance-type "$INSTANCE_TYPE" \ #--elastic-gpu-specification <value> \ #--elastic-inference-accelerators <value> \ #--security-groups "$security_group" \ "$SHUTDOWN_TYPE" \ #--{ser-data } \ --security-groups " #--additional-info <value> \ \ #--elastic-gpu-specification <value> \ ... } #--elastic-inference-accelerators <value> \ #--security-groups "$security_group" \ get_dns_name() $SECURITY_GROUP" #--user-data <value> \ { 4 #--additional-info <value> \ } get_dns_name() <pts/create_infrustructure.sh" 96L, 2120C written |
$ssh ec2-54-72-108-66.eu-west-1.compute.amazonaws.com
^C |
$ssh ec2-54-72-108-66.eu-west-1.compute.amazonaws.com
^C |
$ping ec2-54-72-108-66.eu-west-1.compute.amazonaws.com
PING ec2-54-72-108-66.eu-west-1.compute.amazonaws.com (54.72.108.66) 56(84) bytes of data. ^C --- ec2-54-72-108-66.eu-west-1.compute.amazonaws.com ping statistics --- 43 packets transmitted, 0 received, 100% packet loss, time 43009ms |
$ssh root@ec2-34-245-158-109.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-245-158-109.eu-west-1.compute.amazonaws.com (34.245.158.109)' can't be established. ECDSA key fingerprint is SHA256:nfv1liFQ2e43pgAjFrPJEiOOdc24NjKRvEJjQCuR1jM. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-245-158-109.eu-west-1.compute.amazonaws.com,34.245.158.109' (ECDSA) to the list of known hosts. Please login as the user "admin" rather than the user "root". ^CConnection to ec2-34-245-158-109.eu-west-1.compute.amazonaws.com closed. |
$cat ~/aws/start_log | jq -r .Instances[0].InstanceId
aws/scripts/create_infrustructure.sh stop { "TerminatingInstances": [ { "InstanceId": "i-01fdcf52b7928288c", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { ... "Code": 48, "Name": "terminated" }, "PreviousState": { "Code": 48, "Name": "terminated" } } ] } |
$cd aws/
|
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: scripts/create_infrustructure.sh Untracked files: (use "git add <file>..." to include in what will be committed) start_log no changes added to commit (use "git add" and/or "git commit -a") |
$ssh admin@ec2-34-245-158-109.eu-west-1.compute.amazonaws.com
Linux ip-10-3-1-61 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Thu Dec 20 09:26:42 2018 from 81.25.35.90 admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ ... -rw-r--r-- 1 admin admin 675 May 15 2017 .profile drwx------ 2 admin admin 4096 Dec 20 09:24 .ssh -rw------- 1 admin admin 953 Dec 20 09:33 .viminfo admin@ip-10-3-1-61:~$ exit exit admin@ip-10-3-1-61:~$ ll total 0 admin@ip-10-3-1-61:~$ exit logout Connection to ec2-34-245-158-109.eu-west-1.compute.amazonaws.com closed. |
$ssh admin@ec2-34-245-158-109.eu-west-1.compute.amazonaws.com
udo apt-get update -y ~ ~ ~ ~ ~ ~ ~ ~ ~ ... -rw-r--r-- 1 admin admin 3526 Dec 20 09:33 .bashrc drwx------ 3 admin admin 4096 Dec 20 09:41 .cache -rw-r--r-- 1 admin admin 366 Dec 20 11:26 install.sh -rw-r--r-- 1 admin admin 675 May 15 2017 .profile drwxr-xr-x 8 admin admin 4096 Dec 20 09:55 qrenco.de drwx------ 2 admin admin 4096 Dec 20 09:24 .ssh -rw------- 1 admin admin 2482 Dec 20 11:26 .viminfo admin@ip-10-3-1-61:~$ exit logout Connection to ec2-34-245-158-109.eu-west-1.compute.amazonaws.com closed. |
$~
total 24 -rw-r--r-- 1 user user 112 Dec 17 16:45 Hello_world.md -rw-r--r-- 1 user user 33 Dec 17 16:01 README.md drwxr-xr-x 2 user user 4096 Dec 20 12:24 scripts -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log |
1 user6,tk=l#erR3XY8,AKIAJO7Q5VCMZGOFCKXQ,xDZdIa4RXgL86vMHs1L8u1ufZMSbv81rK0D/zGMm,https://chubin.signin.aws.amazon.com/console
# ~/.bashrc: executed by bash(1) for non-login shells. . /etc/bash_completion # Note: PS1 and umask are already set in /etc/profile. You should not # need this unless you want different defaults for root. # PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ ' # umask 022 # You may uncomment the following lines if you want `ls' to be colorized: # export LS_OPTIONS='--color=auto' # eval "`dircolors`" # alias ls='ls $LS_OPTIONS' # alias ll='ls $LS_OPTIONS -l' # alias l='ls $LS_OPTIONS -lA' # # Some more alias to avoid making mistakes: # alias rm='rm -i' # alias cp='cp -i' # alias mv='mv -i' . /home/user/.lilalo/l3bashrc && _l3_start
{ "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "StateReason": { "Message": "pending", "Code": "pending" }, "State": { "Code": 0, "Name": "pending" }, "EbsOptimized": false, "LaunchTime": "2018-12-20T09:09:47.000Z", "PrivateIpAddress": "10.3.1.61", "ProductCodes": [], "VpcId": "vpc-0e4dfd64aef6a44fc", "CpuOptions": { "CoreCount": 1, "ThreadsPerCore": 1 }, "StateTransitionReason": "", "InstanceId": "i-00bd4454bf75b5769", "ImageId": "ami-09693313102a30b2c", "PrivateDnsName": "ip-10-3-1-61.eu-west-1.compute.internal", "KeyName": "user6", "SecurityGroups": [ { "GroupName": "default", "GroupId": "sg-0f0cc75216aa3485b" } ], "ClientToken": "", "SubnetId": "subnet-0a8edbfe14d168679", "InstanceType": "t2.micro", "NetworkInterfaces": [ { "Status": "in-use", "MacAddress": "0a:ad:5a:a4:a4:d0", "SourceDestCheck": true, "VpcId": "vpc-0e4dfd64aef6a44fc", "Description": "", "NetworkInterfaceId": "eni-0513bd282968ab31b", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-10-3-1-61.eu-west-1.compute.internal", "Primary": true, "PrivateIpAddress": "10.3.1.61" } ], "PrivateDnsName": "ip-10-3-1-61.eu-west-1.compute.internal", "Attachment": { "Status": "attaching", "DeviceIndex": 0, "DeleteOnTermination": true, "AttachmentId": "eni-attach-0bcc7c35b38f74106", "AttachTime": "2018-12-20T09:09:47.000Z" }, "Groups": [ { "GroupName": "default", "GroupId": "sg-0f0cc75216aa3485b" } ], "Ipv6Addresses": [], "OwnerId": "886677986286", "SubnetId": "subnet-0a8edbfe14d168679", "PrivateIpAddress": "10.3.1.61" } ], "SourceDestCheck": true, "Placement": { "Tenancy": "default", "GroupName": "", "AvailabilityZone": "eu-west-1a" }, "Hypervisor": "xen", "BlockDeviceMappings": [], "Architecture": "x86_64", "RootDeviceType": "ebs", "RootDeviceName": "/dev/xvda", "VirtualizationType": "hvm", "Tags": [ { "Value": "user6", "Key": "tag" }, { "Value": "user6-vpc3-vm1", "Key": "Name" } ], "AmiLaunchIndex": 0 } ], "ReservationId": "r-082ff011a41ba6990", "Groups": [], "OwnerId": "886677986286" }
Время первой команды журнала | 12:26:05 2018-12-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 10:38:31 2018-12-20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 7.92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 5.23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008