-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathsession-09.txt
194 lines (148 loc) · 3.78 KB
/
session-09.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
Linux
Expenses project
Shell Script
------------------
3 servers....
configuring the server?
------------------------
installed application runtime --> nodejs
downloaded code
created a directory
created a user for our application
unzip the code
installed node js dependencies
created systemctl service
configured mysql details
start the server
MySQL
----------
install mysql server
configure password
start the server
frontend
-----------
install nginx
start nginx
downloaded the code
unzipped
configured backend details
start the server
15min
20 servers --> 30min
10-15min
Deployment
------------
releasing new version
download andriod latest version
switch off phone
install latest version
start the phone
upgrade/releasing/deploying the new application
---------------
download the new code
stop the server
remove old code
copy the new code
start the server
logs in field
---------------
carry one log at a time manually to home...
hire a tractor, keep all logs at a time...
run commands one by one --> manual
keep all commands in a file and run that file --> shell script
------------------------------
shell runs these commands in sequence...
errors may defnitely come
-------------------------
if error
you ignore?
you clear error and go forward
we need to check if the present command got success or not?
if success go forward
if failure, exit the program
programming/developing scripting
---------------------------
Coding
1. Programming/Developing --> reactjs, nodejs, java, .net, python, etc.
2. Scripting
automating manual tasks other than development
server configuration
installations
deployment process
execution time should be less
memory consumption should be less
data structures
alogorithms
design patterns
connect to DB
fetch the data asap..
transaction management
Coding concepts
-----------------
variables
data types --> less priority in scripting
functions
loops
conditions
Algorithm
-----------------
1. fast releases
2. reduce the defects
write down the steps in general way...
I will install a package through script
1. check the package is already installed or not
if installed that's all
2. if not installed
then you need to install
3. just verify is it done properly or not
if good, that's all
otherwise check and clear the error
if sunday, dont go to school, otherwise go to school
-------------------------------------------------
1. check what day is today..
2. if today is not sunday, just go to school.
3. otherwise enjoy the holiday.
today=wednesday
if(today==sunday){
print enjoy the holiday
}
else{
print go to school
}
what is shell?
----------------
ls -l --> getting result
lss -l --> who is checking that it is wrong?
it's nothing but shell
shell is the CLI that interprets the linux commands and executes them
terminal == shell terminal
shell script --> keeping all the commands you need in a file with variables, conditions, loops, functions, etc is called shell script
shell interprets and executes shell script.
Where to store scripts?
------------------------
can you store in your laptop?
security and backup --> if laptop crashes
versions --> you must keep the previous versions
collobaration -->
to store our shell scripts in github
repository --> stores something...
github --> only store code
git vs github vs gitlab
Linux --> kernel
Redhat, ubuntu --> implementations of linux kernel from different vendors
git --> linus torvalds...concept
github gitlab bitbucket -->implementations of git from different vendors
one repo one specific code...
steps
-----------
1. create repo in github
2. clone in your local laptop
where to develop the code?
-------------------
can I develop code using vim editor?
IDE --> integrated development environment/editor
vs code --> light weight and perfect for scripting
eclipse
intelliJ
sublime editor
1