/l3/users/slm/2018-12-minsk-aws/student06.BigClassRoom/user :1 :2 :3 :4 :5 :6 :7 |
|
$~
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 |
$vi scripts/create_infrustructure.sh
|
$mv s
scripts/ start_log |
$mv s
scripts/ start_log |
$mv start_log ~/
|
$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 12:39 scripts |
$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 no changes added to commit (use "git add" and/or "git commit -a") |
$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), 1.34 KiB | 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/DmitrySnitko/aws 3552fde..f8e0dcf master -> master |
$man scp
|
$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 12:39 scripts |
$cd ~
|
$ll
total 72 drwxr-xr-x 4 user user 4096 Dec 20 12:39 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 -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log 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 |
$man scp
|
$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:04:42 2018 from 172.20.13.186 l3-agent is already running: pid=1843; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ ll -bash: ll: command not found user@instructor:~$ ls 1.json Desktop github.txt Pictures qrencode.conf aws Documents m0_id_rsa.pub Public Templates credentials.csv Downloads Music q- Videos user@instructor:~$ exit logout Connection to m0 closed. |
$scp m0 qrencode.conf
cp: cannot stat 'm0': No such file or directory |
$scp user@m0 qrencode.conf
cp: cannot stat 'user@m0': No such file or directory |
$man scp
|
$scp user@m0:qrencode.conf
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2 |
$scp m0:qrencode.conf
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2 |
$man scp
|
$scp -C m0:qrencode.conf
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2 |
$scp m0:qrencode.conf ~/
user@m0's password: qrencode.conf 100% 766 1.4MB/s 00:00 |
$ll
total 76 drwxr-xr-x 4 user user 4096 Dec 20 12:39 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-r--r-- 1 user user 766 Dec 20 14:11 qrencode.conf -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 -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log 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 |
$ll
total 80 drwxr-xr-x 4 user user 4096 Dec 20 12:39 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-r--r-- 1 user user 766 Dec 20 14:11 qrencode.conf -rw-r--r-- 1 user user 805 Dec 20 14:29 qrencode_V2.conf -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 -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log 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 |
$cat qrencode_V2.conf
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; ... proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } } |
$cat qrencode.conf
server { listen [::]:80; access_log /var/log/nginx/access.log main; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } } |
$rm qrencode.conf
|
$mv qrencode_V2.conf qrencode.conf
|
$ll
total 76 drwxr-xr-x 4 user user 4096 Dec 20 12:39 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-r--r-- 1 user user 805 Dec 20 14:29 qrencode.conf -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 -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log 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 |
$ssh admin@ec2-34-245-158-109.eu-west-1.compute.amazonaws.com
&dmin@ip-10-3-1-61:~$ nohup ve/bin/python bin/srv.py >> ~/log/qrencode.log 2>&1 & [1] 11249 admin@ip-10-3-1-61:~$ sudo etc/init.d/nginx restart sudo: etc/init.d/nginx: command not found [1]+ Exit 127 nohup ve/bin/python bin/srv.py >> ~/log/qrencode.log 2>&1 admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ curl http://127.0.0.1/test <html> ... ~ ~ ~ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ exit logout Connection to ec2-34-245-158-109.eu-west-1.compute.amazonaws.com 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 14:28:25 2018 from 172.20.13.186 l3-agent is already running: pid=1843; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ ll ... git clone https://github.com/chubin/qrenco.de cd qrenco.de virtualenv ve/ ve/bin/pip install -r requirements.txt mkdir -p log/ nohup ve/bin/python bin/srv.py >> log/qrencode.log 2>&1 & sudo /etc/init.d/nginx restart user@instructor:~$ exit logout Connection to m0 closed. |
$ll
total 76 drwxr-xr-x 4 user user 4096 Dec 20 12:39 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-r--r-- 1 user user 805 Dec 20 14:29 qrencode.conf -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 -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log 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 |
$cat qrencode.conf
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; ... proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } } |
$ll
total 76 drwxr-xr-x 4 user user 4096 Dec 20 12:39 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-r--r-- 1 user user 805 Dec 20 14:29 qrencode.conf -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 -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log 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 |
$mv qrencode.conf aws/
|
$ll aws/
total 16 -rw-r--r-- 1 user user 112 Dec 17 16:45 Hello_world.md -rw-r--r-- 1 user user 805 Dec 20 14:29 qrencode.conf -rw-r--r-- 1 user user 33 Dec 17 16:01 README.md drwxr-xr-x 2 user user 4096 Dec 20 12:39 scripts |
$mv aws/qrencode.conf aws/scripts/
|
$ll aws/scripts/
total 8 -rwxr-xr-x 1 user user 2114 Dec 20 12:39 create_infrustructure.sh -rw-r--r-- 1 user user 805 Dec 20 14:29 qrencode.conf |
$ll aws/
total 16 drwxr-xr-x 2 user user 4096 Dec 20 14:41 config -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 14:41 scripts |
$cd aws/
|
$ll config/
total 4 -rw-r--r-- 1 user user 805 Dec 20 14:41 qrencode.conf |
$cat config/qrencode.conf
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; ... proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } } |
$cat scripts/
create_infrustructure.sh qrencode.conf install.sh |
$cat scripts/qrencode.conf
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; ... proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } } |
$rm scripts/qrencode.conf
|
$ll scripts/
total 8 -rwxr-xr-x 1 user user 2114 Dec 20 12:39 create_infrustructure.sh -rw-r--r-- 1 user user 371 Dec 20 14:41 install.sh |
$ll
total 16 drwxr-xr-x 2 user user 4096 Dec 20 14:41 config -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 14:42 scripts |
$cat scripts/install.sh
sudo apt-get update sudo apt-get install -y nginx git-core qrencode python-virtualenv git clone https://github.com/chubin/qrenco.de cd qrenco.de virtualenv ve/ ve/bin/pip install -r requirements.txt sudo cp config/qrencode.conf /etc/nginx/sites-available/default mkdir -p ~/log/ nohup ve/bin/python bin/srv.py >> ~/log/qrencode.log 2>&1 & sudo etc/init.d/nginx restart |
$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) config/ scripts/install.sh nothing added to commit but untracked files present (use "git add" to track) |
$git add scripts/install.sh
|
$git add config/
|
$git commit -m 'Added scripts and config for QRencode'
[master 79a6a40] Added scripts and config for QRencode 2 files changed, 40 insertions(+) create mode 100644 config/qrencode.conf create mode 100644 scripts/install.sh |
$git push
Username for 'https://github.com': DmitrySnitko Password for 'https://DmitrySnitko@github.com': Counting objects: 6, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (6/6), 1.03 KiB | 0 bytes/s, done. Total 6 (delta 0), reused 0 (delta 0) To https://github.com/DmitrySnitko/aws f8e0dcf..79a6a40 master -> master |
$cd ~
|
$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 11:31:40 2018 from 81.25.35.90 admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ ... admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ admin@ip-10-3-1-61:~$ Connection to ec2-34-245-158-109.eu-west-1.compute.amazonaws.com closed by remote host. Connection to ec2-34-245-158-109.eu-west-1.compute.amazonaws.com closed. |
$ll
total 72 drwxr-xr-x 5 user user 4096 Dec 20 14:41 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 -rw-r--r-- 1 user user 10979 Dec 20 12:24 start_log 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 |
$cd aws/
|
$ll
total 16 drwxr-xr-x 2 user user 4096 Dec 20 14:41 config -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 14:43 scripts |
$vi scripts/
|
$vi scripts/install.sh
|
$ll
total 16 drwxr-xr-x 2 user user 4096 Dec 20 14:41 config -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 14:58 scripts |
$vi scripts/
|
$vi scripts/create_infrustructure.sh
|
$scr
screen screendump script scriptreplay scrollkeeper-config scrollkeeper-extract scrollkeeper-gen-seriesid scrollkeeper-get-cl 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 |
$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 |
$script
script scriptreplay |
$script
script scriptreplay |
$ll
total 16 drwxr-xr-x 2 user user 4096 Dec 20 14:41 config -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 15:07 scripts |
$scripts/create_infrustructure.sh stop
{ "TerminatingInstances": [ { "InstanceId": "i-0e56250ab6d290dbc", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { "Code": 16, "Name": "running" } } ] } |
$scripts/create_infrustructure.sh start
An error occurred (InvalidIPAddress.InUse) when calling the RunInstances operation: Address 10.3.1.61 is in use. i-00bd4454bf75b5769 i-01fdcf52b7928288c i-0e56250ab6d290dbc ec2-34-241-132-131.eu-west-1.compute.amazonaws.com |
$cd ~
|
$vi scripts/create_infrustructure.sh
|
$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 15:35:06 2018 from 172.20.13.186 l3-agent is already running: pid=1843; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ ... Usage: $0 start|stop EOF exit 1 fi user@instructor:~$ xit -bash: xit: command not found user@instructor:~$ exit logout Connection to m0 closed. |
$vi scripts/install.sh
|
$~
|
$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 modified: scripts/install.sh no changes added to commit (use "git add" and/or "git commit -a") |
$vi scripts/install.sh
|
$~
|
$vi scripts/create_infrustructure.sh
|
$git commit -m 'Scripts correction'
On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: modified: scripts/create_infrustructure.sh modified: scripts/install.sh no changes added to commit |
$git a
add am annotate apply archive |
$git add scripts/
|
$git commit -m 'Scripts correction'
[master 90f1013] Scripts correction 2 files changed, 28 insertions(+), 7 deletions(-) |
$git push
Username for 'https://github.com': DmitrySnitko Password for 'https://DmitrySnitko@github.com': Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 838 bytes | 0 bytes/s, done. Total 5 (delta 3), reused 0 (delta 0) remote: Resolving deltas: 100% (3/3), completed with 3 local objects. To https://github.com/DmitrySnitko/aws 79a6a40..90f1013 master -> master |
$scr
screen screendump script scriptreplay scrollkeeper-config scrollkeeper-extract scrollkeeper-gen-seriesid scrollkeeper-get-cl 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 |
$~/aws/scripts/create_infrustructure.sh
/home/user/aws/scripts/create_infrustructure.sh: line 13: initial_command: command not found #!/bin/sh curl https://raw.githubusercontent.com/DmitrySnitko/AWS/master/scripts/install.sh | su -c 'bash -s' admin Usage: /home/user/aws/scripts/create_infrustructure.sh start|stop |
$~/aws/scripts/create_infrustructure.sh start
/home/user/aws/scripts/create_infrustructure.sh: line 13: initial_command: command not found #!/bin/sh curl https://raw.githubusercontent.com/DmitrySnitko/AWS/master/scripts/install.sh | su -c 'bash -s' admin /home/user/aws/scripts/create_infrustructure.sh: line 69: initial_command: command not found An error occurred (Blocked) when calling the RunInstances operation: This account is currently blocked and not recognized as a valid account. Please contact aws-verification@amazon.com if you have questions. null |
$vi ~/aws/scripts/create_infrustructure.sh
|
$git add scripts/
|
$cd
|
$cat aws/scripts/install.sh
DIR="$HOME/qrencode" mkdir -p "$DIR" cd "$DIR" sudo apt-get update sudo apt-get install -y nginx git-core qrencode python-virtualenv git clone https://github.com/chubin/qrenco.de cd qrenco.de virtualenv ve/ ve/bin/pip install -r requirements.txt #sudo cp config/qrencode.conf /etc/nginx/sites-available/default sudo curl https://raw.githubusercontent.com/DmitrySnitko/AWS/master/config/qrencode.conf > /etc/nginx/sites-available/default/grencode.conf mkdir -p ~/log/ nohup ve/bin/python bin/srv.py >> ~/log/qrencode.log 2>&1 & sudo /etc/init.d/nginx restart |
$aw
awk aws_bash_completer aws_completer aws/ aws.cmd aws_zsh_completer.sh |
$aw
awk aws_bash_completer aws_completer aws/ aws.cmd aws_zsh_completer.sh |
$aws/scripts/create_infrustructure.sh start
An error occurred (Blocked) when calling the RunInstances operation: This account is currently blocked and not recognized as a valid account. Please contact aws-verification@amazon.com if you have questions. null |
$aws/scripts/create_infrustructure.sh start
An error occurred (Blocked) when calling the RunInstances operation: This account is currently blocked and not recognized as a valid account. Please contact aws-verification@amazon.com if you have questions. null |
$git add aws/scripts/install.sh
fatal: Not a git repository (or any of the parent directories): .git |
$git add aws/scripts/
fatal: Not a git repository (or any of the parent directories): .git |
$cd aws/
|
DIR="$HOME/qrencode" mkdir -p "$DIR" cd "$DIR" sudo apt-get update sudo apt-get install -y nginx git-core qrencode python-virtualenv git clone https://github.com/chubin/qrenco.de cd qrenco.de virtualenv ve/ ve/bin/pip install -r requirements.txt #sudo cp config/qrencode.conf /etc/nginx/sites-available/default sudo curl https://raw.githubusercontent.com/DmitrySnitko/AWS/master/config/qrencode.conf > /etc/nginx/sites-available/default/grencode.conf mkdir -p ~/log/ nohup ve/bin/python bin/srv.py >> ~/log/qrencode.log 2>&1 & sudo /etc/init.d/nginx restart
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } }
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } }
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } }
create_infrustructure.sh qrencode.conf install.sh
sudo apt-get update sudo apt-get install -y nginx git-core qrencode python-virtualenv git clone https://github.com/chubin/qrenco.de cd qrenco.de virtualenv ve/ ve/bin/pip install -r requirements.txt sudo cp config/qrencode.conf /etc/nginx/sites-available/default mkdir -p ~/log/ nohup ve/bin/python bin/srv.py >> ~/log/qrencode.log 2>&1 & sudo etc/init.d/nginx restart
server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { proxy_pass http://127.0.0.1:8003; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; expires off; } }
Время первой команды журнала | 10:38:31 2018-12-20 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 14:26:14 2018-12-20 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 9.90 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.38 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.71 | |||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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