/l3/users/slm/2018-12-minsk-aws/student01.BigClassRoom/user :1 :2 :3 |
|
$ls -a
. .bash_logout Desktop .l3rc Music .sawsrc .. .bash_profile Documents .lilalo Pictures .saws.shortcuts aws .bashrc Downloads .local .profile .ssh .aws .cache github.txt log_cons.txt Public Templates aws2 .config .gnupg m0_id_rsa.pub .saws-history Videos .bash_history create-infra_copy.sh .ICEauthority .mozilla .saws.log .viminfo |
$sudo vim create-infra.sh
|
$~
![]() cp: cannot create regular file '/home/user/.aws2/': Not a directory |
$sudo cp log_cons.txt ~/aws2
|
$ls
hello2.md hello.md log_cons.txt README.md scripts |
$cd scripts/
|
$ls
create-infra.sh |
$bash ./create-infra.sh start
Error parsing parameter '--tag-specifications': Expected: '=', received: 'EOF' for input: ^ Error parsing parameter '--tag-specifications': Expected: '=', received: 'EOF' for input: ^ Error parsing parameter '--tag-specifications': Expected: '=', received: 'EOF' for input: ^ Error parsing parameter '--tag-specifications': Expected: '=', received: 'EOF' for input: ^ Error parsing parameter '--tag-specifications': Expected: '=', received: 'EOF' for input: ^ |
$ftp
![]() bash: ftp: command not found |
$sudo apt-get install ftp
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: ftp 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 58.7 kB of archives. After this operation, 135 kB of additional disk space will be used. Get:1 http://ftp.by.debian.org/debian stretch/main amd64 ftp amd64 0.17-34 [58.7 kB] Fetched 58.7 kB in 0s (499 kB/s) Selecting previously unselected package ftp. (Reading database ... 137697 files and directories currently installed.) Preparing to unpack .../archives/ftp_0.17-34_amd64.deb ... Unpacking ftp (0.17-34) ... Setting up ftp (0.17-34) ... update-alternatives: using /usr/bin/netkit-ftp to provide /usr/bin/ftp (ftp) in auto mode Processing triggers for man-db (2.7.6.1-2) ... |
$ssh ec2-34-244-194-50.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-244-194-50.eu-west-1.compute.amazonaws.com (34.244.194.50)' can't be established. ECDSA key fingerprint is SHA256:k1Fu+rOFKMD2htzuwsjuuADsIJfOOadIjcYAP33sKB4. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-244-194-50.eu-west-1.compute.amazonaws.com,34.244.194.50' (ECDSA) to the list of known hosts. __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 15 package(s) needed for security, out of 16 available Run "sudo yum update" to apply all updates. [ec2-user@ip-10-1-1-111 ~]$ [ec2-user@ip-10-1-1-111 ~]$ [ec2-user@ip-10-1-1-111 ~]$ [ec2-user@ip-10-1-1-111 ~]$ exit logout Connection to ec2-34-244-194-50.eu-west-1.compute.amazonaws.com closed. |
$ssh admin@ec2-34-244-194-50.eu-west-1.compute.amazonaws.com
![]() Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$admin@ec2-34-244-194-50.eu-west-1.compute.amazonaws.com
![]() bash: admin@ec2-34-244-194-50.eu-west-1.compute.amazonaws.com: command not found |
$ftp
ftp> open 130.193.48.71 Connected to 130.193.48.71. 220 Microsoft FTP Service Name (130.193.48.71:user): ftpuser 331 Password required Password: 230-Directory has 18,021,261,312 bytes of disk space available. 230 User logged in. Remote system type is Windows_NT. ftp> put /home/user/log-cons.txt local: /home/user/log-cons.txt remote: /home/user/log-cons.txt local: /home/user/log-cons.txt: No such file or directory ftp> put /home/user/log-cons.txt local: /home/user/log-cons.txt remote: /home/user/log-cons.txt local: /home/user/log-cons.txt: No such file or directory ftp> exit 421 Service not available, remote server has closed connection |
$cd /home/user
|
$ls
aws Desktop log_cons.txt Public aws2 Documents m0_id_rsa.pub Templates create-infra_copy2.sh Downloads Music Videos create-infra_copy.sh github.txt Pictures |
$cd ..
|
$cd ..
|
$cd aws
|
$ls
create-infrastructure.sh qrencode.conf install-qrencode.sh |
$git status
On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) create-infrastructure.sh install-qrencode.sh qrencode.conf nothing added to commit but untracked files present (use "git add" to track) |
$git add
![]() fatal: Unable to create '/home/user/aws/.git/index.lock': Permission denied |
$sudo git add
[sudo] password for user: Nothing specified, nothing added. Maybe you wanted to say 'git add .'? |
$mkdir config
![]() mkdir: cannot create directory ‘config’: Permission denied |
$sudo mkdir config
|
$sudo mkdir scripts
|
$sudo mv qrencode.conf config/
|
$sudo mv *.sh scripts/
|
$ls
config scripts |
$sudo git add scripts/
|
$sudo status
![]() sudo: status: command not found |
$sudo git status
On branch master Initial commit Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: config/qrencode.conf new file: scripts/create-infrastructure.sh new file: scripts/install-qrencode.sh |
$sudo git commit 'add conf' config/
![]() error: pathspec 'add conf' did not match any file(s) known to git. |
$sudo git commit -m 'add conf' config/
[master (root-commit) 3fef16c] add conf 1 file changed, 28 insertions(+) create mode 100644 config/qrencode.conf |
$onfig/
|
$conf' config/
status On branch master Your branch is based on 'origin/master', but the upstream is gone. (use "git branch --unset-upstream" to fixup) nothing to commit, working tree clean |
$sudo git diff
|
$sudo git status
On branch master Your branch is based on 'origin/master', but the upstream is gone. (use "git branch --unset-upstream" to fixup) nothing to commit, working tree clean |
$sudo git push
![]() Username for 'https://github.com': kfilonov Password for 'https://kfilonov@github.com': To https://github.com/kfilonov/aws ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/kfilonov/aws' 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
![]() warning: no common commits remote: Enumerating objects: 6, done. remote: Counting objects: 100% (6/6), done. remote: Compressing objects: 100% (3/3), done. remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (6/6), done. From https://github.com/kfilonov/aws * [new branch] master -> origin/master fatal: refusing to merge unrelated histories |
$sudo git status
On branch master Your branch and 'origin/master' have diverged, and have 2 and 2 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working tree clean |
$sudo git push
![]() Username for 'https://github.com': kfilonov Password for 'https://kfilonov@github.com': To https://github.com/kfilonov/aws ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/kfilonov/aws' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. |
$cp config/ /aws2/
![]() cp: -r not specified; omitting directory 'config/' |
$cp config/ /aws2
![]() cp: -r not specified; omitting directory 'config/' |
$cp config/ aws2
![]() cp: -r not specified; omitting directory 'config/' |
$cp config aws2
![]() cp: -r not specified; omitting directory 'config' |
$ls
config scripts |
$cp /config /aws2
![]() cp: cannot stat '/config': No such file or directory |
$cp config/ /aws2
![]() cp: -r not specified; omitting directory 'config/' |
$cp config aws2/
![]() cp: -r not specified; omitting directory 'config' |
$cp config/ ~/home/user/aws2/
![]() cp: -r not specified; omitting directory 'config/' |
$cp config ~/home/user/aws2/
![]() cp: -r not specified; omitting directory 'config' |
$ls
config scripts |
$sudo cp config ~/home/user/aws2/
![]() cp: -r not specified; omitting directory 'config' |
$sudo cp config/ ~/home/user/aws2/
![]() cp: -r not specified; omitting directory 'config/' |
$sudo cp -r config/ ~/home/user/aws2/
![]() cp: cannot create directory '/home/user/home/user/aws2/': No such file or directory |
$sudo cp -r config ~/home/user/aws2/
![]() cp: cannot create directory '/home/user/home/user/aws2/': No such file or directory |
$sudo cp -r config /aws2
|
$sudo cp -r config/ ~/aws2/
|
$sudo cp -r scripts/ ~/aws2/
|
$conf' config/
![]() On branch master Your branch and 'origin/master' have diverged, and have 2 and 2 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working tree clean |
$conf' config/
/ scripts' scripts/ On branch master Your branch and 'origin/master' have diverged, and have 2 and 2 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working tree clean |
$sudo git push
![]() Username for 'https://github.com': kfilonov Password for 'https://kfilonov@github.com': To https://github.com/kfilonov/aws ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/kfilonov/aws' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. |
$conf' config/
cd |
$cd aws2
|
$conf' config/
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-infra.sh Untracked files: (use "git add <file>..." to include in what will be committed) config/ log_cons.txt scripts/create-infrastructure.sh scripts/install-qrencode.sh no changes added to commit (use "git add" and/or "git commit -a") |
$sudo git add
Nothing specified, nothing added. Maybe you wanted to say 'git add .'? |
$sudo git add config/
|
$sudo git add scripts/
|
$sudo 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: config/qrencode.conf modified: scripts/create-infra.sh new file: scripts/create-infrastructure.sh new file: scripts/install-qrencode.sh Untracked files: (use "git add <file>..." to include in what will be committed) log_cons.txt |
$sudo git add log_cons.txt
|
$sudo 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: config/qrencode.conf new file: log_cons.txt modified: scripts/create-infra.sh new file: scripts/create-infrastructure.sh new file: scripts/install-qrencode.sh |
$sudo git diff
|