/l3/users/slm/2018-12-minsk-aws/student03.BigClassRoom/user :1 :2 :3 :4 :5 :6 :7 |
|
$~
{ } [ ] EOF fi ~ user@instructor:~/aws$ scripts/create-infrastructure.sh Usage: scripts/create-infrastructure.sh start|stop user@instructor:~/aws$ scripts/create-infrastructure.sh start ... user@instructor:~/aws$ git commit -m 'initial revision of create-infrastructure'| push | user@instructor:~/aws$ git commit -m 'initial revision of create-infrastructure'| status | user@instructor:~/aws$ | | user@instructor:~/aws$ user@instructor:~/aws$ user@instructor:~/aws$ exit exit |
$vim scripts/create-infrastructure.sh
|
$aws ec2 run-instance --help
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 operation: Invalid choice, valid choices are: 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 ... search-transit-gateway-routes | start-instances stop-instances | terminate-client-vpn-connections terminate-instances | unassign-ipv6-addresses unassign-private-ip-addresses | unmonitor-instances update-security-group-rule-descriptions-egress | update-security-group-rule-descriptions-ingress withdraw-byoip-cidr | wait help Invalid choice: 'run-instance', maybe you meant: * run-instances * bundle-instance |
$aws ec2 run-instances --help
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help Unknown options: --help |
$aws ec2 run-instances help
RUN-INSTANCES() RUN-INSTANCES() NAME run-instances - DESCRIPTION Launches the specified number of instances using an AMI for which you have permissions. You can specify a number of options, or leave the default options. The following rules apply: o [EC2-VPC] If you don't specify a subnet ID, we choose a default sub- net from your default VPC for you. If you don't have a default VPC, you must specify a subnet ID in the request. o [EC2-Classic] If don't specify an Availability Zone, we choose one for you. o Some instance types must be launched into a VPC. If you do not have a default VPC, or if you do not specify a subnet ID, the request fails. For more information, see Instance Types Available Only in a VPC . |
$aws ec2 run-instances help | less -R
|
$vi scripts/create-infrastructure.sh
|
$nano scripts/create-infrastructure.sh
|
$!/bin/bash
vpc_id=vpc-08b950cd8140c7403 key_name=user3 security_group=... shutdown_type=shutdown start() { private_ip_address="10.2.1.31" aws ec2 run-instances \ --image-id "$image_id" \ --instance-type "$instance_type" \ ... [--dry-run | --no-dry-run] [--ebs-optimized | --no-ebs-optimized] [--iam-instance-profile <value>] [--instance-initiated-shutdown-behavior <value>] [--network-interfaces <value>] [--private-ip-address <value>] [--elastic-gpu-specification <value>] ^G Get Help ^O Write Out ^W Where Is ^K Cut Text ^J Justify ^C Cur Pos ^Y Prev Page M-\ First Line Use "fg" to return to nano.le ^\ Replace ^U Uncut Text ^T To Linter ^_ Go To Line ^V Next Page M-/ Last Line [1]+ Stopped nano scripts/create-infrastructure.sh |
$nano scripts/create-infrastructure.sh
|
$vi scripts/create-infrastructure.sh
|
$vi scripts/create-infrastructure.sh
|
$vi scripts/create-infrastructure.sh
|
${
private_ip_address="10.1.1.31" public_ip=associate-public-ip-address aws ec2 run-instances \ --image-id "$image_id" \ --instance-type "$instance_type" \ --key-name "$key_name" \ --subnet_id "$subnet_id" \ --instance-initiated-shutdown-behavior"$shutdown_type" \ --private-ip-address "$private_ip_address" \ --tag-specifications "$tags"] \ ... --tag-specifications ] \ -- : } stop() { : } if [ = start ]; then start |
${
#!/bin/bash image_id=ami-09693313102a30b2c instance_type=t2.micro vpc_id=vpc-08b950cd8140c7403 key_name=user3 shutdown_type=stop "scripts/create-infrastructure.sh" 45L, 783C #!/bin/bash image_id=ami-09693313102a30b2c instance_type=t2.micro ... --tag-specifications "$tags"] \ --${public_ip} : } stop() { : } if [ "$1" = start ]; then start |
$ ))
|
$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/
|
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: scripts/create-infrastructure.sh |
$git commit -m 'initial revision of create-infrastructure'
[master 267fcbb] initial revision of create-infrastructure Committer: ValeryBarai <user@m3.class.sl> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email you@example.com After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 50 insertions(+) create mode 100755 scripts/create-infrastructure.sh |
$git config --global user.name "ValeryBarai"
|
$git push
Username for 'https://github.com': ValeryBarai Password for 'https://ValeryBarai@github.com': Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 908 bytes | 0 bytes/s, done. Total 4 (delta 0), reused 0 (delta 0) To https://github.com/ValeryBarai/AWS.git 4750fbe..267fcbb master -> master |
$exit
exit There are stopped jobs. |
$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 permitted by applicable law. Last login: Thu Dec 20 10:18:15 2018 from 172.20.13.191 l3-agent is already running: pid=1843; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ d -bash: d: command not found user@instructor:~$ logout Connection to m0 closed. |
$ssh m0
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 permitted by applicable law. Last login: Thu Dec 20 10:18:41 2018 from 172.20.13.180 l3-agent is already running: pid=1843; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ logout Connection to m0 closed. |
$vi scripts/create-infrastructure.sh
|
$vi scripts/create-infrastructure.sh
|
$vi scripts/create-infrastructure.sh
|
$^C
|
$^C
|
$^C
|
$^C
|
$(
SHUTDOWN_TYPE=stop SUBNET_ID=subnet-060d8c5c243f86664 TAGS="ResourceType=instance,Tags=[{Key=installation_id,Value=${USER_NAME}-1},{Key=Name, Value=NAME}]" start_vm() { { local_private_ip_address="$1" local_public_ip_address="$2" local_name="$3" local tags=$(echo $TAGS | sed s/NAME/$name/) #local tags=$(TAGS/NAME/$name} aws ec2 run-instances \ --image-id "$image_id" \ --instance-type "$instance_type" \ --subnet-id "$SUBNET_ID" \ --instance-initiated-shutdown-behavior "$SHUTDOWN_TYPE" \ "scripts/create-infrastructure.sh" 63L, 1608C written |
$rn teacher_script.txt teacher_script_1.txt
bash: rn: command not found |
$mv teacher_script.txt ./teacher_script_1.txt
mv: cannot stat 'teacher_script.txt': No such file or directory |
$mv man
mv: missing destination file operand after 'man' Try 'mv --help' for more information. |
$man mv
|
$mv teacher_script.txt
mv: missing destination file operand after 'teacher_script.txt' Try 'mv --help' for more information. |
$mv teacher_script.txt ~/teacher_script_1.txt
mv: cannot stat 'teacher_script.txt': No such file or directory |
$mv
.aws/ google-chrome-stable_current_amd64.deb .profile AWS/ .ICEauthority Public/ .bash_history .l3rc Readme.txt .bash_logout .lesshst .saws-history .bash_profile libappindicator3-1_0.4.92-4_amd64.deb .saws.log .bashrc libappindicator3-1_0.4.92-4_i386.deb .sawsrc .cache/ .lilalo/ .saws.shortcuts .config/ .local/ .ssh/ Desktop/ m1_id_rsa.pub .tatyanaDNS.txt.swp Documents/ m2_id_rsa.pub Templates/ Downloads/ .mozilla/ Videos/ .gitconfig Music/ .viminfo github.txt .nano/ V.json .gnome/ Pictures/ .gnupg/ .pki/ |
$ls -la
total 55612 drwxr-xr-x 22 user user 4096 Dec 20 11:22 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 2 user user 4096 Dec 19 14:28 .aws drwxr-xr-x 4 user user 4096 Dec 19 15:42 AWS -rw------- 1 user user 12320 Dec 20 11:21 .bash_history -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 666 Dec 19 14:41 .bashrc drwx------ 10 user user 4096 Dec 19 14:47 .cache ... -rw-r--r-- 1 user user 2899 Dec 19 15:08 .saws-history -rw-r--r-- 1 user user 4109 Dec 19 15:04 .saws.log -rw-r--r-- 1 user user 596 Dec 19 17:05 .sawsrc -rw-r--r-- 1 user user 2256 Dec 19 14:49 .saws.shortcuts drwx------ 2 user user 4096 Dec 19 11:33 .ssh -rw------- 1 user user 12288 Dec 19 11:19 .tatyanaDNS.txt.swp drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 15777 Dec 20 11:22 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$ssh m0
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 permitted by applicable law. Last login: Thu Dec 20 11:47:00 2018 from 172.20.13.187 l3-agent is already running: pid=1843; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ cd aws/scripts/ ... stop else cat <<EOF Usage: $0 start|stop EOF exit 1 fi user@instructor:~/aws/scripts$ logout Connection to m0 closed. |
$vi teacher_script.txt
|
$more teacher_script.txt
|
$mv teacher_script.txt teacher_script_1.txt
|
$cd AWS/
|
$scripts/create-infrastructure.sh start
{ "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "StateReason": { "Message": "pending", "Code": "pending" ... "Key": "Name" } ], "AmiLaunchIndex": 0 } ], "ReservationId": "r-0faf9a609a8fdf883", "Groups": [], "OwnerId": "886677986286" } |
$ssh admin@34.241.132.131
The authenticity of host '34.241.132.131 (34.241.132.131)' can't be established. ECDSA key fingerprint is SHA256:Pok7TwuUklIlsDuLawX2mZUABX+REVahnhAaCtwummA. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '34.241.132.131' (ECDSA) to the list of known hosts. Permission denied (publickey). |
$ssh admin@34.241.132.131
Permission denied (publickey). |
$ssh root@34.241.132.131
Permission denied (publickey). |
$ssh admin@34.241.132.131
Permission denied (publickey). |
$ssh-add ~/.ssh/
config id_rsa id_rsa.pub known_hosts m2_id_rsa.pub user3.pem |
$ssh-add ~/.ssh/
config id_rsa id_rsa.pub known_hosts m2_id_rsa.pub user3.pem |
$ssh-add ~/.ssh/user3.pem
Identity added: /home/user/.ssh/user3.pem (/home/user/.ssh/user3.pem) |
$ssh m2
user@m2's password: Linux m2 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: Wed Dec 19 11:25:16 2018 from 172.20.13.189 Removing stale pidfile user@m2:~$ ls -la ... user@m2:~$ mv teacher.sh AWS/scripts/ user@m2:~$ cd AWS/scripts/ user@m2:~/AWS/scripts$ ls -la total 16 drwxr-xr-x 2 user user 4096 Dec 20 12:29 . drwxr-xr-x 4 user user 4096 Dec 19 15:24 .. -rwxr-xr-x 1 user user 1727 Dec 20 12:14 scipts_infrastructure.sh -rwxr-xr-x 1 user user 1835 Dec 20 12:26 teacher.sh user@m2:~/AWS/scripts$ logout Connection to m2 closed. |
$vim install.sh
|
$ssh admin@34.241.132.131
^C |
$ssh admin@34.241.132.131
-rw-r--r-- 1 admin admin 608 Dec 20 09:37 install.txt -rw-r--r-- 1 admin admin 675 May 15 2017 .profile drwxr-xr-x 7 admin admin 4096 Dec 20 09:38 qrenco.de drwx------ 2 admin admin 4096 Dec 20 09:13 .ssh -rw------- 1 admin admin 912 Dec 20 09:37 .viminfo admin@ip-10-1-1-31:~$ .qrenco.de/ve/bin/pip install -r qrenco.de/requirements.txt -bash: .qrenco.de/ve/bin/pip: No such file or directory admin@ip-10-1-1-31:~$ qrenco.de/ve/bin/pip install -r qrenco.de/requirements.txt Collecting gevent>=1.3.0 (from -r qrenco.de/requirements.txt (line 1)) Downloading https://files.pythonhosted.org/packages/40/4f/222cefc08c1ffda69454908496e46c32f7b82da30ade4861178c6a72405e/gevent-1.3.7-cp27-cp27mu-manylinux1_x86_64.whl (4.2MB) ... total 12 drwxr-xr-x 3 root root 4096 Dec 20 09:13 . drwxr-xr-x 22 root root 4096 Dec 20 09:13 .. drwxr-xr-x 5 admin admin 4096 Dec 20 11:18 admin admin@ip-10-1-1-31:/home$ Connection to 34.241.132.131 closed by remote host. Connection to 34.241.132.131 closed. ## # Default server configuration # server { |
$ls -la | grep in
-rw-r--r-- 1 user user 52630 Apr 10 2016 libappindicator3-1_0.4.92-4_amd64.deb -rw-r--r-- 1 user user 53620 Apr 10 2016 libappindicator3-1_0.4.92-4_i386.deb -rw------- 1 user user 4084 Dec 20 12:36 .viminfo |
$ssh m0
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 permitted by applicable law. Last login: Thu Dec 20 14:06:43 2018 from 172.20.13.190 l3-agent is already running: pid=1843; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ scp aws/scripts/ aws/scripts/create-infrastructure.sh aws/scripts/install-qrencode.sh user@instructor:~$ scp aws/scripts/ aws/scripts/create-infrastructure.sh aws/scripts/install-qrencode.sh user@instructor:~$ scp aws/scripts/install-qrencode.sh m3: user@m3's password: install-qrencode.sh 100% 375 583.6KB/s 00:00 user@instructor:~$ logout Connection to m0 closed. |
$mv install-qrencode.sh AWS/scripts/
|
$ls -la AWS/scripts/
total 20 drwxr-xr-x 2 user user 4096 Dec 20 14:28 . drwxr-xr-x 4 user user 4096 Dec 20 12:36 .. -rwxr-xr-x 1 user user 1636 Dec 20 12:12 create-infrastructure.sh -rwxr-xr-x 1 user user 1480 Dec 19 17:05 create-infrastructure.sh.save -rw-r--r-- 1 user user 375 Dec 20 14:28 install-qrencode.sh |
$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'. 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-infrastructure.sh Untracked files: (use "git add <file>..." to include in what will be committed) install.sh scripts/create-infrastructure.sh.save scripts/install-qrencode.sh no changes added to commit (use "git add" and/or "git commit -a") |
$more scripts/install-qrencode.sh
|
$more scripts/install-qrencode.sh
|
$more scripts/install.sh
|
$cd scripts/
|
$ls -la
total 20 drwxr-xr-x 2 user user 4096 Dec 20 14:28 . drwxr-xr-x 4 user user 4096 Dec 20 12:36 .. -rwxr-xr-x 1 user user 1636 Dec 20 12:12 create-infrastructure.sh -rwxr-xr-x 1 user user 1480 Dec 19 17:05 create-infrastructure.sh.save -rw-r--r-- 1 user user 375 Dec 20 14:28 install-qrencode.sh |
$cd ..
|
$ls -la
total 24 drwxr-xr-x 4 user user 4096 Dec 20 12:36 . drwxr-xr-x 22 user user 4096 Dec 20 14:28 .. drwxr-xr-x 8 user user 4096 Dec 20 14:28 .git -rw-r--r-- 1 user user 88 Dec 17 16:45 hello.md -rw-r--r-- 1 user user 222 Dec 20 12:36 install.sh drwxr-xr-x 2 user user 4096 Dec 20 14:28 scripts |
$more hello.md
|
$ls -la
total 24 drwxr-xr-x 4 user user 4096 Dec 20 12:36 . drwxr-xr-x 22 user user 4096 Dec 20 14:28 .. drwxr-xr-x 8 user user 4096 Dec 20 14:28 .git -rw-r--r-- 1 user user 88 Dec 17 16:45 hello.md -rw-r--r-- 1 user user 222 Dec 20 12:36 install.sh drwxr-xr-x 2 user user 4096 Dec 20 14:28 scripts |
$more install.sh
|
$rm install.sh
|
$gid add
bash: gid: command not found |
$git add
Nothing specified, nothing added. Maybe you wanted to say 'git add .'? |
$git add -p
diff --git a/scripts/create-infrastructure.sh b/scripts/create-infrastructure.sh index e7d6cfc..94d313c 100755 --- a/scripts/create-infrastructure.sh +++ b/scripts/create-infrastructure.sh @@ -1,36 +1,49 @@ #!/bin/bash -image_id=ami-09693313102a30b2c +USER_NAME=user3 instance_type=t2.micro +image_id=ami-02fc24d56bc5f3d67 #ami-09693313102a30b2c ... stop() { ids=($( aws ec2 describe-instances \ - --query 'Reservations[*].Instances[?KeyName==`'$key_name'`].InstanceId' \ + --query 'Reservations[*].Instances[?KeyName==`'$KEY_NAME'`].InstanceId' \ --output text )) aws ec2 terminate-instances --instance-ids "${ids[@]}" Stage this hunk [y,n,q,a,d,/,s,e,?]? y |
$git add -p
No changes. |
$git commit -m 'nginx install & etc'
[master a80aaa4] nginx install & etc Committer: ValeryBarai <user@m3.class.sl> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email you@example.com After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 27 insertions(+), 14 deletions(-) |
$git config --global user.name "ValeryBarai"
|
$git commit -m 'nginx install & etc'
On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish your local commits) Untracked files: scripts/create-infrastructure.sh.save scripts/install-qrencode.sh nothing added to commit but untracked files present |
$git push
Username for 'https://github.com': BFedor2006 Password for 'https://BFedor2006@github.com': fatal: could not read Password for 'https://BFedor2006@github.com': Resource temporarily unavailable |
$git push
Username for 'https://github.com': ValeryBarai Password for 'https://ValeryBarai@github.com': Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 828 bytes | 0 bytes/s, done. Total 4 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), completed with 1 local object. To https://github.com/ValeryBarai/AWS.git 267fcbb..a80aaa4 master -> master |
$git diff
diff difftool |
$git diff
|
$ls -la scripts/
total 20 drwxr-xr-x 2 user user 4096 Dec 20 14:28 . drwxr-xr-x 4 user user 4096 Dec 20 14:30 .. -rwxr-xr-x 1 user user 1636 Dec 20 12:12 create-infrastructure.sh -rwxr-xr-x 1 user user 1480 Dec 19 17:05 create-infrastructure.sh.save -rw-r--r-- 1 user user 375 Dec 20 14:28 install-qrencode.sh |
$git commit -m 'nginx install & etc'
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: scripts/create-infrastructure.sh.save scripts/install-qrencode.sh nothing added to commit but untracked files present |
$git commit -m 'nginx install & etc'
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: scripts/create-infrastructure.sh.save scripts/install-qrencode.sh nothing added to commit but untracked files present |
$git add -p
No changes. |
$git add scripts/
|
$git commit -m 'nginx install & etc'
[master f9155c4] nginx install & etc Committer: ValeryBarai <user@m3.class.sl> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email you@example.com After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 2 files changed, 80 insertions(+) create mode 100755 scripts/create-infrastructure.sh.save create mode 100644 scripts/install-qrencode.sh |
$git push
Username for 'https://github.com': ValeryBarai Password for 'https://ValeryBarai@github.com': Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 1.23 KiB | 0 bytes/s, done. Total 5 (delta 0), reused 0 (delta 0) To https://github.com/ValeryBarai/AWS.git a80aaa4..f9155c4 master -> master |
$vi scripts/install-qrencode.sh
|
$sudo cp aws/config/qrencode.conf /etc/nginx/sites-available/default
sudo apt-get update -y sudo apt-get install -y nginx git-core qrencode python-virtualenv sudo cp config/qrencode.conf /etc/nginx/sites-available/default git clone https://github.com/chubin/qrenco.de cd qrenco.de ve/bin/pip install -r requirements.txt # sudo cp config/qrencode.conf /etc/nginx/sites-available/default # # git clone https://github.com/chubin/qrenco.de #cd qrenco.de ... #nohup ve/bin/python bin/srv.py >> log/qrencode.log 2>&1 & #udo /etc/init.d/nginx restart # sudo /etc/init.d/nginx restart git clone https://github.com/sl-2018-12/aws sudo cp aws/config/qrencode.conf /etc/nginx/sites-available/default ~ ~ ~ ~ "scripts/install-qrencode.sh" 18L, 570C written |
Время первой команды журнала | 13:51:46 2018-12-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 12:52:49 2018-12-20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 21.78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 1.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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