diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..19b2258456 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.css +*.java diff --git a/123Dockerfile b/123Dockerfile new file mode 100644 index 0000000000..69084ef35d --- /dev/null +++ b/123Dockerfile @@ -0,0 +1,6 @@ +FROM tomcat:8.0.20-jre8 +# Dummy text to test +COPY target/myweb*.war /usr/local/tomcat/webapps/myweb.war + +# Git webhook trigger demo +# TO test github push trigger diff --git a/Dockerfile b/Dockerfile index 69084ef35d..720df6b3d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,5 +2,3 @@ FROM tomcat:8.0.20-jre8 # Dummy text to test COPY target/myweb*.war /usr/local/tomcat/webapps/myweb.war -# Git webhook trigger demo -# TO test github push trigger diff --git a/Jenkins-ansible b/Jenkins-ansible new file mode 100644 index 0000000000..ba97c47e7f --- /dev/null +++ b/Jenkins-ansible @@ -0,0 +1,48 @@ +pipeline{ + agent any + tools { + maven 'Maven-3.6.1' + } + + environment{ + PATH = "/opt/maven3/bin:$PATH" + } + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'javahome2', url: 'https://github.com/srinivas1987devops/myweb.git' + } + } + stage("Maven Build"){ + steps{ + sh "mvn clean sonar:sonar package" + + } + } + stage('Upload War To Nexus'){ + steps{ + nexusArtifactUploader artifacts: [ + [ + artifactId: 'myweb', + classifier: '', + file: "target/myweb-8.2.0.war", + type: 'war' + ] + ], + credentialsId: 'nexus3', + groupId: 'in.javahome', + nexusUrl: '172.31.38.150:8081', + nexusVersion: 'nexus3', + protocol: 'http', + repository: 'sample-releases', + version: '8.2.0' + } + } + stage("Execute Ansible"){ + steps{ + ansiblePlaybook credentialsId: 'private-key', disableHostKeyChecking: true, installation: 'ansible2', inventory: 'dev.in', playbook: 'copy.yml' + } + + } + } +} diff --git a/Jenkins-appnew b/Jenkins-appnew new file mode 100644 index 0000000000..3f2b3511ad --- /dev/null +++ b/Jenkins-appnew @@ -0,0 +1,46 @@ +pipeline{ + agent any + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'javahome2', url: 'https://github.com/srinivas1987devops/myweb.git' + } + + stages{ + stage('Maven Build'){ + steps{ + echo "${getLatestCommitId()}" + sh "mvn clean package" + } + } + + stage('Docker Build Image'){ + steps{ + sh "docker build . -t prashanthi2021/qa:${getLatestCommitId()}" + } + } + + stage('push to docker hub'){ + steps{ + withCredentials([string(credentialsId: 'docker-hub', variable: 'dockerPwd')]) { + sh "docker login -u prashanthi2021 -p ${dockerPwd}" + sh "docker push prashanthi2021/qa:${getLatestCommitId()}" + } + + } + } + + stage('dev-deploy'){ + steps{ + sshagent(['docker-dev']) { + sh "ssh -o StrictHostKeyChecking=no ec2-user@172.31.1.118 docker rm -f mywebapp" + sh "ssh -o StrictHostKeyChecking=no ec2-user@172.31.1.118 docker run -d -p 8080:8080 --name mywebapp prashanthi2021/qa:${getLatestCommitId()}" + } + } + } + } +} +} +} + + diff --git a/Jenkins-decdemo b/Jenkins-decdemo new file mode 100644 index 0000000000..032870a253 --- /dev/null +++ b/Jenkins-decdemo @@ -0,0 +1,17 @@ +pipeline{ + agent any + stages{ + stage("GIT checkout"){ + steps{ + git credentialsId: 'javahome', url: 'https://github.com/srinivas1987devops/myweb.git' + + } + } + stage("Maven Build"){ + steps{ + sh "mvn clean package" + sh "mv target/*.war target/myweb.war" + } + } + } +} diff --git a/Jenkins-decnew b/Jenkins-decnew new file mode 100644 index 0000000000..b756e81ebc --- /dev/null +++ b/Jenkins-decnew @@ -0,0 +1,35 @@ +pipeline{ + agent any + + environment{ + PATH = "/opt/maven3/bin:$PATH" + } + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'javahome2', url: 'https://github.com/jamaal513/myweb.git' + } + } + stage("Maven Build"){ + steps{ + sh "mvn clean package" + sh "mv target/*.war target/myweb.war" + } + } + stage("deploy-dev"){ + steps{ + sshagent(['tomcat-new']) { + sh """ + scp -o StrictHostKeyChecking=no target/myweb.war ec2-user@172.31.45.234:/home/ec2-user/apache-tomcat-9.0.63/webapps/ + + ssh ec2-user@172.31.45.234 /home/ec2-user/apache-tomcat-9.0.63/bin/shutdown.sh + + ssh ec2-user@172.31.45.234 /home/ec2-user/apache-tomcat-9.0.63/bin/startup.sh + + """ + } + + } + } + } +} diff --git a/Jenkins-docker b/Jenkins-docker new file mode 100644 index 0000000000..023e51cc2f --- /dev/null +++ b/Jenkins-docker @@ -0,0 +1,59 @@ +pipeline{ + agent any + tools { + maven 'Maven-3.6.1' + } + + environment{ + PATH = "/opt/maven3/bin:$PATH" + } + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'javahome2', url: 'https://github.com/srinivas1987devops/myweb.git' + } + } + stage("Maven Build"){ + steps{ + sh "mvn clean sonar:sonar package" + + } + } + stage('Upload War To Nexus'){ + steps{ + nexusArtifactUploader artifacts: [ + [ + artifactId: 'myweb', + classifier: '', + file: "target/myweb-8.2.0.war", + type: 'war' + ] + ], + credentialsId: 'nexus3', + groupId: 'in.javahome', + nexusUrl: '172.31.47.157:8081', + nexusVersion: 'nexus3', + protocol: 'http', + repository: 'sample-releases', + version: '8.2.0' + } + } + stage('Build Docker Image'){ + steps{ + sh 'docker build -t deepikac2021/spring-boot-mongo .' + sh 'docker build -t tomcat:${BUILD_NUMBER} .' + sh 'docker run -itd --name srini36 -p 2900:8080 tomcat:${BUILD_NUMBER}' + } + } + stage('Push Docker Image'){ + steps{ + withCredentials([string(credentialsId: 'DOCKER_HUB_CREDENTIALS', variable: 'DOCKER_HUB_CREDENTIALS')]) { + sh "docker login -u deepikac2021 -p ${DOCKER_HUB_CREDENTIALS}" + } + sh 'docker push deepikac2021/spring-boot-mongo' + } + } + + + } +} diff --git a/Jenkins-kube b/Jenkins-kube new file mode 100644 index 0000000000..6b441b5b44 --- /dev/null +++ b/Jenkins-kube @@ -0,0 +1,65 @@ +pipeline{ + agent any + tools { + maven 'Maven-3.6.1' + } + + environment{ + PATH = "/opt/maven3/bin:$PATH" + } + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'javahome2', url: 'https://github.com/srinivas1987devops/myweb.git' + } + } + stage("Maven Build"){ + steps{ + sh "mvn clean sonar:sonar package" + + } + } + stage('Upload War To Nexus'){ + steps{ + nexusArtifactUploader artifacts: [ + [ + artifactId: 'myweb', + classifier: '', + file: "target/myweb-8.2.0.war", + type: 'war' + ] + ], + credentialsId: 'nexus3', + groupId: 'in.javahome', + nexusUrl: '172.31.8.121:8081', + nexusVersion: 'nexus3', + protocol: 'http', + repository: 'sample-releases', + version: '8.2.0' + } + } + stage('Build Docker Image'){ + steps{ + sh 'docker build -t deepikac2021/spring-boot-mongo .' + } + } + stage('Push Docker Image'){ + steps{ + withCredentials([string(credentialsId: 'DOCKER_HUB_CREDENTIALS', variable: 'DOCKER_HUB_CREDENTIALS')]) { + sh "docker login -u deepikac2021 -p ${DOCKER_HUB_CREDENTIALS}" + } + sh 'docker push deepikac2021/spring-boot-mongo' + } + } + stage("Deploy To Kuberates Cluster"){ + steps{ + kubernetesDeploy( + configs: 'springBoot.yml', + kubeconfigId: 'KUBERNETES_CLUSTER_CONFIG', + enableConfigSubstitution: true + ) + } + } + + } +} diff --git a/Jenkins-sonar-nexus-tomcat b/Jenkins-sonar-nexus-tomcat new file mode 100644 index 0000000000..36c8486544 --- /dev/null +++ b/Jenkins-sonar-nexus-tomcat @@ -0,0 +1,57 @@ +pipeline{ + agent any + tools { + maven 'Maven-3.6.1' + } + + environment{ + PATH = "/opt/maven3/bin:$PATH" + } + stages{ + stage("Git Checkout"){ + steps{ + git credentialsId: 'javahome2', url: 'https://github.com/srinivas1987devops/myweb.git' + } + } + stage("Maven Build"){ + steps{ + sh "mvn clean sonar:sonar package" + + } + } + stage('Upload War To Nexus'){ + steps{ + nexusArtifactUploader artifacts: [ + [ + artifactId: 'myweb', + classifier: '', + file: "target/myweb-8.2.0.war", + type: 'war' + ] + ], + credentialsId: 'nexus3', + groupId: 'in.javahome', + nexusUrl: '172.31.15.91:8081', + nexusVersion: 'nexus3', + protocol: 'http', + repository: 'sample-releases', + version: '8.2.0' + } + } + stage("deploy-dev"){ + steps{ + sshagent(['tomcat-new']) { + sh """ + scp -o StrictHostKeyChecking=no target/myweb-8.2.0.war ec2-user@172.31.14.7:/home/ec2-user/apache-tomcat-9.0.62/webapps/ + + ssh ec2-user@172.31.14.7 /home/ec2-user/apache-tomcat-9.0.62/bin/shutdown.sh + + ssh ec2-user@172.31.14.7 /home/ec2-user/apache-tomcat-9.0.62/bin/startup.sh + + """ + } + + } + } + } +} diff --git a/Jenkins-terraform b/Jenkins-terraform new file mode 100644 index 0000000000..75456cf2b8 --- /dev/null +++ b/Jenkins-terraform @@ -0,0 +1,41 @@ +pipeline { + + parameters { + string(name: 'environment', defaultValue: 'prod', description: 'Workspace/Environment file to use for deployment') + string(name: 'region', defaultValue: 'ap-northeast-1', description: 'Workspace/region file to use for deployment') + + + } + agent any + stages { + stage('Download terraform code from Gihub') { + steps { + git credentialsId: 'javahome2', url: 'https://github.com/srinivas1987devops/myweb.git' + } + } + stage('Terraform Ininitialization') { + steps { + sh """ + cd /var/lib/jenkins/workspace/terraform + terraform init -reconfigure + """ + } + } + stage('Terraform Plan') { + steps { + sh """ + cd /var/lib/jenkins/workspace/terraform + terraform plan -out=plan.${BUILD_NUMBER} -var profile=${params.environment} -var region=${params.region} + """ + } + } + stage('Terraform Apply') { + steps { + sh """ + cd /var/lib/jenkins/workspace/terraform + terraform apply plan.${BUILD_NUMBER} + """ + } + } + } +} diff --git a/Jenkinsfile007 b/Jenkinsfile007 new file mode 100644 index 0000000000..c6f3cdbfc3 --- /dev/null +++ b/Jenkinsfile007 @@ -0,0 +1,3 @@ + +pipeline{ + diff --git a/arun-git.txt b/arun-git.txt new file mode 100644 index 0000000000..80ec00a518 --- /dev/null +++ b/arun-git.txt @@ -0,0 +1,361 @@ +Git ( vcs / SCM ) version control system / source code management. + +Below are the functions of a VCS − + +1. Allows developers to work simultaneously. + +2. Does not allow overwriting each other’s changes. + +3. Maintains a history of every version. + + +The Following are the types of VCS − + +1. Centralized version control system (CVCS). ===>> SVN + +2. Distributed/Decentralized version control system (DVCS). ===> Git. + +we will concentrate only on distributed version control system and especially on Git. Git falls under distributed version control system. + +GIT ===>> alternative older VCS ==>> SVN. + + +Centralized version control system (CVCS) uses a central server to store all files and enables team collaboration. + + But the major drawback of CVCS is its single point of failure, i.e., failure of the central server. + + Unfortunately, if the central server goes down for an hour, then during that hour, no one can collaborate at all. + + And even in a worst case, if the disk of the central server gets corrupted and proper backup has not been taken, + + then you will lose the entire history of the project. Here, distributed version control system (DVCS) comes into picture. + +========================================================================================================================================== + +DVCS clients not only check out the latest snapshot of the directory but they also fully mirror the repository. + +If the server goes down, then the repository from any client can be copied back to the server to restore it. Every checkout is a full backup of the repository. + + Git does not rely on the central server and that is why you can perform many operations when you are offline. + + You can commit changes, create branches, view logs, and perform other operations when you are offline. + + You require network connection only to publish your changes and take the latest changes + +================================================================================================================================================== + +Git terminalogy : + +Git is a client server architecture. + +client ===>> gitbash and server.===>> github + +repository : group of project files to store one single area and each project has one repository.==>>> github has ==>> n . no.of repositories.. + +cloning : remote reposiory ( myweb ) to getting the local ==>>> cloning ==>>> git clone url ( each project has one url) ===>> locally + +fork : projects are copied from one github account to another github account. + +local repository : getting the remote repository ( myweb) to our local laptop. + +remote repository : github ==>> our created repository ( myweb ) + +push : sending local repository changes to remote repository + +pull : sending the remote repository changes to the local repository + +Note : git follows ===>> 2 types of protocalls ==>>> https and ssh. + +===================================================================================================== + +Git workflow : + +1. we need to clone remote repository to local.. + +git clone url + +git clone https://github.com/srinivas1987devops/myweb.git + +ls + +2. go to the inside local repository. + +cd myweb + +3. files ==>>> create / modify ===>> working area. + +touch rk123 + +git status ==>> red color ==>> working area. + +4. git add . / filename / * + +git status + +file ==>> green color ===>> INdexing / staging area. + +5. we are getting the files to local repository ==>> commit + +git commit -m 'rk2020' ==>> local repository. + +git log + +40 digits commitiD ==>>> head ==>> head always points to latest commit. + +6. push to remote repository.. + +git push origin master + +push ==>>> sending local changes to remote repository.. + +origin ==>> alias name ==>>> github url + +master ==>> default branch. + + +========================================================================= +git config --global user.name “ramakrishnaj2020” + +git config --global user.email “ramakrishnaj832@gmail.com” + + +git push origin master ==>> githubaccountname and github passsowrd ==>>> remote. + +================================================================================== + +How to undo changes in working area ?? + +file ==>> modify ==>> working area + +git checkout filename. + +How to undo the changes in index/ staging area + +file ==>> modify ==>> working area + +git add . / filename / * ==>> index / staging area + +git reset filename + +How to undo the changes the in local repository. + +file ==>> modify ==>> working area + +git add . / filename / * ==>> index / staging area. + +git commit -m 'b123' + +git log + +git reset commitid + +======================================================================== + +**** ===>>>> Branching strategies:<<=============== + +1. master branch ===>>> default branch + +2. developement branch ( dev ) ==>>> every team has their own branch ==>> which is created from master branch. + +3. feture branch ==>> every developer has their own branch ==>> which is created from dev branch. + +4. hotfix / bugfix branch ==>> errors / bugs ===> which is created from master branch.===>> errors free ==>>> hotfix / bugfix branch will delete. + +5. Release branch.===>> every release has one branch with version ==>> which is created from master branch. ==>> once release push to remote ==>> Release branch will delete. + +Branch : To develope the code of our project. + +How to create branch in locally ?? + +git branch branchname + +How to push local branch remote ??? + +git push origin branchname + +How to delete local branch + +git branch -d branchname + +How to delete remote branch + +git push origin -d branchname + +How to go to inside a branch + +git checkout branchname + +=================================== + +***** merging strayegies in locally **** + +1. fast-forward + +2. twoway or recursive merge + +3. git rebase ( dangerous) + +=============================================================================== + +git cherry-pick : + +It picks a commit from one branch and applys it to another branch with out doing merge. + +git cherry-pick commitid. + +================================================================================== + +How to merge the remote side changes ===>>> pull request. + +pull request ==>> remote side branches ==>>> github ===>> in between the branches ==>> merging is nothing but pull request. + +pull request ==>> TL / collegues ===>> approval ==>> merge pull request ==>> conform merge. + +pull request ==>>> source and destination + +source ( right side ) and destination ( left side). + +================================================================================== + +tags : tags are used to release the application or code version or feture version. + +list of tags to see ==>> git tag + +how to create a tag locally ?? + +git tag tagname + +git tag v1.0 + + +how to push local tag to remote + +git push origin taganme + +git push origin v1.0 + + +tags are create on the perticular commit. + +git tag tagname commitid + +tags are created from the master branch only.. + +how to delete a tag locally + +git tag -d tagname + +how to delete remote tags + +git push origin -d tagname. + +================================================================================= + +git stash : + +bhargavi ==>> developer ==>> mno file ==>>> working area , index area ===>> before going to commit ==>> P1 ( priority one task ==>>> 2 hours close) . + +bharagavi ==>>> developer ==>>> mno file ==>>> tempararily save ==>> git statsh. + +after completion of the p1 task ==>> tempararily save ==>> unstash ==>> after that commit. + +git stash save ==>>> tempararily save + +git stash list ==>> stash {0} + +git stash apply stashid stash {5} or git stash pop stashid stash {5} ==>> unstash + +git commit -m 'c1' + +git push origin master. + +=============================================================================================== + +merge conflicts ( locally ) + +ramakrishna ==>> developer + +siva ===>> developer + +both develoeprs are working on the same file ===>>> pqrs ===>> same line ==>> 151 + +siva ==>> developer ==>> dev branch ==>>> merge ==>>> unable to merge. + +git merge tool + +pqrs ==>> will open ==>> 151 << >> ==>> brackets ==>>> remove the brackets + +pull request conflicts ( remote side) + +sekhar ==>> developer + +sundar ===>> developer + +both develoeprs are working on the same file ===>>> mno ===>> same line ==>> 351 + +sundar ==>> developer ==>> dev branch ==>>> pullrequest ==>>> unable to pullrequest. ===>> resolve conflicats. + +mergeconflicts ===>>> click this ==>>>> mno ==>>> open + +mno ==>> will open ==>> 351 << >> ==>> brackets ==>>> remove the brackets. + +=============================================================================================== + +1. release branch + +2. pullrequest. + +3. tags + +4. github ==>> backup. + +====================================================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..0a2b52b7fc --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,29 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +steps: +- script: echo Hello, world! + displayName: 'Run a one-line script' + +- script: | + echo Add other tasks to build, test, and deploy your project. + echo See https://aka.ms/yaml + displayName: 'Run a multi-line script' +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' + javaHomeOption: 'JDKVersion' + mavenVersionOption: 'Default' + mavenAuthenticateFeed: false + effectivePomSkip: false + sonarQubeRunAnalysis: false \ No newline at end of file diff --git a/c1 b/c1 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/c2 b/c2 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/c3 b/c3 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cherry1 b/cherry1 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/copy.yml b/copy.yml new file mode 100644 index 0000000000..5c6a884277 --- /dev/null +++ b/copy.yml @@ -0,0 +1,7 @@ +--- + - hosts: webservers + tasks: + - name: copy the file from local to remote + copy: + src: target/myweb-8.2.0.war + dest: /usr/local/apache-tomcat-9.0.62/webapps/ diff --git a/dev.in b/dev.in new file mode 100644 index 0000000000..e34b9e808f --- /dev/null +++ b/dev.in @@ -0,0 +1,2 @@ +[webservers] +172.31.44.56 ansible_user=ec2-user diff --git a/elb123.txt b/elb123.txt new file mode 100644 index 0000000000..fc58acfd19 --- /dev/null +++ b/elb123.txt @@ -0,0 +1,109 @@ + +================================================== +#! /bin/bash +yum install httpd -y +service httpd start +chkconfig httpd on +echo "
My first paragraph.
+ + + + +==================================== + + + + + +My second paragraph.
+ + + + +======================================== + + + + + + +My orders paragraph.
+ + + + +=============================== + + + + + +My payments paragraph.
+ + + + +MomNdad@143 + + + +HTTP : without security + +HTTPS : SSL cirtificate ==>> upload + + + + +Arman@2020 + + +git config --global user.email “Armanali2you@gmail.com” + +git config --global user.name “Armanali2020” + + + + + + + + + + + +baluchina999@gmail.com + +baluchina@123 + + + + + + + + + + + + + + + + + diff --git a/garum b/garum new file mode 100644 index 0000000000..248d259855 --- /dev/null +++ b/garum @@ -0,0 +1,2 @@ +fdsff +sfsdfds \ No newline at end of file diff --git a/geesha b/geesha new file mode 100644 index 0000000000..e69de29bb2 diff --git a/hhh b/hhh new file mode 100644 index 0000000000..e69de29bb2 diff --git a/iii b/iii new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jamaal b/jamaal new file mode 100644 index 0000000000..3b486bb727 --- /dev/null +++ b/jamaal @@ -0,0 +1 @@ +ths is the demo of how to undo the chages in index/staging area diff --git a/jamaal.txt b/jamaal.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jamaal1 b/jamaal1 new file mode 100644 index 0000000000..00d3f03fa5 --- /dev/null +++ b/jamaal1 @@ -0,0 +1 @@ +dfdsfsfffdsfffds diff --git a/jamaal56 b/jamaal56 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jamaalpullrequest b/jamaalpullrequest new file mode 100644 index 0000000000..e3a4189328 --- /dev/null +++ b/jamaalpullrequest @@ -0,0 +1 @@ +this is pull request job diff --git a/jamalpasha b/jamalpasha new file mode 100644 index 0000000000..4e69c1c48e --- /dev/null +++ b/jamalpasha @@ -0,0 +1,2 @@ +He is belongs to spain team.. +he is belongs to pune team.. diff --git a/jamesbond b/jamesbond new file mode 100644 index 0000000000..160d86e694 --- /dev/null +++ b/jamesbond @@ -0,0 +1,7 @@ +HI ths is jamaalpasha. + +learninng dev-ops +interview questons .what is the lifecycle of git >> +workig area --indexing area or staging area--local repsitory--remote repository.. +s +he is same as bond like jamaal diff --git a/jenkins b/jenkins new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jjj b/jjj new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jp b/jp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jp2 b/jp2 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jp3 b/jp3 new file mode 100644 index 0000000000..ff7d016dcf --- /dev/null +++ b/jp3 @@ -0,0 +1,2 @@ +fdff +fdfsf \ No newline at end of file diff --git a/kejriwal b/kejriwal new file mode 100644 index 0000000000..e69de29bb2 diff --git a/kk b/kk new file mode 100644 index 0000000000..dcd6df1696 --- /dev/null +++ b/kk @@ -0,0 +1,2 @@ +fdsf +dsf \ No newline at end of file diff --git a/kkk b/kkk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/m1 b/m1 new file mode 100644 index 0000000000..e69de29bb2 diff --git a/madan-linux.txt b/madan-linux.txt new file mode 100644 index 0000000000..f407091aa0 --- /dev/null +++ b/madan-linux.txt @@ -0,0 +1,1470 @@ +How to create AWS account ??? + +email address , mobile number , Debit card ( master / visa ) + +Google ===>> aws console login ==>> AWs management console ===>> sign into console ==>>> create new account ==>> email : xyz , password 1243 , conform password : 1234 ==>> Aws account name : ==>> continue.. + +AWS free-tier ( select ) ===>> personal ( select ) or proffesional/ business acount ===>>> address details ==> d.no , streect , pincode , state ,near landmark.. + +==>>> debit card details ==>> 16 digits number ==>> CVV ===>>> OTP ( 2/-) ===>>> do you have pancrad : no ===>> + +AWS ==> verification ==>> mobile number ===>> voice message / text message (select) ==>> 4 digits ( 5896 ) + +my role is : student + +you are intestrd in : other.. + +AWs console login ==>> sign in ==>> email id with password ===>> + +AWS account ==>> imediate / 24 hours.. + + +========================================================================================================= + +Linux servers : we will create linux servers in AWS account + +Linux servers to connect ===>> we need to two softwares or applications install in our laptop. + +1. gitbash + +2. putty + +========================================================================================================================= + +Linux : it is an operating system like windows.. + +Linux is process oriented operating system.. + + +Datacenter : physical linux servers ===>> hardware ===>> o.s install ( linux ) ===>> application and databse installl ==>> APP ===>> EU. + +AWS ==>> Cloud ===>>> AMI ( amazon machine image) ==>> Ec2 instance ==>>> application and databse installl ==>> APP ===>> EU. + + +Unix : operating system. + +Unix 4 types of flavours : + +1. sun solaris 2. Redhat Linux ( open source and free of cost ) 3. IBM-AIX 4. HP-UNIX.. + +Other remaining these three are enterpraise versions ===>> License purhase ===>>>> manadatory.. + + +windows : + +C:/ : operating system install ===>> Admin user. + +GUI mode operations ( Graphical user interface) ===>> clicks. + +files and folders + +NTFS filesystem ( new technology file system) + + +Linux : + +/ ==>>> root ===>>> operating system install ===>>> rootuser / parent user / super user / Admin user. + +CLI mode operations : ( Command Line interface) ===>>> commands to type. + +files and directories + +ext2 , ext3 , ext4 ( latest ) ==>> file systems. + +ext2 ===>> second extended file system. + +ext3 ===>> third extended file system. + +ext4 ===>> fourth extended file system. + + +===================================================================================================================================== + +ec2 : elastic cloud compute : ec2 ==>>> virtal machine. ==>>> ec2 instance. + +AMI ==>> Amazon machine image + +Every AMI has their own identification number ===>> AMI ID. + +Every operarting sysrem has their own AMI. ==>> o.s install. + +security group : + +It is a virtual firewall at ec2 instance level.. + +it contains set of rules.. + +every application has their own port number.. + +all ports in between ==>>> 0 to 65535 + +ec2-user ( default user ) ===>> able to login we need to add a rule ==>> ssh ( mandatory) + +ssh ==>> port number ==>>> 22. + +http ==>> port number ==>> 80 + +mysql ==>>> database ==>> 3306 + +============================================================================================== + +when ever you created a ec2 intsance ==>> then automatically two Ip addresses will come. + +1. public IP address : ec2 instance to login and application enduser to access. + +this is visible only in AWs console dashboard. + +2. private Ip address : it is used to internal communication. + +this is visible in both AWS console dashboard and ec2 instance. + +================================================================================================== + +keypair ===>>> ramakrishna ===>> download ===>>> extension ====>>> ramakrishna.pem ==>> pemfile. + +pemfile conatins privatekey + +afetr launching the ec2 instance ===>> defaultly create publickey key . + +privatekey and publickey -->>> match --->>> default user able to login into ec2 instance ( ec2-user). + +===================================================================================================== + +======================================================================================================= + +Linux basic commands : + +Files and directory operations : + +Files operations : + +cat > filename + +I am new to linux .. + +ctrl + d ==> save. + +ex: cat > ramakrishna + +I am new to linux , devops , aws + +ctrl + d ==>> save.. + +==>>>> list of files ==>> ls + +file identification ==>> ls ==> file ==>>> white color. + +ls -l ==>> first field ==>> - ( hyphen) + +2. How to append the data ina file + +cat >> filename + +S3 and RDS .. + +ctrl + d ==>> save + +3. How to view inside data in a file. + +cat filename + +cat ramakrishna + +4. How to copy file from one location to another location. + +cp source destionation + +note : destination must be a directory.. + +mkdir directoryname + +mkdir sachin + +ex: cp ramakrishna sachin + +4. How to move file from one location to another location. + +mv source destionation + +note : destination must be a directory.. + +mkdir directoryname + +mkdir yuvi + +ex: mv ramakrishna yuvi + +5. How to rename a file. + +mv oldname newname + +mv ramakrishna srinivas + + +6. How to create empty files. + +touch filename + +touch abc + +touch {a..m} + +7. file1 ==>>>data and file2 empty file ==>> file1 data copy to file2. ==>>> redirect. + +cat file1 > file2 + +cat ramakrishna > abc + +8. How to delete a file . + +rm -rf filename + +rm -rf ramakrishna. + +==================================================================================== + +==================================================================================== + +directory operations : + +how to create a directory ?? + +mkdir directoryname + +mkdir sachin + +ls ==>> directory color ==>> blue. + +ls -l ==>> first field ( d) + +pwd ==>> present working directory.. + +cd ==>> change directory.. + +cd sachin + +pwd + +/home/ec2-user/sachin + +mkdir rahul + +cd rahul + +pwd + +/home/ec2-user/sachin/rahul + +mkdir hardik + +cd hardik + +pwd + +/home/ec2-user/sachin/rahul/hardik + +mkdir lara + +cd lara + +pwd + +/home/ec2-user/sachin/rahul/hardik/lara + +cd .. + +/home/ec2-user/sachin/rahul/hardik + +cd .. + +/home/ec2-user/sachin/rahul + +cd .. + +/home/ec2-user/sachin/ + +cd .. + +/home/ec2-user/ + +mkdir -p /home/ec2-user/sachin/rahul/hardik/lara/ponting + +cd /home/ec2-user/sachin/rahul/hardik/lara + +pwd + +/home/ec2-user/sachin/rahul/hardik/lara + +cd ../../../../ + +pwd + +/home/ec2-user/ + +================================ + +how to rename a directory + +mv oldname newname + +mv sachin dhoni + +how to delete a directory + +rm -rf directryname + +rm -rf sachin + +================================================================================================= + +filter commands : + +files / directories / users / groups + +useradd ramakrishna + +useradd bhargavi + +user related information ==>>> /etc/passwd + +head : top 10 users to display ==>> head /etc/passwd + +tail : below 10 users to display ==>> tail /etc/passwd + +more : page by page ===>> more /etc/passwd ==>>> space button press ==>> last page ==>> automatically exit.. + +less : page by page ==>> less /etc/passwd. ==>>> space button press ==>> last page ==>> not exit ==>>> q button press ==> quit + +================================================================================================== + + +vi editor : + +files ===>>> create , with in the files ==>> data ==>>> modify and delete by using vi editor.. + +vi editor has 3 types of modes.. + +1. CLI mode. + +2. Insert mode. + +3. Extended mode. + +vi ramakrisha ====>> CLI mode + +press " i " key ==>> insert mode. + +I am new to Linux.. + +escape shift:wq! ===>>> save ===>>> extended mode. + +cat ramakrishna + +================================================================================================================= + + +grep and find : + +10 files + + +ramakrishna + +ls -l | grep ramkrishna + +ls -l | grep 123 + +ls -l | grep abc + +ls -l | grep a + +ls -l | grep A + +i ==>> ignore case sensitive + +ls -l | grep -i A + + +find : + +find / -optins keyword + +options : + +1. files + +2. directories + +3. users + +4. groups + +5. inum ==>>> inode number ==>> 4 digit number. + +find / -name ramakrishna + +find / -name sachin + +find / -user pavan + +find / -group aws + +find / -inum 1234 + +================================================================= + +files and directory permissions : ===>> security + +security ===>> userlevel , grouplevel , otherlevel.. + +ls -l + +- ==>> file + +d ==>> directory + +c ==>> charecter file + +b ==>> block file + +l ==>> link file. + +rw- ( userlevel) r-- (grouplevel ) r-- ( otherslevel) + +r ==>>> read ===>> 4 + +w ==>> write ===>> 2 + +x ==>> execute ==>> 1 + +By using this command ==>> chmod command ==>> change modification. + +2 types methods to giving the files and directory permissions. + +1. symbolic method. + +2. Absolute method. +======================= + +1. symbolic method. + +file ==>>> bhargavi + +userlevel 6 , grouplevel 3 , otherslevel ==>> 5 + +chmod u=rw,g=wx,o=rx bhargavi + +sachin ==>>> 7 ( userlevel ) 6 ( group level ) 4 ( otherlevel ) + +chmod u=rwx,g=rw,o=r sachin + +========================================================= + +2. Absolute method. + +yuvi ==>> 655 + +chmod 655 yuvi + +chiru ==>> 666 + +chmod 666 chiru + +abc ==>> only userlevel full permissions.. + +chmod 700 abc + +xyz ==>> group level full permissions.. + +chmod 070 xyz + +chmod 007 ponting.. + +======================================================================== + +file full permissions : 666 + +directory full permissions : 777 + +default file permissions : 644 + +default directory permissions : 755 + +umask ==>> 022 / 0022 + +666 - 022 ==>> 644 + +777 - 022 ==>> 755 + +======================================================================== + +Booting process : + +ex: windows ==>> power on button ==>> press ==>> password ====>> in between poweron button and passowrd process ==>> Booting process.. + +Linux ==> power on button ==>> press then booting process will starts. + +Booting process has 6 stages : + +1. BIOS : Basic input output system. + +2. MBR : Master boot record. + +3. GRUB : Grand unified bootloader. + +4. KERNEL : + +5.INIT : initialization. + +6. RUNLEVELS : + + +1. BIOS : Basic input out system. + +It will checks the system integrity check . + +system integrity check ==>> system's hradware check ==>> motherboard , cpu , ram , harddisk ==>> properly working or not ?? + + +2. MBR : Master boot record: + +It contains the bootables files .. + +MBR has 3 components + +1. Primary bootloader. ==>> 446 bytes. + +2. Partition table information. ==>> 64 bytes. + +3. MBR validation check. ==>> 2 bytes. + +MBR size ==>> 512 bytes. + +3. GRUB : Grand unified bootloader. + +GRUB contains the information + +Root device inforamtion ===>> /dev/xvda + +multiple kernel images ==>> 5 , 6 , 7 , 8 , 9 + +default time ===>> ??? + +timedout ===>> ??? + +grub contains one configuration file ===>> /boot/grub/grub.conf + +vi /boot/grub/grub.conf + +/boot/grub/grub.conf ==>>> this configuration file link to /etc/grub.conf. + + +4. KERNEL : + +It is the mediator between o.s and hardware. + +it is the heart of the operating. + +It will manages devices information , multitasking , filesystem information. + +5. INIT : + +It is parent of all process. + +each process has their own unique identification number. + +process ==>> unique id ==>> process id ==>>> PID + +init ==>> pid ==>> 1 + +root ==>> pid ==>> 0 + +init 0 ===>> Hung state. ( danger command.) + +init 1 ===>> single user mode ( trouble shoot ) + +init 2 ===>> multiuser mode with out network ( networking related commands are not working) + +init 3 ===>> multiuser mode with network ( networking related commands are working here) ==>> default init level + +init 4 ===>> un used. + +init 5 ==>>> X11 ( GUI mode ) + +init 6 ===>>> reboot ==>> danger command ===>> with respective people ==>> approval. + +vi /etc/inittab + +/etc/init.d ==>> scripts.. + +6. RUNLEVELS : + +shell scripts ==>>> application install or backup ==>> scripts to put inside inside runlevels. + +/etc/rc.d/rc0.d ==>> runlevel 0 + +/etc/rc.d/rc1.d ==>> runlevel 1 + +/etc/rc.d/rc2.d ==>> runlevel 2 + +/etc/rc.d/rc3.d ==>> runlevel 3 ==>>> default runlevel.. + +/etc/rc.d/rc4.d ==>> runlevel 4 + +/etc/rc.d/rc5.d ==>> runlevel 5 + +/etc/rc.d/rc6.d ==>> runlevel 6 + +vi /etc/rc.d/rc3.d/.backup.sh ==>> reboot ==>> you will get complete backup of linux server. + +/etc/init.d ==>> scripts.. ==>>> app ==>> service ==>> manage. + +============================================================================================= + +AWS ==>> runlevels ==>> alternative ==>> userdata ==>> script. + +================================================================================================== + +Partitiong / filesystem creation : + +deviding the hard disk into the no .of partitions.. + +500gb harddsik ===>> 10 parttions ==>> each partition has the size ==>> 50 gb.. + +Physical servers point of view : + +device naming convensions : + +/dev ==>> devices information. + +/dev/sda ==>> SCSI + +/dev/hda ==>> IDE + +/dev/vda ==>> virtual disk.. + +4 , 8 , 12 , 16. + +Each physical linux servers ==>> 16 hard disks attached one linux servers.. + +/dev/sda to /dev/sdp + +/dev/sda to /dev/sde ==>>>> o.s internally used.. + +extranal we will attached to the physical linux server ==>>> /dev/sdf to /dev/sdp.. + +LInux ==>> file system types ==>> ext2 , ext3 , ext4 ( latest ) + + +senario : + +Application team ==>> request raise to linux admin team ==>> 500 gb ==>> disk space ( hard disk) ==>>>file sysyem ==>> app5 ==>> mount point ==>> application install. + +Linux admin team ==>> request raise SAN ( storage area network ) team ==>> please attach 500 gb hard disk to lx123 ( linux server name ). + +SAN team request raise to data center people ( field engineers ) ==>>> lax123 ==>attach to 500gb hard disk. ==>>> they will attach 500gb hard disk to linux server. + +Linux admin team follows below steps.. + +1. fdisk -l ( o.s control ) + +2. partprobe /dev/sdf ==>>> kernel identification. + +3. mkfs.ext4 /dev/sdf ==>> creating the file system. + +4. mkdir app5 + +5. mounting : attaching a directory to the file system. it is called mount point. + +mount -t ext4 /dev/sdf app5 + +6. cat /etc/mtab ==>> temparary mount points. + +7. How to make permanate mount ?? + +vi /etc/fstab + +devicename mountpoint typeoffilesystem defaults 0 (dump) 0 ( check sequence) + +/dev/sdf /home/ec2-user/app5 ext4 defaults 0 0 + +esc shift:wq! + +8. cd app5 + +ls + +lost + found ==>> directory.. + +touch {a..e} + +reboot + +=============================================================================== + +AWS cloud : EBS ==>> elastic block storage. + +disk space ===>> volume + +Application team ==>> request raise to linux admin team ==>> 500 gb ==>> volume ==>>> filesystem ==>>> app5 ==>> mount point ==>> application install. + +EBS thumbrule : + +Ec2 instance and volume should be in same availability zone. + +Ec2 instance ==>> 1a ==>> AZ + +volume ==>> same AZ ( 1a ) ==> 500 gb + +we will attach this volume to ec2 instance + +volumes ==>> 16 volumes to create one ec2 instance. + +/dev/sda to /dev/sdp. + +/dev/sda to /dev/sde ==>> o.s internelly used. + +volume attach to ec2 instance ==>>> /dev/sdf to /dev/sdp. (11) + +After login into the ec2 instance ==>> device naming convension to display diffrent. ==>>> /dev/xvdf to /dev/xvdp. + +Linux admin team follows below steps.. + +1. fdisk -l ( o.s control ) + +2. lsblk ==>>> kernel identification. + +3. mkfs.ext4 /dev/xvdf ==>> creating the file system. + +4. mkdir app5 + +5. mounting : attaching a directory to the file system. it is called mount point. + +mount -t ext4 /dev/xvdf app5 + +6. cat /etc/mtab ==>> temparary mount points. + +7. How to make permanate mount ?? + +vi /etc/fstab + +devicename mountpoint typeoffilesystem defaults 0 (dump) 0 ( check sequence) + +/dev/xvdf /home/ec2-user/app5 ext4 defaults 0 0 + +esc shift:wq! + +8. cd app5 + +ls + +lost + found ==>> directory.. + +touch {a..e} + +reboot + +=============================================================================== +ebs history : + +[root@ip-172-31-32-34 ec2-user]# history + 1 fdisk -l + 2 lsblk + 3 mkfs.ext4 /dev/xvdf + 4 mkdir app5 + 5 mount -t ext4 /dev/xvdf app5 + 6 cat /etc/mtab + 7 vi /etc/fstab + 8 df -h + 9 cd app5/ + 10 ls + 11 touch {a..z} + 12 ls + 13 cd .. + 14 fdisk -l + 15 lsblk + 16 mkfs.ext4 /dev/xvdg + 17 mkdir app6 + 18 mount -t ext4 /dev/xvdg app6 + 19 cat /etc/mtab + 20 vi /etc/fstab + 21 ls + 22 cd app6 + 23 ls + 24 touch {1..20} + 25 ls + 26 cd .. + 27 history +[root@ip-172-31-32-34 ec2-user]# + +[root@ip-172-31-32-34 ec2-user]# cat /etc/fstab +# +UUID=26620198-186a-404b-b9a1-12d957d7c826 / xfs defaults,noatime 1 1 +/dev/xvdf /home/ec2-user/app5 ext4 defaults 0 0 +/dev/xvdg /home/ec2-user/app6 ext4 defaults 0 0 +[root@ip-172-31-32-34 ec2-user]# +[root@ip-172-31-32-34 ec2-user]# + + +============================================================================================================ + +Networking : + +Two or more systems connected each other ==>> networking + +systems ==>>>nothing but servers. + +Physical servers point of view ==>> data center ===>> onpremise infrastructure. + +Two servers are in same network ==>>> minimum requirements.. + +1. Two servers must be cabled with other. + +2. Each servers has at least one NIC card ( Network interface card / controller..) + +3. Each NIC card has one IPaddress and subnetmask.. + +4. After login into physical servers==>> eth0 ===>> logic nic name ==>> 192.168.0.1 ( IP address ) and subnetmask ==>> 255.255.255.0. + +NIC1 ==>> eth0 + +NIC2 ==>> eth1 + +NIC3 ==>> eth2 + +Based on the hardware ==>> nic slots..==> NICs will attach. + +5. Then these two systems in same network.. and these systems communicate with each other.. + +6. server1 ==>>> login ==>> ping server2IPaddress ==>> ping sequence.. + +7. server2 ==>>> login ==>> ping server1IPaddress ==>> ping sequence.. + +====================================================================================== + +Networking advantages.. + +1. files transfer ==>>> from one server to another server. + +2. Remoteuserly login ==>> from one server to another server. ==>>> applications install.. + +========================================================================================== + +The above requirements to do tasks..==>> we configure the ssh configuration. + +ssh : secure shell ==>>>> port number ==>>> 22 + +ssh : secure sheel + +1. server1 to server2 ==>>> files trasfer ==>> encrypted format. + +server2 to server1 ==>>> files trasfer ==>> decrypted format. + +SSH ==>> no one will hack. + +2. ssh : password less authentication. + +server1 to server2 ==>>> connect ==>> with out passowrd asking. + +server2 to server1 ==>>> connect ==>> with out passowrd asking. + +How to configure ssh configuration ?? + +central.pem ==>> privatekey. + +server1 : central.pem ==>> privatekey ==>> copy. + +1. vi /tmp/central.pem + + paste the privatekey ==>> save + +2. chmod 700 /tmp/central.pem + +server2 : central.pem ==>> privatekey ==>> copy. + +1. vi /tmp/central.pem + + paste the privatekey ==>> save + +2. chmod 700 /tmp/central.pem + +============================================================================== + +1. How to transfer files from one server to another server. + +server1 to server2 ==>> files transfer + +scp : secure copy + +touch bhargavi + +scp -i /tmp/central.pem filename ec2-user@server2IPaddress(public / private Ip):/home/ec2-user + +scp -i /tmp/central.pem bhargavi ec2-user@50.20.10.5:/home/ec2-user + +server2 to server1 ==>> files transfer + +scp : secure copy + +touch ramakrishna + +scp -i /tmp/central.pem filename ec2-user@server1IPaddress(public / private Ip):/home/ec2-user + +scp -i /tmp/central.pem ramakrishna ec2-user@60.20.10.5:/home/ec2-user + +==================================================================================================== + +2. How to login remote userly from one server to another server. + +server1 to server2 ==>>> remoteuserly login. + +ssh : secure shell + +ssh -i /tmp/central.pem ec2-user@server2IPaddress(public / private Ip) + +ssh -i /tmp/central.pem ec2-user@50.20.10.5 ==>> enter ==>> now you are in server2. + + +server2 to server1 ==>>> remoteuserly login. + +ssh : secure shell + +ssh -i /tmp/central.pem ec2-user@server1IPaddress(public / private Ip) + +ssh -i /tmp/central.pem ec2-user@60.20.10.5 ==>> enter ==>> now you are in server1. + +======================================================================================================= + +ifconfig -a ==>> command + +nic card logical name , up , running ,mtu ( memory tranfer unit )==>>9001 + +nIC ==>>> mac address , IPaddress and subnetmask.. + +lo : loop back address ==>> self ping ===>> 127( series) + +Ipaddress ==>> privateIP. + +==>> How to change / assign the IPaddress of linux server ?? + +cd /etc/sysconfig/network-scripts + +ls + +ifcfg-eth0 ifcfg-eth1 + +vi ifcfg-eth0 + +IPADDR=192.168.20.5 + +save + +service network start + +==>> How to change / assign the hostname of the linux server ?? + +vi /etc/sysconfig/network + +hostame = xyz.com + +save + +service network start + +===================================================================================================== +hostname + +xyz.com + +==================================================================================================== + + +[root@ip-172-31-46-139 network-scripts]# history + 1 ping 54.250.156.121 + 2 ifconfig -a + 3 ping 172.31.46.139 + 4 vi /tmp/kalpana123.pem + 5 chmod 700 /tmp/kalpana123.pem + 6 touch jyothsna + 7 scp -i /tmp/kalpana123.pem jyothsna ec2-user@54.250.156.121:/home/ec2-user + 8 ls + 9 ifconfig -a + 10 ssh -i /tmp/kalpana123.pem ec2-user@54.250.156.121 + 11 ifconfig -a + 12 git --version + 13 cd /etc/sysconfig/network-scripts/ + 14 ls + 15 vi ifcfg-eth0 + 16 hostname + 17 cat /etc/sysconfig/network + 18 vi /etc/sysconfig/network + 19 hostname + 20 history +[root@ip-172-31-46-139 network-scripts]# + +===================================================== + +=============================================================================================== + +Each Linux servers has one Ipaddress along with one subnetmask.. + +An Ip address is an 4 digit octal number + +octal number ==>> 8. + +example Ipaddress ==>> 192.168.5.10 + +Each ==>> digit / bit. + +4 * 8 = 32 bits.. + +each bit or digit ==>> 2 power some thing. + +Each bit ==>> binaray format ==>> 010110 + +We will decide Ipaddress ==>>> which class it will be avaible based on the first bit. + +Ipaddress class types: + +CLASS A : 0 to 127 ===>> 255.0.0.0 ==>> subnetmask ====>>> CIDR block ==>> /8 + +CLASS B : 128 to 191 ===>> 255.255.0.0 ==>> sunbetmask ==>> CIDR block ==>> /16 ===>> VPC + +CLASS C : 192 to 223 ===>> 255.255.255.0 ==>> subnetmask ==>> CIDR block ==>> /24 ==>> subnet. + +CLASS D : R&D + +CLASS E : unused. + +127 + 64 ===>> 191 + +191 + 32 ===>> 223 + +CIDR block / notation ==>> we will decide the cidr notation based on the subnetmask.. + +CIDR : classless interdomain route. + +An Ipaddress can be devided into two portions. + +1. Network portion ( static / constant) + +2. host portion ( dynamic and change) + +1. Network portion ( static / constant) ===>> first 2 bits or 3 bits. + +2. host portion ( dynamic and change) ==>> last 2 bits or 1 bit. + +our own network ==>>> how many Ipaddresses will relases and In this network ==>> how many ec2 instances will create.?? + +ex: 30.50.10.40 ==>> SBI network + +1. Network portion ( static / constant) ===>> first 2 bits ==>> 2 power 16 + +2. host portion ( dynamic and change) ==>> last 2 bits. ==>> 2 power 16 ===>> 500. + +30.50.10.40 ==>> SBI network ==>>> in this network 500 Ipaddresse release ==>> 500 ec2 instances will create in this SBI network.. + +30.50.11.40 + +30.50.12.40 + +30.50.13.40 + +30.50.14.40 + +. +. +. + +30.50.300.40 + +30.50.300.41 + +30.50.300.42 + +30.50.300.43 +. +. +. + +=========================================================================== + +ex: 90.50.40.25 ==>> HDFC network + +1. Network portion ( static / constant) ===>> first 3 bits ==>> 2 power 24 + +2. host portion ( dynamic and change) ==>> last 1 bits. ==>> 2 power 8 ===>> 256 + +90.50.40.25 ==>> HDFC network ==>>> in this network 256 Ipaddresse release ==>> 256 ec2 instances will create in this HDFC network.. + +90.50.40.26 + +90.50.40.27 + +90.50.40.28 + +90.50.40.29 + +90.50.40.30 + +. +. +. + +90.50.40.281 + +===================================================================================== + +Package Administration / software management / package management. + +windows ==>>> softwares like ==>> vlc media player , pdf , msooffice.. + +Linux ==>>> packages.. + +Package Adminsitration ==>> LINUX ==>> two types utilities.. + +1. RPM : Redhat package manager + +2. YUM : Yellow dog update modifier. + +LINUX : RPM and YUM ==>> packages ==>> install , uninstall , verify , information , update , upgrade. + +update ==>>> linux version 5.2 ===>>> linux version 5.5 ===>> patching. + +upgrade ==>>> Linux version 5 ===>> linux version 6 ==>> upgrade. + +Physical servers point of view : + +1. RPM : Redhat package manager + +step 1 :Physical linux server ===>> cd / dvd disk ===>>> group of packages copied into cd / dvd disk. + +Physical linux server ===>> cd / dvd disk ===>>> insert ==>>> all packages ==>> copy to any location of the physical server. + +location ==>> /var/ftp/pub/packages. + +step 2 : go to the exact path of the available packages. + +cd /var/ftp/pub/packages ===>> mandatory. + +rpm -ivh packagename + +i ==>> install , v ==>> verbose , h ==>> hash prompt. + +rpm -ivh httpd + +rpm -uvh packagename + +rpm -uvh httpd + +rpm -qa packagename + +rpm -qa httpd + +rpm info packagename + +rpm info httpd + +rpm update + +rpm upgrade + +Key point : It will check the dependencys.. + +httpd install ==>> dependent ==>> java ==>> first you need to install java and after that you need to install httpd. + +RPM : drawbacks ==>> 1. path 2. dependency checking. + +To overcome the above drawbacks in RPM then YUM came into the picture. + +1. YUM : Yellow dog update modifier + +step 1 :Physical linux server ===>> cd / dvd disk ===>>> group of packages copied into cd / dvd disk. + +Physical linux server ===>> cd / dvd disk ===>>> insert ==>>> all packages ==>> copy to any location of the physical server. + +location ==>> /var/ftp/pub/packages. + +Repositories ===>> group of packages managed place . + +we will create our own repositories. + +/etc/repos.d ===>> we will create repositories here. + +repository extension must be name.repo + +vi /etc/repos.d/bhargavi.repo + +[bhargavi] + +base url : http:///var/ftp/pub/packages + +gpgcheck = 0 + +enabled =1 + +esc shift:wq! + +==>> yum install packagename + +yum install httpd ==>> y/d/n ===>> type y. + +yum install -y httpd + +yum remove packagename + +yum remove httpd + +yum list + +yum info packagename + +yum info httpd + +yum update -y + +yum upgrade -y + +======================================================================== + +AWS ==>> cloud. + +1. cd / dvd disk ==>> no need insert. ==>> these instances are virtual instances. + +2. No need to create repositories. + +yum install -y httpd ==>> online ==>> httpd site. + +yum install -y git ==>> gitsite + +yum install -y maven ==>> maven site + +yum install -y docker ==>> docker site. + +yum install -y tomcat ===>> tomcat site. + +====================================================================================== + +Managing installed packages.. + +service packagename status + +service packagename start + +service packagename stop + +service packagename restart + +service packagename reload +===================================== + +service httpd status + +service httpd start + +service httpd stop + +service httpd restart + +service httpd reload. + +restart ===>> service ==>> stop and start + +reload ===>> service ===>> httpd ==>>> install ==>>> internet issue ==>> 80 % install==>> remaining 20 % install ==>> stop and start. + +=================================================================================== + +The above only for one session. + +chkconfig httpd on ==>>> application will always close to enduser. + +chkconfig httpd off + +================================================================================ + +[root@ip-172-31-4-161 ec2-user]# history + 1 yum install httpd + 2 service httpd status + 3 service httpd start + 4 service httpd status + 5 cd /var/www/html/ + 6 ls + 7 vi index.html + 8 cd /home/ec2-user/ + 9 yum install -y docker + 10 yum install -y git + 11 yum list | grep jdk + 12 yum install -y java-1.8.0-openjdk-devel.x86_64 + 13 yum install -y ansible + 14 sudo amazon-linux-extras install ansible2 -y + 15 history + 16 yum install -y httpd + 17 history +[root@ip-172-31-4-161 ec2-user]# +[root@ip-172-31-4-161 ec2-user]# + +========================================================================================= +========================================================================================= + +Job automation / job scheduling .. + +Job ==>> task ==> perticular interval of time schedule ==>> job scheduling or job automation. + +job scheduling ==>> two types of methos or jobs.. + +1. at job. + +2. cron job. + +1. at job : It is used to only once at a specified time. + +at task of time. + +step of task + +ctrl + d ==>> save. + +at now + +mkdir sachin + +ctrl + d ==>>> save. + + +at 10:30 am + +ifconfig -a + +ctrl + d ==>> save. + +==>> when ever you created a job then automatically linux operating system gives a one unique id ==>>> job id. + +list of jobs ==>> atq + +at rm jobid ==>> delete the atjob + +at rm 1234 + +=============== + +/etc/at.deny ==>>> bhargavi , pavan + +/etc/at.allow ===>. ramakrishna , pavan + +at , cron jobs are follows round robin algorithem.==>>> first in first out. + +=================================================================================== + +cron jobs : It is used to repetative taks.. ====>> poll scm , build peridically ==>> jenkins. + +crontab -e ==>>here we will create cron jobs and cronjobs has the fields.. + +min hours dayofmonth month dayofweek command / task / script. + +* * 2 3 0 ./backup.sh + + +* ==>> all + +*/2 ==>> every 2minits + +*/5 ==>>> every 5 hours + +*/4 ==>> evry 4 days + +*/3 ==>> evry 3 months + +*/0 ==>> evry sunday.. + +*/2-4 + +*/ 2,4,6 + +crontab -l + +crontab -r + +crontab -u + +/etc/cron.deny ==>> vamsi , shekar + +/etc/cron.allow ==>> rajendra , shekar + +==================================================================================== + +Troubleshooting commands / performance tuning / health checkup commands. + +1. ps ==>> how many processes currently running your system. + +2. ps -elf ==>> it displys all processes.. + +3. bg ==>>> background running processes to display. + +4. fg ==>>> foreground running processes to display. + +5. ps -ef | grep smon ==>> currently running application in linux server. + +6. ps -ef | grep pmon ==>> currently running database in linux server. + +7. top ==>> process running , stop , uptime , load average , cpu , memory , swap ...etc..==>> exit ==>> press q button. + +8. iostat ==>>> disk related information. + +9. vmstat ==>> virtual memory statistics information.; free -m + +10. uptime ==>> load average ===>> 3 fields ==>> 1m 5m 15m + +11. netstat ==>> networking statistics information ; netstat -nr ==>>> routing table information. + +12. sar ==>> system activity report. + +=================================================================================================== + +[root@ip-172-31-14-39 ec2-user]# +[root@ip-172-31-14-39 ec2-user]# history + 1 ps + 2 ps -elf + 3 bg + 4 fg + 5 ps -ef | grep smon + 6 ps -ef | grep pmon + 7 top + 8 top + 9 iostat + 10 vmstat + 11 free -m + 12 netstat + 13 netstat -nr + 14 sar + 15 uptime + 16 history +[root@ip-172-31-14-39 ec2-user]# +[root@ip-172-31-14-39 ec2-user]# +============================================================================================================ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mahesh b/mahesh new file mode 100644 index 0000000000..b70102d043 --- /dev/null +++ b/mahesh @@ -0,0 +1,4 @@ +he is also belongs to devops team +kubernetes +docker +ansible diff --git a/main.tf b/main.tf new file mode 100644 index 0000000000..421856d9d5 --- /dev/null +++ b/main.tf @@ -0,0 +1,13 @@ +# Configure the AWS Provider +provider "aws" { + region = var.region + profile = var.profile +} +resource "aws_instance" "web7" { + ami = "${lookup(var.ami, var.region)}" + instance_type = "${lookup(var.instancetype, var.region)}" + + tags = { + Name = "HelloWorld9" + } +} diff --git a/manha b/manha new file mode 100644 index 0000000000..5d1ca457c0 --- /dev/null +++ b/manha @@ -0,0 +1,3 @@ +dfd +fdf +df \ No newline at end of file diff --git a/manhapasha b/manhapasha new file mode 100644 index 0000000000..f7a8a1e706 --- /dev/null +++ b/manhapasha @@ -0,0 +1,3 @@ +manah is 6th standard in skill stork international school.. +she is very good student . +and obidient. diff --git a/maven b/maven new file mode 100644 index 0000000000..40fa8153a0 --- /dev/null +++ b/maven @@ -0,0 +1 @@ +this isthe maen file diff --git a/oopp b/oopp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pasha b/pasha new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pom.xml b/pom.xml index 8e7ea14187..3268336417 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,9 @@