├── AWS-Resources └── Resource-Links.txt ├── Ansible-Adhoc-commands-ref ├── Ansible-Vagrant-Files ├── ansible-master-vagrantfile │ └── Vagrantfile ├── ansible-node1-vagrantfile │ └── Vagrantfile └── ansible-node2-vagrantfile │ └── Vagrantfile ├── Ansible ├── Ansible-Class-Notes.txt ├── Ansible-reference-links └── ansible-installation-steps ├── Ansible_SSH_Configuration.txt ├── DevOps_Software_Installations.txt ├── ELK ├── ELK-Configuration-Steps-Updated └── Vagrantfile ├── Elk-updated-Ubuntu2004 ├── APM-reference.txt ├── ELK-Installation-1.pdf ├── Elk-Customization-Script.txt ├── Lab-work.txt └── Vagrantfile ├── Git ├── Gitflowdemo └── mergerebasedemo.txt ├── Jenkins ├── Javac-configuration ├── Jenkins Installation Instructions ├── Jenkins-Installation-debian-July2022.txt ├── Jenkins-pipeline-project-4.pptx ├── Vagrantfile └── jenkins-new-version-install.txt ├── Kubernetes ├── Kubernetes Minikube Installation.txt ├── Setup cluster using minikube.txt ├── Vagrantfile ├── ingress demo.txt └── kubeadm-cluster │ └── reference.txt ├── Nagios ├── Installation.txt ├── Nagios_Client_Plugin_Installation_v1.0.txt └── nagios_core_server_installation_v1.0.txt ├── Nexus ├── Installation.txt └── Nexus-Hands-On-Lab.txt ├── Python └── python-reference.txt ├── Steps To Register Azure Free Account.docx ├── Terraform ├── Ubuntu Installation and Commands.txt └── tf-commands ├── Vagrantfile ├── devops Practice resources ├── Resource Links.txt └── devops interview questions and answers 2023.pdf ├── docker ├── Dockerfile ├── Dockerfile-reference.txt ├── docker-installation.txt ├── docker-jenkins └── history_docker_may132022.txt ├── history_22nd_aug_2ndhalf.txt ├── history_for_print.txt └── sonarqube └── sonarqube_install_config.txt /AWS-Resources/Resource-Links.txt: -------------------------------------------------------------------------------- 1 | EC2 Instance Types - documentation 2 | 3 | https://aws.amazon.com/ec2/instance-types/ 4 | 5 | Free tier - Maximum limits of free resources 6 | 7 | https://aws.amazon.com/free/ 8 | 9 | Connecting to EC2 Instances using Putty 10 | 11 | https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html 12 | 13 | Instances built using Nitro System - for EBS multi attach volumes 14 | 15 | https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances 16 | -------------------------------------------------------------------------------- /Ansible-Adhoc-commands-ref: -------------------------------------------------------------------------------- 1 | https://www.middlewareinventory.com/blog/ansible-ad-hoc-commands/#ex3 2 | 3 | -------------------------------------------------------------------------------- /Ansible-Vagrant-Files/ansible-master-vagrantfile/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.define "v", primary: true do |v| 3 | v.vm.box = "bento/ubuntu-18.04" 4 | v.vm.hostname = 'ansible-master' 5 | v.vm.network :private_network, ip: "192.168.56.151" 6 | 7 | v.vm.provider :virtualbox do |v| 8 | v.customize ["modifyvm", :id, "--name", "ansible-master"] 9 | v.customize ["modifyvm", :id, "--memory", 1024] 10 | v.customize ["modifyvm", :id, "--cpus", 1] 11 | end 12 | end 13 | end -------------------------------------------------------------------------------- /Ansible-Vagrant-Files/ansible-node1-vagrantfile/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.define "v", primary: true do |v| 3 | v.vm.box = "bento/ubuntu-18.04" 4 | v.vm.hostname = 'ansible-node1' 5 | v.vm.network :private_network, ip: "192.168.56.152" 6 | 7 | v.vm.provider :virtualbox do |v| 8 | v.customize ["modifyvm", :id, "--name", "ansible-node1"] 9 | v.customize ["modifyvm", :id, "--memory", 1024] 10 | v.customize ["modifyvm", :id, "--cpus", 1] 11 | end 12 | end 13 | end -------------------------------------------------------------------------------- /Ansible-Vagrant-Files/ansible-node2-vagrantfile/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.define "v", primary: true do |v| 3 | v.vm.box = "bento/ubuntu-18.04" 4 | v.vm.hostname = 'ansible-node2' 5 | v.vm.network :private_network, ip: "192.168.56.153" 6 | 7 | v.vm.provider :virtualbox do |v| 8 | v.customize ["modifyvm", :id, "--name", "ansible-node2"] 9 | v.customize ["modifyvm", :id, "--memory", 1024] 10 | v.customize ["modifyvm", :id, "--cpus", 1] 11 | end 12 | end 13 | end -------------------------------------------------------------------------------- /Ansible/Ansible-Class-Notes.txt: -------------------------------------------------------------------------------- 1 | https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-on-ubuntu 2 | 3 | # Prefer to run apt-get update on ansible_node1 and ansible_node2 4 | 5 | ########### Install ansible 6 | 7 | sudo apt update 8 | sudo apt install software-properties-common -y 9 | sudo apt-add-repository --yes --update ppa:ansible/ansible 10 | sudo apt install ansible -y 11 | 12 | ansible --version 13 | 14 | 15 | ########### Configure ansible master 16 | ########### ansible master (192.168.56.101) 17 | - install ansible 18 | 19 | - vi /etc/hosts 20 | 192.168.56.102 ansible-node1 21 | 22 | 23 | - /etc/ansible/hosts 24 | 192.168.56.102 ansible_ssh_user=vagrant 25 | - ssh-keygen 26 | 27 | # ansible master 28 | - ssh-copy-id vagrant@ansible-node1 # this will copy public key to client under ~/.ssh/authorized_keys file 29 | - ansible all -m ping 30 | - ansible ansible-node1 -m ping 31 | 32 | ************************** 33 | #add ansible-node2 as a node with vagrant user. 34 | 35 | vi /etc/hosts 36 | 192.168.56.103 ansible-node2 37 | 38 | # ansible master 39 | /etc/ansible/hosts 40 | [ansible-nodes] 41 | 192.168.56.102 ansible_ssh_user=vagrant 42 | 192.168.56.103 ansible_ssh_user=ansible_user 43 | 44 | 45 | # ansible-node2 machine 46 | - adduser ansible_user (and give passwd -same as of now) 47 | - ansible_user ALL=(ALL) NOPASSWD: ALL # add this line to /etc/sudoers 48 | 49 | ssh-copy-id -i ansible_user@ansible-node2 50 | 51 | ansible dev -m ping 52 | ansible all -m ping 53 | ************************** 54 | 55 | ------------------------------------------------------------------ 56 | 57 | # gathering facts 58 | # https://www.tutorialspoint.com/ansible/ansible_ad_hoc_commands.htm 59 | 60 | ansible all -m setup 61 | 62 | https://www.youtube.com/watch?reload=9&v=YI48bKykx7k 63 | https://www.youtube.com/watch?v=4nKW2eF-nIw 64 | https://www.youtube.com/watch?v=XJpN8qpxWbA 65 | 66 | 67 | 68 | https://www.devopsschool.com/courses/ansible/ansible-advance-training.html 69 | 70 | 71 | ansible-doc -l # list of modules 72 | ansible-doc -l | wc -l #count modules 73 | ansible-doc apt # description of module 74 | docs.ansible.com modules list # at google 75 | 76 | 77 | 78 | ansible all -m ping 79 | ansible all -m setup 80 | 81 | 82 | ansible all –a "mkdir ~/test" #create dir at all nodes 83 | ansible all –a "touch ~/test/newfile" #create file 84 | 85 | root@ansible-master:~# mkdir ansible_code 86 | root@ansible-master:~# cd ansible_code 87 | ---------------------------------------------------- 88 | root@ansible-master:~/ansible_code# vi inventory 89 | [dev] 90 | ansible-node1 ansible_ssh_user=vagrant 91 | 92 | [test] 93 | ansible-node2 ansible_ssh_user=ansible_user 94 | ------------------------------------------------------- 95 | ############ ansible ad-hoc commands ##################################################### 96 | ansible all -m file -a "path=/root/ansible_code/tmp-file state=touch" # create file (change - yellow color) 97 | ansible all -m file -a "path=/root/ansible_code/tmp-file state=touch" # create file (every time change - yellow color) 98 | ansible all -m file -a "path=/root/ansible_code/tmp-file state=touch" # create file (every time change - yellow color) 99 | ansible all –a "mkdir ~/tmp" #create dir at all nodes 100 | 101 | ansible localhost -m file -a "path=/root/ansible_code/tmp-file/mydir state=directory" 102 | 103 | ansible all -i inventory -m copy -a "src=/root/ansible_code/tmp-file dest=~/tmp" 104 | 105 | ansible localhost -m file -a "path=/root/ansible_code/tmp-file state=absent" # delete file (change - yellow color) 106 | ansible localhost -m file -a "path=/root/ansible_code/tmp-file state=absent" # delete file (no change - green color) 107 | 108 | ansible localhost -m user -a "name=john password=john" -b # -b means become root user 109 | 110 | ------------------------------------------------------ 111 | 112 | 113 | ansible all -m ping 114 | ansible dev -m ping 115 | ansible dev1 -m ping # no such pattern/env 116 | ansible test -m ping 117 | 118 | ansible all -m setup 119 | ansible all -m setup -a "filter=*ipv4*" 120 | 121 | ansible all -a "df -h" -u root # check disk usage 122 | ansible all -a "uptime" -u root 123 | 124 | ansible all -m file -a "path=~/tmp-file state=touch" # create file (change - yellow color) 125 | ansible all -m file -a "path=~/tmp-file state=touch" # create file (every time change - yellow color) 126 | ansible all -m file -a "path=~/tmp-file state=touch" # create file (every time change - yellow color) 127 | ansible all –a "mkdir ~/tmp" #create dir at all nodes 128 | 129 | ansible all -m copy -a "src=~/tmp-file dest=~/tmp" 130 | 131 | ansible all -m file -a "path=/root/ansible_code/tmp-file state=absent" # delete file (change - yellow color) 132 | ansible all -m file -a "path=/root/ansible_code/tmp-file state=absent" # delete file (no change - green color) 133 | 134 | #usermod -G sudo ansible_user 135 | ansible all -m user -a "name=john password=john" -b # -b means become root user 136 | ---------------------------------------------- 137 | id john # to verify if user has been created 138 | 139 | vi /etc/ansible/ansible.cfg # configuration file 140 | 141 | #inventory 142 | #forks means no of parallel sessions 143 | #role_path 144 | 145 | ansible-playbook -i inventory-name playbook1.yml --syntax-check 146 | ansible-playbook -i inventory-name playbook1.yml --check 147 | ansible-playbook -i inventory-name playbook1.yml --limit host2 148 | ansible-playbook -i inventory-name playbook1.yml --list-hosts 149 | 150 | --------------------------------------------------- 151 | ################playbook 1 ################################################################################ 152 | 153 | root@u64-18-04-ansible-master:~/ansible_code# vi 1-playbook-createfile-specific-host.yml 154 | --- 155 | 156 | - hosts: dev 157 | tasks: 158 | - name: create a file 159 | file: 160 | path: /tmp/file-playbook1 161 | state: touch 162 | 163 | ------------------------------------------------------------- 164 | root@ansible-master:~/ansible_code# cat inventory 165 | [dev] 166 | ansible-node1 ansible_ssh_user=vagrant 167 | 168 | [test] 169 | ansible-node2 ansible_ssh_user=ansible_user 170 | ------------------------------------------------- 171 | 172 | ansible-playbook 1-playbook-createfile-specific-host.yml # run only for specific host - dev 173 | ############################################################################################################### 174 | ################playbook 2 ################################################################################ 175 | 176 | root@ansible-master:~/ansible_code# vi 2-playbook-createfile.yml 177 | --- 178 | 179 | - hosts: all 180 | tasks: 181 | - name: create a file 182 | file: 183 | path: /tmp/file-playbook-1 184 | state: touch 185 | 186 | ------------------------------------------------------------- 187 | 188 | ansible-playbook 2-playbook-createfile.yml 189 | ############################################################################################################### 190 | ################playbook 3 #################################################################################### 191 | 192 | root@ansible-master:~/ansible_code# vi 3-playbook-deletefile.yml 193 | --- 194 | 195 | - hosts: all 196 | tasks: 197 | - name: delete a file 198 | file: 199 | path: /tmp/file-playbook-1 200 | state: absent 201 | 202 | ------------------------------------------------------------- 203 | 204 | ansible-playbook 3-playbook-deletefile.yml 205 | ############################################################################################################### 206 | ################playbook 4 #################################################################################### 207 | root@ansible-master:~/ansible_code# vi 4-playbook-install-webserver-apache.yml 208 | --- 209 | 210 | - hosts : ansible-node1 211 | become: true 212 | name: 4-playbook-install-webserver-apache 213 | tasks: 214 | - name: Install Apache 215 | apt: 216 | name: apache2 217 | state: latest 218 | - name: add website page 219 | script: hello.sh 220 | 221 | 222 | --------------------------------------------------------------------------------------- 223 | ansible-playbook 4-playbook-install-webserver-apache.yml --syntax-check 224 | ansible-playbook 4-playbook-install-webserver-apache.yml 225 | ############################################################################################################### 226 | ################playbook 5 #################################################################################### 227 | root@ansible-master:~/ansible_code# vi 5-playbook-install-webservers-selective.yml 228 | --- 229 | 230 | - hosts : dev 231 | become: true 232 | name: 5-playbook-install-webservers 233 | tasks: 234 | - name: Install Apache 235 | apt: 236 | name: apache2 237 | state: latest 238 | - name: add website page 239 | script: hello.sh 240 | 241 | - hosts : test 242 | become: true 243 | name: 5-playbook-install-webservers 244 | tasks: 245 | - name: Install Nginx 246 | apt: 247 | name: nginx 248 | state: latest 249 | ------------------------------------------------------------------- 250 | ansible-playbook 5-playbook-install-webservers-selective.yml 251 | ############################################################################################################### 252 | ################playbook 6 #################################################################################### 253 | root@ansible-master:~/ansible_code# vi 6-playbook-remove-webservers-selective.yml 254 | --- 255 | 256 | - hosts : dev 257 | become: true 258 | name: 6-playbook-remove-webservers 259 | tasks: 260 | - name: un-install Apache 261 | apt: 262 | name: apache2 263 | state: absent 264 | 265 | - hosts : test 266 | become: true 267 | name: 5-playbook-remove-webservers 268 | tasks: 269 | - name: un-install Nginx 270 | apt: 271 | name: nginx-common 272 | state: absent 273 | 274 | ------------------------------------------------------------------- 275 | ansible-playbook 6-playbook-remove-webservers-selective.yml 276 | ############################################################################################################### 277 | ################playbook 7 #################################################################################### 278 | root@ansible-master:~/ansible_code# vi 7-playbook-with_loop-install-packages.yml 279 | --- 280 | 281 | - hosts : dev 282 | become: true 283 | name: playbook-install 284 | tasks: 285 | - name: Install Packages 286 | apt: 287 | name: "{{ item }}" 288 | state: latest 289 | with_items: 290 | - vim 291 | - git 292 | - curl 293 | 294 | ------------------------------------------------------------------- 295 | ansible-playbook 7-playbook-with_loop-install-packages.yml 296 | ############################################################################################################### 297 | ################playbook 8 #################################################################################### 298 | root@ansible-master:~/ansible_code# vi 8-playbook-with_loop-remove-packages.yml 299 | --- 300 | 301 | - hosts : dev 302 | become: true 303 | name: playbook-install 304 | tasks: 305 | - name: Remove Packages 306 | apt: 307 | name: "{{ item }}" 308 | state: absent 309 | with_items: 310 | - vim 311 | - git 312 | - curl 313 | 314 | ------------------------------------------------------------------- 315 | ansible-playbook 8-playbook-with_loop-remove-packages.yml 316 | ############################################################################################################### 317 | ################playbook 9 #################################################################################### 318 | root@ansible-master:~/ansible_code# vi 9-playbook-array-install-packages.yml 319 | --- 320 | 321 | - hosts : test 322 | become: true 323 | vars: 324 | packages: [ 'vim', 'git', 'curl' ] 325 | tasks: 326 | - name: Install Packages 327 | apt: 328 | name: "{{ item }}" 329 | state: latest 330 | with_items: "{{ packages }}" 331 | 332 | ------------------------------------------------------------------- 333 | ansible-playbook 9-playbook-array-install-packages.yml 334 | ############################################################################################################### 335 | ################playbook 10 #################################################################################### 336 | root@ansible-master:~/ansible_code# vi 10-playbook-array-remove-packages.yaml 337 | --- 338 | 339 | - hosts : test 340 | become: true 341 | vars: 342 | packages: [ 'vim', 'git', 'curl' ] 343 | tasks: 344 | - name: Remove Packages 345 | apt: 346 | name: "{{ item }}" 347 | state: absent 348 | with_items: "{{ packages }}" 349 | 350 | ------------------------------------------------------------------- 351 | ansible-playbook 10-playbook-array-remove-packages.yaml 352 | ############################################################################################################### 353 | ################playbook 11 #################################################################################### 354 | root@ansible-master:~/ansible_code# vi 11-playbook-with_loop-create-files.yml 355 | --- 356 | - hosts: dev 357 | tasks: 358 | - name: create files 359 | file: 360 | path: /tmp/{{item}} 361 | state: touch 362 | with_items: 363 | - file1 364 | - file2 365 | - file3 366 | ------------------------------------------------------------------- 367 | ansible-playbook 11-playbook-array-remove-packages.yaml 368 | ############################################################################################################### 369 | ################playbook 12 #################################################################################### 370 | root@ansible-master:~/ansible_code# vi 12-playbook-with_loop-delete-files.yml 371 | --- 372 | - hosts: dev 373 | tasks: 374 | - name: delete files 375 | file: 376 | path: /tmp/{{item}} 377 | state: absent 378 | with_items: 379 | - file1 380 | - file2 381 | - file3 382 | ------------------------------------------------------------------- 383 | ansible-playbook 12-playbook-with_loop-delete-files.yaml 384 | ############################################################################################################### 385 | -------------------------------------------- 386 | vault.yml 387 | 388 | ansible-vault create vault.yml #will ask for password to create a new enctypted password # vault used AES256 389 | ansible-vault view vault.yml # to display the conents of vault file in plain text mode 390 | ansible-vault edit vault.yml # edit encrypted playbook 391 | ansible-vault rekey vault.yml # change password 392 | ansible-vault encrypt target.yml 393 | ansible-vault decrypt target.yml 394 | 395 | ################playbook 13 #################################################################################### 396 | root@ansible-master:~/ansible_code# vi 13-create-user.yml 397 | --- 398 | - name: Create New Users 399 | hosts: all 400 | become: true 401 | gather_facts: false 402 | vars_files: 403 | - my_vault_create_user.yml 404 | tasks: 405 | - name: Create Users 406 | user: 407 | name: "{{ item }}" 408 | password: "{{ my_password | password_hash('sha512') }}" 409 | shell: /bin/bash 410 | #update_password: on_create #to avoid updating password hash in /etc/shadow 411 | loop: 412 | - alice 413 | - vincent 414 | ------------------------------------------------- 415 | ansible-vault create my_vault_create_user.yml #my_vault 416 | my_password: mysecret$1 417 | ansible-vault view my_vault_create_user.yml 418 | 419 | ansible-playbook --ask-vault-pass 13-create-user.yml 420 | 421 | 422 | -------------------------------------------- 423 | Ansible roles 424 | 425 | ansible-galacy --version 426 | mkdir -p playbooks/roles 427 | cd playbooks/roles 428 | ansible-galaxy init webserver 429 | vi webserver/tasks/main.yml 430 | - name: install apache2 431 | action: apt name=apache2 state=latest 432 | 433 | cd .. 434 | root@ansible-master:~/ansible_code/playbooks# 435 | vi master.yml 436 | 437 | - hosts: test 438 | become: yes 439 | roles: 440 | - webserver 441 | 442 | root@ansible-master:~/ansible_code/playbooks# ansible-playbook master.yml 443 | ---------------------------------------------------------------------------------- 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | ########### ansible playbook - playbook delete 457 | 458 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-delete.yaml 459 | --- 460 | 461 | - hosts : slave1 462 | become: true 463 | name: playbook-delete 464 | tasks: 465 | - name: Uninstall Apache 466 | apt: 467 | name: apache2 468 | state: absent 469 | - name: Remove unwanted Apache2 packages from the system. 470 | apt: 471 | autoremove: yes 472 | purge: yes 473 | 474 | 475 | ########### ansible playbook 2 - playbook install 476 | 477 | --- 478 | 479 | - hosts : slave1 480 | become: true 481 | name: playbook-install 482 | tasks: 483 | - name: Install Apache 484 | apt: 485 | name: apache2 486 | state: latest 487 | - name: add website page 488 | script: hello.sh 489 | 490 | - hosts : slave2 491 | become: yes 492 | name: playbook-install 493 | tasks: 494 | - name: Install Nginx 495 | apt: 496 | name: nginx 497 | state: latest 498 | 499 | ============= 500 | root@u64-18-04-ansible-master:~/ansible-code# cat hello.sh 501 | #!/bin/sh 502 | 503 | echo hello world > /var/www/html/1.html # 192.168.56.102/1.html 504 | 505 | ============= 506 | # changing hello.sh contents at master, you can change the nodes without logging into the node 507 | 508 | root@u64-18-04-ansible-master:~/ansible-code# cat hello.sh 509 | #!/bin/sh 510 | 511 | echo hello world updated > /var/www/html/1.html # 192.168.56.102/1.html 512 | 513 | 514 | 515 | 516 | ########### ansible playbook 2 - playbook delete 517 | 518 | --- 519 | 520 | - hosts : slave1 521 | become: yes 522 | name: playbook-delete 523 | tasks: 524 | - name: remove Apache 525 | apt: name=apache2 state=absent 526 | 527 | - hosts : slave2 528 | become: yes 529 | name: playbook-delete 530 | tasks: 531 | - name: remove nginx 532 | apt: name=nginx-common state=absent 533 | 534 | ======================================================================= 535 | 536 | 537 | ------------------------------------------------------------------------ 538 | 539 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-createfile-register.yml 540 | 541 | --- 542 | 543 | - hosts: localhost 544 | tasks: 545 | - name: create a file 546 | file: 547 | path: /tmp/file1 548 | state: touch 549 | register: output 550 | - debug: 'msg="this is the value of register variable {{ output }}"' 551 | - name: edit file 552 | lineinfile: 553 | path: /tmp/file1 554 | line: '{{ ansible_hostname }} - {{ output.uid }}' 555 | 556 | cat /tmp/file1 557 | hostname - id 558 | 559 | 560 | 561 | https://www.digitalocean.com/community/tutorials/configuration-management-101-writing-ansible-playbooks 562 | 563 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-createfile-with.yml 564 | --- 565 | - hosts: localhost 566 | tasks: 567 | - name: create files 568 | file: 569 | path: /tmp/{{item}} 570 | state: touch 571 | with_items: 572 | - file1 573 | - file2 574 | - file3 575 | 576 | 577 | 578 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-loop.yaml 579 | --- 580 | 581 | - hosts : slave1 582 | become: true 583 | name: playbook-install 584 | tasks: 585 | - name: Install Packages 586 | apt: 587 | name: "{{ item }}" 588 | state: latest 589 | with_items: 590 | - vim 591 | - git 592 | - curl 593 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-loop-remove-packages.yaml 594 | --- 595 | 596 | - hosts : slave1 597 | become: true 598 | name: playbook-install 599 | tasks: 600 | - name: Remove Packages 601 | apt: 602 | name: "{{ item }}" 603 | state: absent 604 | with_items: 605 | - vim 606 | - git 607 | - curl 608 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-array.yaml 609 | --- 610 | 611 | - hosts : slave1 612 | become: true 613 | vars: 614 | packages: [ 'vim', 'git', 'curl' ] 615 | tasks: 616 | - name: Install Packages 617 | apt: 618 | name: "{{ item }}" 619 | state: latest 620 | with_items: "{{ packages }}" 621 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-array-remove-packages.yaml 622 | --- 623 | 624 | - hosts : slave1 625 | become: true 626 | vars: 627 | packages: [ 'vim', 'git', 'curl' ] 628 | tasks: 629 | - name: Remove Packages 630 | apt: 631 | name: "{{ item }}" 632 | state: absent 633 | with_items: "{{ packages }}" 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | -------------------- 646 | links 647 | 648 | https://linuxhint.com/begineers_guide_tutorial_ansible/ 649 | 650 | https://medium.com/@ahmadfarag/ansible-in-action-f2f17706931 651 | 652 | https://techexpert.tips/ansible/ansible-playbook-examples-ubuntu-linux/ 653 | 654 | https://www.tecmint.com/create-ansible-plays-and-playbooks/ 655 | 656 | https://www.digitalocean.com/community/tutorials/configuration-management-101-writing-ansible-playbooks 657 | 658 | https://blog.ssdnodes.com/blog/step-by-step-ansible-guide/ 659 | 660 | https://www.tutorialspoint.com/ansible/ansible_yaml_basics.htm 661 | 662 | 663 | =================================================================================== 664 | root@u64-18-04-ansible-master:~/ansible-code# cat playbook-variable.yaml 665 | --- 666 | - hosts : all 667 | become: true 668 | vars: 669 | package: vim 670 | tasks: 671 | - name: Install Package 672 | apt: 673 | name: "{{ package }}" 674 | state: latest 675 | -------------------------------------------------------------------------------- /Ansible/Ansible-reference-links: -------------------------------------------------------------------------------- 1 | Ansible code snippet generator 2 | 3 | https://ansible.ai/ 4 | 5 | Remove python - old version error 6 | 7 | https://stackoverflow.com/questions/44602191/how-to-completely-uninstall-python-2-7-13-on-ubuntu-16-04 8 | 9 | other ways 10 | 11 | Change Python version 12 | 13 | https://towardsdatascience.com/installing-multiple-alternative-versions-of-python-on-ubuntu-20-04-237be5177474 14 | 15 | -------------------------------------------------------------------------------- /Ansible/ansible-installation-steps: -------------------------------------------------------------------------------- 1 | ########### Install ansible on ansible-master 2 | 3 | sudo apt update 4 | sudo apt install software-properties-common -y 5 | sudo apt-add-repository --yes --update ppa:ansible/ansible 6 | sudo apt install ansible -y 7 | 8 | ansible --version 9 | 10 | ############## 11 | 12 | for aws and azure machines 13 | 14 | ssh-copy-id may not work.. 15 | 16 | pls copy the public key to the client machines profiles 17 | 18 | copy the public key from id_rsa.pub from Jenkins master to the /home//.ssh/authorized_keys file 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Ansible_SSH_Configuration.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #### 5 | 6 | /etc/hosts configuration for name resolution 7 | 8 | Add below entries in the other two nodes 9 | 10 | vi /etc/hosts add other two hostnames with the ip address 11 | 12 | 192.168.56.151 ansible-master 13 | 192.168.56.152 ansible-node1 14 | 192.168.56.153 ansible-node2 15 | 16 | 17 | 18 | 19 | ####### 20 | 21 | for EC2 instances 22 | 23 | cat /root/.ssh/id_rsa.pub . and press enter 24 | 25 | and copy the content of the file.. 26 | 27 | go to the node1 and login as ubuntu user 28 | 29 | and enter nano .ssh/authorized_keys 30 | 31 | open the file and paste it there.. 32 | 33 | for EC2 instances 34 | 35 | use ssh-copy-id username@ip address 36 | 37 | for EC2 instances use ubuntu@ip-address 38 | 39 | copy the file from master to the slaves 40 | 41 | root@ansible-master:~# cat /root/.ssh/id_rsa.pub 42 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9zl6SovBA/xs3Rh4qfklBFGx226i9eY6UoKjI2/qmztb22pXxPYojS1qv+2j1AqeFwjDm85nWr9/0rHi2mFkpYNnwp7dmQGQrlYDGFXZx+s4clZVfxpirRO504RK/TUfHAE5P9rd6zWTqf7dW49cl5v8FagLDLEkyDhUdZhJ7VPXtcFbpPmPamUv+1nxR41q6J6gawFxn0Rp4VqfQ4fy5RGRhdEcpIKAXDz8w5WY+xeDjHWpJ4Kr3adP9qJ4z5+ZGTLgz5osRXUYh91ABHKWGk7HT8Pd0mQOcReAty18y5AULi1v7D2utAo6axGDC5u1M1KmAgijl2Dc3rOmXm3oP root@ansible-master 43 | root@ansible-master:~# 44 | 45 | 46 | ####### -------------------------------------------------------------------------------- /DevOps_Software_Installations.txt: -------------------------------------------------------------------------------- 1 | Git Client 2 | 3 | https://git-scm.com/downloads 4 | 5 | Vagrant Download Link - optional - you may also use AWS VMs 6 | 7 | https://www.vagrantup.com/downloads 8 | 9 | Oracle virtual box - optional - you may also use AWS VMs 10 | 11 | https://www.virtualbox.org/wiki/Downloads 12 | 13 | Mobaxterm - portable edition or any putty client 14 | 15 | https://mobaxterm.mobatek.net/download-home-edition.html 16 | 17 | Notepad++ 18 | 19 | https://notepad-plus-plus.org/downloads/ 20 | 21 | To use linux commands in windows system 22 | 23 | Powershell client installation 24 | 25 | https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2 26 | 27 | WSL - windows subsystem for linux 28 | 29 | https://docs.microsoft.com/en-us/windows/wsl/about 30 | 31 | VS Code download and installation 32 | 33 | https://code.visualstudio.com/download 34 | 35 | Rapid Environment Editor - For editing path and variables 36 | 37 | https://www.rapidee.com/en/download 38 | 39 | -------------------------------------------------------------------------------- /ELK/ELK-Configuration-Steps-Updated: -------------------------------------------------------------------------------- 1 | apt-get update 2 | apt-get install openjdk-8-jdk -y 3 | apt-get install nginx -y 4 | wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - 5 | echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list 6 | sudo apt update 7 | sudo apt install elasticsearch 8 | 9 | sudo apt install kibana 10 | 11 | sudo apt install logstash 12 | 13 | sudo apt install filebeat 14 | 15 | 16 | ### vi /etc/elasticsearch/elasticsearch.yml 17 | 18 | network.host: localhost 19 | 20 | ------------------- 21 | sudo systemctl start elasticsearch 22 | sudo systemctl status elasticsearch 23 | 24 | ########## 25 | 26 | curl -X GET "localhost:9200" 27 | 28 | 29 | ##### vi /etc/kibana/kibana.yml 30 | 31 | server.port: 5601 32 | server.host: localhost 33 | 34 | ######## 35 | 36 | 37 | sudo systemctl start kibana 38 | sudo systemctl status kibana 39 | 40 | 41 | echo "kibanaadmin:`openssl passwd -apr1`" | sudo tee -a /etc/nginx/htpasswd.users 42 | 43 | 44 | cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.bak 45 | 46 | ### vi /etc/nginx/sites-available/default # can take backup first 47 | 48 | server { 49 | listen 80; 50 | 51 | server_name 192.168.56.110; 52 | 53 | auth_basic "Restricted Access"; 54 | auth_basic_user_file /etc/nginx/htpasswd.users; 55 | 56 | location / { 57 | proxy_pass http://localhost:5601; 58 | proxy_http_version 1.1; 59 | proxy_set_header Upgrade $http_upgrade; 60 | proxy_set_header Connection 'upgrade'; 61 | proxy_set_header Host $host; 62 | proxy_cache_bypass $http_upgrade; 63 | } 64 | } 65 | ######################################## 66 | 67 | sudo ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default 68 | sudo nginx -t 69 | 70 | 71 | sudo systemctl restart nginx 72 | sudo systemctl status nginx 73 | 74 | sudo ufw allow 'Nginx Full' (optional) 75 | 76 | 77 | sudo systemctl start logstash 78 | sudo systemctl status logstash 79 | 80 | # access kibana at http://192.168.56.110 i.e. your VM IP address or public IP of EC2 instance 81 | 82 | http://192.168.56.110 83 | 84 | 85 | 86 | =================================================================== 87 | Lab work 88 | -------- 89 | 90 | Example-1 : sample data 91 | Manage spaces -> Kibana -> Index patterns -> Add sample data -> sample flight data -> view data -> dashboard 92 | 93 | Example-2 : upload csv file 94 | 95 | wget https://raw.githubusercontent.com/PacktPublishing/Kibana-7-Quick-Start-Guide/master/Chapter02/crimes_2001.csv 96 | 97 | root@elk:~# cp crimes_2001.csv /home/vagrant/ 98 | 99 | 100 | vi /etc/logstash/conf.d/crimes.conf 101 | 102 | # Logstash configuration file to read CSV data. Add Elasticsearch username and password if you have configured the security. 103 | input { 104 | file { 105 | path => "/home/vagrant/crimes_2001.csv" 106 | start_position => beginning 107 | } 108 | } 109 | filter { 110 | csv { 111 | columns => [ 112 | "ID", 113 | "Case Number", 114 | "Date", 115 | "Block", 116 | "IUCR", 117 | "Primary Type", 118 | "Description", 119 | "Location Description", 120 | "Arrest", 121 | "Domestic", 122 | "Beat", 123 | "District", 124 | "Ward", 125 | "Community Area", 126 | "FBI Code", 127 | "X Coordinate", 128 | "Y Coordinate", 129 | "Year", 130 | "Updated On", 131 | "Latitude", 132 | "Longitude", 133 | "Location" 134 | ] 135 | separator => "," 136 | } 137 | } 138 | output { 139 | elasticsearch { 140 | action => "index" 141 | hosts => ["127.0.0.1:9200"] 142 | index => "crimes" 143 | } 144 | } 145 | 146 | 147 | 148 | service logstash restart 149 | 150 | Goto kibana dashboard -> D -> manage spaces - kibana -> Index management should have the entry for "crimes_2001.csv" after some time. 151 | Goto kibana dashboard -> D -> manage spaces - kibana - index patterns - create index pattern -crime* - @timestamp 152 | 153 | Discover -> change index pattern -> crime* 154 | 155 | #filter 156 | 157 | Click on arrest -> visualize -> save (Arrest data for last week) -> save on dashboard 158 | save dashboard as "Crime Dashboard" 159 | Goto dashboard and verify 160 | 161 | Create visualization -> community area -> visualize -> Pie graph - save and return -> Title : "Comminity wise crime in last week" 162 | Search -> select fields - Date Domestic District Description -> Save -> Domestic telephone threats for lst week. (can be checked from open option from top right side) 163 | 164 | 165 | 166 | ############ 167 | 168 | Restart Procedure after the services are shutdown 169 | Graceful shutdown procedure 170 | 171 | stop logstash 172 | stop kibana 173 | stop elasticsearch 174 | 175 | Reboot order 176 | 177 | Start Elasticache - service elasticsearch start 178 | Start Logstash - service logstash start 179 | Start Kibana -service kibana start 180 | 181 | After sometime reboot nginx server as well. 182 | 183 | nginx - service nginx start 184 | 185 | ------------------------------------------------------------------ 186 | 187 | -------------------------------------------------------------------------------- /ELK/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.define "v", primary: true do |v| 3 | v.vm.box = "bento/ubuntu-18.04" 4 | v.vm.hostname = 'elk' 5 | v.vm.network :private_network, ip: "192.168.56.110" 6 | 7 | v.vm.provider :virtualbox do |v| 8 | v.customize ["modifyvm", :id, "--name", "elk"] 9 | v.customize ["modifyvm", :id, "--memory", 4096] 10 | v.customize ["modifyvm", :id, "--cpus", 2] 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /Elk-updated-Ubuntu2004/APM-reference.txt: -------------------------------------------------------------------------------- 1 | APM Installation reference for APT 2 | 3 | https://www.elastic.co/guide/en/apm/server/current/setup-repositories.html 4 | 5 | APM Installation on Ubuntu with ELK Stack 6 | 7 | https://logz.io/blog/application-performance-monitoring/ 8 | -------------------------------------------------------------------------------- /Elk-updated-Ubuntu2004/ELK-Installation-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rushtojp/devopsclassfiles/1e0711743eb2083d6795a39f934d1caa7a5600dc/Elk-updated-Ubuntu2004/ELK-Installation-1.pdf -------------------------------------------------------------------------------- /Elk-updated-Ubuntu2004/Elk-Customization-Script.txt: -------------------------------------------------------------------------------- 1 | cluster.name: my-application 2 | node.name: node-1 3 | http.port: 9200 4 | network.host: localhost 5 | 6 | 7 | 8 | server.port: 5601 9 | server.host: "localhost" 10 | 11 | 12 | server { 13 | listen 80; 14 | server_name 20.230.131.209; 15 | auth_basic "Restricted Access"; 16 | auth_basic_user_file /etc/nginx/htpasswd.users; 17 | location / { 18 | proxy_pass http://localhost:5601; 19 | proxy_http_version 1.1; 20 | proxy_set_header Upgrade $http_upgrade; 21 | proxy_set_header Connection 'upgrade'; 22 | proxy_set_header Host $host; 23 | proxy_cache_bypass $http_upgrade; 24 | } 25 | } 26 | 27 | 28 | APM-server xml location 29 | 30 | root@ELK-APM-DemoApr15:/usr/share/apm-server/bin# cd /etc/apm-server/ 31 | root@ELK-APM-DemoApr15:/etc/apm-server# ls 32 | apm-server.yml fields.yml 33 | root@ELK-APM-DemoApr15:/etc/apm-server# vim 34 | 35 | -------------------------------------------------------------------------------- /Elk-updated-Ubuntu2004/Lab-work.txt: -------------------------------------------------------------------------------- 1 | Lab work 2 | -------- 3 | 4 | Example-1 : sample data 5 | Manage spaces -> Kibana -> Index patterns -> Add sample data -> sample flight data -> view data -> dashboard 6 | 7 | Example-2 : upload csv file 8 | 9 | wget https://raw.githubusercontent.com/PacktPublishing/Kibana-7-Quick-Start-Guide/master/Chapter02/crimes_2001.csv 10 | 11 | root@elk:~# cp crimes_2001.csv /home/vagrant/ 12 | 13 | 14 | vi /etc/logstash/conf.d/crimes.conf 15 | 16 | # Logstash configuration file to read CSV data. Add Elasticsearch username and password if you have configured the security. 17 | input { 18 | file { 19 | path => "/home/vagrant/crimes_2001.csv" 20 | start_position => beginning 21 | } 22 | } 23 | filter { 24 | csv { 25 | columns => [ 26 | "ID", 27 | "Case Number", 28 | "Date", 29 | "Block", 30 | "IUCR", 31 | "Primary Type", 32 | "Description", 33 | "Location Description", 34 | "Arrest", 35 | "Domestic", 36 | "Beat", 37 | "District", 38 | "Ward", 39 | "Community Area", 40 | "FBI Code", 41 | "X Coordinate", 42 | "Y Coordinate", 43 | "Year", 44 | "Updated On", 45 | "Latitude", 46 | "Longitude", 47 | "Location" 48 | ] 49 | separator => "," 50 | } 51 | } 52 | output { 53 | elasticsearch { 54 | action => "index" 55 | hosts => ["127.0.0.1:9200"] 56 | index => "crimes" 57 | } 58 | } 59 | 60 | 61 | 62 | service logstash restart 63 | 64 | Goto kibana dashboard -> D -> manage spaces - kibana -> Index management should have the entry for "crimes_2001.csv" after some time. 65 | Goto kibana dashboard -> D -> manage spaces - kibana - index patterns - create index pattern -crime* - @timestamp 66 | 67 | Discover -> change index pattern -> crime* 68 | 69 | #filter 70 | 71 | Click on arrest -> visualize -> save (Arrest data for last week) -> save on dashboard 72 | save dashboard as "Crime Dashboard" 73 | Goto dashboard and verify 74 | 75 | Create visualization -> community area -> visualize -> Pie graph - save and return -> Title : "Comminity wise crime in last week" 76 | Search -> select fields - Date Domestic District Description -> Save -> Domestic telephone threats for lst week. (can be checked from open option from top right side) 77 | 78 | 79 | 80 | ############ 81 | 82 | Restart Procedure after the services are shutdown 83 | Graceful shutdown procedure 84 | 85 | stop logstash 86 | stop kibana 87 | stop elasticsearch 88 | 89 | Reboot order 90 | 91 | Start Elasticache - service elasticsearch start 92 | Start Logstash - service logstash start 93 | Start Kibana -service kibana start 94 | 95 | After sometime reboot nginx server as well. 96 | 97 | nginx - service nginx start 98 | 99 | ------------------------------------------------------------------ 100 | -------------------------------------------------------------------------------- /Elk-updated-Ubuntu2004/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.define "v", primary: true do |v| 3 | v.vm.box = "bento/ubuntu-20.04" 4 | v.vm.hostname = 'Elk-Demo-183' 5 | v.vm.network :private_network, ip: "192.168.56.183" 6 | 7 | v.vm.provider :virtualbox do |v| 8 | v.customize ["modifyvm", :id, "--name", "Elk-Demo-183"] 9 | v.customize ["modifyvm", :id, "--memory", 2048] 10 | v.customize ["modifyvm", :id, "--cpus", 2] 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /Git/Gitflowdemo: -------------------------------------------------------------------------------- 1 | https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow 2 | -------------------------------------------------------------------------------- /Git/mergerebasedemo.txt: -------------------------------------------------------------------------------- 1 | Merge 2 | 3 | #Master 4 | 5 | step1 - master file - m1 6 | step2 - test - t1 t2 7 | step3 - master - m2 m3 8 | 9 | switch to test 10 | 11 | git merge master - m1 t1 t2 m2 m3 12 | 13 | 14 | ---------------- 15 | # rebase 16 | 17 | step1 - master file - m1 18 | step2 - test - t1 t2 19 | step3 - master - m2 m3 20 | 21 | switch to test 22 | 23 | git rebase master - m1 m2 m3 t1 t2 24 | 25 | -------------------------------------------------------------------------------- /Jenkins/Javac-configuration: -------------------------------------------------------------------------------- 1 | https://itsfoss.com/set-java-home-ubuntu/ 2 | 3 | 4 | Javac Installation 5 | 6 | apt install openjdk-11-jdk-headless 7 | 8 | -------------------------------------------------------------------------------- /Jenkins/Jenkins Installation Instructions: -------------------------------------------------------------------------------- 1 | ####################### 2 | 3 | This is old version. pls do not use unless needed 4 | 5 | Please use this. https://github.com/rushtojp/devopsclassfiles/blob/master/Jenkins/Jenkins-Installation-debian-July2022.txt 6 | 7 | 8 | ###################### 9 | 10 | 11 | # Steps to install Jenkins at ubuntu 18.04 12 | 13 | sudo apt-get update 14 | sudo apt install openjdk-8-jdk -y 15 | wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - 16 | 17 | or 18 | 19 | wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - 20 | echo deb https://pkg.jenkins.io/debian binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list 21 | sudo apt-get update 22 | sudo apt-get -y install jenkins 23 | sudo service jenkins status 24 | 25 | sudo systemctl start jenkins 26 | sudo systemctl status jenkins 27 | sudo ufw allow 8080 28 | 29 | 30 | # http://ip_address_or_domain_name:8080 31 | # /var/lib/jenkins/secrets/initialAdminPassword 32 | # install suggested plugins 33 | -------------------------------------------------------------------------------- /Jenkins/Jenkins-Installation-debian-July2022.txt: -------------------------------------------------------------------------------- 1 | 2 | Use Ubuntu 18.04 Installation 3 | 4 | sudo apt update 5 | sudo apt install openjdk-11-jre -y 6 | java -version 7 | 8 | the output would be similar to below 9 | 10 | openjdk version "11.0.12" 2021-07-20 11 | OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2) 12 | OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing) 13 | 14 | apt install openjdk-11-jdk-headless 15 | 16 | Refer to below link for latest version of installation instructions 17 | 18 | https://www.jenkins.io/doc/book/installing/linux/#debianubuntu 19 | 20 | curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \ 21 | /usr/share/keyrings/jenkins-keyring.asc > /dev/null 22 | echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ 23 | https://pkg.jenkins.io/debian binary/ | sudo tee \ 24 | /etc/apt/sources.list.d/jenkins.list > /dev/null 25 | sudo apt-get update 26 | sudo apt-get install jenkins 27 | 28 | 29 | sudo systemctl enable jenkins 30 | 31 | sudo systemctl start jenkins 32 | 33 | sudo systemctl status jenkins 34 | 35 | Optional 36 | 37 | opening up firewall steps 38 | 39 | 40 | YOURPORT=8080 41 | PERM="--permanent" 42 | SERV="$PERM --service=jenkins" 43 | 44 | firewall-cmd $PERM --new-service=jenkins 45 | firewall-cmd $SERV --set-short="Jenkins ports" 46 | firewall-cmd $SERV --set-description="Jenkins port exceptions" 47 | firewall-cmd $SERV --add-port=$YOURPORT/tcp 48 | firewall-cmd $PERM --add-service=jenkins 49 | firewall-cmd --zone=public --add-service=http --permanent 50 | firewall-cmd --reload 51 | -------------------------------------------------------------------------------- /Jenkins/Jenkins-pipeline-project-4.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rushtojp/devopsclassfiles/1e0711743eb2083d6795a39f934d1caa7a5600dc/Jenkins/Jenkins-pipeline-project-4.pptx -------------------------------------------------------------------------------- /Jenkins/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.define "v", primary: true do |v| 3 | v.vm.box = "bento/ubuntu-18.04" 4 | v.vm.hostname = 'jenkinsmaster195' 5 | v.vm.network :private_network, ip: "192.168.56.195" 6 | 7 | v.vm.provider :virtualbox do |v| 8 | v.customize ["modifyvm", :id, "--name", "jenkinsmaster195"] 9 | v.customize ["modifyvm", :id, "--memory", 1024] 10 | v.customize ["modifyvm", :id, "--cpus", 1] 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /Jenkins/jenkins-new-version-install.txt: -------------------------------------------------------------------------------- 1 | Installation steps 2 | 3 | https://www.jenkins.io/doc/book/installing/linux/#debianubuntu 4 | -------------------------------------------------------------------------------- /Kubernetes/Kubernetes Minikube Installation.txt: -------------------------------------------------------------------------------- 1 | Please use ubuntu 18.04 - in aws t2.medium - min 2vpcu and 4 to 8GB ram 2 | 3 | apt-get update 4 | apt-get install docker.io -y 5 | 6 | curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl 7 | chmod +x ./kubectl 8 | sudo mv ./kubectl /usr/local/bin/kubectl 9 | kubectl version --client -o json 10 | 11 | curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_1.6.2.deb && sudo dpkg -i minikube_1.6.2.deb 12 | 13 | sudo minikube config set vm-driver none 14 | sudo minikube start & 15 | 16 | 17 | sudo minikube status 18 | host: Running 19 | kubelet: Running 20 | apiserver: Running 21 | kubeconfig: Configured 22 | ===================================================================== 23 | -------------------------------------------------------------------------------- /Kubernetes/Setup cluster using minikube.txt: -------------------------------------------------------------------------------- 1 | minikube VM setup [make sure CPU count should be min 2]. 2 | #follow minikube install instuctions 3 | sudo minikube start & 4 | sudo minikube status 5 | 6 | 7 | 8 | kubectl cluster-info 9 | Kubernetes master is running at https://10.0.2.15:8443 10 | KubeDNS is running at https://10.0.2.15:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy 11 | 12 | 13 | kubectl get pods --all-namespaces 14 | kubectl get pods -A 15 | 16 | ### Run dashboard at given IP 17 | kubectl proxy --address='192.168.56.101' --disable-filter=true & 18 | 19 | kubectl get svc -A 20 | NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 21 | default kubernetes ClusterIP 10.96.0.1 443/TCP 11d 22 | kube-system kube-dns ClusterIP 10.96.0.10 53/UDP,53/TCP,9153/TCP 11d 23 | 24 | minikube dashboard & (^c) # to create dashboard 25 | kubectl get pods -A - will see that kubernetes dashboard will be started 26 | 27 | #also check dashboard, pods are getting recreated. 28 | 29 | 30 | kubectl get svc -A 31 | NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 32 | default kubernetes ClusterIP 10.96.0.1 443/TCP 11d 33 | kube-system kube-dns ClusterIP 10.96.0.10 53/UDP,53/TCP,9153/TCP 11d 34 | kubernetes-dashboard dashboard-metrics-scraper ClusterIP 10.96.192.32 8000/TCP 11d 35 | kubernetes-dashboard kubernetes-dashboard ClusterIP 10.96.180.195 80/TCP 11d 36 | ================================================================================================================================================== 37 | ### change kubernetes-dashboard spec type from ClusterIP to NodePort by running below command, save and exit. 38 | kubectl -n kubernetes-dashboard edit service kubernetes-dashboard 39 | ----------------------------------------------------------------- 40 | #now check kubernetes-dashboard pod and you will find PORT number 41 | kubectl get svc -A 42 | NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 43 | default kubernetes ClusterIP 10.96.0.1 443/TCP 11d 44 | kube-system kube-dns ClusterIP 10.96.0.10 53/UDP,53/TCP,9153/TCP 11d 45 | kubernetes-dashboard dashboard-metrics-scraper ClusterIP 10.96.192.32 8000/TCP 11d 46 | kubernetes-dashboard kubernetes-dashboard NodePort 10.96.180.195 80:30590/TCP 11d 47 | 48 | # Acess the dashboard at 49 | 192.168.56.101:30590 50 | 51 | Within portal : 10.96.180.195 52 | 53 | 54 | #### Running a workload 55 | 56 | kubectl create deployment hello-nginx --image=nginx --port=80 # this creates a deployment and we can investigate into the Pod that gets created, which will run the container 57 | -------------------------------------------------------------- 58 | # after running above command, new workload created and can be checked at dashboard under Workloads -> Deployments 59 | # Also, At dashboard under Workloads -> Replica Sets - show pod details. 60 | 61 | kubectl get pods 62 | ----------------- 63 | NAME READY STATUS RESTARTS AGE 64 | hello-nginx-c56599c4d-q8jmk 1/1 Running 0 21m 65 | 66 | kubectl describe pod hello-nginx-c56599c4d-q8jmk 67 | ------------------------------------------------- 68 | 69 | #Expose a Service 70 | #It is time now to expose our basic Nginx deployment as a service. We can use the command shown below: 71 | 72 | kubectl expose deployment hello-nginx --type=NodePort #If we visit the Dashboard at this point and go to Services section, we can see out hello-nginx service entry. 73 | ----------------------------------------------------- 74 | 75 | kubectl get services 76 | -------------------- 77 | NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE 78 | hello-nginx NodePort 10.96.184.16 80:32093/TCP 87s 79 | kubernetes ClusterIP 10.96.0.1 443/TCP 113m 80 | 81 | kubectl describe service hello-nginx # give details of hello-nginx 82 | http://192.168.56.101:32093/ # exposed to 32093 port and can be accessed at http://192.168.56.101:32093/ 83 | 84 | within portal : 10.96.184.16 85 | 86 | #Workloads -> Services -> Pods -> hello-nginx-c56599c4d-q8jmk -> Logs or 87 | kubectl logs hello-nginx-c56599c4d-q8jmk 88 | 89 | kubectl scale --replicas=3 deployment/hello-nginx # Workloads -> Deployments will show 3/3 Pods. 90 | -------------------------------------------- 91 | 92 | kubectl scale --replicas=8 deployment/hello-nginx 93 | -------------------------------------------- 94 | 95 | #delete pods 96 | 97 | Dashboard -> deployments -> scale -> 2 98 | 99 | 100 | kubectl get replicaset 101 | ---------------------- 102 | NAME DESIRED CURRENT READY AGE 103 | hello-nginx-c56599c4d 0 0 0 11d 104 | 105 | kubectl delete replicaset hello-nginx-c56599c4d 106 | ----------------------------------------------- 107 | 108 | kubectl get deployments -A 109 | --------------------------- 110 | 111 | kubectl get deployments 112 | ------------------------ 113 | NAME READY UP-TO-DATE AVAILABLE AGE 114 | hello-nginx 0/0 0 0 11d 115 | 116 | kubectl delete deployments hello-nginx 117 | deployment.apps "hello-nginx" deleted 118 | 119 | kubectl get deployments 120 | No resources found in default namespace. 121 | 122 | kubectl get replicaset 123 | No resources found in default namespace. 124 | 125 | 126 | kubectl run hello-nginx --image=nginx --port=80 127 | kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead. 128 | deployment.apps/hello-nginx created 129 | 130 | kubectl get pods --all-namespaces 131 | NAMESPACE NAME READY STATUS RESTARTS AGE 132 | default hello-nginx-c56599c4d-kdxlj 1/1 Running 0 23s 133 | ... 134 | ... 135 | kubectl scale --replicas=5 deployment/hello-nginx 136 | 137 | kubectl get pods --all-namespaces 138 | NAMESPACE NAME READY STATUS RESTARTS AGE 139 | default hello-nginx-c56599c4d-7z77z 0/1 ContainerCreating 0 6s 140 | default hello-nginx-c56599c4d-bgz4p 0/1 ContainerCreating 0 6s 141 | default hello-nginx-c56599c4d-kdxlj 1/1 Running 0 68s 142 | default hello-nginx-c56599c4d-lm5jb 0/1 ContainerCreating 0 6s 143 | default hello-nginx-c56599c4d-sbwz4 0/1 ContainerCreating 0 6s 144 | ... 145 | ... 146 | 147 | 148 | # Pods will be recreated even after deleting them. 149 | kubectl delete --all pods --namespace=default 150 | 151 | #No authentication by default 152 | ps -ef | grep kubernetes-dashboard 153 | root 6544 2022 0 16:51 pts/0 00:00:00 grep --color=auto kubernetes-dashboard 154 | 1001 7462 7352 0 14:49 ? 00:00:34 /dashboard --insecure-bind-address=0.0.0.0 --bind-address=0.0.0.0 --namespace=kubernetes-dashboard --enable-skip-login --disable-settings-authorizer 155 | 156 | 157 | https://www.youtube.com/watch?v=-qrH23K7GaI&list=PLBAFXs0YjviLrsyydCzxWrIP_1-wkcSHS&index=16 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /Kubernetes/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure("2") do |config| 2 | config.vm.define "v", primary: true do |v| 3 | v.vm.box = "bento/ubuntu-18.04" 4 | v.vm.hostname = 'kubernetes' 5 | v.vm.network :private_network, ip: "192.168.56.101" 6 | 7 | v.vm.provider :virtualbox do |v| 8 | v.customize ["modifyvm", :id, "--name", "kubernetes"] 9 | v.customize ["modifyvm", :id, "--memory", 2048] 10 | v.customize ["modifyvm", :id, "--cpus", 2] 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /Kubernetes/ingress demo.txt: -------------------------------------------------------------------------------- 1 | minikube addons enable ingress 2 | kubectl get pods -n kube-system 3 | kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0 4 | kubectl expose deployment web --type=NodePort --port=8080 5 | kubectl get service web 6 | minikube service web --url 7 | curl 8 | 9 | 10 | kubectl create deployment web2 --image=gcr.io/google-samples/hello-app:2.0 11 | kubectl expose deployment web2 --port=8080 --type=NodePort 12 | kubectl apply -f example-ingress-2.yaml 13 | kubectl get ingress 14 | curl hello-world-2.info or curl hello-world-2.info/v1 15 | curl hello-world-2.info/v2 16 | 17 | 18 | ######## 19 | 20 | Kubectl get ingress 21 | 22 | the above command will help to get the cluster ip address and update that ip address in /etc/hosts file with below details for the curl command to work.. 23 | 24 | 10.25.65.1 hello-world-2.info 25 | -------------------------------------------------------------------------------- /Kubernetes/kubeadm-cluster/reference.txt: -------------------------------------------------------------------------------- 1 | 2 | Socks shop on minikube demo 3 | 4 | https://microservices-demo.github.io/deployment/kubernetes-minikube.html 5 | 6 | ###################### 7 | 8 | kubernetes multimaster using vagrant 9 | 10 | https://github.com/dyrnq/kubeadm-vagrant.git 11 | 12 | ################### 13 | 14 | kubernetes cluster using ansible 15 | 16 | https://www.cloudsigma.com/how-to-create-a-kubernetes-cluster-using-kubeadm-on-ubuntu-18-04/ 17 | 18 | ############## 19 | 20 | installatino using containerd 21 | 22 | https://k21academy.com/docker-kubernetes/three-node-kubernetes-cluster/ 23 | 24 | ############ 25 | 26 | 27 | https://www.gremlin.com/community/tutorials/how-to-create-a-kubernetes-cluster-on-ubuntu-16-04-with-kubeadm-and-weave-net/ 28 | 29 | Microservices demo using weave socks 30 | 31 | https://microservices-demo.github.io/docs/quickstart.html 32 | 33 | To make the status ready on the cluster 34 | 35 | kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')" 36 | 37 | location of complete-demo.yml file 38 | 39 | /home/ubuntu/microservices-demo/deploy/kubernetes/complete-demo.yaml 40 | 41 | 42 | Enabling K8S Dashboard 43 | 44 | kubectl apply -f https://gist.githubusercontent.com/initcron/32ff89394c881414ea7ef7f4d3a1d499/raw/4863613585d05f9360321c7141cc32b8aa305605/kube-dashboard.yaml 45 | 46 | Expose the dashboard 47 | 48 | kubectl describe svc kubernetes-dashboard -n kube-system 49 | 50 | Kubeadm Errors and Fixes 51 | 52 | https://www.devopsschool.com/blog/kubernetes-error-kubeadm-related-errors-and-solutions/ 53 | 54 | how to completely uninstall docker version 55 | 56 | https://stackoverflow.com/questions/71669875/how-to-completely-uninstall-docker 57 | 58 | docker version to install 18.09 59 | 60 | install a specific verison of docker 61 | 62 | https://docs.docker.com/engine/install/ubuntu/ 63 | 64 | -------------------------------------------------------------------------------- /Nagios/Installation.txt: -------------------------------------------------------------------------------- 1 | Installation steps 2 | 3 | 4 | https://www.tecmint.com/install-nagios-core-in-ubuntu-and-debian/ 5 | 6 | 7 | Open port no 80 and 443 to access nagios web console 8 | 9 | For NRPE installation pls use the following dependencies 10 | 11 | for the dependancies installation use the following step 12 | 13 | sudo apt-get update 14 | 15 | sudo apt-get install wget build-essential unzip openssl libssl-dev 16 | 17 | sudo apt-get install apache2 php libapache2-mod-php php-gd libgd-dev 18 | 19 | 20 | -------------------------------------------------------------------------------- /Nagios/Nagios_Client_Plugin_Installation_v1.0.txt: -------------------------------------------------------------------------------- 1 | Slave/Client 2 | 3 | 1. sudo apt-get update 4 | 5 | 2. sudo apt-get install nagios-nrpe-server nagios-plugins 6 | 7 | 3. Open the configuration file as shown below: 8 | 9 | sudo vim /etc/nagios/nrpe.cfg 10 | 11 | Find the below given line and in place of XXX add your master IP 12 | allowed_hosts=127.0.0.1, 13 | 14 | 15 | 4. Start NRPE service as shown below 16 | 17 | # sudo /etc/init.d/nagios-nrpe-server restart 18 | 19 | 20 | ################ 21 | 22 | Install check_nrpe on Master 23 | 24 | ################# 25 | #sudo apt-get update 26 | 27 | Install following package 28 | 29 | # sudo apt-get install -y autoconf automake gcc libc6 libmcrypt-dev 30 | 31 | cd /tmp 32 | 33 | wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-3.2.1/nrpe-3.2.1.tar.gz 34 | 35 | 36 | untar the file : tar xvf 37 | 38 | root@nagios-sog-4may:/tmp# tar -xvf nrpe.tar.gz 39 | 40 | then execute the following command 41 | 42 | root@nagios-sog-4may:/tmp/nrpe-3.2.1# 43 | 44 | cd /tmp/nrpe-nrpe-3.2.1$ ./configure 45 | 46 | 47 | 48 | #make check_nrpe 49 | 50 | # sudo make install-plugin 51 | 52 | # /usr/local/nagios/libexec/check_nrpe -H NRPE v3.2.1 53 | 54 | 55 | # /usr/local/nagios/libexec/check_nrpe -H 20.57.118.31 NRPE v3.2.1 56 | 57 | 58 | # /usr/local/nagios/libexec/check_nrpe -H 20.242.92.51 NRPE v3.2.1 59 | 60 | 61 | Make a configuration file as shown 62 | 63 | sudo vim /usr/local/nagios/etc/servers/host1.cfg 64 | 65 | 66 | 67 | 68 | verify the configuration again 69 | 70 | sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 71 | 72 | sudo service nagios restart 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | +919566515622 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /Nagios/nagios_core_server_installation_v1.0.txt: -------------------------------------------------------------------------------- 1 | Nagios core installation 2 | 3 | ########### 4 | Use ubuntu 18.04 LTS version to install 5 | 6 | 7 | Install Pre-requirements for Nagios 8 | 9 | first install the following LAMP stack components in your system, 10 | 11 | # apt install apache2 libapache2-mod-php php 12 | 13 | install the following system dependencies and utilities required to compile and install Nagios Core from sources, by issuing the follwoing command. 14 | 15 | # apt install wget unzip zip autoconf gcc libc6 make apache2-utils libgd-dev 16 | 17 | 18 | Install Nagios 4 Core in Ubuntu and Debian 19 | 20 | On the first step, create nagios system user and group and add nagios account to the Apache www-data user, by issuing the below commands. 21 | 22 | # useradd nagios 23 | # usermod -a -G nagios www-data 24 | 25 | 4. After all dependencies, packages and system requirements for compiling Nagios from sources are present in your system, go to Nagios webpage and grab the latest version of Nagios Core stable source archive by issuing the following wget command. 26 | 27 | # wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz 28 | 5. Next, extract Nagios tarball and enter the extracted nagios directory, with the following commands. Issue ls command to list nagios directory content. 29 | 30 | # tar xzf nagios-4.4.6.tar.gz 31 | # cd nagios-4.4.6/ 32 | # ls 33 | Sample Output 34 | total 600 35 | -rwxrwxr-x 1 root root 346 Apr 28 20:48 aclocal.m4 36 | drwxrwxr-x 2 root root 4096 Apr 28 20:48 autoconf-macros 37 | drwxrwxr-x 2 root root 4096 Apr 28 20:48 base 38 | drwxrwxr-x 2 root root 4096 Apr 28 20:48 cgi 39 | -rw-rw-r-- 1 root root 32590 Apr 28 20:48 Changelog 40 | drwxrwxr-x 2 root root 4096 Apr 28 20:48 common 41 | -rwxrwxr-x 1 root root 43765 Apr 28 20:48 config.guess 42 | -rwxrwxr-x 1 root root 36345 Apr 28 20:48 config.sub 43 | -rwxrwxr-x 1 root root 246354 Apr 28 20:48 configure 44 | -rw-rw-r-- 1 root root 29812 Apr 28 20:48 configure.ac 45 | drwxrwxr-x 5 root root 4096 Apr 28 20:48 contrib 46 | -rw-rw-r-- 1 root root 6291 Apr 28 20:48 CONTRIBUTING.md 47 | drwxrwxr-x 2 root root 4096 Apr 28 20:48 docs 48 | -rw-rw-r-- 1 root root 886 Apr 28 20:48 doxy.conf 49 | -rwxrwxr-x 1 root root 7025 Apr 28 20:48 functions 50 | drwxrwxr-x 11 root root 4096 Apr 28 20:48 html 51 | drwxrwxr-x 2 root root 4096 Apr 28 20:48 include 52 | -rwxrwxr-x 1 root root 77 Apr 28 20:48 indent-all.sh 53 | -rwxrwxr-x 1 root root 161 Apr 28 20:48 indent.sh 54 | -rw-rw-r-- 1 root root 422 Apr 28 20:48 INSTALLING 55 | ... 56 | 6. Now, start to compile Nagios from sources by issuing the below commands. Make sure you configure Nagios with Apache sites-enabled directory configuration by issuing the below command. 57 | 58 | # ./configure --with-httpd-conf=/etc/apache2/sites-enabled 59 | Sample Output 60 | *** Configuration summary for nagios 4.4.6 2020-04-28 ***: 61 | 62 | General Options: 63 | ------------------------- 64 | Nagios executable: nagios 65 | Nagios user/group: nagios,nagios 66 | Command user/group: nagios,nagios 67 | Event Broker: yes 68 | Install ${prefix}: /usr/local/nagios 69 | Install ${includedir}: /usr/local/nagios/include/nagios 70 | Lock file: /run/nagios.lock 71 | Check result directory: /usr/local/nagios/var/spool/checkresults 72 | Init directory: /lib/systemd/system 73 | Apache conf.d directory: /etc/apache2/sites-enabled 74 | Mail program: /bin/mail 75 | Host OS: linux-gnu 76 | IOBroker Method: epoll 77 | 78 | Web Interface Options: 79 | ------------------------ 80 | HTML URL: http://localhost/nagios/ 81 | CGI URL: http://localhost/nagios/cgi-bin/ 82 | Traceroute (used by WAP): 83 | 84 | 85 | Review the options above for accuracy. If they look okay, 86 | type 'make all' to compile the main program and CGIs. 87 | 7. In the next step, build Nagios files by issuing the following command. 88 | 89 | # make all 90 | 8. Now, install Nagios binary files, CGI scripts and HTML files by issuing the following command. 91 | 92 | # make install 93 | 9. Next, install Nagios daemon init and external command mode configuration files and make sure you enable nagios daemon system-wide by issuing the following commands. 94 | 95 | # make install-init 96 | # make install-commandmode 97 | # systemctl enable nagios.service 98 | 10. Next, run the following command in order to install some Nagios sample configuration files needed by Nagios to run properly by issuing the below command. 99 | 100 | # make install-config 101 | 11. Also, install Nagios configuration file for Apacahe web server, which can be fount in /etc/apacahe2/sites-enabled/ directory, by executing the below command. 102 | 103 | # make install-webconf 104 | 12. Next, create nagiosadmin account and a password for this account necessary by Apache server to log in to Nagios web panel by issuing the following command. 105 | 106 | # htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin 107 | 13. To allow Apache HTTP server to execute Nagios cgi scripts and to access Nagios admin panel via HTTP, first enable cgi module in Apache and then restart Apache service and start and enable Nagios daemon system-wide by issuing the following commands. 108 | 109 | # a2enmod cgi 110 | # systemctl restart apache2 111 | # systemctl start nagios 112 | # systemctl enable nagios 113 | 114 | for azure, Open port no 80 and 443 to access nagios web console 115 | 116 | 14. Finally, log in to Nagios Web Interface by pointing a browser to your server’s IP address or domain name at the following URL address via HTTP protocol. Log in to Nagios with nagiosadmin user the password setup with htpasswd script. 117 | 118 | http://IP-Address/nagios 119 | OR 120 | http://DOMAIN/nagios 121 | 122 | 15. To view your hosts status, navigate to Current Status -> Hosts menu where you will notice that some errors are displayed for localhost host, as illustrated in the below screenshot. The error appears because Nagios has no plugins installed to check hosts and services status. 123 | 124 | 125 | Install Nagios Plugins in Ubuntu 126 | 127 | 128 | 16. To compile and install Nagios Plugins from sources in Debian or Ubuntu, at the first stage, install the following dependencies in your system, by issuing the below command. 129 | 130 | 131 | for the dependancies installation use the following step 132 | 133 | sudo apt-get update 134 | 135 | sudo apt-get install wget build-essential unzip openssl libssl-dev 136 | 137 | sudo apt-get install apache2 php libapache2-mod-php php-gd libgd-dev 138 | 139 | 17. Next, visit Nagios Plugins repositories page and download the latest source code tarball by issuing the following command. 140 | 141 | # wget https://github.com/nagios-plugins/nagios-plugins/archive/release-2.3.3.tar.gz 142 | 18. Go ahead and extract the Nagios Plugins source code tarball and change path to the extracted nagios-plugins directory by executing the following commands. 143 | 144 | # tar xfz release-2.3.3.tar.gz 145 | # cd nagios-plugins-release-2.3.3/ 146 | 19. Now, start to compile and install Nagios Plugins from sources, by executing the following series of commands in your server console. 147 | 148 | # ./tools/setup 149 | # ./configure 150 | # make 151 | # make install 152 | 20. The compiled and installed Nagios plugins can be located in /usr/local/nagios/libexec/ directory. List this directory to view all available plugins in your system. 153 | 154 | # ls /usr/local/nagios/libexec/ 155 | Nagios Plugins Directory 156 | Nagios Plugins Directory 157 | 21. Finally, restart Nagios daemon in order to apply the installed plugins, by issuing the below command. 158 | 159 | # systemctl restart nagios.service 160 | 22. Next, log in to Nagios web panel and go to Current Status -> Services menu and you should notice all hosts services are checked now by Nagios plugins. 161 | 162 | From the color code you should see the current services status: green color is for OK status, yellow for Warning and red for Critical status. 163 | 164 | Check Host Services 165 | Check Host Services 166 | 23. Finally, to access Nagios admin web interface via HTTPS protocol, issue the following commands to enable Apache SSL configurations and restart the Apache daemon to reflect changes. 167 | 168 | # a2enmod ssl 169 | # a2ensite default-ssl.conf 170 | # systemctl restart apache2 171 | # sudo a2enmod rewrite 172 | 24. After you’ve enabled Apache SSL configurations, open /etc/apache2/sites-enabled/000-default.conf file for editing and add the following block of code after DocumentRoot statement as shown in the below excerpt. 173 | 174 | sudo a2enmod rewrite 175 | RewriteEngine On 176 | RewriteCond %{HTTPS} off 177 | RewriteRule (.*) https://%{23.102.116.33}/$1 [R,L] 178 | 179 | Configure Apache for Nagios 180 | Configure Apache for Nagios 181 | 25. You need to restart Apache daemon to apply the configured rules, by issuing the below command. 182 | 183 | # systemctl restart apache2.service 184 | 26. Finally, refresh the browser in order to be redirected to Nagios admin panel via HTTPS protocol. Accept the wanting message that gets displayed in the browser and log in to Nagios again with the your credentials. 185 | 186 | Nagios HTTPS Dashboard 187 | Nagios HTTPS Dashboard 188 | Congratulations! You have successfully install and configured Nagios Core monitoring system from sources in Ubuntu server or Debian. 189 | 190 | 191 | 192 | ########## 193 | root@nagios-sog-4may:~# cd /usr/local/nagios/etc/objects 194 | root@nagios-sog-4may:/usr/local/nagios/etc/objects# ls 195 | commands.cfg host1.cfg localhost.cfg switch.cfg timeperiods.cfg 196 | contacts.cfg host2.cfg printer.cfg templates.cfg windows.cfg 197 | root@nagios-sog-4may:/usr/local/nagios/etc/objects# 198 | 199 | ############# 200 | 201 | define service { 202 | 203 | use local-service ; Name of service template to use 204 | host_name localhost 205 | service_description PING 206 | check_command check_ping!100.0,20%!500.0,60% 207 | } 208 | 209 | 210 | Reference: https://www.tecmint.com/install-nagios-core-in-ubuntu-and-debian/ 211 | 212 | 213 | -------------------------------------------------------------------------------- /Nexus/Installation.txt: -------------------------------------------------------------------------------- 1 | ==========< Nexus Installation >========== 2 | 3 | Pre-requisite 4 | 2gigs of ram 5 | 15gigs of storage 6 | 7 | Just use virtual box (with 2 gigs of ram and 15 gigs of space) 8 | 9 | 'cd /opt' 10 | 11 | 'sudo su' 12 | 13 | 'sudo yum install -y yum-utils device-mapper-persistent-data lvm2' //Install required packages. 14 | 15 | 'sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo' //Use the following command to set up the stable repository. 16 | 17 | 18 | 'sudo yum install docker-ce docker-ce-cli containerd.io' //INSTALL DOCKER ENGINE - COMMUNITY 19 | 20 | 'systemctl start docker' 21 | 22 | 'docker pull sonatype/nexus3' 23 | 24 | 'docker run -d -p 8081:8081 --name nexus sonatype/nexus3' 25 | 26 | 'docker ps' 27 | 28 | 29 | Now go to browser: 30 | localhost:8081/nexus 31 | -------------------------------------------------------------------------------- /Nexus/Nexus-Hands-On-Lab.txt: -------------------------------------------------------------------------------- 1 | ===============< Nexus Hands On >=============== 2 | 3 | ===============< On Browser >=============== 4 | 5 | default username & password: admin & admin123 (respectively) 6 | 7 | 8 | to get the pasword for the admin you need to go inside the docker container and then go inside cd /nexus-data/admin.password 9 | 10 | 11 | go to settings up below the navigation bar (its a gear icon) 12 | 13 | //it will show us the repository 14 | 15 | //we need a sample project and a build tool to perform all the shizz. 16 | 17 | //install apache 18 | 19 | 'cd /opt' 20 | 21 | 'wget http://mirrors.estointernet.in/apache/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.tar.gz' 22 | 23 | 'tar zxf apache-maven-3.6.2-bin.tar.gz' 24 | 25 | 'cd apache-maven-3.6.2' 26 | 27 | 'cd bin/' 28 | 29 | './mvn -version' 30 | 31 | 'export PATH=$PATH:/opt/apache-maven-3.6.2/bin' 32 | 33 | //we need to integrate maven with nexus like how we did it with JFROG, this is for dependency management 34 | 35 | 'id'// will show which user are you logged in 36 | 37 | // home directory for root user is '/root' this is where the user will be placed when he logs in and all the other user's home directory is /home/ 38 | 39 | 'cd /root' //try to go to home directory 40 | 41 | 'ls -a' //shows hidden files also if you want to make a file/direcotry hidden just add a '.' before the name while naming it 42 | 43 | 'mkdir .m2' // it is a hidden folder that we are creating 44 | 45 | 'cd .m2' 46 | 47 | 'touch settings.xml' // this is to create the settings file 48 | 49 | 'vi settings.xml' // to connect maven to Nexus 50 | 51 | ++++++++++++++++< settings.xml >++++++++++++++++ 52 | 53 | 56 | 57 | 58 | 59 | nexus 60 | admin 61 | admin123 62 | 63 | 64 | 65 | 66 | 67 | nexus 68 | central 69 | http://52.66.25.4:8081/repository/maven-public/ 70 | * 71 | 72 | 73 | 74 | 75 | ++++++++++++++++++++++++++++++++++++++++++++++++++ 76 | 77 | // now we will get the sample code 78 | 79 | 'yum install git' 80 | 81 | 'git clone https://github.com/gouthamchilakala/sample-maven-project.git' 82 | 83 | 'cd sample-maven-project' 84 | 85 | 'vi pom.xml' 86 | 87 | 88 | Constantly changing code: 89 | each time they change, the won't or sometimes wouldn't need to change the version number, but they still would want the latest WAR file to be uploaded 90 | 91 | 1.0.0-snapshot // whenever you give -snapshot in the pom.xml file, each time it is built it will be updated on the test server. 92 | 93 | 1.0.0 // this is actual release 94 | 95 | 96 | //below we will change the distribution management 97 | 98 | ++++++++++++++++< settings.xml >++++++++++++++++ 99 | 101 | 4.0.0 102 | 103 | flipkart 104 | offers 105 | 1.1-release 106 | jar 107 | 108 | offers 109 | http://maven.apache.org 110 | 111 | 112 | UTF-8 113 | 114 | 115 | 116 | 117 | junit 118 | junit 119 | 3.8.1 120 | test 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | nexus 129 | maven-releases 130 | http://localhost:8081/repository/maven-releases 131 | 132 | 133 | 134 | nexus 135 | maven-snapshots 136 | http://localhost:8081/repository/maven-snapshots 137 | 138 | 139 | 140 | 141 | ++++++++++++++++< settings.xml >++++++++++++++++ 142 | 143 | 'mvn compile' 144 | 145 | //it will be going through the nexus repository if you see it. 146 | 147 | go to the browser, select 'browse server contents' that is next to the gear icon below the navigation bar 148 | 149 | click on 'maven-public' // this will be our central repository 150 | 151 | // you can see there are a lot of dependencies downloaded there 152 | 153 | // we will also need to learn how maven will upload its artifacts to the nexus reposiotry 154 | 155 | 'mvn deploy' // this will do the needful, deploy the sample project hence creating the JAR file and uploading it to the nexus 156 | 157 | 'ls' 158 | 159 | 'cd target/' 160 | 161 | // you can now see the JAR file in here if you ls again, but it needs to be in the nexus, so to see if it is actually there we can go and check 162 | 163 | goto the browser, under Browse server contents 164 | 165 | // here we can see under 'maven-releases' that the file of version 0.1.0 or which ever version was mentioned in the pom.xml file will be there 166 | 167 | //if we change the version in the pom.xml hence simulating a change in the code 168 | 169 | go to where the 'pom.xml' file is // it will mostly be inside the project folder 170 | 171 | 'vi pom.xml' 172 | 173 | +++++++< pom.xml >+++++++ 174 | ... 175 | 0.2.0 176 | ... 177 | +++++++++++++++++++++++++ 178 | 179 | 'mvn deploy' 180 | 181 | // now that we have simulated a change we will see whether the chnages have been reflected in the nexus 182 | 183 | go to the browser, refresh, go to browse server contents , inside the maven-release folder under the customercare repository you can see that both 0.1.0 and 0.2.0 //both the artifacts are available hence nexus acts as artifact repository just like JFrog acted as one. 184 | 185 | 186 | // to simulate a snapshot situation we will go to the pom.xml file and do the exact same thing except we will also add '-Snapshot' in the version name 187 | 188 | go to where the 'pom.xml' file is // it will mostly be inside the project folder 189 | 190 | 'vi pom.xml' 191 | 192 | +++++++< pom.xml >+++++++ 193 | ... 194 | 0.2.0-Snapshot // 'S' must be capital here 195 | ... 196 | +++++++++++++++++++++++++ 197 | 198 | 'mvn deploy' 199 | 200 | goto browser & refresh, click 'maven-snapshots' // you can see the artifact 201 | -------------------------------------------------------------------------------- /Python/python-reference.txt: -------------------------------------------------------------------------------- 1 | Python installation Link 2 | 3 | https://www.python.org/downloads/ 4 | 5 | Pycharm Community Edition Download link 6 | 7 | https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=windows&code=PCC 8 | 9 | Code Samples and Practice Exercises 10 | 11 | https://github.com/rushtojp/python-foundations-3-weeks.git 12 | 13 | -------------------------------------------------------------------------------- /Steps To Register Azure Free Account.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rushtojp/devopsclassfiles/1e0711743eb2083d6795a39f934d1caa7a5600dc/Steps To Register Azure Free Account.docx -------------------------------------------------------------------------------- /Terraform/Ubuntu Installation and Commands.txt: -------------------------------------------------------------------------------- 1 | Ubuntu -> https://learn.hashicorp.com/tutorials/terraform/install-cli 2 | ------ 3 | sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl 4 | curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - 5 | sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" 6 | sudo apt-get update && sudo apt-get install terraform 7 | mkdir learn-terraform-docker-container 8 | cd learn-terraform-docker-container 9 | 10 | main.tf 11 | ------------------------ 12 | terraform { 13 | required_providers { 14 | docker = { 15 | source = "kreuzwerker/docker" 16 | version = "~> 2.13.0" 17 | } 18 | } 19 | } 20 | 21 | provider "docker" {} 22 | 23 | resource "docker_image" "nginx" { 24 | name = "nginx:latest" 25 | keep_locally = false 26 | } 27 | 28 | resource "docker_container" "nginx" { 29 | image = docker_image.nginx.latest 30 | name = "tutorial" 31 | ports { 32 | internal = 80 33 | external = 8000 34 | } 35 | } 36 | ----------------------------- 37 | 38 | terraform init 39 | terraform apply 40 | terraform destroy 41 | ------------------------------------------------------- 42 | 43 | Terraform aws 44 | https://learn.hashicorp.com/tutorials/terraform/aws-build?in=terraform/aws-get-started 45 | 46 | AWS EC2 Location - region and ami ids 47 | 48 | https://cloud-images.ubuntu.com/locator/ec2/ 49 | 50 | ------------------------------------------------------------------------------------ 51 | # multiple ec2 instances 52 | https://automateinfra.com/2021/03/22/how-to-launch-multiple-ec2-instances-on-aws-using-terraform/ 53 | 54 | 55 | 56 | ==================================================================================== 57 | 58 | #Terraform with Azure https://learn.hashicorp.com/tutorials/terraform/azure-build 59 | 60 | #Prerequisites 61 | Create azure account 62 | Install the Azure CLI tool 63 | Authenticate using the Azure CLI - az login 64 | 65 | mkdir D:\learn-terraform\azure 66 | cd D:\learn-terraform\azure 67 | #create main.tf to create resouce group 68 | 69 | terraform init 70 | terraform plan 71 | terraform apply 72 | --------------------------- 73 | #rename main.tf with main.tf.1 74 | #rename main.tf.2 main.tf to create VM 75 | 76 | 77 | terraform init 78 | terraform plan 79 | terraform apply 80 | ---------------------------------------------- 81 | -------------------------------------------------------------------------------- /Terraform/tf-commands: -------------------------------------------------------------------------------- 1 | ## Create default subnet ## 2 | 3 | aws ec2 create-default-subnet --availability-zone ap-southeast-1a 4 | 5 | # Determine which Availability Zones support your instance type 6 | aws ec2 describe-instance-type-offerings --location-type availability-zone --filters Name=instance-type,Values=t3.micro --region us-east-1 --output table 7 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox' 5 | 6 | Vagrant.configure("2") do |config| 7 | ##### DEFINE VM ##### 8 | config.vm.define "dockervm-sog-ubuntu-aug23" do |config| 9 | config.vm.hostname = "dockervm-sog-ubuntu-aug23" 10 | config.vm.box = "bento/ubuntu-18.04" 11 | config.vm.box_check_update = false 12 | config.vm.network "private_network", ip: "192.168.56.59" 13 | 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /devops Practice resources/Resource Links.txt: -------------------------------------------------------------------------------- 1 | JP's Youtube channel : https://www.youtube.com/channel/UCt45vqIEmKUwpNG11yKtIfA 2 | 3 | JP's Linkedin : https://www.linkedin.com/in/jayaprakashbalakrishnan/ 4 | 5 | how to get a highly paid career with azure https://www.edrawmind.com/app/editor/BVWhkIm4gdFiwNglZXR30iUMClSAr8SZ?page=8889934692& 6 | 7 | Github Practice Site 8 | ################### 9 | 10 | https://learngitbranching.js.org/ 11 | 12 | KUbernetes 13 | ############## 14 | 15 | https://kubernetes.io/docs/tasks/run-application/ 16 | 17 | https://killercoda.com/pricing 18 | 19 | 20 | 21 | Azure Architecture Center 22 | ############################# 23 | 24 | https://docs.microsoft.com/en-us/azure/architecture/ 25 | 26 | AZURE PRICING/COST CALCULATOR 27 | ################## 28 | https://azure.microsoft.com/en-in/pricing/calculator/ 29 | 30 | AWS vs Azure comparison 31 | 32 | ######### 33 | https://docs.microsoft.com/en-us/azure/architecture/aws-professional/services 34 | 35 | AWS Knowledge Center Videos 36 | 37 | https://www.youtube.com/playlist?list=PLhr1KZpdzukfdjsOHZ-BazZt1iK1J8UUw 38 | 39 | AWS Architecture Center 40 | ########################## 41 | 42 | https://aws.amazon.com/architecture/ 43 | 44 | DevOPS BOOKS 45 | ############# 46 | 47 | Devops handbook by Gene Kim - 2nd edition 48 | 49 | https://amzn.to/3OG33uK 50 | 51 | Phoenix project 52 | 53 | https://amzn.to/3vuE2Ly 54 | 55 | Unicorn Project 56 | 57 | https://amzn.to/3KujNlt 58 | 59 | Beyond the phoenix project 60 | 61 | https://amzn.to/3KwQJd8 62 | 63 | Cloud resources by AWS, Azure, GCP and Oracle 64 | 65 | ############################################### 66 | 67 | pls visit their respective sites for free credits 68 | 69 | 70 | AWS BUilder's library 71 | 72 | #################### 73 | 74 | https://aws.amazon.com/builders-library/ 75 | 76 | Azure Devops Demo Generator 77 | ############################## 78 | 79 | https://azuredevopslabs.com/labs/vstsextend/Setup/ 80 | 81 | https://azuredevopsdemogenerator.azurewebsites.net/ 82 | 83 | Devops Interview Questions 84 | ########################## 85 | 86 | https://github.com/rushtojp/devops-commands/tree/main/DevOps%20Interview%20Quesions 87 | 88 | #################### 89 | 90 | Redhat Ansible workshops 91 | 92 | https://aap2.demoredhat.com/ 93 | 94 | ############ 95 | Reposweeper 96 | 97 | To clean github repos 98 | 99 | https://reposweeper.com/#tools_main 100 | 101 | Docker compose examples 102 | 103 | https://github.com/docker/awesome-compose/ 104 | 105 | 106 | Rezi Resume Builder website 107 | ################### 108 | https://www.rezi.ai/ 109 | 110 | Cloud comparison Tools 111 | ###################### 112 | 113 | https://comparecloud.in/ 114 | 115 | AWS Policy Generator Tool 116 | 117 | https://awspolicygen.s3.amazonaws.com/policygen.html 118 | 119 | AWS Well Architected Labs 120 | ########################## 121 | 122 | https://www.wellarchitectedlabs.com/ 123 | 124 | Architect Roles - Job Definition and Description 125 | ################################################# 126 | 127 | 128 | https://github.com/anitsh/til/issues/439 129 | 130 | ########### 131 | Ansible code snippet generator 132 | 133 | https://ansible.ai/ 134 | 135 | ############# 136 | 137 | encoding - decoding tool 138 | 139 | https://www.base64encode.org/ 140 | ############# 141 | 142 | Azure Charts for referring all the above 143 | 144 | https://azurecharts.com/ 145 | 146 | ############## 147 | 148 | AWS Developer Center 149 | 150 | https://aws.amazon.com/developer/ 151 | 152 | 153 | ############### 154 | 155 | Good reference books 156 | 157 | https://books.goalkicker.com/ 158 | 159 | ########## 160 | 161 | AI Explorer of AWS 162 | 163 | https://aiexplorer.aws.amazon.com/?lang=en 164 | 165 | ############### 166 | 167 | Azure Course blueprints 168 | 169 | https://techcommunity.microsoft.com/discussions/azurearchitecture/azure-course-blueprints/4012399 170 | 171 | ############### 172 | 173 | Teachable machine to demo AI training and others. 174 | 175 | https://teachablemachine.withgoogle.com/ 176 | 177 | ############ 178 | 179 | Azure architecture diagrams 180 | https://azurediagrams.com/ 181 | 182 | ########## 183 | AI App Templates 184 | https://azure.github.io/ai-app-templates/ 185 | 186 | ########### 187 | 188 | -------------------------------------------------------------------------------- /devops Practice resources/devops interview questions and answers 2023.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rushtojp/devopsclassfiles/1e0711743eb2083d6795a39f934d1caa7a5600dc/devops Practice resources/devops interview questions and answers 2023.pdf -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | RUN apt-get update 3 | RUN ["apt-get" , "install" , "figlet"] 4 | CMD ["figlet", "-f", "script", "hello"] 5 | # ENTRYPOINT ["figlet", "-f", "script"] 6 | 7 | 8 | # ENTRYPOINT ["figlet", "-f", "script"] 9 | 10 | # CMD ["hello"] 11 | 12 | 13 | 14 | # CMD ["figlet", "-f", "script", "hello"] 15 | 16 | -------------------------------------------------------------------------------- /docker/Dockerfile-reference.txt: -------------------------------------------------------------------------------- 1 | Dockerfile figlet:v1 2 | ############ 3 | 4 | FROM ubuntu 5 | RUN apt-get update 6 | RUN ["apt-get" , "install" , "figlet"] 7 | CMD ["figlet", "-f" , "script" , "hello" ] 8 | 9 | vim Dockerfile 10 | 11 | command to create image from dockerfile 12 | ############# 13 | docker build -t figlet:v1 . 14 | 15 | 16 | 17 | 18 | 19 | with entrypoint 20 | ############## 21 | 22 | FROM ubuntu 23 | RUN apt-get update 24 | RUN ["apt-get" , "install" , "figlet"] 25 | ENTRYPOINT ["figlet", "-f" , "script" ] 26 | CMD [”hello”] 27 | 28 | docker build -t figlet:v2 . 29 | -------------------------------------------------------------------------------- /docker/docker-installation.txt: -------------------------------------------------------------------------------- 1 | sudo apt-get update 2 | sudo apt-get install curl apt-transport-https ca-certificates software-properties-common -y 3 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 4 | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 5 | 6 | sudo apt-get update 7 | sudo apt-get install -y docker-ce 8 | service docker status 9 | 10 | __________ 11 | 12 | docker compose 13 | 14 | sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 15 | 16 | sudo chmod +x /usr/local/bin/docker-compose 17 | docker-compose --version 18 | 19 | _________ 20 | 21 | How to create AWS Ubuntu instance! 22 | 23 | https://www.cloudbooklet.com/create-an-ec2-instance-on-aws-with-ubuntu-18-04/ 24 | 25 | 26 | ####### 27 | 28 | root@sog-docker-sept-wd:~# docker run -d --name jenkins -p 8080:8080 jenkins/jenkins 29 | -------------------------------------------------------------------------------- /docker/docker-jenkins: -------------------------------------------------------------------------------- 1 | Run Docker container on Jenkins 2 | 3 | https://devops4solutions.com/integrate-jenkins-with-docker/ 4 | -------------------------------------------------------------------------------- /docker/history_docker_may132022.txt: -------------------------------------------------------------------------------- 1 | root@may12-docker-demo:~# history 2 | 1 clear 3 | 2 sudo apt-get update 4 | 3 sudo apt-get install curl apt-transport-https ca-certificates software-properties-common -y 5 | 4 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 6 | 5 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 7 | 6 sudo apt-get update 8 | 7 sudo apt-get install -y docker-ce 9 | 8 service docker status 10 | 9 docker compose 11 | 10 sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 12 | 11 sudo chmod +x /usr/local/bin/docker-compose 13 | 12 docker-compose --version 14 | 13 clear 15 | 14 docker ps 16 | 15 docker ps -A 17 | 16 docker ps -a 18 | 17 docker images 19 | 18 clear 20 | 19 docker pull hello-world 21 | 20 docker images 22 | 21 docker ps -a 23 | 22 docker run hello-world 24 | 23 docker ps 25 | 24 docker ps -a 26 | 25 clear 27 | 26 docker images 28 | 27 docker run hello-world 29 | 28 docker ps -a 30 | 29 clear 31 | 30 docker ps 32 | 31 docker ps -a 33 | 32 docker images 34 | 33 docker run hello-world 35 | 34 docker images -a 36 | 35 clear 37 | 36 docker run -it ubuntu bash 38 | 37 hostname 39 | 38 docker ps -a 40 | 39 docker run -dt ubuntu bash 41 | 40 docker ps 42 | 41 docker exec -it d0828de bash 43 | 42 docker ps 44 | 43 docker ps -a 45 | 44 docker start 94db652b2c 46 | 45 docker ps 47 | 46 clear 48 | 47 docker images 49 | 48 docker ps -a 50 | 49 docker run --name myubuntu -dt ubuntu bash 51 | 50 docker ps -a 52 | 51 docker exec -it 7f024aa119 bash 53 | 52 docker images 54 | 53 docker ps -a 55 | 54 clear 56 | 55 docker pull jenkins/jenkins:lts 57 | 56 docker images 58 | 57 docker run -p 9999:8080 -dt jenkins/jenkins:ltsbash 59 | 58 docker run -p 9999:8080 -dt jenkins/jenkins:lts bash 60 | 59 docker ps 61 | 60 curl ifconfig.co 62 | 61 docker ps -a 63 | 62 docker run -p 9999:8080 -dt jenkins/jenkins:lts bash 64 | 63 clear 65 | 64 docker run -p 9999:8080 -dt jenkins/jenkins 66 | 65 docker run -p 9998:8080 -dt jenkins/jenkins 67 | 66 docker ps -a 68 | 67 clear 69 | 68 docker ps 70 | 69 docker exec -it bdc0fc bash 71 | 70 docker logs 72 | 71 ls 73 | 72 docker ps 74 | 73 docker logs bdc0fc4e0df 75 | 74 clear 76 | 75 docker images 77 | 76 clear 78 | 77 pwd 79 | 78 clear 80 | 79 docker ps 81 | 80 docker exec -it 7f024aa11 bash 82 | 81 docker commit myubuntu coachjp/ubuntu-apachemay13:v1 83 | 82 docker push 84 | 83 docker push coachjp/ubuntu-apachemay13:v1 85 | 84 docker login 86 | 85 docker push coachjp/ubuntu-apachemay13:v1 87 | 86 docker run --name myubuntu3 ubuntu bash 88 | 87 docker ps -a 89 | 88 clear 90 | 89 docker images 91 | 90 docker pull jenkins:2.60.1 92 | 91 docker images 93 | 92 clear 94 | 93 docker ps -a 95 | 94 docker images 96 | 95 docker rmi hello-world 97 | 96 docker rm f6d9f0a d06998c0 436e12 98 | 97 docker ps -a 99 | 98 clear 100 | 99 docker images -a 101 | 100 docker rmi hello-world 102 | 101 docker images -a 103 | 102 clear 104 | 103 docker ps -a 105 | 104 docker rm 94db652b2c 106 | 105 docker stop 94db652b2c 107 | 106* docker rm ps -a 108 | 107 docker rm 94db652b2c 109 | 108 clear 110 | 109 history 111 | root@may12-docker-demo:~# 112 | -------------------------------------------------------------------------------- /history_22nd_aug_2ndhalf.txt: -------------------------------------------------------------------------------- 1 | 259 git log --oneline 2 | 260 git checkout test 3 | 261 git log --oneline 4 | 262 git merge master 5 | 263 git log --oneline 6 | 264 cd c: 7 | 265 clear 8 | 266 mkdir aug9rebasedemo 9 | 267 cd aug9rebasedemo/ 10 | 268 git status 11 | 269 git init 12 | 270 echo this is masterfile >> masterfile.txt 13 | 271 git status 14 | 272 git add . 15 | 273 git commit -m "m1" masterfile.txt 16 | 274 clear 17 | 275 git checkout -b test 18 | 276 echo test file created >> testfile.txt 19 | 277 git status 20 | 278 git add . 21 | 279 git commit -m "t1" testfile.txt 22 | 280 echo few more lines of code >> testfile.txt 23 | 281 git add . 24 | 282 git commit -m "t2" testfile.txt 25 | 283 git log --oneline 26 | 284 git status 27 | 285 git checkout master 28 | 286 ls 29 | 287 echo few lines of code >> masterfile.txt 30 | 288 git status 31 | 289 git add . 32 | 290 git commit -m "m2" masterfile.txt 33 | 291 git status 34 | 292 echo few more lines of code >> masterfile.txt 35 | 293 git status 36 | 294 git add . 37 | 295 git commit -m "m3" masterfile.txt 38 | 296 git checkout test 39 | 297 git log --oneline 40 | 298 git rebase master 41 | 299 git log --oneline 42 | 300 cd c: 43 | 301 mkdir aug9gitstash 44 | 302 cd aug9gitstash/ 45 | 303 echo git stash demo >> gitstashfile.txt 46 | 304 git status 47 | 305 git init 48 | 306 git status 49 | 307 git add gitstashfile.txt 50 | 308 git status 51 | 309 git stash 52 | 310 git stash gitstashfile.txt 53 | 311 git stash save firststash 54 | 312 git commit -m "git stash demo" . 55 | 313 echo additional changes to feature1 >> gitstashfile.txt 56 | 314 git status 57 | 315 git stash 58 | 316 git log --oneline 59 | 317 git status 60 | 318 git status 61 | 319 git stash 62 | 320 git stash pop 63 | 321 git status 64 | 322 echo 2nd file for stash demo >> gitstashsecondfile.txt 65 | 323 git status 66 | 324 git stash save stashdemo1 67 | 325 git status 68 | 326 git stash --help 69 | 327 git stash list 70 | 328 git status 71 | 329 git stash save secondfileadded 72 | 330 git status 73 | 331 git add . 74 | 332 git stash save secondfileadded 75 | 333 git stash list 76 | 334 git stash pop stash@{0} 77 | 335 git status 78 | 336 git stash save secondfileadded 79 | 337 git status 80 | 338 git stash list 81 | 339 git status 82 | 340 git status 83 | 341 echo feature1 udpates > feature1.txt 84 | 342 git status 85 | 343 git add . 86 | 344 echo "few lines of code" >> feature1.txt 87 | 345 git status 88 | 346 git stash save featur1stash 89 | 347 git status 90 | 348 echo "feature2 create" >> feature2.txt 91 | 349 git status 92 | 350 git add . 93 | 351 git status 94 | 352 git commit -m "work completed" feature2.txt 95 | 353 git status 96 | 354 git stash list 97 | 355 git stash pop featur1stash 98 | 356 git stash pop stash@{0} 99 | 357 git status 100 | 358 git stash list 101 | 359 git stash pop stash@{0} 102 | 360 git status 103 | 361 touch gitstashuntracked.txt 104 | 362 git status 105 | 363 git stash -u 106 | 364 git stash list 107 | 365 git stash pop 108 | 366 git stash list 109 | 367 git stash pop stash@{0} 110 | 368 git stash list 111 | 369 clear 112 | 370 cd c: 113 | 371 mkdir gitflowinitdemo 114 | 372 cd gitflowinitdemo/ 115 | 373 clear 116 | 374 git status 117 | 375 git flow init 118 | 376 git status 119 | 377 git branch 120 | 378 git flow feature start feature_branch 121 | 379 git status 122 | 380 git branch 123 | 381 echo some lines of code >> feature_feature_branchdemo.txt 124 | 382 git status 125 | 383 git add feature_feature_branchdemo.txt 126 | 384 git commit -m "feature branch added" . 127 | 385 git status 128 | 386 git flow feature finish feature_branch 129 | 387 git status 130 | 388 git branch 131 | 389 ls 132 | 390 clear 133 | 391 git flow release start 0.1.0 134 | 392 git branch 135 | 393 ls 136 | 394 echo "updates done at release branch" >> feature_feature_branchdemo.txt 137 | 395 git status 138 | 396 git add . 139 | 397 git commit -m "changes done in release" . 140 | 398 git status 141 | 399 git flow release finish '0.1.0' 142 | 400 git status 143 | 401 git branch 144 | 402 ls 145 | 403 git checkout master 146 | 404 ls 147 | 405 git tag 148 | 406 git flow hotfix start hotfix_branch 149 | 407 git branch 150 | 408 ls 151 | 409 git status 152 | 410 ls 153 | 411 echo "some hotfix updates" >> feature_feature_branchdemo.txt 154 | 412 git status 155 | 413 git add . 156 | 414 git commit -m "hotfix done" feature_feature_branchdemo.txt 157 | 415 git flow hotfix finish hotfix_branch 158 | 416 history 159 | 417 exit 160 | 418 pwd 161 | 419 cd c: 162 | 420 clear 163 | 421 mkdir sogaug9gitdemo 164 | 422 cd sogaug9gitdemo/ 165 | 423 git status 166 | 424 git init 167 | 425 pwd 168 | 426 ls 169 | 427 ls -al 170 | 428 clear 171 | 429 ls 172 | 430 git status 173 | 431 echo some lines of code >> sog123.yaml 174 | 432 git status 175 | 433 git add . 176 | 434 git status 177 | 435 git commit -m "sog123 file added" sog123.yaml 178 | 436 git status 179 | 437 git remote -v 180 | 438 git remote add origin https://github.com/rushtojp/sogaug9th.git 181 | 439 git remote -v 182 | 440 git branch -M master 183 | 441 git push -u origin master 184 | 442 ls 185 | 443 echo few more lines of code >> sog123.yaml 186 | 444 cat sog123.yaml 187 | 445 git status 188 | 446 git add sog123.yaml 189 | 447 git status 190 | 448 git commit -m "modifications done" . 191 | 449 git status 192 | 450 git log 193 | 451 git push 194 | 452 git log --oneline 195 | 453 git status 196 | 454 git fetch 197 | 455 git log --oneline 198 | 456 git pull 199 | 457 git status 200 | 458 git log --oneline 201 | 459 pwd 202 | 460 ls 203 | 461 vim sog123.yaml 204 | 462 git status 205 | 463 git add . 206 | 464 git commit -m sog123.yaml . 207 | 465 git status 208 | 466 git push 209 | 467 git log --oneline 210 | 468 vim sog123.yaml 211 | 469 git status 212 | 470 git add . 213 | 471 git status 214 | 472 git commit -m "changes done by git user change3" . 215 | 473 git push 216 | 474 git pull 217 | 475 ls 218 | 476 vim sog123.yaml 219 | 477 git status 220 | 478 git add . 221 | 479 git commit -m "merge conflict resolved" 222 | 480 git status 223 | 481 git push 224 | 482 cd c: 225 | 483 mkdir gitclonedemo 226 | 484 mkdir soggitclonedemo 227 | 485 cd soggitclonedemo/ 228 | 486 git clone https://github.com/rushtojp/git-cheat-sheet-jpscopy.git 229 | 487 ls 230 | 488 ls -al 231 | 489 cd git-cheat-sheet-jpscopy/ 232 | 490 ls 233 | 491 git clone https://github.com/GoogleCloudPlatform/solutions-terraform-jenkins-gitops.git 234 | 492 ls 235 | 493 clear 236 | 494 git branch 237 | 495 git branch feature1 238 | 496 git branch 239 | 497 git checkout feature1 240 | 498 git status 241 | 499 ls -al 242 | 500 exit 243 | 501 pwd 244 | 502 git status 245 | 503 clear 246 | 504 pwd 247 | 505 cd .. 248 | 506 cd .. 249 | 507 clear 250 | 508 mkdir sog22augdemo 251 | 509 cd sog22augdemo/ 252 | 510 pwd 253 | 511 git --version 254 | 512 git status 255 | 513 git init 256 | 514 ls -al 257 | 515 ls -l 258 | 516 ls -al 259 | 517 cd .git 260 | 518 pwd 261 | 519 ls -al 262 | 520 start . 263 | 521 cd .. 264 | 522 pwd 265 | 523 clear 266 | 524 ls 267 | 525 ls -al 268 | 526 echo "few lines of code" > newprogram.yaml 269 | 527 cat newprogram.yaml 270 | 528 git status 271 | 529 git add newprogram.yaml 272 | 530 git status 273 | 531 clear 274 | 532 git statsu 275 | 533 git status 276 | 534 git rm --cached newprogram.yaml 277 | 535 git status 278 | 536 clear 279 | 537 git status 280 | 538 echo "2nd program file" >> newprogram2.yaml 281 | 539 git status 282 | 540 git add newprogram.yaml 283 | 541 git status 284 | 542 git rm --cached newprogram.yaml 285 | 543 git status 286 | 544 clear 287 | 545 git status 288 | 546 git add . 289 | 547 git status 290 | 548 clear 291 | 549 git status 292 | 550 git commit -m "adding newprogram.yaml" newprogram.yaml 293 | 551 git status 294 | 552 git log 295 | 553 git status 296 | 554 git commit -m "adding newprogram2.yaml" . 297 | 555 git status 298 | 556 clear 299 | 557 git log 300 | 558 git status 301 | 559 clear 302 | 560 ls 303 | 561 echo "this is my 3rd program with some updates" >> newprogram3.yaml 304 | 562 git status 305 | 563 git add newprogram3.yaml 306 | 564 clear 307 | 565 git status 308 | 566 git commit -m "3rd program file added" . 309 | 567 git log 310 | 568 clear 311 | 569 git status 312 | 570 ls 313 | 571 vim newprogram.yaml 314 | 572 git status 315 | 573 git restore newprogram.yaml 316 | 574 git status 317 | 575 ls 318 | 576 cat newprogram.yaml 319 | 577 clear 320 | 578 ls 321 | 579 vim newprogram.yaml 322 | 580 git status 323 | 581 cat newprogram.yaml 324 | 582 git restore newprogram.yaml 325 | 583 cat newprogram.yaml 326 | 584 clear 327 | 585 vim newprogram.yaml 328 | 586 git status 329 | 587 git add newprogram.yaml 330 | 588 git status 331 | 589 git commit -m "new lines of code added" . 332 | 590 git status 333 | 591 clear 334 | 592 git status 335 | 593 git log 336 | 594 git log --oneline 337 | 595 clear 338 | 596 git config --global list 339 | 597 git config --global -list 340 | 598 git config --global --list 341 | 599 pwd 342 | 600 cd .. 343 | 601 mkdir sog22augdemo2 344 | 602 cd sog22augdemo2 345 | 603 git status 346 | 604 git init 347 | 605 start . 348 | 606 clear 349 | 607 echo "new testprogram" > testprogram.yaml 350 | 608 cat testprogram.yaml 351 | 609 git status 352 | 610 git add testprogram.yaml 353 | 611 clear 354 | 612 git status 355 | 613 git commit -m "testprogram added" . 356 | 614 git status 357 | 615 clear 358 | 616 git log 359 | 617 ls 360 | 618 cat testprogram.yaml 361 | 619 history 362 | 620 history > history_for_print.txt 363 | 621 ls 364 | 622 git log --oneline 365 | 623 ls 366 | 624 clear 367 | 625 pwd 368 | 626 cd .. 369 | 627 cd sog22augdemo 370 | 628 pwd 371 | 629 clear 372 | 630 git status 373 | 631 git log --oneline 374 | 632 git remote add origin https://github.com/rushtojp/sog22augdemo.git 375 | 633 git branch -M master 376 | 634 git push -u origin master 377 | 635 git log --oneline 378 | 636 git remote -v 379 | 637 ls 380 | 638 vim newprogram.yaml 381 | 639 git status 382 | 640 git add . 383 | 641 clear 384 | 642 git status 385 | 643 git commit -m "new modification" . 386 | 644 git status 387 | 645 git push 388 | 646 git log --oneline 389 | 647 git log 390 | 648 clear 391 | 649 pwd 392 | 650 start . 393 | 651 pwd 394 | 652 cd c: 395 | 653 mkdir gitclonedemosogaug22 396 | 654 cd gitclonedemosogaug22 397 | 655 pwd 398 | 656 clear 399 | 657 git clone https://github.com/rushtojp/addressbook-1.git 400 | 658 pwdl 401 | 659 pwd 402 | 660 ls -al 403 | 661 cd addressbook-1/ 404 | 662 ls -al 405 | 663 pwd 406 | 664 cd .. 407 | 665 cd .. 408 | 666 cd gitclonedemosogaug22/ 409 | 667 clear 410 | 668 git remote -v 411 | 669 cd .. 412 | 670 cd sog 413 | 671 cd sog22augdemo 414 | 672 pwd 415 | 673 clear 416 | 674 git remote -v 417 | 675 git log --oneline 418 | 676 git fetch 419 | 677 git diff 7744b78 2434510 420 | 678 cat newprogram.yaml 421 | 679 git pull 422 | 680 cat newprogram.yaml 423 | 681 ls 424 | 682 cat newprogram.yaml 425 | 683 git diff --help 426 | 684 git fetch --help 427 | 685 clear 428 | 686 git status 429 | 687 clear 430 | 688 git status 431 | 689 git branch 432 | 690 git branch feature1 433 | 691 git branch 434 | 692 git status 435 | 693 git checkout feature1 e1 436 | 694 clear 437 | 695 git checkout feature1 438 | 696 git status 439 | 697 git push -u origin feature1 440 | 698 git status 441 | 699 git status 442 | 700 clear 443 | 701 echo new code in feature1 > code1feature1.yaml 444 | 702 cat code1feature1.yaml 445 | 703 git status 446 | 704 git add . 447 | 705 clear 448 | 706 git commit -m "code1 of feature1 added" . 449 | 707 git status 450 | 708 git log 451 | 709 git push -u origin feature1 452 | 710 git checkout master 453 | 711 git log 454 | 712 git status 455 | 713 git log --oneline 456 | 714 git pull -u origin master 457 | 715 clear 458 | 716 git pull 459 | 717 git log 460 | 718 clear 461 | 719 git log --oneline 462 | 720 git status 463 | 721 ls 464 | 722 git status 465 | 723 git branch 466 | 724 git checkout feature1 467 | 725 ls 468 | 726 ls 469 | 727 clear 470 | 728 git checkout -b feature2 471 | 729 git status 472 | 730 echo this is code for feature2 > code1feature2.yaml 473 | 731 cat code1feature2.yaml 474 | 732 git status 475 | 733 git add . 476 | 734 git commit -m "code2 feature1 added locally" . 477 | 735 git status 478 | 736 ls 479 | 737 git checkout master 480 | 738 ls 481 | 739 ls 482 | 740 git status 483 | 741 clear 484 | 742 git status 485 | 743 git merge feature2 486 | 744 ls 487 | 745 git push -u origin master 488 | 746 git status 489 | 747 git status 490 | 748 git checkout -b feature3 491 | 749 git push -u origin feature3 492 | 750 git status 493 | 751 echo "new code added to feature3" > code1feature3.yaml 494 | 752 git status 495 | 753 git push -u origin feature3 496 | 754 git status 497 | 755 git add . 498 | 756 git commit -m "code1 in feature3 added" . 499 | 757 git push -u origin feature3 500 | 758 history > history_22nd_aug_2ndhalf.txt 501 | -------------------------------------------------------------------------------- /history_for_print.txt: -------------------------------------------------------------------------------- 1 | 121 echo few more lines of code >> 4thaug2ndyamlfile.yaml 2 | 122 cat 4thaug2ndyamlfile.yaml 3 | 123 git status 4 | 124 git add . 5 | 125 git status 6 | 126 git restore --staged 4thaug2ndyamlfile.yaml 7 | 127 git status 8 | 128 git status 9 | 129 cat 4thaug2ndyamlfile.yaml 10 | 130 git restore 4thaug2ndyamlfile.yaml 11 | 131 git status 12 | 132 cat 4thaug2ndyamlfile.yaml 13 | 133 git restore --help 14 | 134 clear 15 | 135 git status 16 | 136 ls 17 | 137 echo fewmorelinesof code >> 4thaug2ndyamlfile.yaml 18 | 138 git status 19 | 139 git add . 20 | 140 git commit -m "4thaug2ndyamlfile.yaml modifications added" 4thaug2ndyamlfile.yaml 21 | 141 git status 22 | 142 git log 23 | 143 git log --oneline 24 | 144 git diff b7c9b8c 7a50926 25 | 145 git status 26 | 146 git log 27 | 147 git config --global list 28 | 148 git config --global -list 29 | 149 git config --global --list 30 | 150 ls 31 | 151 ls -al 32 | 152 cd .git 33 | 153 ls 34 | 154 ls -al 35 | 155 vim config 36 | 156 ls 37 | 157 cd .. 38 | 158 pwd 39 | 159 ls 40 | 160 echo few more lines of yaml code >> 4thaug2ndyamlfile2.yaml 41 | 161 cat 4thaug2ndyamlfile2.yaml 42 | 162 git status 43 | 163 git add . 44 | 164 git status 45 | 165 git commit -m "4thaug2ndyamlfile2.yaml few lines added" . 46 | 166 git status 47 | 167 git log 48 | 168 start . 49 | 169 git status 50 | 170 git reset --help 51 | 171 git log --oneline 52 | 172 git reset b7c9b8c 53 | 173 git log --oneline 54 | 174 git status 55 | 175 cat 4thaug2ndyamlfile2.yaml 56 | 176 git remote add origin https://github.com/rushtojp/sog4thaugrepo1.git 57 | 177 git branch -M master 58 | 178 git push -u origin master 59 | 179 exit 60 | 180 vim testfile 61 | 181 pwd 62 | 182 cd c: 63 | 183 clear 64 | 184 mkdir 9thauggitdemo 65 | 185 cd 9thauggitdemo 66 | 186 clear 67 | 187 git status 68 | 188 git init 69 | 189 git status 70 | 190 echo myfirstfile on 9th august > 9thaugfirstfile.txt 71 | 191 git status 72 | 192 git commit -m "firstfile added" . 73 | 193 git commit -m "firstfile added" 9thaugfirstfile.txt 74 | 194 git status 75 | 195 git add . 76 | 196 git commit -m "firstfile added" 9thaugfirstfile.txt 77 | 197 git log 78 | 198 git log --oneline 79 | 199 clear 80 | 200 git remote add origin https://github.com/rushtojp/9thaugrepo.git 81 | 201 git branch -M master 82 | 202 git push -u origin master 83 | 203 git remote -v 84 | 204 git branch 85 | 205 git branch feature1 86 | 206 echo file1 branch code >> file1branch1.txt 87 | 207 ls 88 | 208 git branch feature1 89 | 209 git checkout feature1 90 | 210 ls 91 | 211 git status 92 | 212 git add . 93 | 213 git status 94 | 214 git status 95 | 215 git checkout master 96 | 216 git status 97 | 217 git checkout feature1 98 | 218 git status 99 | 219 git commit -m "file1branch1 committed" file1branch1.txt 100 | 220 git status 101 | 221 git checkout master 102 | 222 git status 103 | 223 ls 104 | 224 git merge feature1 105 | 225 git status 106 | 226 ls 107 | 227 git push 108 | 228 git log 109 | 229 clear 110 | 230 cd c: 111 | 231 mkdir aug9mergedemo 112 | 232 cd aug9mergedemo/ 113 | 233 vim mastercode.txt 114 | 234 git status 115 | 235 git init 116 | 236 git add . 117 | 237 git status 118 | 238 git commit -m "m1" mastercode.txt 119 | 239 git checkout -b test 120 | 240 echo test code >> testcode.txt 121 | 241 git add testcode.txt 122 | 242 git commit -m "t1" testcode.txt 123 | 243 echo few more lines of code >> testcode.txt 124 | 244 git status 125 | 245 git add . 126 | 246 git commit -m "t2" testcode.txt 127 | 247 git status 128 | 248 git log 129 | 249 git checkout master 130 | 250 ls 131 | 251 echo few lines of code m2 >> mastercode.txt 132 | 252 git add . 133 | 253 git commit -m "m2" mastercode.txt 134 | 254 git status 135 | 255 echo few more lines of code m3 >> mastercode.txt 136 | 256 git add . 137 | 257 git commit -m "m3" mastercode.txt 138 | 258 git status 139 | 259 git log --oneline 140 | 260 git checkout test 141 | 261 git log --oneline 142 | 262 git merge master 143 | 263 git log --oneline 144 | 264 cd c: 145 | 265 clear 146 | 266 mkdir aug9rebasedemo 147 | 267 cd aug9rebasedemo/ 148 | 268 git status 149 | 269 git init 150 | 270 echo this is masterfile >> masterfile.txt 151 | 271 git status 152 | 272 git add . 153 | 273 git commit -m "m1" masterfile.txt 154 | 274 clear 155 | 275 git checkout -b test 156 | 276 echo test file created >> testfile.txt 157 | 277 git status 158 | 278 git add . 159 | 279 git commit -m "t1" testfile.txt 160 | 280 echo few more lines of code >> testfile.txt 161 | 281 git add . 162 | 282 git commit -m "t2" testfile.txt 163 | 283 git log --oneline 164 | 284 git status 165 | 285 git checkout master 166 | 286 ls 167 | 287 echo few lines of code >> masterfile.txt 168 | 288 git status 169 | 289 git add . 170 | 290 git commit -m "m2" masterfile.txt 171 | 291 git status 172 | 292 echo few more lines of code >> masterfile.txt 173 | 293 git status 174 | 294 git add . 175 | 295 git commit -m "m3" masterfile.txt 176 | 296 git checkout test 177 | 297 git log --oneline 178 | 298 git rebase master 179 | 299 git log --oneline 180 | 300 cd c: 181 | 301 mkdir aug9gitstash 182 | 302 cd aug9gitstash/ 183 | 303 echo git stash demo >> gitstashfile.txt 184 | 304 git status 185 | 305 git init 186 | 306 git status 187 | 307 git add gitstashfile.txt 188 | 308 git status 189 | 309 git stash 190 | 310 git stash gitstashfile.txt 191 | 311 git stash save firststash 192 | 312 git commit -m "git stash demo" . 193 | 313 echo additional changes to feature1 >> gitstashfile.txt 194 | 314 git status 195 | 315 git stash 196 | 316 git log --oneline 197 | 317 git status 198 | 318 git status 199 | 319 git stash 200 | 320 git stash pop 201 | 321 git status 202 | 322 echo 2nd file for stash demo >> gitstashsecondfile.txt 203 | 323 git status 204 | 324 git stash save stashdemo1 205 | 325 git status 206 | 326 git stash --help 207 | 327 git stash list 208 | 328 git status 209 | 329 git stash save secondfileadded 210 | 330 git status 211 | 331 git add . 212 | 332 git stash save secondfileadded 213 | 333 git stash list 214 | 334 git stash pop stash@{0} 215 | 335 git status 216 | 336 git stash save secondfileadded 217 | 337 git status 218 | 338 git stash list 219 | 339 git status 220 | 340 git status 221 | 341 echo feature1 udpates > feature1.txt 222 | 342 git status 223 | 343 git add . 224 | 344 echo "few lines of code" >> feature1.txt 225 | 345 git status 226 | 346 git stash save featur1stash 227 | 347 git status 228 | 348 echo "feature2 create" >> feature2.txt 229 | 349 git status 230 | 350 git add . 231 | 351 git status 232 | 352 git commit -m "work completed" feature2.txt 233 | 353 git status 234 | 354 git stash list 235 | 355 git stash pop featur1stash 236 | 356 git stash pop stash@{0} 237 | 357 git status 238 | 358 git stash list 239 | 359 git stash pop stash@{0} 240 | 360 git status 241 | 361 touch gitstashuntracked.txt 242 | 362 git status 243 | 363 git stash -u 244 | 364 git stash list 245 | 365 git stash pop 246 | 366 git stash list 247 | 367 git stash pop stash@{0} 248 | 368 git stash list 249 | 369 clear 250 | 370 cd c: 251 | 371 mkdir gitflowinitdemo 252 | 372 cd gitflowinitdemo/ 253 | 373 clear 254 | 374 git status 255 | 375 git flow init 256 | 376 git status 257 | 377 git branch 258 | 378 git flow feature start feature_branch 259 | 379 git status 260 | 380 git branch 261 | 381 echo some lines of code >> feature_feature_branchdemo.txt 262 | 382 git status 263 | 383 git add feature_feature_branchdemo.txt 264 | 384 git commit -m "feature branch added" . 265 | 385 git status 266 | 386 git flow feature finish feature_branch 267 | 387 git status 268 | 388 git branch 269 | 389 ls 270 | 390 clear 271 | 391 git flow release start 0.1.0 272 | 392 git branch 273 | 393 ls 274 | 394 echo "updates done at release branch" >> feature_feature_branchdemo.txt 275 | 395 git status 276 | 396 git add . 277 | 397 git commit -m "changes done in release" . 278 | 398 git status 279 | 399 git flow release finish '0.1.0' 280 | 400 git status 281 | 401 git branch 282 | 402 ls 283 | 403 git checkout master 284 | 404 ls 285 | 405 git tag 286 | 406 git flow hotfix start hotfix_branch 287 | 407 git branch 288 | 408 ls 289 | 409 git status 290 | 410 ls 291 | 411 echo "some hotfix updates" >> feature_feature_branchdemo.txt 292 | 412 git status 293 | 413 git add . 294 | 414 git commit -m "hotfix done" feature_feature_branchdemo.txt 295 | 415 git flow hotfix finish hotfix_branch 296 | 416 history 297 | 417 exit 298 | 418 pwd 299 | 419 cd c: 300 | 420 clear 301 | 421 mkdir sogaug9gitdemo 302 | 422 cd sogaug9gitdemo/ 303 | 423 git status 304 | 424 git init 305 | 425 pwd 306 | 426 ls 307 | 427 ls -al 308 | 428 clear 309 | 429 ls 310 | 430 git status 311 | 431 echo some lines of code >> sog123.yaml 312 | 432 git status 313 | 433 git add . 314 | 434 git status 315 | 435 git commit -m "sog123 file added" sog123.yaml 316 | 436 git status 317 | 437 git remote -v 318 | 438 git remote add origin https://github.com/rushtojp/sogaug9th.git 319 | 439 git remote -v 320 | 440 git branch -M master 321 | 441 git push -u origin master 322 | 442 ls 323 | 443 echo few more lines of code >> sog123.yaml 324 | 444 cat sog123.yaml 325 | 445 git status 326 | 446 git add sog123.yaml 327 | 447 git status 328 | 448 git commit -m "modifications done" . 329 | 449 git status 330 | 450 git log 331 | 451 git push 332 | 452 git log --oneline 333 | 453 git status 334 | 454 git fetch 335 | 455 git log --oneline 336 | 456 git pull 337 | 457 git status 338 | 458 git log --oneline 339 | 459 pwd 340 | 460 ls 341 | 461 vim sog123.yaml 342 | 462 git status 343 | 463 git add . 344 | 464 git commit -m sog123.yaml . 345 | 465 git status 346 | 466 git push 347 | 467 git log --oneline 348 | 468 vim sog123.yaml 349 | 469 git status 350 | 470 git add . 351 | 471 git status 352 | 472 git commit -m "changes done by git user change3" . 353 | 473 git push 354 | 474 git pull 355 | 475 ls 356 | 476 vim sog123.yaml 357 | 477 git status 358 | 478 git add . 359 | 479 git commit -m "merge conflict resolved" 360 | 480 git status 361 | 481 git push 362 | 482 cd c: 363 | 483 mkdir gitclonedemo 364 | 484 mkdir soggitclonedemo 365 | 485 cd soggitclonedemo/ 366 | 486 git clone https://github.com/rushtojp/git-cheat-sheet-jpscopy.git 367 | 487 ls 368 | 488 ls -al 369 | 489 cd git-cheat-sheet-jpscopy/ 370 | 490 ls 371 | 491 git clone https://github.com/GoogleCloudPlatform/solutions-terraform-jenkins-gitops.git 372 | 492 ls 373 | 493 clear 374 | 494 git branch 375 | 495 git branch feature1 376 | 496 git branch 377 | 497 git checkout feature1 378 | 498 git status 379 | 499 ls -al 380 | 500 exit 381 | 501 pwd 382 | 502 git status 383 | 503 clear 384 | 504 pwd 385 | 505 cd .. 386 | 506 cd .. 387 | 507 clear 388 | 508 mkdir sog22augdemo 389 | 509 cd sog22augdemo/ 390 | 510 pwd 391 | 511 git --version 392 | 512 git status 393 | 513 git init 394 | 514 ls -al 395 | 515 ls -l 396 | 516 ls -al 397 | 517 cd .git 398 | 518 pwd 399 | 519 ls -al 400 | 520 start . 401 | 521 cd .. 402 | 522 pwd 403 | 523 clear 404 | 524 ls 405 | 525 ls -al 406 | 526 echo "few lines of code" > newprogram.yaml 407 | 527 cat newprogram.yaml 408 | 528 git status 409 | 529 git add newprogram.yaml 410 | 530 git status 411 | 531 clear 412 | 532 git statsu 413 | 533 git status 414 | 534 git rm --cached newprogram.yaml 415 | 535 git status 416 | 536 clear 417 | 537 git status 418 | 538 echo "2nd program file" >> newprogram2.yaml 419 | 539 git status 420 | 540 git add newprogram.yaml 421 | 541 git status 422 | 542 git rm --cached newprogram.yaml 423 | 543 git status 424 | 544 clear 425 | 545 git status 426 | 546 git add . 427 | 547 git status 428 | 548 clear 429 | 549 git status 430 | 550 git commit -m "adding newprogram.yaml" newprogram.yaml 431 | 551 git status 432 | 552 git log 433 | 553 git status 434 | 554 git commit -m "adding newprogram2.yaml" . 435 | 555 git status 436 | 556 clear 437 | 557 git log 438 | 558 git status 439 | 559 clear 440 | 560 ls 441 | 561 echo "this is my 3rd program with some updates" >> newprogram3.yaml 442 | 562 git status 443 | 563 git add newprogram3.yaml 444 | 564 clear 445 | 565 git status 446 | 566 git commit -m "3rd program file added" . 447 | 567 git log 448 | 568 clear 449 | 569 git status 450 | 570 ls 451 | 571 vim newprogram.yaml 452 | 572 git status 453 | 573 git restore newprogram.yaml 454 | 574 git status 455 | 575 ls 456 | 576 cat newprogram.yaml 457 | 577 clear 458 | 578 ls 459 | 579 vim newprogram.yaml 460 | 580 git status 461 | 581 cat newprogram.yaml 462 | 582 git restore newprogram.yaml 463 | 583 cat newprogram.yaml 464 | 584 clear 465 | 585 vim newprogram.yaml 466 | 586 git status 467 | 587 git add newprogram.yaml 468 | 588 git status 469 | 589 git commit -m "new lines of code added" . 470 | 590 git status 471 | 591 clear 472 | 592 git status 473 | 593 git log 474 | 594 git log --oneline 475 | 595 clear 476 | 596 git config --global list 477 | 597 git config --global -list 478 | 598 git config --global --list 479 | 599 pwd 480 | 600 cd .. 481 | 601 mkdir sog22augdemo2 482 | 602 cd sog22augdemo2 483 | 603 git status 484 | 604 git init 485 | 605 start . 486 | 606 clear 487 | 607 echo "new testprogram" > testprogram.yaml 488 | 608 cat testprogram.yaml 489 | 609 git status 490 | 610 git add testprogram.yaml 491 | 611 clear 492 | 612 git status 493 | 613 git commit -m "testprogram added" . 494 | 614 git status 495 | 615 clear 496 | 616 git log 497 | 617 ls 498 | 618 cat testprogram.yaml 499 | 619 history 500 | 620 history > history_for_print.txt 501 | -------------------------------------------------------------------------------- /sonarqube/sonarqube_install_config.txt: -------------------------------------------------------------------------------- 1 | Please create a ubuntu 18.04 image and open all the ports. though 9000 is what is required to be specific. 2 | 3 | 4 | ######### 5 | 6 | sudo apt-get update 7 | sudo apt-get install curl apt-transport-https ca-certificates software-properties-common -y 8 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 9 | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 10 | sudo apt-get update 11 | sudo apt-get install -y docker-ce 12 | service docker status 13 | 14 | 15 | ##################### 16 | 17 | docker pull sonarqube:6.7.7-community 18 | 19 | docker run -d -p 9000:9000 sonarqube:6.7.7-community 20 | 21 | 22 | sudo apt-get install openjdk-8-jdk -y 23 | 24 | 25 | export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 26 | 27 | echo $JAVA_HOME 28 | 29 | 30 | ----< Installing Maven >---- 31 | 32 | cd /opt 33 | 34 | wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.tar.gz 35 | 36 | tar zxf apache-maven-3.6.2-bin.tar.gz 37 | 38 | cd apache-maven-3.6.2 39 | 40 | cd bin/ 41 | 42 | ./mvn -version 43 | 44 | export PATH=$PATH:/opt/apache-maven-3.6.2/bin 45 | 46 | Fork the Petclinic repository and clone the git repository 47 | 48 | Git Clone PetClinic 49 | 50 | Go to home folder 51 | 52 | CD ~ 53 | 54 | git clone https://github.com/rushtojp/PetClinic.git 55 | 56 | cd PetClinic 57 | 58 | 'mvn compile' // to compile the project 59 | 60 | Please ensure to get the build success message. 61 | 62 | after that copy the maven code from the sonarqube website and run it here. 63 | 64 | ####### 65 | 66 | Go to the docker ip addres:9000 and create the project 67 | 68 | http://192.168.56.196:9000/ 69 | 70 | and login with username and password admin : admin 71 | 72 | 73 | 74 | ----< Performing the analysis of the sample code on SonarQube >---- 75 | 76 | 77 | after this welcome to sonarqube message 78 | 79 | enter a name for the token : PetClinic 80 | 81 | and generate 82 | 83 | whats your projects main language - choose java and in build technology - 84 | 85 | choose maven 86 | 87 | 88 | ### 89 | 90 | after that choose the below code 91 | 92 | Execute the SonarQube Scanner for Maven from your computer 93 | Running a SonarQube analysis with Maven is straighforward. You just need to run the following command in your project's folder. 94 | 95 | 96 | copy the code below that and run it in the vagrant machine.. 97 | 98 | 99 | mvn sonar:sonar \ 100 | -Dsonar.host.url=http://20.65.53.194:9001 \ 101 | -Dsonar.login=86abe96012ad47db813ca034a45cb1473af4ed28 102 | 103 | ########### 104 | 105 | Provide a token 106 | petclinic: 5bcf2226e7fbd83249e8c3673d916ce777fb4fa9 107 | 108 | 109 | 110 | sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_312/bin/java 111 | 112 | 113 | 114 | 115 | 116 | 117 | ######### 118 | 119 | Other references to troubleshoot 120 | 121 | ----< Installing Maven >---- 122 | 123 | 'cd /opt' 124 | 125 | 'wget http://mirrors.estointernet.in/apache/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.tar.gz' 126 | 127 | 'tar zxf apache-maven-3.6.2-bin.tar.gz' 128 | 129 | 'cd apache-maven-3.6.2' 130 | 131 | 'cd bin/' 132 | 133 | './mvn -version' 134 | 135 | 'export PATH=$PATH:/opt/apache-maven-3.6.2/bin' 136 | 137 | 138 | 'cd PetClinic' 139 | 140 | 'mvn compile' // to compile the project 141 | 142 | ----< Performing the analysis of the sample code on SonarQube >---- 143 | 144 | '/opt/apache-maven-3.6.1/bin/mvn ' //get the code from sonarqube and perfrom this code from PetClinic folder 145 | 146 | 147 | '/opt/apache-maven-3.6.1/bin/mvn ' //get the code from sonarqube and perfrom this code from PetClinic folder 148 | 149 | 150 | 151 | 152 | export PATH=$PATH:$JAVA_HOME/bin 153 | 154 | 155 | export PATH=$PATH:/usr/share/maven/bin 156 | 157 | root@AnsibleNode1:~/PetClinic# mvn compile 158 | 159 | --------------------------------------------------------------------------------