Devopsnotes Till30thaugust
Devopsnotes Till30thaugust
==========================================================================
SOFTWARE ARCHITECTURES:
1. ONE-TIER
2. TWO-TIER
3. THREE-TIER
4. N-TIER
WEB SERVER:
it is also called as the presentation layer.
to show the application.
who works: ui/ux developers
what they use: web technologies
ex: html, css, js
APP SERVER:
To use the application.
also called the logic layer
who work: backend developers
what they use: programming
ex: java, python, c, c++, .net, go --------
DB SERVER:
It also called as db layer.
To store & retrieve data.
who work: db admins
what they use: db languages
ex: sql, oracle, postgres, arango ----
PERKS:
1. RESUME BUILDING
2. CAREER GUIDANCE
3. MOCK INTERVIEWS
4. PDFS, LIVE
5. LINKEDIN
6. INTRA PERSONAL SKILLS
==========================================================
SERVER = COMPUTER
1. TAGS = NAME
2. AMI = OS, SOFTWARE PACKAGES
3. INSTANCE_TYPE = CPU & RAM
4. KEY_PAIR = LOGIN (public=aws, private=user)
5. NETWORK = VPC, SECURITY GROUPS (port numbers=0-65535)
6. STORAGE = 8 GB - 16 TB
7. SUMMARY = TO REVIEW
===========================================================
TYPES:
1. WINDOWS
2. LINUX
3. MACOS
ADVANTAGES:
1. FREE AND OPEN SOURCE
2. SECURITY
3. PERFOMANCE IS TOO GOOD.
4. MULTI USER BASED.
5. MULTI TASKING.
MODES:
1. GUI : GRAPHICAL USER INTERFACE
2. CLI : COMMAND LINE INTERFACE
COMMANDS:
sudo -i : to switch from ec2-user to root user
sudo su - : to switch from ec2-user to root user
sudo su : to switch from ec2-user to root user
logout (ctrl d) : to switch from root to ec2-user
cat /proc/cpuinfo: to show cpu information
lscpu: to show cpu information
cat /proc/meminfo: to show memory information
lsmem: to show memory information
fdisk -l: to show the volume information
lsblk: to show the volume information
ifconfig/ ip addr/ ip addr show/ hostname -i: to show ip address
clear (ctrl l): to clear the screen
FILE COMMANDS:
touch file : to create a file
ls/11 : to show list of files
cat file1 : to show the content
cat>>file1 : to insert the content
enter ctrl d : to save and exit form file
cp file1 file2 : copies the content form file1 to file2
mv file1 file2 : to renmae file1 to file2
rm file1 : to remove a file
rm file1 -f : to remove a file forcefully
rm * -f : to remove all files forcefully
touch file{1..100}: to create 100 files at a time
cat file1 >>file2 : to copy content from file1 to file2 (without overriding)
===========================================================
types:
1. VIM/vi
2. nano
1. command mode
2. insert mode
3. save mode
3. SAVE MODE:
:w : to save
:q : to quit
:wq : save and quit
:wq! : save and quit forcefully
2. INSERT MODE:
i : to insert command
A : end of line
I : starting of line
O : create new line above existing
o : to create new line below existing.
1. COMMAND MODE:
gg : top of file
shift g : bottom of file
:set number: to show number of lines inside file
:n : to go to speicif line
yy : to copy a line
10yy : to copy 10 lines
p : to paste
5pp : to paste 5 times
dd : to delete
10 dd : to delete 10 lines
u : undo
ctrl r : redo
/word : to search for a word
=========================================
PERMISSIONS:
FILE TYPE:
- : Regular file
b : Blocked file
c : character file
d : directory
l : link file
PERMISSION:
rw-r--r--
r : read : 4
w : write : 2
x : executable: 1
========================================================
inside file:
ec2-user : default
root : admin (he has all permissions)
useradd raham
passwd raham
visudo -- > :100 -- > yy & p -- > root=raham -- > save
su - raham
sudo useradd vijay
==============================================
INTRO:
Git is used to track the files.
It will maintain multiple versions of the same file.
It is platform-independent.
It is free and open-source.
They can handle larger projects efficiently.
It is 3rd generation of vcs.
it is written on c programming
it came on the year 2005
STAGES:
WORKING DIRECTORY: where we write our source code.
STAGING AREA: we track files here.
REPOSITORY: where we store tracked source code
=================================================
NOTE: this user and email will be replicated to new commits only.
Git show: used to show the files which are attached to commits.
git log --online
git show commit_id
BRANCHES:
It is a individaual line of developemt.
developers write the code on branches.
initally baraches we create on git.
after write source code on git we push to github.
Default barnch is Master.
Note: when we do a iniatl commit the only default branch will be created.
COMMNDS:
git branch : to list the branches
git branch movies : to create the branch movie
git checkout movies : to switch blw the branches
git checkout -b dth : to create and switch dth at same time
git branch -m old new : to rename a branch
git branch -D recharge : to delete a branch
TOKEN GENERATION:
account -- > settings -- >developer settings -- > PAT -- > Classic -- > Generate
new token -- > classic -- > name: abcd -- > select 6 options -- > generate
create branch
switch to branch
files
add
commit
push
1 df -h
2 cd cd
3 cd /
4 cd /
5 du -sh
6 ll
7 cd
8 yum install git maven docker httpd tree htop -y
9 touch file{1..10
10 rm -rf file\{1..10
11 rm -rf file\{1..10}
12 ll
13 touch file{1..10}
14 vim file1
15 rm -rf *
16 mkdir paytm
17 cd paytm/
18 ls -al
19 git init
20 touch index.html
21 git add index.html
22 git config user.name "raham"
23 git config user.email "[email protected]"
24 git commit -m "commit-1" index.html
25 git branch
26 git branch movies
27 git branch
28 git checkout movies
29 touch movies{1..5}
30 git add movies*
31 git commit -m "dev-1" movies*
32 git remote add origin https://github.com/RAHAMSHAIK007/1045paytm.git
33 git push origin movies
34 git branch
35 git branch train
36 git branch
37 git checkout train
38 git branch
39 touch train{1..5}
40 git add train*
41 git commit -m "dev-2" train*
42 git push origin train
43 ll
44 git branch
45 git checkout -b dth
46 git branch
47 ll
48 touch dth{1..5}
49 git add dth*
50 git commit -m "dev-3" dth*
51 git push origin dth
52 git checkout -b recharge
53 touch recharge{1..5}
54 git add recharge*
55 git commit -m "dev-4" recharge*
56 git push origin recharge
57 ll
58 git status
59 touch java{1..5}
60 git status
61 vim .gitignore
62 git status
63 vim .gitignore
64 git status
65 ll
66 git add *
67 ll
68 git status
69 touch python{1..5}
70 git status
71 vim .gitignore
72 git status
73 ll
74 git branch
75 git branch -m master raham
76 git branch
77 git branch -m raham main
78 git branch
79 git branch -m main master
80 git branch
81 ll
82 git push origin movies
83 git branch
84 git branch -D recharge
85 git checkout movies
86 git branch -D recharge
87 git branch
88 git pull origin recharge
89 git branch
90 git checkout recharge
91 git branch
92 ll
93 git branch
94 git branch -D movies
95 git branch
96 git pull origin movies
97 ll
98 git branch
99 git checkout movies
100 git branch
101 touch raham
102 git status
103 git add raham
104 git status
105 git restore --staged raham
106 git status
107 git add raham
108 git status
109 git restore --staged raham
110 git status
111 rm -f raham
112 git restore raham
113 ll
114 git status
115 cd
116 mkdir abcd
117 cd abcd/
118 touch file1
119 git add file1
120 git init
121 git add file1
122 ll
123 rm -f file1
124 git restore file1
125 ll
126 touch file2
127 git status
128 rm -f file
129 rm -f file2
130 git restore file2
131 ll
132 touch file{1..100}
133 git status
134 git add *
135 git status
136 rm -f *
137 git restore *
138 ls
139 cd
140 cd paytm/
141 git push origin train
142 git push origin master movies
143 history
=================================================
MERGE:
adding the files blw one branch to another branch
git merge branch_name
REBASE:
adding the files blw one branch to another branch
git rebase branch_name
MERGE VS REBASE:
merge will show files, rebase will not show files
merge will not show branches, rebase will show branches
merge will show entire history, rebase will not.
touch file2
git stash
git stash apply
git stash list
git stash clear
git stash pop (clears last stash)
HISTORY:
1 cd p
2 ll
3 cd swiggy/
4 ll
5 git branch
6 git branch -D master
7 git branch -D dth
8 ll
9 git branch
10 git pull origin dth
11 cd
12 git clone https://github.com/RAHAMSHAIK007/1045paytm.git
13 ll
14 cd 1045paytm/
15 git branch
16 git checkout train
17 git branch
18 git checkout dth
19 git branch
20 git checkout recharge
21 ll
22 git branch
23 git branch -D dth
24 git branch
25 git pull origin dth
26 git checkout dth
27 git branch
28 cd
29 mkdir abcd
30 cd abcd/
31 git init
32 ll
33 touch java1
34 git add java1
35 git commit -m "java commits" java1
36 ll
37 touch java2
38 git status
39 git add java2
40 git status
41 ll
42 git stash
43 ll
44 git stash apply
45 ll
46 git stash
47 ll
48 git stash apply
49 ll
50 git stash list
51 git stash clear
52 git stash list
53 git stash -h
54 git stash --help
55 git stash list
56 git stash
57 git stash list
58 history