/l3/users/slm/2018-12-minsk-aws/student01.BigClassRoom/user :1 :2 :3 |
|
$sudo
![]() usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>] usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ... |
$ls
aws Documents Music aws2 Downloads Pictures create-infra_copy2.sh github.txt Public create-infra_copy.sh log_cons.txt Templates Desktop m0_id_rsa.pub Videos |
$ls
aws Downloads Pictures aws2 ec2.yaml Public create-infra_copy2.sh github.txt Templates create-infra_copy.sh log_cons.txt Videos Desktop m0_id_rsa.pub Documents Music |
$cd aws2
|
$ls
config hello.md README.md hello2.md log_cons.txt scripts |
$ls -l
total 24 drwxr-xr-x 2 user user 4096 Dec 20 15:13 config -rw-r--r-- 1 user user 43 Dec 17 16:46 hello2.md -rw-r--r-- 1 user user 10 Dec 17 16:22 hello.md -rw-r--r-- 1 user user 3875 Dec 20 11:13 log_cons.txt -rw-r--r-- 1 user user 6 Dec 17 16:02 README.md drwxr-xr-x 2 user user 4096 Dec 20 16:06 scripts |
$cd scripts/
|
$ls -l
total 12 -rw-r--r-- 1 user user 1711 Dec 20 12:25 create-infra.sh -rwxr-xr-x 1 user user 1833 Dec 20 16:06 create-infrastructure.sh -rw-r--r-- 1 user user 423 Dec 20 15:13 install-qrencode.sh |
$ls -l
cd |
$ls
aws Downloads Pictures aws2 ec2.yaml Public create-infra_copy2.sh github.txt Templates create-infra_copy.sh log_cons.txt Videos Desktop m0_id_rsa.pub Documents Music |
$ls -l
total 76 drwxr-xr-x 5 root root 4096 Dec 20 15:01 aws drwxr-xr-x 5 user user 4096 Dec 20 15:13 aws2 -rw-r--r-- 1 user user 1688 Dec 20 11:57 create-infra_copy2.sh -rw-r--r-- 1 user user 1162 Dec 19 16:49 create-infra_copy.sh 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:59 Downloads -rw-r--r-- 1 root root 203 Dec 20 16:26 ec2.yaml -rw-r--r-- 1 root root 9 Dec 17 15:17 github.txt -rw-r--r-- 1 user user 12892 Dec 20 16:13 log_cons.txt -rw-r--r-- 1 user user 397 Dec 19 11:12 m0_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 drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos |
$cd .aws
|
$ls
config credentials |
$cd credentials
![]() bash: cd: credentials: Not a directory |
$ls -l
total 8 -rw------- 1 user user 29 Dec 19 14:28 config -rw------- 1 user user 116 Dec 19 14:28 credentials |
$cd /credentials
![]() bash: cd: /credentials: No such file or directory |
$ls -a
. .. config credentials |
$vim credentials
|
$cd
|
$cd
|
$cd aws2
|
$cd scripts/
|
$ls
create-infra.sh install-qrencode.sh create-infrastructure.sh |
$ls
config scripts |
$cd config
|
$ls
qrencode.conf |
$cd ..
|
$cd scripts
|
$ls
create-infrastructure.sh install-qrencode.sh |
$sudo apt-get install doker
![]() [sudo] password for user: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package doker |
$sudo apt-get install doker
![]() Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package doker |
$sudo apt-get install docker
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: docker 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 12.8 kB of archives. After this operation, 42.0 kB of additional disk space will be used. Get:1 http://ftp.by.debian.org/debian stretch/main amd64 docker amd64 1.5-1+b1 [12.8 kB] Fetched 12.8 kB in 0s (0 B/s) Selecting previously unselected package docker. (Reading database ... 137706 files and directories currently installed.) Preparing to unpack .../docker_1.5-1+b1_amd64.deb ... Unpacking docker (1.5-1+b1) ... Processing triggers for man-db (2.7.6.1-2) ... Setting up docker (1.5-1+b1) ... |
$curl -fsSL https://get.docker.com -o get-docker.sh
![]() curl: (23) Failed writing body (0 != 13380) |
$cd
|
$curl -fsSL https://get.docker.com -o get-docker.sh
|
$sudo chown -R user:user ~user/
|
$user@instructor:~$ curl -fsSL https://get.docker.com -o get-docker.sh
![]() bash: user@instructor:~$: command not found |
$user@instructor:~$ sudo sh get-docker.sh
![]() bash: user@instructor:~$: command not found |
$sudo sh get-docker.sh
# Executing docker install script, commit: 4957679 + sh -c apt-get update -qq >/dev/null + sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null + sh -c curl -fsSL "https://download.docker.com/linux/debian/gpg" | apt-key add -qq - >/dev/null Warning: apt-key output should not be parsed (stdout is not a terminal) + sh -c echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch edge" > /etc/apt/sources.list.d/docker.list + sh -c apt-get update -qq >/dev/null + sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null + sh -c docker version Client: ... Experimental: false If you would like to use Docker as a non-root user, you should now consider adding your user to the "docker" group with something like: sudo usermod -aG docker your-user Remember that you will have to log out and back in for this to take effect! WARNING: Adding a user to the "docker" group will grant the ability to run containers which can be used to obtain root privileges on the docker host. Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface for more information. |
$^C
![]() |
$sudo usermod -aG docker user
|
$sudo docker pull busybox
[sudo] password for user: Using default tag: latest latest: Pulling from library/busybox 90e01955edcd: Pull complete Digest: sha256:2a03a6059f21e150ae84b0973863609494aad70f0a80eaeb64bddd8d92465812 Status: Downloaded newer image for busybox:latest |
$docker images
![]() Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/json: dial unix /var/run/docker.sock: connect: permission denied |
$docker images
![]() Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/json: dial unix /var/run/docker.sock: connect: permission denied |
$sudo docker images
[sudo] password for user: REPOSITORY TAG IMAGE ID CREATED SIZE busybox latest 59788edf1f3e 2 months ago 1.15MB |
$sudo docker run -it busybox
/ # ls bin dev etc home proc root sys tmp usr var / # ls -l total 36 drwxr-xr-x 2 root root 12288 Oct 1 22:37 bin drwxr-xr-x 5 root root 360 Dec 21 08:22 dev drwxr-xr-x 1 root root 4096 Dec 21 08:22 etc drwxr-xr-x 2 nobody nogroup 4096 Oct 1 22:37 home dr-xr-xr-x 176 root root 0 Dec 21 08:22 proc drwx------ 1 root root 4096 Dec 21 08:25 root ... drwxr-xr-x 5 root root 360 Dec 21 08:22 dev drwxr-xr-x 1 root root 4096 Dec 21 08:22 etc drwxr-xr-x 2 nobody nogroup 4096 Oct 1 22:37 home dr-xr-xr-x 177 root root 0 Dec 21 08:22 proc drwx------ 1 root root 4096 Dec 21 08:25 root dr-xr-xr-x 13 root root 0 Dec 21 08:22 sys drwxrwxrwt 2 root root 4096 Oct 1 22:37 tmp drwxr-xr-x 3 root root 4096 Oct 1 22:37 usr drwxr-xr-x 4 root root 4096 Oct 1 22:37 var / # exit |
$docker ps
![]() Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/json: dial unix /var/run/docker.sock: connect: permission denied |
$sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
$sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES eb17480e18e6 busybox "sh" 10 minutes ago Exited (0) 31 seconds ago modest_albattani |
$sudo docker pull debian:8
[sudo] password for user: 8: Pulling from library/debian 4b105072aa89: Pull complete Digest: sha256:14e15b63bf3c26dac4f6e782dbb4c9877fb88d7d5978d202cb64065b1e01a88b Status: Downloaded newer image for debian:8 |
$ssh m1
The authenticity of host 'm1 (127.0.1.1)' 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' (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 ... config scripts user@m1:~/aws$ cd /aws2 user@m1:/aws2$ ls qrencode.conf user@m1:/aws2$ ls -l total 4 -rw-r--r-- 1 root root 805 Dec 20 15:12 qrencode.conf user@m1:/aws2$ exit logout Connection to m1 closed. |
$cd aws2
|
$ls
config docker hello2.md hello.md log_cons.txt README.md scripts |
$sudo git add docker/
[sudo] password for user: |
$sudo git commit - m 'new folder' docker
![]() error: pathspec '-' did not match any file(s) known to git. error: pathspec 'm' did not match any file(s) known to git. error: pathspec 'new folder' did not match any file(s) known to git. |
$sudo git commit -m 'new folder' docker
[master 8b8ca64] new folder 1 file changed, 16 insertions(+) create mode 100644 docker/qrencode/dockerfile |
$sudo git push
![]() Username for 'https://github.com': kfilonov Password for 'https://kfilonov@github.com': To https://github.com/kfilonov/aws2 ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/kfilonov/aws2' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. |
$sudo git pull
# the commit. Merge made by the 'recursive' strategy. log_cons.txt | 151 ------------------------------------------------------------------------------------------- 1 file changed, 151 deletions(-) delete mode 100644 log_cons.txt |
$sudo git status
On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits) 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 no changes added to commit (use "git add" and/or "git commit -a") |
$sudo git add scripts/create-infrastructure.sh
|
$history
1 scp .ssh/id_rsa.pub m3:~/m1_id_rsa.pub 2 ls .ssh/ 3 ls .ssh/ 4 ls .ssh/ 5 ls .ssh/ 6 ls .ssh/ 7 ls 8 ls 9 ls .ssh/ 10 ls ... 490 sudo git push 491 sudo git pull 492 sudo git status 493 sudo git add scripts/create-infrastructure.sh 494 sudo git commit -m 'new changes' scripts/create-infrastructure.sh 495 sudo git push 496 sudo git status 497 exit 498 ssh m0 499 history |
Время первой команды журнала | 14:06:38 2018-12-20 | ||||||||||||||||||||||||||||||||||
Время последней команды журнала | 15:05:03 2018-12-21 | ||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 67 | ||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 16.42 | ||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 2.99 | ||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.92 | ||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.38 | ||||||||||||||||||||||||||||||||||
Частота использования команд |
|