/l3/users/slm/2018-12-minsk-aws/student03.BigClassRoom/user :1 :2 :3 :4 :5 :6 :7 |
|
$https://raw.githubusercontent.com/ValeryBarai/AWS/master/scripts/install-qrencode.sh
bash: https://raw.githubusercontent.com/ValeryBarai/AWS/master/scripts/install-qrencode.sh: No such file or directory |
$git add -p
diff --git a/scripts/initial-command.sh b/scripts/initial-command.sh index c039d40..b085b09 100755 --- a/scripts/initial-command.sh +++ b/scripts/initial-command.sh @@ -1,3 +1,3 @@ #!/bin/sh -curl https://raw.githubusercontent.com/sl-2018-12/aws/master/scripts/install-qrencode.sh | bash -s +curl https://raw.githubusercontent.com/ValeryBarai/AWS/master/scripts/install-qrencode.sh | bash -s Stage this hunk [y,n,q,a,d,/,e,?]? y |
$git commit -m 'with correct link'
[master 0423fce] with correct link 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, 1 insertion(+), 1 deletion(-) |
$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), 520 bytes | 0 bytes/s, done. Total 4 (delta 0), reused 0 (delta 0) To https://github.com/ValeryBarai/AWS.git 4ac7d1a..0423fce master -> master |
$git diff
|
$scripts/create-infrastructure.sh start
{ "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": "", "StateReason": { "Message": "pending", "Code": "pending" ... "Key": "Name" } ], "AmiLaunchIndex": 0 } ], "ReservationId": "r-041992238c05edf61", "Groups": [], "OwnerId": "886677986286" } |
$ls -la
total 55628 drwxr-xr-x 22 user user 4096 Dec 21 10:14 . 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 20 15:46 AWS -rw------- 1 user user 13217 Dec 20 17:16 .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 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 -rw-r--r-- 1 user user 1796 Dec 20 11:48 teacher_script_1.txt 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 13672 Dec 20 17:16 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$ls -la | grep cre
|
$cd Downloads/
|
$ls -la | grep cre
|
$scr
screen scrollkeeper-gen-seriesid scrollkeeper-get-toc-from-id screendump scrollkeeper-get-cl scrollkeeper-install script scrollkeeper-get-content-list scrollkeeper-preinstall scriptreplay scrollkeeper-get-extended-content-list scrollkeeper-rebuilddb scrollkeeper-config scrollkeeper-get-index-from-docpath scrollkeeper-uninstall scrollkeeper-extract scrollkeeper-get-toc-from-docpath scrollkeeper-update |
$./scripts/
create-infrastructure.sh initial-command.sh install-qrencode.sh |
$./scripts/
create-infrastructure.sh initial-command.sh install-qrencode.sh |
$./scripts/create-infrastructure.sh
Usage: ./scripts/create-infrastructure.sh start|stop |
$./scripts/create-infrastructure.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. |
$cd..
bash: cd..: command not found |
$cd ..
|
$find cread* ./
find: ‘cread*’: No such file or directory ./ ./.l3rc ./.lesshst ./Desktop ./.sawsrc ./m2_id_rsa.pub ./.bash_history ./Pictures ./libappindicator3-1_0.4.92-4_i386.deb ... ./AWS/.git/logs/refs/heads ./AWS/.git/logs/refs/heads/master ./AWS/.git/logs/refs/remotes ./AWS/.git/logs/refs/remotes/origin ./AWS/.git/logs/refs/remotes/origin/master ./AWS/.git/info ./AWS/.git/info/exclude ./Music ./.saws-history ./.tatyanaDNS.txt.swp |
$find *cread* ./
find: ‘*cread*’: No such file or directory ./ ./.l3rc ./.lesshst ./Desktop ./.sawsrc ./m2_id_rsa.pub ./.bash_history ./Pictures ./libappindicator3-1_0.4.92-4_i386.deb ... ./AWS/.git/logs/refs/heads ./AWS/.git/logs/refs/heads/master ./AWS/.git/logs/refs/remotes ./AWS/.git/logs/refs/remotes/origin ./AWS/.git/logs/refs/remotes/origin/master ./AWS/.git/info ./AWS/.git/info/exclude ./Music ./.saws-history ./.tatyanaDNS.txt.swp |
$cd .ssh/
|
$ls -la
total 32 drwx------ 2 user user 4096 Dec 19 11:33 . drwxr-xr-x 22 user user 4096 Dec 21 10:22 .. -rw-r--r-- 1 user user 168 Dec 19 11:33 config -rw------- 1 user user 1766 Dec 19 10:45 id_rsa -rw-r--r-- 1 user user 389 Dec 19 10:45 id_rsa.pub -rw-r--r-- 1 user user 3330 Dec 20 12:17 known_hosts -rw-r--r-- 1 user user 389 Dec 19 11:01 m2_id_rsa.pub -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
$more config
|
$more id_rsa
|
$more id_rsa.pub
|
$more known_hosts
|
$ls -la
total 32 drwx------ 2 user user 4096 Dec 19 11:33 . drwxr-xr-x 22 user user 4096 Dec 21 10:22 .. -rw-r--r-- 1 user user 168 Dec 19 11:33 config -rw------- 1 user user 1766 Dec 19 10:45 id_rsa -rw-r--r-- 1 user user 389 Dec 19 10:45 id_rsa.pub -rw-r--r-- 1 user user 3330 Dec 20 12:17 known_hosts -rw-r--r-- 1 user user 389 Dec 19 11:01 m2_id_rsa.pub -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
$more user3.pem
|
$find ./ -name credenti*
|
$cd ..
|
$find ./ -name credenti*
./.local/lib/python2.7/site-packages/botocore/credentials.pyc ./.local/lib/python2.7/site-packages/botocore/credentials.py ./.aws/credentials |
$cd ./.aws/
|
$ls -la c
ls: cannot access 'c': No such file or directory |
$ls -la ./credentials
-rw------- 1 user user 116 Dec 19 14:28 ./credentials |
$ls -la
total 16 drwxr-xr-x 2 user user 4096 Dec 19 14:28 . drwxr-xr-x 22 user user 4096 Dec 21 10:22 .. -rw------- 1 user user 29 Dec 19 14:28 config -rw------- 1 user user 116 Dec 19 14:28 credentials |
$more credentials
|
$more config
|
$su -s
su: option requires an argument -- 's' Usage: su [options] [LOGIN] Options: -c, --command COMMAND pass COMMAND to the invoked shell -h, --help display this help message and exit -, -l, --login make the shell a login shell -m, -p, --preserve-environment do not reset environment variables, and keep the same shell -s, --shell SHELL use SHELL instead of the default in passwd |
$su -
Password: Removing stale pidfile root@m3:~# cat credentials.csv | tr , '\n' user3 nXcLgqp@w{=v AKIAICURZPV5ZJ3CXGDA r8qVLcjn01LIb6/4e0RJd0ZAWbFmVgaQz2ubgl32 https://chubin.signin.aws.amazon.com/console root@m3:~# logout |
$touch credentials_root.txt
|
$vi credentials_root.txt
|
$ls -la
total 20 drwxr-xr-x 2 user user 4096 Dec 21 10:33 . drwxr-xr-x 22 user user 4096 Dec 21 10:33 .. -rw------- 1 user user 29 Dec 19 14:28 config -rw------- 1 user user 116 Dec 19 14:28 credentials -rw-r--r-- 1 user user 127 Dec 21 10:33 credentials_root.txt |
$vm credentials_root.txt cr.txt
bash: vm: command not found |
$sudo apt-get install docker
[sudo] password for user: 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 ... 137794 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) ... |
$sudo apt-get remove docker
Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: docker 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 42.0 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 137801 files and directories currently installed.) Removing docker (1.5-1+b1) ... Processing triggers for man-db (2.7.6.1-2) ... |
$curl -fsSL https://get.docker.com -o get-docker.sh
|
$sh get-docker.sh
# Executing docker install script, commit: 4957679 + sudo -E sh -c apt-get update -qq >/dev/null + sudo -E sh -c apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null + sudo -E 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) + sudo -E sh -c echo "deb [arch=amd64] https://download.docker.com/linux/debian stretch edge" > /etc/apt/sources.list.d/docker.list + sudo -E sh -c apt-get update -qq >/dev/null + sudo -E sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null + sudo -E 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 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. |
$ls -la
total 55628 drwxr-xr-x 22 user user 4096 Dec 21 10:33 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 2 user user 4096 Dec 21 10:42 .aws drwxr-xr-x 4 user user 4096 Dec 20 15:46 AWS -rw------- 1 user user 13199 Dec 21 10:22 .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 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 -rw-r--r-- 1 user user 1796 Dec 20 11:48 teacher_script_1.txt 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 14049 Dec 21 10:33 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$cd .aws/
|
$ls -la
total 36 drwxr-xr-x 2 user user 4096 Dec 21 10:42 . drwxr-xr-x 22 user user 4096 Dec 21 10:33 .. -rw------- 1 user user 29 Dec 19 14:28 config -rw------- 1 user user 116 Dec 19 14:28 credentials -rw-r--r-- 1 user user 127 Dec 21 10:33 cr.txt -rw-r--r-- 1 user user 13380 Dec 21 10:42 get-docker.sh |
$more get-docker.sh
|
$docker ps -a
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?all=1: dial unix /var/run/docker.sock: connect: permission denied |
$docker
attach cp export import login pause push run stack system update build create help info logout plugin rename save start tag version commit diff history inspect logs port restart search stats top volume config events image kill network ps rm secret stop trust wait container exec images load node pull rmi service swarm unpause |
$docker -help
unknown shorthand flag: 'e' in -elp See 'docker --help'. Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: --config string Location of client config files (default "/home/user/.docker") -D, --debug Enable debug mode -H, --host list Daemon socket(s) to connect to -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info") --tls Use TLS; implied by --tlsverify ... start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes Run 'docker COMMAND --help' for more information on a command. |
$docker --help
Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: --config string Location of client config files (default "/home/user/.docker") -D, --debug Enable debug mode -H, --host list Daemon socket(s) to connect to -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info") --tls Use TLS; implied by --tlsverify --tlscacert string Trust certs signed only by this CA (default "/home/user/.docker/ca.pem") --tlscert string Path to TLS certificate file (default "/home/user/.docker/cert.pem") ... start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes Run 'docker COMMAND --help' for more information on a command. |
$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 image
Usage: docker image COMMAND Manage images Commands: build Build an image from a Dockerfile history Show the history of an image import Import the contents from a tarball to create a filesystem image inspect Display detailed information on one or more images load Load an image from a tar archive or STDIN ls List images prune Remove unused images pull Pull an image or a repository from a registry push Push an image or a repository to a registry rm Remove one or more images save Save one or more images to a tar archive (streamed to STDOUT by default) tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE Run 'docker image COMMAND --help' for more information on a command. |
$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
REPOSITORY TAG IMAGE ID CREATED SIZE busybox latest 59788edf1f3e 2 months ago 1.15MB |
$docker pull busybox
Using default tag: latest Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=busybox&tag=latest: dial unix /var/run/docker.sock: connect: permission denied |
$sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE busybox latest 59788edf1f3e 2 months ago 1.15MB |
$docker run -it busybox sh
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/create: dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'. |
$sudo docker ps -a
[sudo] password for user: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bbda36ce2f54 busybox "sh" 13 minutes ago Up 13 minutes flamboyant_brahmagupta |
$docker ps -a
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?all=1: dial unix /var/run/docker.sock: connect: permission denied |
$sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bbda36ce2f54 busybox "sh" 20 minutes ago Up 20 minutes flamboyant_brahmagupta |
$sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES bbda36ce2f54 busybox "sh" 20 minutes ago Exited (0) 3 seconds ago flamboyant_brahmagupta |
$docker pull ubuntu
Using default tag: latest Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=ubuntu&tag=latest: dial unix /var/run/docker.sock: connect: permission denied |
$docker run -it busybox
/ # exit |
$docker -ps -a
unknown shorthand flag: 'p' in -ps See 'docker --help'. Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: --config string Location of client config files (default "/home/user/.docker") -D, --debug Enable debug mode -H, --host list Daemon socket(s) to connect to -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info") --tls Use TLS; implied by --tlsverify ... start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes Run 'docker COMMAND --help' for more information on a command. |
$docker -ps
unknown shorthand flag: 'p' in -ps See 'docker --help'. Usage: docker [OPTIONS] COMMAND A self-sufficient runtime for containers Options: --config string Location of client config files (default "/home/user/.docker") -D, --debug Enable debug mode -H, --host list Daemon socket(s) to connect to -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info") --tls Use TLS; implied by --tlsverify ... start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes Run 'docker COMMAND --help' for more information on a command. |
$docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e30204d64d80 ubuntu "/bin/bash" 2 minutes ago Up 2 minutes hungry_clarke 50e5339dedc8 busybox "sh" 3 minutes ago Exited (0) 2 minutes ago peaceful_yalow 1fa495435b68 busybox "sh" 8 minutes ago Exited (0) 8 minutes ago gallant_fermat bbda36ce2f54 busybox "sh" About an hour ago Exited (0) 41 minutes ago flamboyant_brahmagupta |
$docker run -it debian
Unable to find image 'debian:latest' locally latest: Pulling from library/debian 54f7e8ac135a: Pull complete Digest: sha256:df6ebd5e9c87d0d7381360209f3a05c62981b5c2a3ec94228da4082ba07c4f05 Status: Downloaded newer image for debian:latest root@f9084a5c60c4:/# bash |
$docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES f9084a5c60c4 debian "bash" 2 minutes ago Up 2 minutes admiring_tu |
$docker attach admiring_tu
root@f9084a5c60c4:/# exit exit root@f9084a5c60c4:/# mkdir /tmp/myvolume root@f9084a5c60c4:/# docker run -it -v /tmp/myvolume/:/myvolume debiash bush bash: docker: command not found root@f9084a5c60c4:/# docker run -it -v /tmp/myvolume/:/myvolume debiash bush bash: docker: command not found root@f9084a5c60c4:/# exit exit |
$docker run -it -v /tmp/myvolume/:/myvolume debiash bush
Unable to find image 'debiash:latest' locally docker: Error response from daemon: pull access denied for debiash, repository does not exist or may require 'docker login'. See 'docker run --help'. |
$docker run -it -v /tmp/myvolume/:/myvolume debian bush
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"bush\": executable file not found in $PATH": unknown. |
$docker run -it -v /tmp/myvolume:/myvolume debian bush
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"bush\": executable file not found in $PATH": unknown. |
$mkdir /tmp/myvolume
mkdir: cannot create directory ‘/tmp/myvolume’: File exists |
$docker run -it -v /tmp/myvolume:/myvolume debian bash
root@874cb08a6372:/# ls -la total 76 drwxr-xr-x 1 root root 4096 Dec 21 09:34 . drwxr-xr-x 1 root root 4096 Dec 21 09:34 .. -rwxr-xr-x 1 root root 0 Dec 21 09:34 .dockerenv drwxr-xr-x 2 root root 4096 Nov 12 00:00 bin drwxr-xr-x 2 root root 4096 Oct 20 10:40 boot drwxr-xr-x 5 root root 360 Dec 21 09:34 dev drwxr-xr-x 1 root root 4096 Dec 21 09:34 etc drwxr-xr-x 2 root root 4096 Oct 20 10:40 home ... drwx------ 2 root root 4096 Nov 12 00:00 root drwxr-xr-x 3 root root 4096 Nov 12 00:00 run drwxr-xr-x 2 root root 4096 Nov 12 00:00 sbin drwxr-xr-x 2 root root 4096 Nov 12 00:00 srv dr-xr-xr-x 13 root root 0 Dec 21 09:34 sys drwxrwxrwt 2 root root 4096 Nov 12 00:00 tmp drwxr-xr-x 10 root root 4096 Nov 12 00:00 usr drwxr-xr-x 11 root root 4096 Nov 12 00:00 var root@874cb08a6372:/# exit exit |
$docker volume create myvol
myvol |
$docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
$docker volume inspect myvol
[ { "CreatedAt": "2018-12-21T12:36:53+03:00", "Driver": "local", "Labels": {}, "Mountpoint": "/var/lib/docker/volumes/myvol/_data", "Name": "myvol", "Options": {}, "Scope": "local" } ] |
$docker run -it -v myvol:/myvolume debian bush
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"bush\": executable file not found in $PATH": unknown. |
$docker run -it -v myvol:/myvolume debian bash
root@7db4ef82b17e:/# root@7db4ef82b17e:/# root@7db4ef82b17e:/# ls -la total 76 drwxr-xr-x 1 root root 4096 Dec 21 09:37 . drwxr-xr-x 1 root root 4096 Dec 21 09:37 .. -rwxr-xr-x 1 root root 0 Dec 21 09:37 .dockerenv drwxr-xr-x 2 root root 4096 Nov 12 00:00 bin drwxr-xr-x 2 root root 4096 Oct 20 10:40 boot drwxr-xr-x 5 root root 360 Dec 21 09:37 dev ... root@7db4ef82b17e:/# df -h /myvolume/ Filesystem Size Used Avail Use% Mounted on /dev/sda1 285G 5.5G 265G 3% /myvolume root@7db4ef82b17e:/# echo hello T >> /myvolume/ bash: /myvolume/: Is a directory root@7db4ef82b17e:/# echo hello T >> /myvolume/readme.txt root@7db4ef82b17e:/# more myvolume/readme.txt hello T root@7db4ef82b17e:/# exit exit |
$docker run -it -v myvol:/myvolume debian bush
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"bush\": executable file not found in $PATH": unknown. |
$docker run -it -v myvol:/myvolume debian bash
root@c63895541a3b:/# ls -ls /myvolume/readme.txt 4 -rw-r--r-- 1 root root 8 Dec 21 09:40 /myvolume/readme.txt root@c63895541a3b:/# cat /myvolume/readme.txt hello T root@c63895541a3b:/# exit exit |
$dd if=/dev/zero of=/disk1 cound=1 bs=1024k seek=1023
dd: unrecognized operand ‘cound=1’ Try 'dd --help' for more information. |
$dd if=/dev/zero of=/disk1 count=1 bs=1024k seek=1023
dd: failed to open '/disk1': Permission denied |
$cat /proc/
Display all 225 possibilities? (y or n) |
$cat /proc/pa
pagetypeinfo partitions |
$cat /proc/pa
pagetypeinfo partitions |
$cat /proc/partitions
major minor #blocks name 11 0 1048575 sr0 8 0 312571224 sda 8 1 304217088 sda1 8 2 1 sda2 8 5 8351744 sda5 |
$sudo losetup /dev/loop0 /disk1
|
$sudo apt-get install lvm2
Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: dmeventd libdevmapper-event1.02.1 liblvm2app2.2 liblvm2cmd2.02 libreadline5 Suggested packages: thin-provisioning-tools The following NEW packages will be installed: dmeventd libdevmapper-event1.02.1 liblvm2app2.2 liblvm2cmd2.02 libreadline5 lvm2 0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. ... W: Possible missing firmware /lib/firmware/rtl_nic/rtl8411-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8402-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-2.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-3.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-2.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169 |
$sudo pvcreate /dev/loop0
Physical volume "/dev/loop0" successfully created. |
$sudo vgcreate -n vg1 /dev/loop0
vgcreate: invalid option -- 'n' Error during parsing of command line. |
Display all 225 possibilities? (y or n)
pagetypeinfo partitions
major minor #blocks name 11 0 1048575 sr0 8 0 312571224 sda 8 1 304217088 sda1 8 2 1 sda2 8 5 8351744 sda5
Время первой команды журнала | 15:00:42 2018-12-20 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 10:52:41 2018-12-21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 14.85 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 7.92 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.32 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.73 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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