├── README.md
├── frontend-101
├── 01-html-basics
│ └── README.md
├── 02-block-and-inline
│ └── README.md
├── 03-css-grids
│ ├── ASSIGNMENT.md
│ └── README.md
├── 04-resume
│ └── ASSIGNMENT.md
└── 05-bootstrap
│ ├── ASSIGNMENT.md
│ └── README.md
├── git-masterclass
├── 01-introduction
│ └── README.md
├── 02-basic-commands
│ └── README.md
├── 03-branches
│ └── README.md
└── 04-practical-uses
│ └── README.md
└── linux-masterclass
├── 01-setup
└── README.md
├── 02-introduction
├── README.md
└── notes.pdf
├── 03-streams-and-files
├── README.md
└── notes.pdf
├── 04-users-and-permissions
├── README.md
└── notes.pdf
├── 05-processes
├── README.md
└── notes.pdf
├── 06-partitions
├── README.md
└── notes.pdf
├── 07-kernel
├── README.md
└── notes.pdf
└── 08-resource-utilization
├── README.md
└── notes.pdf
/README.md:
--------------------------------------------------------------------------------
1 | # Virtual Tech Notes 📖
2 |
3 | 
4 |
5 | These notes are based on our videos [here](https://youtube.com/c/ApoorvGoyalMain). In order to contribute, please take note of the following -
6 |
7 | 1. All the notes should be added/modified in the relevant README.md files. This is specifically because our website will look for the README.md files to display them.
8 | 2. Please refrain from adding any images into the project directory for displaying them in the README file. Keep everything text-based to keep the size of this repository in check.
9 | 3. If you, however, feel the need to add images of diagrams, please host them elsewhere, and add their links into the README files to display them.
10 | 4. You're free to add PDFs of handwritten notes for the relevant topics/videos, however the naming convention for that PDF should be "notes.pdf" so that our website can identify it. Also, do make sure that the PDF does not exceed the size of 1MB.
11 | 5. When making a PR, if a markdown or PDF version for that topic already exists, please tell us what improvements did you make in the PR.
12 |
13 | ## Connect with our mentor
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | ## Join Virtual Tech School
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | ## Our Contributors
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/frontend-101/01-html-basics/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=JLKy8apeLac&list=PL2kSRH_DmWVbKFpYn3drI8Qf66ZpvZ_3L&index=2) video now!
2 | # **HTML** #
3 | HTML stands for Hyper Text Markup Language.
4 | !
= For Emmet Abbreviations(also this brings in the boiler plate in VScode).
5 |
6 |
7 | ## **Tags in HTML** ##
8 | HTML has different tags to do different things.
9 | Types of tags:
10 |
11 | Ones that hold some content <tag>...</tag> (requires closing tag).
12 | Ones that does not hold any content <tag> (self closing tags).
13 |
14 | Tags are not case sensitive (good practice to do all in smallcase)
15 |
16 |
17 | ## **Understanding boilerplate of HTML** ##
18 | 1. <!DOCTYPE html>
tells the browser that this is an HTML document.
19 | 2. <html lang="en">
the root tag of a HTML document.
20 | It contains two main tags
21 |
22 | <head> - contains metadata/information about the document like title, description, charset, link etc.
23 | <body> - the body of the document which gets displayed on the web page.
24 |
25 | 3. <meta charset="UTF-8">
displays all content in ASCII text.
26 | 4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
helps to load in internet explorer.
27 | 5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
to make your site responsive.
28 | 6. <title>Document</title>
title of your web page (name of the tab).
29 | 7. <body> ... </body>
content that you see on your webpage.
30 | Anything from the opening tag to the closing tag is known as HTML element. All HTML tags have attributes.
31 | Attributes are way to provide additional information about the tags. It is always defined in opening tag.
32 | Attributes always come in name="value" pairs.
33 |
34 | Some Common HTML tags
35 | 1. Heading : h1 to h6 , h1 is largest in size and most important whereas h6 is smallest in size and least important.
36 | 2. Paragraph : to write paragraph texts.
37 | 3.Links : <a> ... </a>
tag (anchor tag) used to add links to web page . Has an attribute "href" that specifies the link that you want to redirect to.
38 | (target="_blank" opens link new tab)
39 | 4.Images : img tag for images.
40 |
41 | It has following attributes:
42 | 1. "src" to add link of the image.
43 | 2. "alt" - alternative text that will appear when image fails to load.
44 | 3. "width" & "height" - value default in pixels.
45 | Types of urls(Uniform Resource Locator):
46 | 1. absolute url : Links that are hosted on other website.
47 | 2. relative url : Links that are hosted within website.
48 | "title" attribute : if you hover over the content this title comes.
49 |
50 | Style attributes
51 | In HTML, style attribute comes in pair.
52 | For eg:
53 | <tag style="color: black; background-color: blue" ></tag>
54 | Some common css style properties
55 |
56 | background-color
57 | color
58 | font-family
59 | font-size
60 | text-align
61 | margin -> adds some space out of box
62 | padding -> adds space inside of box
63 |
64 |
65 | Color representation
66 |
67 | color (name of color).
68 | rgb (red green blue) value is from 0-255 of all three.
69 | rgba - 4th value for opacity. (value 0-1).
70 | Hexadecimal color rrggbb value each value is between 0 to ff.
71 | hsl (hue saturation and lightness).
72 | hsla a for opacity similar to rgba.
73 |
74 |
75 | 1.hue : degree on color wheel (value 0 to 360) 0 is red, 120 is green, 240 is blue.
76 | 2.saturation : % value to give a shade of grey ( 0% max shade of grey, 100% no shade of grey).
77 | 3.lightness : % value where 0 is black and 100% is white.
78 |
79 |
80 | CSS (cascading style sheet)
81 | CSS is used to format layout of a web page.It is very helpful as it helps setting layout for multiple pages at once.
82 | Cascading means whatever you apply to parent tag gets applied to children tag as well.
83 | CSS can be added to HTML in 3 ways:
84 | 1. Inline CSS : using style attribute.
85 | 2. Internal CSS : if we add a <style>..</style> tag inside head tag.
86 | 3. External CSS : adds style in different file and add a link in HTML file.
87 |
88 | Linking css style sheet:
89 | <link rel = "stylesheet" href="style.css">
90 |
91 | Comments in HTML
92 | <!--...-->
93 | Comments are not displayed in the browsers. You can use comments to explain your code, which can help you when you edit the source code at a later date. This is especially useful if you have a lot of code.
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/frontend-101/02-block-and-inline/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=ZYbajSqMrN4&list=PL2kSRH_DmWVbKFpYn3drI8Qf66ZpvZ_3L&index=3) video now!
2 |
3 | # Block and Inline Elements
4 |
5 | Every HTML element has a default display value, depending on what type of element it is.
6 |
7 | ## There are 2 display values-
8 |
9 | 1. Block level elements
10 | 2. Inline elements
11 |
12 |
13 |
14 | ## Block Level Elements
15 |
16 | A block level element always starts on a new line, and the browser automatically adds some space (a margin) on top and bottom of it.
17 |
18 | A block level element also would always take full width available to it.
19 |
20 | ### Some block level elements are -
21 |
22 | ``````html
23 |
24 |
25 | 1.
26 |
27 | 2.
28 |
29 | 3.
30 |
31 | 4.
32 |
33 | 5.
34 |
35 | 6. (Description List)
36 |
37 | 7. (Term / Name in the List)
38 |
39 | 8. (Description of a term / name in the List)
40 |
41 | 9. (Grouping Elements in a form)
42 |
43 | 10. (For Images with a caption)
44 |
45 | 11. (Caption of the image)
46 |
47 | 12.
48 |
49 | 13.
50 |
51 | 14. to
52 |
53 | 15.
54 |
55 | 16.
56 |
57 | 17. (List Item)
58 |
59 | 18. (Ordered List)
60 |
61 | 19. (Unordered List)
62 |
63 | 20.
64 |
65 | 21.
66 |
67 | 22. (Defines alternate content for the users that do not support client side scripts).
68 |
69 | 23.
70 |
71 | 24.
72 |
73 | 25.
74 |
75 | 26.
76 |
77 | 27.
78 |
79 | 28.
80 |
81 | 29.
82 |
83 | ``````
84 |
85 |
86 | ## Inline Level Elements
87 |
88 | An Inline Element does not start with a new line and it only takes up as much width as it needs.
89 |
90 | ### Some of the inline elements are-
91 |
92 | ``````html
93 |
94 |
95 | 1.
96 |
97 | 2.
98 |
99 | 3.
100 |
101 | 4. (Overrides the current text direction)
102 |
103 | 5.
104 |
105 | 6.
106 |
107 | 7. (Defines the title of the work)
108 |
109 | 8.
(For a piece of computer code)
110 |
111 | 9. (The term that is going to be defined within the text)
112 |
113 | 10.
114 |
115 | 11.
116 |
117 | 12.
118 |
119 | 13.
120 |
121 | 14.
122 |
123 | 15.
124 |
125 | 16.
126 |
127 | 17. (Short quotation)
128 |
129 | 18. (Sample Output from a computer program)
130 |
131 | 19. (client side script)
132 |
133 | 20. (Drop-downs)
134 |
135 | 21. (Smaller Text)
136 |
137 | 22.
138 |
139 | 23.
140 |
141 | 24.
142 |
143 | 25.
144 |
145 | 26. (To define specific time)
146 |
147 | 27. (For variable values)
148 |
149 | 28. (Commonly used as a container for things)
150 |
151 |
152 | ``````
153 |
154 |
155 | ## <div> </div> Element
156 |
157 | It is often used as a container for other HTML elements. It doesn't have any required attributes, but it can usse
158 |
159 | 1. style
160 | 2. class
161 | 3. id
162 |
163 | It can be used to used to style block of elements with CSS
164 |
165 |
166 | ## <span> </span> Element
167 |
168 | This is an inline container used to mark up a part of a text or a part of a do Again, it has no required attributes but can use the same as above.
169 |
170 | It can be used to style parts of text with CSS.
171 |
172 |
173 |
174 | ## Class Attribute
175 |
176 | As the name suggests, a class can be used to represent a set of elements having similar properties.
177 |
178 | The class can also be used by JavaScript to access and manipulate elements with the specific class name.
179 |
180 | A class is represented in CSS with a dot (.)
181 |
182 | You can also give multiple classes to an element by separating the class names with a space.
183 |
184 |
185 | ## id Attribute
186 |
187 | Unlike a class that can be represent multiple elements, id attribute is used to specify a unique ID for an HTML element.
188 |
189 | You should not have more than one element with the same ID in an HTML document.
190 |
191 | It can be used to point to a specific style declaration in a style sheet, and it can also be used by JS to access and manipulate the element with the specific ID.
192 |
193 | It is represented in CSS with a hashtag (#).
194 |
195 | The major difference between a class and an id is that class name can be used by multiple HTML elements, while an ID name must only be used by one HTML element with the page.
196 |
197 |
198 |
199 | ## HTML Bookmarks with ID and Links
200 |
201 | It is used by a web page to allow readers to jump to a specific part of a web page.
202 |
203 | They can be useful if your page is very long.
204 |
205 | To use a bookmark, you can give an ID to any element you want to bookmark, and then add a link to it.
206 |
207 | You can add the links from the same page or from some other page too.
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
--------------------------------------------------------------------------------
/frontend-101/03-css-grids/ASSIGNMENT.md:
--------------------------------------------------------------------------------
1 | # CSS Grids and Box Model
2 | ### Task 1
3 | Create a wireframe of the entire [website](https://virtualtechschool.org) including all the pages following the box model, as showcased in the [course video](https://www.youtube.com/watch?v=WEZJvQf3nH0&list=PL2kSRH_DmWVbKFpYn3drI8Qf66ZpvZ_3L&index=4).
4 | ### Task 2
5 | Try to create grids based on your wireframe using boxes. Just try to replicate the layout in boxes, no styling needed for this task.
6 | ### Getting it reviewed
7 | To get it reviewed, share your work in the #assignments channel on our discord server ([Join here](https://discord.gg/EYB8tQxjxH)).
8 |
--------------------------------------------------------------------------------
/frontend-101/03-css-grids/README.md:
--------------------------------------------------------------------------------
1 | # CSS Grids and Box Model
2 |
3 | ## Grid Layout In CSS
4 |
5 | It offers grid based layout system, with rows and columns, making it easier to design web pages.
6 |
7 | With them, you can divide a page into major regions.
8 |
9 |
10 |
11 | ## CSS Box Model
12 |
13 | The term "box model" is used when talking about the design & layout.
14 |
15 | Everything in CSS is a box, square or rectangle
16 |
17 | The CSS Box Model is essentially a box that wraps around every HTML element consisting ->
18 |
19 | 1. Margins
20 |
21 | 2. Borders
22 |
23 | 3. Padding
24 |
25 | 4. Content
26 |
27 | Content -> The content of the box, where the text & images appear. Padding -> Clears an area around the content. It is transparent.
28 |
29 | Border -> Goes around the padding and content.
30 |
31 | Margin -> Clears an area outside the border. The margin is transparent.
32 |
33 |
--------------------------------------------------------------------------------
/frontend-101/04-resume/ASSIGNMENT.md:
--------------------------------------------------------------------------------
1 | # Resume
2 | ### Task 1
3 | Create a wireframe using CSS box model for your resume as demonstrated in [this video](https://www.youtube.com/watch?v=O6xiTUjkNIw&list=PL2kSRH_DmWVbKFpYn3drI8Qf66ZpvZ_3L&index=5), and code your resume using CSS Grids. If you're not comfortable with CSS Grids, checkout this [course video](https://www.youtube.com/watch?v=WEZJvQf3nH0&list=PL2kSRH_DmWVbKFpYn3drI8Qf66ZpvZ_3L&index=4).
4 |
5 | ### Getting it reviewed
6 | To get it reviewed, share your work in the #assignments channel on our discord server ([Join here](https://discord.gg/EYB8tQxjxH)). Also, share your newly coded Resume on LinkedIn/Twitter using #LearningWithApoorv.
--------------------------------------------------------------------------------
/frontend-101/05-bootstrap/ASSIGNMENT.md:
--------------------------------------------------------------------------------
1 | # Grids With Bootstrap
2 | ### Task 1
3 | Based on the wireframe you created for our [website](https://virtualtechschool.org) in [this](https://github.com/virtual-tech-school/virtual-tech-notes/blob/main/frontend-101/03-css-grids/ASSIGNMENT.md) assignment, create the home page of the website using Bootstrap Grid classes .row and .col as showcased in the [course video](https://www.youtube.com/watch?v=tiUy-0GpUlY&list=PL2kSRH_DmWVbKFpYn3drI8Qf66ZpvZ_3L&index=6). No heavy styling needed for this task.
4 | ### Getting it reviewed
5 | To get it reviewed, share your work in the #assignments channel on our discord server ([Join here](https://discord.gg/EYB8tQxjxH)).
6 |
--------------------------------------------------------------------------------
/frontend-101/05-bootstrap/README.md:
--------------------------------------------------------------------------------
1 | # Bootstrap 5 - Introduction & Building a Responsive Website
2 |
3 | ## Bootstrap
4 |
5 | Bootstrap is the most popular **CSS Framework** for developing responsive and mobile first websites.
6 | Bootstrap 5.2 is the newst version of Bootstrap. It supports all major browsers except Internet Explore 11 & down.
7 |
8 | To see Bootstrap **Documentation**, [click here](https://getbootstrap.com/docs/5.2/getting-started/introduction/).
9 |
10 | ## CDN (Content Delivery Network)
11 |
12 | CDN stand for Content Delivery Network that been around since the late 90s.
13 | A CDN brings content closer to the user improving the performance of the web service.
14 | They have Servers at hundreds of locations around the world. These locations are called **POP (Point of Presence)**.
15 | A server inside the POP can be called an Edge Server.
16 | Having many POPs all over the world ensures thatevey user can reach a fast-edged server close to them.
17 |
18 | ## Setting Bootstrap
19 |
20 | Since Bootstrap is a library of Pre-Written CSS and JavaScript (as only CSS is not enough for some styling effects). Hence, we need to connect to that library Database. it is done by Adding CDN links of Bootstrap CSS and Javascript in the index.html file.
21 |
22 | ```HTML
23 |
24 |
25 |
26 |
27 |
28 |
29 | Bootstrap demo
30 |
31 |
32 |
33 | Hello, world!
34 |
35 |
36 |
37 |
38 | ```
39 |
40 | CDN links are available in Bootstrap 5.2 Document on its official [website](https://getbootstrap.com/docs/5.2/getting-started/introduction/#cdn-links).
41 |
42 | **Bootstrap Library content are categorized majorly in 7 types**
43 |
44 | - Customize
45 | - Layout
46 | - Content
47 | - Forms
48 | - Components
49 | - Helpers
50 | - Utilities
51 |
52 | ## Layout
53 |
54 | This Category Contain mostly used CSS concepts like Breakpoints, Containers, Grid, CSS grid, Colums, etc.
55 |
56 | ### Breakpoints in Bootstraps
57 |
58 | In Present, Websites/Webapps are preferred to be Responsive in single code for various devices.
59 | **Breakpoints** are customizable widths that determine how your responsive layout behaves across device or viewport sizes in Bootstrap.
60 |
61 | ***Available breakpoints***
62 |
63 | Bootstrap includes six default breakpoints, sometimes referred to as grid tiers, for building responsively.
64 |
65 | | Breakpoint | Class infix | Dimensions |
66 | | ----------------- | ------------- | ---------- |
67 | | Extra small | None | <576px |
68 | | Small | sm | ≥576px |
69 | | Medium | md | ≥768px |
70 | | Large | lg | ≥992px |
71 | | Extra large | xl | ≥1200px |
72 | | Extra extra large | xxl | ≥1400px |
73 |
74 | Each breakpoint was chosen to comfortably hold containers whose widths are multiples of 12.
75 |
76 | ### Conainers and Breakpoint
77 |
78 | **Containers**are the most basic layout element in Bootstrap and are required when using our default grid system. Containers are used to contain, pad, and (sometimes) center the content within them. While containers can be nested, most layouts do not require a nested container.
79 |
80 | Bootstrap comes with three different containers:
81 |
82 | - **.container**, which sets a max-width at each responsive breakpoint
83 | - **.container-{breakpoint}**, which is width: 100% until the specified breakpoint
84 | - **.container-fluid**, which is width: 100% at all breakpoints.
85 |
86 | The table below illustrates how each container’s max-width compares to the original .container and .container-fluid across each breakpoint.
87 |
88 | | ---- | Extra small (<576px) | Small (≥576px) | Medium (≥768px) | Large (≥992px) | X-Large (≥1200px) | XX-Large (≥1400px) |
89 | | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
90 | | .container | 100% | 540px | 720px | 960px | 1140px | 1320px |
91 | | .container-sm | 100% | 540px | 720px | 960px | 1140px | 1320px |
92 | | .container-md | 100% | 100% | 720px | 960px | 1140px | 1320px |
93 | | .container-lg | 100% | 100% | 100% | 960px | 1140px | 1320px |
94 | | .container-xl | 100% | 100% | 100% | 100% | 1140px | 1320px |
95 | | .container-xxl | 100% | 100% | 100% | 100% | 100% | 1320px |
96 | | .container-fluid | 100% | 100% | 100% | 100% | 100% | 100% |
97 |
98 | **Responsive containers** allow you to specify a class that is 100% wide until the specified breakpoint is reached, after which we apply max-widths for each of the higher breakpoints.
99 |
100 | for example :
101 | ```HTML
102 | 100% wide until small breakpoint
103 | 100% wide until medium breakpoint
104 | 100% wide until large breakpoint
105 | 100% wide until extra large breakpoint
106 | 100% wide until extra extra large breakpoint
107 |
108 | ```
109 |
110 | Above code snippet shows the use of different Class name for different container size for variuos device screensize.
111 |
112 | > **Note :**
113 | >
114 | > We can use all the Class name under single code as shown below.
115 | > Also all this class name are present in the Bootstrap Library with Pre-Written CSS code as per its function.
116 | >
117 |
118 | ```HTML
119 | text / code / CSS styling / Blocks / ETC here
120 |
121 | ```
122 |
123 | ## Grid System in Bootstrap (Major Topic)
124 |
125 | I hope you all are familiar with the box model in CSS.
126 |
127 | So, **Grid system** in Bootstrap uses powerful mobile-first flexbox grid to build layouts of all shapes and sizes thanks to a ***12 column system***, six default responsive tiers, Sass variables and mixins, and dozens of predefined classes.
128 |
129 | Grid sysytem 2 main pre-define **Classes** known as "row" & "col". "col" class is nested inside "row" class **always**. Also, both "row" & "col" class is nested inside "Container" as shown below.
130 |
131 | ***Example 1***
132 |
133 | ```HTML
134 |
135 |
136 |
137 | Column
138 |
139 |
140 | Column
141 |
142 |
143 | Column
144 |
145 |
146 |
147 |
148 | ```
149 | > Output as
150 | >
151 | > | Column | Column | Column |
152 | > | ----- | ----- | ----- |
153 | >
154 |
155 | The above example creates three equal-width columns across all devices and viewports using our predefined grid classes. Those columns are centered in the page with the parent .container.
156 |
157 | ### Special Cases and Example
158 |
159 | It is to be noted that each "row" class contain a definite **12 Column** and based on the required no. of col needed for the design. we show column in combination for representing one column.
160 | Further explanation : As shown in the ***Example 1*** above we can only see 3 column but each column is a combination **4 definite column shown as 1**. hence, adding upto "12" = "4 + 4 + 4".
161 |
162 | we can also define the Number of definite column that are to be combine to repesent a single column in the "col" class by naming the column class as **"col-N"** where N is the number of definite column to be combine.
163 | Please refer to below examples
164 |
165 | ***Example 2***
166 |
167 | ```HTML
168 |
169 |
170 |
1
171 |
2
172 |
3
173 |
4
174 |
5
175 |
6
176 |
7
177 |
8
178 |
9
179 |
10
180 |
11
181 |
12
182 |
13
183 |
14
184 |
185 |
186 |
187 | ```
188 | > Output as
189 | >
190 | > | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
191 | > | - | - | - | - | - | - | - | - | - | - | - | - |
192 | > | 13 | 14 |
193 | >
194 |
195 | we can see there are maximum of only 12 column possible in a row, for column 13 and 14 it takes next row.
196 | Note : "box" is a class present in Bootstrap library for creating box around the content of that tag.
197 |
198 | ***Example 3***
199 |
200 | let there be a responsive website with 3 case of display devices
201 | 1. Desktop
202 | 1. Ipad
203 | 1. Phone
204 |
205 | > for Desktop as
206 | >
207 | > | JOIN US |
208 | > | ---- |
209 | >
210 | > | YouTube | Hashnode | Discord | Twitter |
211 | > | ---- | ---- | ---- | ---- |
212 | >
213 |
214 | > for Ipad as
215 | >
216 | > | JOIN US |
217 | > | ---- |
218 | >
219 | > | YouTube | Hashnode |
220 | > | ---- | ---- |
221 | > | Discord | Twiter |
222 | > | ---- | ---- |
223 | >
224 |
225 | > for Phone
226 | >
227 | > | JOIN US |
228 | > | ---- |
229 | > | YouTube |
230 | > | Hashnode |
231 | > | Discord |
232 | > | Twiter |
233 |
234 |
235 | The code will be as shown below
236 |
237 | ```HTML
238 |
242 |
243 |
244 |
245 |
246 |
JOIN US
247 |
248 |
249 |
254 |
255 |
256 |
YouTube
257 |
258 |
259 |
Hashnode
260 |
261 |
262 |
Discord
263 |
264 |
265 |
Twitter
266 |
267 |
268 |
269 |
270 | ```
271 |
272 | Please see the HTML comment in the code for the explanation of the code
273 |
274 | ## Margin and Padding in the Bootstrap
275 |
276 | Margin and Padding section is inside Spacing under **Utilities**.
277 |
278 | *Notation*
279 |
280 | The classes are named using the format **{property}{sides}-{size}** for **xs** and {**property}{sides}-{breakpoint}-{size}** for **sm, md, lg, xl, and xxl**.
281 |
282 | >
283 | > Where property is one of:
284 | >
285 | > - m - for classes that set margin
286 | > - p - for classes that set padding
287 | >
288 | > Where sides is one of:
289 | >
290 | > - t - for classes that set margin-top or padding-top
291 | > - b - for classes that set margin-bottom or padding-bottom
292 | > - s - (start) for classes that set margin-left or padding-left in LTR, margin-right or padding-right in RTL
293 | > - e - (end) for classes that set margin-right or padding-right in LTR, margin-left or padding-left in RTL
294 | > - x - for classes that set both *-left and *-right
295 | > - y - for classes that set both *-top and *-bottom
296 | > blank - for classes that set a margin or padding on all 4 sides of the element
297 | >
298 | > Where size is one of:
299 | >
300 | > - 0 - for classes that eliminate the margin or padding by setting it to 0
301 | > - 1 - (by default) for classes that set the margin or padding to $spacer * .25
302 | > - 2 - (by default) for classes that set the margin or padding to $spacer * .5
303 | > - 3 - (by default) for classes that set the margin or padding to $spacer
304 | > - 4 - (by default) for classes that set the margin or padding to $spacer * 1.5
305 | > - 5 - (by default) for classes that set the margin or padding to $spacer * 3
306 | > - auto - for classes that set the margin to auto
307 | >
308 |
309 | ## Conclusion
310 |
311 | When you go through all the example and explanations and syntax, we are only studying syntax to write **Class names** of all the different property that we need like Breakpoint, containers, grid system, etc.
312 |
313 | We are not coding any CSS styling in the code or any other .css file on our computer but the class mention in the code are the pre-written class in the bootstrap library with there CSS styling code.
314 |
315 | Hence, we are only learning which Bootstrap library Class name to mention to obtained the required styling instead coding it.
316 |
317 | Also, Watch the [Bootstrap video](https://www.youtube.com/watch?v=tiUy-0GpUlY&t=153s) for better understanding this notes.
318 |
319 | Have Good Day.
--------------------------------------------------------------------------------
/git-masterclass/01-introduction/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=LQ2LTPHeTts&list=PL2kSRH_DmWVajYgFoP-HVKK5VKkzFYyzp&index=1) video now!
2 |
3 |
4 |
5 | # Contents
6 |
7 | - [01 What is Git ?](#01-what-is-git-)
8 |
9 | - [02 Version Control System (VCS)](#02-version-control-system-vcs)
10 | - [03 Types of Version Control System (VCS)](#03-types-of-version-control-system-vcs)
11 | - [Local Version Control System](#1-local-version-control-system)
12 | - [Centralized Version Control System](#2-centralized-version-control-system)
13 | - [Distributed Version Control System](#3-distributed-version-control-system)
14 | - [04 How was Git created ?](#04-how-was-git-created-)
15 | - [05 How Git is different from other Version Control System ?](#05-how-git-is-different-from-other-version-control-system-)
16 | - [Snapshots, Not Differences](#1-snapshorts-not-differences)
17 | - [Nearly Every Operation Is Local](#2-nearly-every-operation-is-local)
18 | - [Git Has Integrity](#3-git-has-integrity)
19 | - [Git Generally Only Adds Data](#4-git-generally-only-adds-data)
20 |
21 | # 01 What is Git ?
22 |
23 | Git is a **Version Control System (VCS)** for your files
24 |
25 | - It reverts a selected file/entire project back to previous state
26 | - Compares changes
27 | - Helps in identification of who modified the files that is causing some issue
28 | - Helps in identification of who introduced an issue and when
29 |
30 | # 02 Version Control System (VCS)
31 |
32 | - Version control, also known as source control, is the practice of tracking and managing changes to software code.
33 | - Version control systems are software tools that help software teams manage changes to source code over time.
34 | - Version control software keeps track of every modification to the code in a special kind of database.
35 | - If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption.
36 |
37 | # 03 Types of Version Control System (VCS)
38 |
39 | ### 1. Local Version Control System
40 |
41 | - Contains the Version Database located on your computer.
42 | - Every file change is stored as a patch.
43 | - Every patch set contains only the changes made to the file since its last version.
44 |
45 | #### Problems:-
46 |
47 | - Since , stored locally collaboration with other developer or a team is not possible.
48 | - If anything happens to local database , all the patches would be lost.
49 | - If anything happens to single version , all the changes made after that version would be lost.
50 |
51 | ### 2. Centralized Version Control System
52 |
53 | - Contains a single server that contains all the file versions.
54 | - Allows multiple clients to simultaneously access files on the server.
55 | - Allows to pull files to their local computer or push onto server from their local computer.
56 | - Administrators have control over who can do what and what not.
57 | - Allows for easy collaboration with other developer or a team.
58 |
59 | #### Problems:-
60 |
61 | - Single point of failure.
62 | - As everything is stored on the centralized server. If something were to happen to that server, nobody can save their versioned changes, pull files or collaborate at all.
63 | - If the central database became corrupted, and backups haven't been kept, you lose the entire history of the project except whatever single snapshots people happen to have on their local machines.
64 |
65 | ### 3. Distributed Version Control System
66 |
67 | - Clients don’t just check out the latest snapshot of the files from the server, they fully mirror the repository, including its full history.
68 | - Everyone collaborating on a project owns a local copy of the whole project, i.e. owns their own local database with their own complete history.
69 | - If the server becomes unavailable or dies, any of the client repositories can send a copy of the project's version to any other client or back onto the server when it becomes available.
70 | - It is enough that one client contains a correct copy which can then easily be further distributed.
71 |
72 | #### Example :-
73 |
74 | Git is the most well-known example of Distributed Version Control System (DVC sys).
75 |
76 | # 04 How was Git created ?
77 |
78 | As with many great things in life, Git began with a bit of creative destruction and fiery controversy.
79 |
80 | The Linux kernel is an open source software project of fairly large scope. During the early years of the Linux kernel maintenance (1991–2002), changes to the software were passed around as patches and archived files. In 2002, the Linux kernel project began using a proprietary DVCS called BitKeeper.
81 |
82 | In 2005, the relationship between the community that developed the Linux kernel and the commercial company that developed BitKeeper broke down, and the tool’s free-of-charge status was revoked. This prompted the Linux development community (and in particular Linus Torvalds, the creator of Linux) to develop their own tool based on some of the lessons they learned while using BitKeeper. Some of the goals of the new system were as follows:
83 |
84 | - Speed
85 | - Simple design
86 | - Strong support for non-linear development (thousands of parallel branches)
87 | - Fully distributed
88 | - Able to handle large projects like the Linux kernel efficiently (speed and data size)
89 |
90 | Since its birth in 2005, Git has evolved and matured to be easy to use and yet retain these initial qualities. It’s amazingly fast, it’s very efficient with large projects, and it has an incredible branching system for non-linear development
91 |
92 | # 05 How Git is different from other Version Control System ?
93 |
94 | ## 1. Snapshots, not Differences
95 |
96 | - #### Others:
97 |
98 | - Most other systems store information as a list of file-based changes. These other systems think of the information they store as a set of files and the changes made to each file over time.
99 |
100 | - #### Git:
101 | - Git thinks of its data more like a series of snapshots of a miniature filesystem
102 | - With Git, every time you commit, or save the state of your project, Git basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot
103 | - To be efficient, if files have not changed, Git doesn’t store the file again, just a link to the previous identical file it has already stored. Git thinks about its data more like a **stream of snapshots**.
104 |
105 | ## 2. Nearly Every Operation Is Local
106 |
107 | - Most operations in Git need only local files and resources to operate — generally no information is needed from another computer on your network
108 | - You have the entire history of the project right there on your local disk, most operations seem almost instantaneous
109 |
110 | #### Example:-
111 |
112 | To browse the history of the project, Git doesn’t need to go out to the server to get the history and display it for you — it simply reads it directly from your local database. This means you see the project history almost instantly. If you want to see the changes introduced between the current version of a file and the file a month ago, Git can look up the file a month ago and do a local difference calculation, instead of having to either ask a remote server to do it or pull an older version of the file from the remote server to do it locally.
113 |
114 | ## 3. Git Has Integrity
115 |
116 | - Everything in Git is checksummed before it is stored and is then referred to by that checksum.
117 | - This means it’s impossible to change the contents of any file or directory without Git knowing about it.
118 | - The mechanism that Git uses for this checksumming is called a SHA-1 hash.
119 | - This is a 40-character string composed of hexadecimal characters (0–9 and a–f) and calculated based on the contents of a file or directory structure in Git.
120 | - A SHA-1 hash looks something like this:
121 |
122 | ```
123 | 24b9da6552252987aa493b52f8696cd6d3b00373
124 | ```
125 |
126 | ## 4. Git Generally Only Adds Data
127 |
128 | - When you do actions in Git, nearly all of them only _add_ data to the Git database.
129 | - It is hard to get the system to do anything that is not undoable or to make it erase data in any way.
130 | - After you commit a snapshot into Git, it is very difficult to lose, especially if you regularly push your database to another repository.
131 |
--------------------------------------------------------------------------------
/git-masterclass/02-basic-commands/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=fkKfKsASjV4&list=PL2kSRH_DmWVajYgFoP-HVKK5VKkzFYyzp&index=2) video now!
2 |
3 | # Contents
4 |
5 | - [Architecture of Git](#architechure-of-git)
6 | - [The Three States](#the-three-states)
7 | - [The basic Git workflow](#the-basic-git-workflow-goes-something-like-this)
8 | - [Installing Git](#installing-git)
9 | - [Installing on Linux](#installing-on-linux)
10 | - [Installing on macOS](#installing-on-macos)
11 | - [Installing on Windows](#installing-on-windows)
12 | - [Installing from Source](#installing-from-source)
13 | - [First-Time Git Setup](#first-time-git-setup)
14 | - [Git Config](#git-config)
15 | - [Your Identity](#your-identity)
16 | - [Your Editor](#your-editor)
17 | - [Your default branch name](#your-default-branch-name)
18 | - [Checking Your Settings](#checking-your-settings)
19 | - [Getting Help](#getting-help)
20 | - [List of Basic Commands](#list-of-basic-commands)
21 |
22 | ## List of Basic Commands
23 |
24 | | Task | Command |
25 | | ------------------------------------ | ------------------------------- |
26 | | Initializing a repository | `git init` |
27 | | Stages a single file | `git add filename.js ` |
28 | | Viewing the status | `git status` |
29 | | Commits with a one-line message | `git commit -m "Message"` |
30 | | Creates a new branch | `git branch branchName ` |
31 | | Switches to the another branch | `git checkout branchName` |
32 | | Deletes the branch | `git branch -d branchName` |
33 | | Merge branch into the current branch | `git merge branchName ` |
34 | | Pushes branch to origin | `git push -u origin branchName` |
35 | | Cloning a repository | `git clone repoUrl` |
36 | | Adds a new remote called upstream | `git remote add upstream url ` |
37 | | Push the local changes to remote | `git push ` |
38 |
39 | ## [Architecture of Git]
40 |
41 | ### The Three States
42 |
43 | Git has three main states that your files can reside in: _modified_, _staged_, and _committed_:
44 |
45 | - Modified means that you have changed the file but have not committed it to your database yet.
46 | - Staged means that you have marked a modified file in its current version to go into your next commit snapshot.
47 | - Committed means that the data is safely stored in your local database.
48 |
49 | - **The working tree** is a single checkout of one version of the project. These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.
50 | - **The staging area** is a file, generally contained in your Git directory, that stores information about what will go into your next commit.
51 | - **The Git directory** is where Git stores the metadata and object database for your project. This is the most important part of Git, and it is what is copied when you _clone_ a repository from another computer.
52 |
53 | #### The basic Git workflow goes something like this:
54 |
55 | 1. You modify files in your working tree.
56 | 2. You selectively stage just those changes you want to be part of your next commit, which adds _only_ those changes to the staging area.
57 | 3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.
58 |
59 | - if a particular version of a file is in the Git directory,it’s considered **_committed_**.
60 | - If it has been modified and was added to the staging area, it is **_staged_**.
61 | - And if it was changed since it was checked out but has not been staged, it is **_modified_**.
62 |
63 | ## [Installing Git]
64 |
65 | ### Installing on Linux
66 |
67 | If you want to install the basic Git tools on Linux via a binary installer, you can generally do so through the package management tool that comes with your distribution
68 |
69 | - If you’re on Fedora (or any closely-related RPM-based distribution, such as RHEL or CentOS), you can use `dnf`:
70 |
71 | ```console
72 | $ sudo dnf install git-all
73 | ```
74 |
75 | - If you’re on a Debian-based distribution, such as Ubuntu, try `apt`:
76 |
77 | ```console
78 | $ sudo apt install git-all
79 | ```
80 |
81 | For more options, there are instructions for installing on several different Unix distributions on the Git website, at [https://git-scm.com/download/linux](https://git-scm.com/download/linux).
82 |
83 | ### Installing on macOS
84 |
85 | There are several ways to install Git on a Mac. The easiest is probably to install the Xcode Command Line Tools.
86 |
87 | - On Mavericks (10.9) or above you can do this simply by trying to run `git` from the Terminal the very first time.
88 |
89 | ```console
90 | $ git --version
91 | ```
92 |
93 | **If you don’t have it installed already, it will prompt you to install it.**
94 |
95 | If you want a more up to date version, you can also install it via a binary installer. A macOS Git installer is maintained and available for download at the Git website, at [https://git-scm.com/download/mac](https://git-scm.com/download/mac).
96 |
97 | ### Installing on Windows
98 |
99 | There are also a few ways to install Git on Windows.
100 |
101 | - The most official build is available for download on the Git website. Just go to [https://git-scm.com/download/win](https://git-scm.com/download/win) and the download will start automatically.
102 |
103 | \*Note :- this is a project called Git for Windows, which is separate from Git itself; for more information on it, go to [https://gitforwindows.org](https://gitforwindows.org).
104 |
105 | - To get an automated installation you can use the [Git Chocolatey package](https://chocolatey.org/packages/git).
106 |
107 | _Note that the Chocolatey package is community maintained._
108 |
109 | ### Installing from Source
110 |
111 | - If you do want to install Git from source, you need to have the following libraries that Git depends on: **autotools, curl, zlib, openssl, expat, and libiconv**
112 |
113 | - For example, if you’re on a system that has `dnf` (such as Fedora) or `apt-get` (such as a Debian-based system), you can use one of these commands to install the minimal dependencies for compiling and installing the Git binaries:
114 |
115 | ```console
116 | $ sudo dnf install dh-autoreconf curl-devel expat-devel gettext-devel \
117 | openssl-devel perl-devel zlib-devel
118 | $ sudo apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev \
119 | gettext libz-dev libssl-dev
120 | ```
121 |
122 | - In order to be able to add the documentation in various formats (doc, html, info), these additional dependencies are required:
123 |
124 | ```console
125 | $ sudo dnf install asciidoc xmlto docbook2X
126 | $ sudo apt-get install asciidoc xmlto docbook2x
127 | ```
128 |
129 | - If you’re using a Debian-based distribution (Debian/Ubuntu/Ubuntu-derivatives), you also need the `install-info` package:
130 |
131 | ```console
132 | $ sudo apt-get install install-info
133 | ```
134 |
135 | - If you’re using a RPM-based distribution (Fedora/RHEL/RHEL-derivatives), you also need the `getopt` package (which is already installed on a Debian-based distro):
136 |
137 | ```console
138 | $ sudo dnf install getopt
139 | ```
140 |
141 | - Additionally, if you’re using Fedora/RHEL/RHEL-derivatives, you need to do this:
142 |
143 | ```console
144 | $ sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
145 | ```
146 |
147 | due to binary name differences.
148 |
149 | - When you have all the necessary dependencies, you can go ahead and grab the latest tagged release tarball from several places.
150 | You can get it via the kernel.org site, at [https://www.kernel.org/pub/software/scm/git](https://www.kernel.org/pub/software/scm/git), or the mirror on the GitHub website, at [https://github.com/git/git/releases](https://github.com/git/git/releases).
151 | It’s generally a little clearer what the latest version is on the GitHub page, but the kernel.org page also has release signatures if you want to verify your download.
152 |
153 | - Then, compile and install:
154 |
155 | ```console
156 | $ tar -zxf git-2.8.0.tar.gz
157 | $ cd git-2.8.0
158 | $ make configure
159 | $ ./configure --prefix=/usr
160 | $ make all doc info
161 | $ sudo make install install-doc install-html install-info
162 | ```
163 |
164 | - After this is done, you can also get Git via Git itself for updates:
165 |
166 | ```console
167 | $ git clone git://git.kernel.org/pub/scm/git/git.git
168 | ```
169 |
170 | ## [First-Time Git Setup]
171 |
172 | Now that you have Git on your system, you’ll want to do a few things to customize your Git environment. You should have to do these things only once on any given computer; they’ll stick around between upgrades. You can also change them at any time by running through the commands again.
173 |
174 | ### Git Config
175 |
176 | Git comes with a tool called `git config` that lets you get and set configuration variables that control all aspects of how Git looks and operates.
177 |
178 | These variables can be stored in three different places:
179 |
180 | 1. `[path]/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories. If you pass the option `--system` to `git config`, it reads and writes from this file specifically. Because this is a system configuration file, you would need administrative or superuser privilege to make changes to it.
181 | 2. `~/.gitconfig` or `~/.config/git/config` file: Values specific personally to you, the user. You can make Git read and write to this file specifically by passing the `--global` option, and this affects _all_ of the repositories you work with on your system.
182 | 3. `config` file in the Git directory (that is, `.git/config`) of whatever repository you’re currently using: Specific to that single repository. You can force Git to read from and write to this file with the `--local` option, but that is in fact the default. Unsurprisingly, you need to be located somewhere in a Git repository for this option to work properly.
183 |
184 | Each level overrides values in the previous level, so values in `.git/config` trump those in `[path]/etc/gitconfig`.
185 |
186 | On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people). It also still looks for `[path]/etc/gitconfig`, although it’s relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer.
187 | If you are using version 2.x or later of Git for Windows, there is also a system-level config file at `C:\Documents and Settings\All Users\Application Data\Git\config` on Windows XP, and in `C:\ProgramData\Git\config` on Windows Vista and newer. This config file can only be changed by `git config -f ` as an admin.
188 |
189 | You can view all of your settings and where they are coming from using:
190 |
191 | ```console
192 | $ git config --list --show-origin
193 | ```
194 |
195 | ### Your Identity
196 |
197 | The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information, and it’s immutably baked into the commits you start creating:
198 |
199 | ```console
200 | $ git config --global user.name "John Doe"
201 | $ git config --global user.email johndoe@example.com
202 | ```
203 |
204 | Again, you need to do this only once if you pass the `--global` option, because then Git will always use that information for anything you do on that system. If you want to override this with a different name or email address for specific projects, you can run the command without the `--global` option when you’re in that project.
205 |
206 | Many of the GUI tools will help you do this when you first run them.
207 |
208 | ### Your Editor
209 |
210 | Now that your identity is set up, you can configure the default text editor that will be used when Git needs you to type in a message. If not configured, Git uses your system’s default editor.
211 |
212 | If you want to use a different text editor, such as Emacs, you can do the following:
213 |
214 | ```console
215 | $ git config --global core.editor emacs
216 | ```
217 |
218 | On a Windows system, if you want to use a different text editor, you must specify the full path to its executable file. This can be different depending on how your editor is packaged.
219 |
220 | In the case of Notepad++, a popular programming editor, you are likely to want to use the 32-bit version, since at the time of writing the 64-bit version doesn’t support all plug-ins. If you are on a 32-bit Windows system, or you have a 64-bit editor on a 64-bit system, you’ll type something like this:
221 |
222 | ```console
223 | $ git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
224 | ```
225 |
226 | Note
227 |
228 | Vim, Emacs and Notepad++ are popular text editors often used by developers on Unix-based systems like Linux and macOS or a Windows system. If you are using another editor, or a 32-bit version, please find specific instructions for how to set up your favorite editor with Git in [git config core.editor commands](https://git-scm.com/book/en/v2/ch00/ch_core_editor).
229 |
230 | Warning
231 |
232 | You may find, if you don’t setup your editor like this, you get into a really confusing state when Git attempts to launch it. An example on a Windows system may include a prematurely terminated Git operation during a Git initiated edit.
233 |
234 | ### Your default branch name
235 |
236 | By default Git will create a branch called _master_ when you create a new repository with `git init`. From Git version 2.28 onwards, you can set a different name for the initial branch.
237 |
238 | To set _main_ as the default branch name do:
239 |
240 | ```console
241 | $ git config --global init.defaultBranch main
242 | ```
243 |
244 | ### Checking Your Settings
245 |
246 | If you want to check your configuration settings, you can use the `git config --list` command to list all the settings Git can find at that point:
247 |
248 | ```console
249 | $ git config --list
250 | user.name=John Doe
251 | user.email=johndoe@example.com
252 | color.status=auto
253 | color.branch=auto
254 | color.interactive=auto
255 | color.diff=auto
256 | ...
257 | ```
258 |
259 | You may see keys more than once, because Git reads the same key from different files (`[path]/etc/gitconfig` and `~/.gitconfig`, for example). In this case, Git uses the last value for each unique key it sees.
260 |
261 | You can also check what Git thinks a specific key’s value is by typing `git config `:
262 |
263 | ```console
264 | $ git config user.name
265 | John Doe
266 | ```
267 |
268 | Note
269 |
270 | Since Git might read the same configuration variable value from more than one file, it’s possible that you have an unexpected value for one of these values and you don’t know why. In cases like that, you can query Git as to the _origin_ for that value, and it will tell you which configuration file had the final say in setting that value:
271 |
272 | ```console
273 | $ git config --show-origin rerere.autoUpdate
274 | file:/home/johndoe/.gitconfig false
275 | ```
276 |
277 | ## [Getting Help]
278 |
279 | If you ever need help while using Git, there are three equivalent ways to get the comprehensive manual page (manpage) help for any of the Git commands:
280 |
281 | ```console
282 | $ git help
283 | $ git --help
284 | $ man git-
285 | ```
286 |
287 | For example, you can get the manpage help for the `git config` command by running this:
288 |
289 | ```console
290 | $ git help config
291 | ```
292 |
293 | if you don’t need the full-blown manpage help, but just need a quick refresher on the available options for a Git command, you can ask for the more concise “help” output with the `-h` option, as in:
294 |
295 | ```console
296 | $ git add -h
297 | usage: git add [] [--] ...
298 |
299 | -n, --dry-run dry run
300 | -v, --verbose be verbose
301 |
302 | -i, --interactive interactive picking
303 | -p, --patch select hunks interactively
304 | -e, --edit edit current diff and apply
305 | -f, --force allow adding otherwise ignored files
306 | -u, --update update tracked files
307 | --renormalize renormalize EOL of tracked files (implies -u)
308 | -N, --intent-to-add record only the fact that the path will be added later
309 | -A, --all add changes from all tracked and untracked files
310 | --ignore-removal ignore paths removed in the working tree (same as --no-all)
311 | --refresh don't add, only refresh the index
312 | --ignore-errors just skip files which cannot be added because of errors
313 | --ignore-missing check if - even missing - files are ignored in dry run
314 | --chmod (+|-)x override the executable bit of the listed files
315 | --pathspec-from-file read pathspec from file
316 | --pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character
317 | ```
318 |
--------------------------------------------------------------------------------
/git-masterclass/03-branches/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=SFLpVkF0obY&list=PL2kSRH_DmWVajYgFoP-HVKK5VKkzFYyzp&index=3) video now!
2 |
3 | ## Commit Objects
4 | As we have studied earlier about committing changes, let's know what is commit object.
5 | A commit object contains :
6 | - reference to commit objects and tree objects.
7 | - reference to blob objects.
8 | - commit message.
9 | - also stores pointer to its parent(s) commit(s).
10 |
11 | #### About parent commits
12 | 1. 0 parent = initial commit
13 | 2. 1 parent = usual commit
14 | 3. multiple parents = commit resulting from merging 2 or more branches
15 | ---------------------------------------------------------------------------------------
16 |
17 | ## What happens when we stage a file?
18 | Let's see what happens at the staging time:
19 | - computes the checksum for each file
20 | - stores a version of file in a git repo(blob)
21 | - adds checksum into staging area
22 | ----------------------------------------------------------------------------------------
23 |
24 | ## What happens when we commit a file?
25 | When you make a commit, git stores a commit object that contains a pointer to the snapshot of the content you staged.
26 | Following happens upon committing a file:
27 | - checksums each subdirectory
28 | - stores it as a tree object in git repo
29 | --------------------------------------------------------------
30 | ## What is this commit, tree and blob?
31 | 1. **commit** : The files which are present in the staging area and needs to be committed. It has some size, some SHA-1 hash ID of tree, author and committer, and is the first commit of the project pointing towards something called tree.
32 |
33 | 2. **tree** : A Git tree object creates the hierarchy between files in a Git repository. You can use the Git tree object to create the relationship between directories and the files they contain. These endpoints allow you to read and write tree objects to your Git database on GitHub. We can again see size and some blobs and their SHA-1 hash ID and their names pointing towards multiple blobs.
34 |
35 | 3. **blob** : A Git blob(binary large object) is the object type used to store the contents of each file in a repository. The file's SHA-1 hash is computed and stored in the blob object.
36 | ---
37 |
38 | ## Branches
39 |
40 | Git branches are effectively a pointer to a snapshot of your changes. When you want to add a new feature or fix a bug(no matter how big or small) you spawn a new branch to encapsulate your changes. Branches are cheap and easy to merge. Switching back and forth the branches is also very easy.
41 | #### Some commands related to branches
42 | - `git branch` : list all branches in your repository
43 | - `git branch ` : create a new branch called <branch>. This does not check out the new branch.
44 | - `git checkout ` : lets you navigate between the branches created by git branch
45 | - `git switch ` : allows you to switch your current HEAD branch
46 | - `git branch -d ` : Delete the specified branch. This is a “safe” operation in that Git prevents you from deleting the branch if it has unmerged changes
47 | - `git branch -D ` : Force delete the specified branch, even if it has unmerged changes. This is the command to use if you want to permanently throw away all of the commits associated with a particular line of development
48 | - `git branch -m ` : rename the current branch to "branch"
49 | - `git branch -a` : list all the remote branches
50 |
51 | >HEAD : it points out the last commit in the current checkout branch. It is like a pointer to any reference. The HEAD can be understood as the "current branch." When you switch branches with 'checkout,' the HEAD is transferred to the new branch.
52 |
53 |
54 |
--------------------------------------------------------------------------------
/git-masterclass/04-practical-uses/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=jp_fOkie4gs&list=PL2kSRH_DmWVajYgFoP-HVKK5VKkzFYyzp&index=4) video now!
2 |
3 | # CONTENT:
4 | - [COMMIT HISTORY](#commit-history)
5 | - [CREATING A NEW BRANCH & COMMITTING CHANGES](#CREATING-A-NEW-BRANCH-&-COMMITTING-CHANGES)
6 | - [MERGING BRANCHES](#MERGING-BRANCHES)
7 | - ["FAST-FORWARD" MERGING]("FAST-FORWARD"-MERGING)
8 | - ["3 WAY" MERGING]("3-WAY"-MERGING)
9 | - [RESOLVE MERGE CONFLICTS](#RESOLVE-MERGE-CONFLICTS)
10 | - [BRANCH MANAGEMENT COMMANDS](#BRANCH-MANAGEMENT-COMMANDS)
11 | - [DELETE A BRANCH THAT IS NOT MERGED](#DELETE-A-BRANCH-THAT-IS-NOT-MERGED)
12 | - [COMMIT HISTORY](#COMMIT-HISTORY)
13 | - [NOTE](#NOTE)
14 | ## COMMIT HISTORY:
15 | *starting with some commits in the **main** branch.*
16 | ## CREATING A NEW BRANCH & COMMITTING CHANGES:
17 | ### CREATING "01-INTRODUCTION" BRANCH:
18 | ```sh
19 | //create a new branch "01-introduction",
20 | git branch 01-introduction
21 | //switch HEAD from "main" branch to "01-introduction",
22 | git checkout 01-introduction
23 |
24 | //done with changes to "01-introduction", now commit the changes.
25 |
26 | // to stage the changes,
27 | git add .
28 | // commit changes.
29 | git commit -m "commit on 01-introduction"
30 | ```
31 | ```sh
32 | Switch to main branch:
33 | git switch main
34 | ```
35 |
36 | ### CREATING "02-BASIC-COMMANDS" BRANCH:
37 | ```sh
38 | Create "02-basic-commands":
39 |
40 | // create a new branch "02-basic-commands",
41 | git branch 02-basic-commands
42 |
43 | //switch HEAD from main branch to "Branch2",
44 | git checkout 02-basic-commands
45 |
46 | //done with changes to "02-basic-commands", now commit the changes.
47 |
48 | // to stage the changes,
49 | git add .
50 | // commit changes.
51 | git commit -m "commit on Branch2"
52 | ```
53 |
54 | ```sh
55 | Switch to main branch:
56 | git switch main
57 | ```
58 |
59 | **Now we have 2 new branches diverging from the main branch,
60 | And the git HEAD will be pointing to main.**
61 |
62 | ## MERGING BRANCHES:
63 | ### "FAST FORWARD" MERGING:
64 | ```sh
65 | -As we are in "main" branch,
66 | -if we merge the "01-introduction" with the current branch,
67 | //git merge 01-introduction
68 | -then the "main" branch pointer points to the commit that "01-introduction" branch is pointing to.
69 | -This is also called as "Fast-Forward".
70 |
71 | // delete "01-introduction" branch.
72 | git branch -d 01-introduction
73 | ```
74 | ### "3 WAY" MERGING:
75 | ```sh
76 | - If we merge the "02-basic-commands" with "main" branch ,
77 | // git merge 02-basic-commands
78 | - As these two branches are diverged (commits these branches are pointing are not direct ancestors) ,
79 | - 3 way merge takes place, also called "merge made by the 'ort' strategy",
80 | - git will create a new commit by taking the snapshot from the commits of two branches.
81 | - The main branch points to the new commit.
82 | - Now we can delete the "02-basic-commands" branch, as it is merged with the "main" branch.
83 |
84 | // delete "02-basic-commands" branch.
85 | git branch -d 02-basic-commands
86 | ```
87 |
88 |
89 | ## RESOLVE MERGE CONFLICTS:
90 | - While doing **3 way merges** , we may encounter conflict that the two commits may have different data in the same lines from some files.
91 | - Git cannot decide on what data has to be taken for the new commit.
92 | - In that case we have to remove the conflict data , and manual commit the changes.
93 |
94 | ## BRANCH MANAGEMENT COMMANDS:
95 | git branch
96 | - will show all the branches.
97 | git branch -v
98 | - will show all the branches with the last commit message.
99 | git branch --merged
100 | - will show the branches that are merged with the current branch.
101 |
102 |
103 | ## DELETE A BRANCH THAT IS MERGED:
104 | git branch -d BranchName
105 | ## DELETE A BRANCH THAT IS NOT MERGED:
106 | git branch -D BranchName
107 |
108 | ## COMMIT HISTORY:
109 |
110 | git log
111 | - all the commits with author details, time and check-sum.
112 | git log --stat
113 | - git logs along with files that are modified in that commit.
114 | git log --pretty=oneline
115 | - presents each commit details in a single line.
116 |
117 | # NOTE:
118 | 1) When we are switching to new branch,
119 | there should be no pending changes in the working tree of present branch,
120 | otherwise git will not allow us to switch.
121 | 2) But in-case ,
122 | if we don’t want to commit changes in the current branch for now,
123 | but want to switch to other branch, we can store the changes temporarily using stash.
124 |
125 |
126 |
--------------------------------------------------------------------------------
/linux-masterclass/01-setup/README.md:
--------------------------------------------------------------------------------
1 | # Context
2 |
3 | Linux is the most widely used Operating System for software engineers. Most of us still prefer Windows for our day to day tasks, and dual booting can be tricky. There are a few ways in which you can still use Linux without letting go of Windows or go through the hassle of dual booting.
4 |
5 | ## WSL (Windows Subsystem Linux)
6 |
7 | It can be that your system is not powerful enough to run a virtual machine, but you still want to get started with Linux.
8 |
9 | WSL is a lightweight Linux subsystem that can help you in that scenario.
10 |
11 | WSL command is available by default. You can simply run the following command in your command prompt (CMD) to check the distributions available to install -
12 |
13 | `wsl --list --online`
14 |
15 | This displays 2 columns -
16 |
17 | 1. The name of the distribution.
18 | 2. Friendly name for it.
19 |
20 | You can then simply run -
21 |
22 | `wsl --install -d `
23 |
--------------------------------------------------------------------------------
/linux-masterclass/02-introduction/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=Juo_0lpBMPY) video now!
2 |
3 | ## **What happens when your start a computer?**
4 |
5 | The first thing that happens on starting a computer is that it executes the software that are there in the BIOS (Basic Input Output System) also referred to as a firmware.
6 |
7 | This firmware comes by default in a computer stored in ROM attached to the motherboard. Secondly, it loads the bootloader which is responsible to initialize the OS.
8 | ___
9 |
10 | ## **What is Bootloader?**
11 |
12 | It is a program that is responsible for initializing the *Operating System.*
13 |
14 | ___
15 |
16 | ## **What is OS (Operating System)?**
17 |
18 | An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
19 |
20 | ___
21 | ## **An operating system should have :**
22 | - Kernel
23 | - File system
24 | - User interface (GUI & CLI)
25 | - Should be able to manipulate data based on command.
26 | ___
27 |
28 | ## **What is file system?**
29 |
30 | Method or Data Structure that the OS use to store and retrieve the data in the memory.
31 |
32 | ___
33 |
34 | ## **What is kernel?**
35 | The kernel is a core component of an operating system and serves as the main interface between the computer's physical hardware and the processes running on it.
36 | It is also known as bridge between *Software* and *Hardware.*
37 | ___
38 |
39 | ## **What are Most Popular OS ?**
40 | - Microsoft Windows
41 | - Mac OS (Only on apple)
42 | - Linux (UNIX based)
43 | - Android
44 | - iOS (iPhone Operating system)
45 | ___
46 |
47 | ## **Why use Linux?**
48 | - Open Source
49 | - Support almost all *Programming Languages*
50 | - Developer Friendly
51 | - Terminal is superior to CMD
52 | - Bash Scripting
53 | - SSH (Secure Shell)
54 | ___
55 |
56 | ## **History of Linux**
57 |
58 | In **1969** First unix OS created by *Ken Thompson* and *Dennis M. Ritchie*
59 | 10 years later *Richard Stallman* started working on GNU project (BSD , MINIX, etc).
60 |
61 | In **1991** *Linus Torvalds* started working on the "Linux Kernel". This kernel was used in every linux distribution.
62 |
63 | >Linus Torvalds is the father of *Linux*
64 |
65 |
66 | ## **Linux Distributions**
67 | - Ubuntu
68 | - Fedora
69 | - Arch
70 | - Kali Linux
71 | - Pop OS and many more
72 |
73 | As a beginner you should start out with Ubuntu.
74 |
75 | ## **Why Ubuntu than any other distribution?**
76 | - It is Beginner Friendly
77 | - It has a decent UI (user interface)
78 | - Ease to use for non-programmer also
79 |
80 | >Fun fact : Linux is all about of Keyboard
81 | ___
82 |
83 | ## **What is Terminal?**
84 |
85 | A terminal(black window) is a tool where we are going to write our commands.Start terminal using this command : `ctrl+alt+t` or you can press windows button and type terminal.
86 | ___
87 |
88 | ## **What is SHELL?**
89 | A *shell* is a command line interpreter because it executes the commands line by line.
90 |
91 | >Just like how Python (a programming language) works.
92 | ___
93 |
94 | ## **What is BASH Programming?**
95 |
96 | Every command we are writing on the terminal is a BASH language.
97 | ___
98 |
99 | ## **Shell Format**
100 | `apoorvgoyal@apoorvtwts:~$`
101 | this is the format of shell, lets understand what all this means:
102 |
103 | - `apoorvgoyal` : username
104 | - `@apoortwts` : hostname
105 | - `~` : represents the home directory of the user('~' symbol is called tilde)
106 | - `$` : after this you can start writing command
107 | ___
108 |
109 | ## **Printing "Hello World" in terminal**
110 | `apoorvgoyal@apoorvtwts:~$ echo "Hello World" `
111 | ___
112 |
113 | ## **pwd (Print Working Directory)**
114 | The pwd command writes the full pathname of the current working directory to the standard output.
115 | `apoorvgoyal@apoorvtwts:~$ pwd`
116 | ___
117 |
118 | ## **File Structure in Linux**
119 | The linux file hierarchy structure or the Filesystem Hierarchy Standard (FHS) defines the directory structure and directory contents in Unix like operating systems. It is maintained by the Linux Foundation.
120 |
121 | 
122 | ### if u wanna know in depth then [Go follow this Link](https://www.geeksforgeeks.org/linux-file-hierarchy-structure/)
123 |
124 | ___
125 |
126 |
127 | ## **Path of a Directory**
128 | Suppose u have to go `/home` directory in the above diagram. How will u go in terminal?
129 |
130 | You can use this way `~$ cd ~/home`
131 |
132 | ## Basics Commands in Linux
133 | | Task | Command |
134 | |----------------------------------------------|----------------------------------|
135 | |List files |`ls` |
136 | |Changed directory |`cd ` |
137 | |Clean the terminal |`clear` |
138 | |Make directory |`mkdir ` |
139 | |Make file |`touch ` |
140 | |Reads data and opens in the terminal |`cat ` |
141 | |Previously executed commands |`history` |
142 | |Short discription of the command |`whatis ` |
143 | |Remove directory |`rmdir ` |
144 | |Copy file or directory |`cp ` |
145 | |Move file or directory |`mv ` |
146 | |Opens a text editor |`gedit ` |
147 |
--------------------------------------------------------------------------------
/linux-masterclass/02-introduction/notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/virtual-tech-school/virtual-tech-notes/20c5e3aa2b2fbc9756c3f95eef98fd36c12bb544/linux-masterclass/02-introduction/notes.pdf
--------------------------------------------------------------------------------
/linux-masterclass/03-streams-and-files/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=xVaC_G6aeH0&list=PL2kSRH_DmWVZp_cu6MMPWkgYh7GZVFS6i&index=3) video now!
2 |
3 | ## **3 standard streams.** ##
4 |
5 | What happens when we execute a command? Linux by default has 3 standard streams:
6 |
7 | stdin (standard input) code - 0
8 | stdout (standard output) code - 1
9 | stderr (standard error) code - 2
10 |
11 | Stream's job is to transfer data (simple text), takes input and gives output.
12 |
13 | output can be in terminal.
14 | in some file.
15 | or in pipe which redirects it.
16 |
17 | If you want to redirect, (>) this symbol is used.
18 | Eg : ls > output.txt
19 | this command overwrites the data. To append the data,
20 | ls >> output.txt
is used.
21 |
22 | ## **stderr**
23 | Now the lg > output.txt
command gives an error, to tackle this
24 | lg 2> output.txt
is used because error is denoted by 2.
25 |
26 | > lg 2> /dev/null : to nullify error.
27 |
28 | ## **less**
29 | Opens output in seperate window.
30 | Eg: less /var/log/syslog
31 |
32 | To view large files without populating your terminal. Do ls -la /etc | less
33 | to close the seperate window press "q"
34 |
35 | ## **pipe**
36 | Takes standard output of one command and feeds it to the next command as standard input.
37 |
38 | ## **Environment Variables**
39 | It store and provide useful information that shells and processes can use.
40 |
41 | **pwd** - gives present working directory.
42 | Maintains a present working directory.
43 | **Path environment variable** - contains all the path that your pc
44 | will search whenever you enter a command.
45 | > Everything in linux is file even the commands.
46 |
47 | ## **Some commands.**
48 |
49 | head : prints first 10 lines of file.
50 | eg : head output.txt
.
51 | eg : head -n 15 output.txt
(prints first 15 lines of file)
52 |
53 | tail : prints last 10 lines of file .
54 | eg : tail output.txt
55 | eg : tail -n 15 output.txt
(prints last 15 lines of file)
56 |
57 | sort gives sorted version of the file.
58 | eg : sort testing.txt
59 | eg : sort -r testing.txt
is for reverse sorting.
60 |
61 | translate
62 | eg : cat testing.txt | tr a-z A-Z
(from lowercase to uppercase)
63 |
64 | uniq gives unique value in a file.
65 | eg : uniq testing.txt
66 | eg : uniq -c testing.txt
(gives number of occurances).
67 |
68 | >Drawback: only works when the duplicate words are next to each other.
69 |
70 | wc (word count)
71 | eg : wc testing.txt
(gives no of lines, words in the file & size of the file in Bytes)
72 |
73 | grep used in searching and matching text files contained in the regular expressions.
74 | eg : env | grep PWD
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/linux-masterclass/03-streams-and-files/notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/virtual-tech-school/virtual-tech-notes/20c5e3aa2b2fbc9756c3f95eef98fd36c12bb544/linux-masterclass/03-streams-and-files/notes.pdf
--------------------------------------------------------------------------------
/linux-masterclass/04-users-and-permissions/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=hxNFeL2qY-k&list=PL2kSRH_DmWVZp_cu6MMPWkgYh7GZVFS6i&index=4) video now!
2 |
3 |
4 |
5 |
6 | # Content
7 |
8 | - [Users-and-permissions](#users-and-permissions)
9 | - [What are users and groups?](#what-are-users-and-groups)
10 | - [Managing users](#managing-users)
11 | - To create a new Linux user
12 | - To modify a Linux user
13 | - Accessing a user configuration file
14 | - To modify a Linux user
15 | - Change the user ID for a user
16 | - Change the user login name
17 | - To delete a Linux user
18 | - [Manage groups](#manage-groups)
19 | - To create a group
20 | - Modify the group ID of a user
21 | - [Superuser access](#superuser-access)
22 | - [File permissions & ownership](#file-permissions--ownership)
23 | - To change permissions on a file or directory
24 | - change ownership of a file/directory
25 | - Example
26 | - [How to manage permissions?](#how-to-manage-permissions)
27 | - How to use absolute mode?
28 | - How do I use symbolic mode?
29 | - [Sticky bit](#sticky-bit)
30 |
31 |
32 |
33 |
34 | # Users-and-permissions
35 |
36 | Linux, being a truly multi-user, multi-namespace OS, offers a lot of options when it comes to user management
37 |
38 | ### What are users and groups?
39 |
40 | A user is an entity, in a Linux operating system, that can manipulate files and perform several other operations. Each user is assigned an ID that is unique for each user in the operating system.
41 |
42 | After installation of the operating system, the **ID 0 is assigned to the root user** and the IDs 1 to 999 (both inclusive) are assigned to the system users and hence the ids for local user begins from 1000 onwards.
43 |
44 | In a single directory, we can create 60,000 users.
45 |
46 | A multi-user OS means that Linux can be used by multiple users _at the same time_.
47 | Most Linux distributions have much more users, each one responsible for a certain aspect of the system.
48 |
49 | You can not easily log in to them, but you can run commands from their name and set permissions. Groups, then, are just groups of users who need access to a certain resource.
50 |
51 | To list all users on your system, run this command:
52 |
53 | ```
54 | $ less /etc/passwd
55 | ```
56 |
57 | `/etc/passwd` is the file that holds the information about users, and `less` outputs it nicely.
58 |
59 | ```
60 | root:x:0:0:root:/root:/bin/bash
61 | daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
62 | bin:x:2:2:bin:/bin:/usr/sbin/nologin
63 | sys:x:3:3:sys:/dev:/usr/sbin/nologin
64 | sync:x:4:65534:sync:/bin:/bin/sync
65 | games:x:5:60:games:/usr/games:/usr/sbin/nologin
66 | man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
67 | lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
68 | mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
69 | news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
70 | uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
71 | proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
72 | www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
73 | backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
74 | list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
75 | irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
76 | gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
77 | nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
78 | systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
79 | systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
80 | systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
81 | messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
82 | ```
83 |
84 | The format of the `passwd` file is the following:
85 |
86 | - username
87 | - password (replaced with x and stored in `/etc/shadow`)
88 | - UID (user id, a number)
89 | - GID (group id, also a number)
90 | - user’s full name
91 | - user’s home directory
92 | - user’s login shell (the program that runs when you log in. The `nologin` is a program that does nothing, used to prevent logging in as system users)
93 |
94 | ### Managing users
95 |
96 | **To create a new Linux user**: use the `useradd` command like this:
97 |
98 | ```
99 | $ sudo useradd
100 | ```
101 |
102 | The user is given the ID automatically depending on which category it falls in. The username of the user will be as provided by us in the command.
103 |
104 | Additionally, `useradd` can take these arguments:
105 |
106 | - `-d ` – sets user’s home directory
107 | - `-s ` – sets user’s login shell
108 | - `-g ` – sets user’s primary group (more on that later)
109 | - `-u ` – sets user’s UID (will be autogenerated by default)
110 |
111 | After you have created the user, you need to set a password for him. Unlike windows, if a user does not have a password, there is no way of logging in as him. To set the password run this command:
112 |
113 | ```
114 | # passwd
115 | ```
116 |
117 | You will be prompted for the password twice.
118 |
119 | **To modify a Linux user:** use the `usermod` command like this:
120 |
121 | ```
122 | # usermod
123 | ```
124 |
125 | Like `useradd`, `usermod` will accept the same arguments to set the fields of the user.
126 |
127 | **Accessing a user configuration file**: use the `/etc/passwd` command like :
128 |
129 | ```
130 | cat /etc/passwd
131 | ```
132 |
133 | This commands prints the data of the configuration file. This file contains information about the user in the format.
134 |
135 | ```
136 | username : x : user id : user group id : : /home/username : /bin/bash
137 | ```
138 |
139 | ```
140 | root:x:0:0:root:/root:/bin/bash
141 | daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
142 | bin:x:2:2:bin:/bin:/usr/sbin/nologin
143 | sys:x:3:3:sys:/dev:/usr/sbin/nologin
144 | sync:x:4:65534:sync:/bin:/bin/sync
145 | games:x:5:60:games:/usr/games:/usr/sbin/nologin
146 | man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
147 | lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
148 | mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
149 | news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
150 | uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
151 | proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
152 | www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
153 | backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
154 | list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
155 | irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
156 | gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
157 | ```
158 |
159 | **To modify a Linux user:** use the `usermod` command like this:
160 |
161 | ```
162 | # usermod
163 | ```
164 |
165 | Like `useradd`, `usermod` will accept the same arguments to set the fields of the user.
166 |
167 | **Change the user ID for a user**:usr `usermod ` command like this:
168 |
169 | ```
170 | usermod -u new_id username
171 | ```
172 |
173 | This command can change the user ID of a user. The user with the given username will be assigned with the new ID given in the command and the old ID will be removed.
174 |
175 | **Change the user login name** using `usermod` command
176 |
177 | ```
178 | sudo usermod -l new_login_name old_login_name
179 | ```
180 |
181 | This command is used to change the login name of the user. The old login name of the user is changed to the new login name provided.
182 |
183 | **To delete a Linux user:** use the `userdel` command like this:
184 |
185 | ```
186 | # userdel
187 | ```
188 |
189 | It accepts an argument `-r` to also delete the user’s home directory and mail.
190 |
191 | ### Manage groups
192 |
193 | Like users, you can create, modify, and delete groups. To view the group membership for a user, as well as its UID, use:
194 |
195 | ```
196 | $ id
197 | ```
198 |
199 | Like users, you can list all groups on your setup:
200 |
201 | ```
202 | $ cat /etc/group
203 | ```
204 |
205 | **To create a group:** use the `groupadd` command like this:
206 |
207 | ```
208 | # groupadd
209 | ```
210 |
211 | `groupadd` takes these arguments:
212 |
213 | - `-g ` set the group id
214 | - `-f` force the command to return successfully even if group already exists
215 |
216 | After the group is created, you might want to add some users to it. The `gpasswd` tool can do that:
217 |
218 | ```
219 | # gpasswd
220 | ```
221 |
222 | And, lastly, you can edit groups with `groupmod` (same arguments as `groupadd`) and delete groups with `groupdel`.
223 |
224 | **Modify the group ID of a user**.
225 |
226 | ```
227 | usermod -g new_group_id username
228 | ```
229 |
230 | This command can change the group ID of a user and hence it can even be used to move a user to an already existing group. It will change the group ID of the user whose username is given and sets the group ID as the given new_group_id.
231 |
232 | ### Superuser access
233 |
234 | `root`, or superuser, is a special user in the system, with unlimited power. `root` can read, write, and execute every single file.
235 | So some distributions disable `root` altogether. Instead, you can use the `sudo` command to run a specific program _as_ `root`.
236 |
237 | ```
238 | $ sudo apt-get install cowsay
239 | ```
240 |
241 | Here, the `apt-get install cowsay` command will be run as `root`, after you enter your password. Access to `sudo` is governed by the `/etc/sudoers` file. In it, you will find lines like these:
242 |
243 | ```
244 | Defaults env_reset
245 |
246 | username ALL=(ALL:ALL) ALL
247 | %sudo ALL=(ALL:ALL) ALL
248 | ```
249 |
250 | The `Defaults env_reset` line clears all environmental variables. This is a safety precaution. Then, the `username ALL=(ALL:ALL) ALL` command does this:
251 |
252 | - Let `username`
253 | - On `ALL` hosts
254 | - Run commands as `ALL` users and `ALL` groups
255 | - `ALL` commands are allowed
256 |
257 | So, the syntax goes like this:
258 |
259 | ```
260 | =(:)
261 | ```
262 |
263 | The next line starts with a `%` sign. That means that that rule applies to any user in the `sudo` group. This is convenient because you do not have to edit this file when creating new users, instead, you can add them to `sudo` group.
264 |
265 | Now, there may be cases when you need to login as genuine `root`. The `su` command switches current user to `root`, and if you run it with `sudo`, you will be able to switch to `root` using your own password:
266 |
267 | ```
268 | $ whoami // michael
269 | $ sudo su
270 | # whoami // root
271 | ```
272 |
273 | When logged in as `root`, you can simply run `passwd` to change `root`‘s password and be able to login to it directly **(please do not do this)**.
274 |
275 | ### File permissions & ownership
276 |
277 | Every file and every folder on your system has permission, as well as ownership info. The permissions have these values:
278 |
279 | - `0` or `---` – nothing allowed
280 | - `1` or `--x` – execution allowed
281 | - `2` or `-w-` – writing allowed
282 | - `3` or `-wx` – writing and execution allowed
283 | - `4` or `r--` – reading allowed
284 | - `5` or `r-x` – reading and execution allowed
285 | - `6` or `rw-` – reading and writing allowed
286 | - `7` or `rwx` – everything allowed
287 |
288 | In addition, every file and directory has an _owner_. The owner is the user that has absolute control over the file. The owner can also be specified as a group. Thus, every file has 3 different permissions: for owner, for owning group, and for everyone else. You can easily view permissions by running `ls -al`:
289 |
290 | ```
291 | total 128
292 | drwxr-xr-x 20 root root 4096 Nov 13 00:02 .
293 | drwxr-xr-x 20 root root 4096 Nov 13 00:02 ..
294 | lrwxrwxrwx 1 root root 7 Mar 30 2021 bin -> usr/bin
295 | drwxr-xr-x 3 root root 4096 Nov 11 14:22 boot
296 | drwxr-xr-x 20 root root 4800 Nov 23 09:54 dev
297 | -rw-r--r-- 1 root root 1424 Nov 10 12:07 docker-desktop.install
298 | -rw-r--r-- 1 root root 3059 Nov 10 12:07 docker-desktop.spec
299 | drwxr-xr-x 160 root root 12288 Nov 22 09:38 etc
300 | drwxr-xr-x 3 root root 4096 Oct 31 2021 home
301 | lrwxrwxrwx 1 root root 7 Mar 30 2021 lib -> usr/lib
302 | lrwxrwxrwx 1 root root 9 Mar 30 2021 lib32 -> usr/lib32
303 | lrwxrwxrwx 1 root root 9 Mar 30 2021 lib64 -> usr/lib64
304 | lrwxrwxrwx 1 root root 10 Mar 30 2021 libx32 -> usr/libx32
305 | drwx------ 2 root root 16384 Oct 31 2021 lost+found
306 | drwxr-xr-x 3 root root 4096 Nov 15 2021 media
307 | drwxr-xr-x 2 root root 4096 Mar 30 2021 mnt
308 | drwxr-xr-x 5 root root 4096 Nov 13 00:02 opt
309 | -rw-r--r-- 1 root root 1028 Nov 10 12:07 PKGBUILD
310 | dr-xr-xr-x 443 root root 0 Nov 23 09:53 proc
311 | drwx------ 10 root root 4096 Nov 17 12:36 root
312 | drwxr-xr-x 45 root root 1300 Nov 23 13:45 run
313 | lrwxrwxrwx 1 root root 8 Mar 30 2021 sbin -> usr/sbin
314 | drwxr-xr-x 13 root root 4096 Aug 11 10:22 snap
315 | drwxr-xr-x 2 root root 4096 Mar 30 2021 srv
316 | dr-xr-xr-x 13 root root 0 Nov 23 09:53 sys
317 | drwxr-xr-x 9 root root 4096 Nov 22 20:00 timeshift
318 | drwxrwxrwt 40 root root 36864 Nov 23 19:14 tmp
319 | drwxr-xr-x 14 root root 4096 Sep 20 2021 usr
320 | drwxr-xr-x 15 root root 4096 Aug 14 14:00 var
321 | ```
322 |
323 | In the first column you can see the permissions, specified in the order `user` `group` `everyone`. For example, only `root` can edit the `boot` directory, but anyone can read and execute stuff from it.
324 |
325 | **To change permissions on a file or directory**, use the `chmod` command:
326 |
327 | ```
328 | $ chmod [options] [mode] [files]
329 | ```
330 |
331 | Most common `chmod` option is `-R`. It stands for recursive and means that the rule will be applied to all children in a folder.
332 |
333 | You can use the `chown` command to **change ownership of a file/directory**. Its syntax is similar:
334 |
335 | ```
336 | $ chown [options] [user:group] [files]
337 | ```
338 |
339 | It takes the same option `-R`, which does the same thing.
340 |
341 | examples:
342 |
343 | ```
344 | $ chown -R mike /home/mike
345 | Set ownership to mike for all files in his home directory
346 | ```
347 |
348 | Example :
349 |
350 | How to change the user/owner associated with `file1`?
351 |
352 | ```
353 | # chown user02 file1
354 | ```
355 |
356 | How to change the group associated with `file1`?
357 |
358 | ```
359 | # chown :groupA file1
360 | ```
361 |
362 | How to change the owner and group at the same time for `file2`?
363 |
364 | ```
365 | # chown user02:groupA file2
366 | ```
367 |
368 | How tp change the user/group for a directory and all of its contents?
369 |
370 | ```
371 | # chown -R user01:groupA Resources
372 | ```
373 |
374 | The above task provides a recursive configuration. Technically, recursive commands are repeated on each specified object. Effectively, recursive means "this and everything in it." In the above example, you are configuring the related user/group for the Resources directory and everything in it. Without the -R option, you would only affect the Resources directory itself, but not its contents.
375 |
376 | ## How to manage permissions?
377 |
378 | The _change mode_ or `chmod` command sets permissions. The syntax is straight-forward:
379 |
380 | ```
381 | chmod permissions resource-name
382 | ```
383 |
384 | Here are two examples of manipulating permissions for `file`:
385 |
386 | ```
387 | # chmod 740 file
388 | # chmod u=rwx,g=r,o-rwx file
389 | ```
390 |
391 | The first example represents **absolute mode** and second **symbolic mode** respectively.
392 |
393 | #### How to use absolute mode?
394 |
395 | Absolute mode is one of two ways of specifying permissions
396 |
397 | Each access level (read, write, execute) has an octal value:
398 |
399 | | **Access level** | **Octal value** |
400 | | ---------------- | --------------- |
401 | | Read | 4 |
402 | | Write | 2 |
403 | | Execute | 1 |
404 |
405 | Each identity (user, group, others) has a position:
406 |
407 | | **Identity** | **Position** |
408 | | ------------ | ------------------ |
409 | | User | First or left-most |
410 | | Group | Middle |
411 | | Other | Last or right-most |
412 |
413 | The absolute mode syntax states the desired permissions from left to right.
414 |
415 | How to grant the user (owner) read, write, and execute, the group read-only, and all others no access to `file` by using absolute mode
416 |
417 | ```
418 | # chmod 740 file
419 | ```
420 |
421 | The three permissions values are associated with identities:
422 | **ugo**
423 | **740**
424 |
425 | - The **7** is assigned to the user and is the sum of 4+2+1 or read+write+execute (full access)
426 | - The **4** is assigned to the group and is the sum of 4+0+0 (read-only)
427 | - The **0** is assigned to others and is the sum of 0+0+0 (no access)
428 |
429 | In this example, the user has **rwx**, the group has **r** only, and all others have **no access** to `file`.
430 |
431 | One more example.
432 |
433 | How to grant the user (owner) read and write, the group read-only, and all others read-only to `file
434 |
435 | ```
436 | # chmod 644 file
437 | ```
438 |
439 | - The user has **6** (read and write)
440 | - The group has **4** (read-only)
441 | - All others have **4** (read-only)
442 |
443 | How to set permissions for the `Resources` directory and all of its contents by using absolute mode
444 |
445 | ```
446 | # chmod -R 744 Resources
447 | ```
448 |
449 | #### How do I use symbolic mode?
450 |
451 | Symbolic mode uses more symbols, but the symbols are simpler to understand.
452 |
453 | Each access level has a symbol:
454 |
455 | | **Access level** | **Symbol** |
456 | | ---------------- | ---------- |
457 | | Read | r |
458 | | Write | w |
459 | | Execute | x |
460 |
461 | Each identity has a symbol:
462 |
463 | | **Identity** | **Symbol** |
464 | | ------------ | ---------- |
465 | | User | u |
466 | | Group | g |
467 | | Other | o |
468 |
469 | There are also operators to manipulate the permissions:
470 |
471 | | **Task** | **Operator** |
472 | | ------------------------ | ------------ |
473 | | Grant a level of access | + |
474 | | Remove a level of access | - |
475 | | Set a level of access | = |
476 |
477 | The general `chmod` command syntax is the same:
478 |
479 | ```plaintext
480 | command permissions directory/file
481 | ```
482 |
483 | Here is an example:
484 |
485 | How to remove the read permissions from others for `file` by using symbolic mode
486 |
487 | ```
488 | # chmod o-r file
489 | ```
490 |
491 | This example removes (`-`) the read (`r`) permission from others (`o`) for `file`.
492 |
493 | How to set permissions for a directory and all of its contents by using symbolic mode
494 |
495 | ```
496 | # chmod -R o=rwx,g+rw,o-rwx Resources
497 | ```
498 |
499 | ### Sticky bit
500 |
501 | The permission system in Linux has one interesting concept, called the sticky bit. A sticky bit is a parameter that can be set on any directory. It prohibits anyone other than the owner from deleting or renaming files in it. Notice, that other users may or may not be able to edit the file. Even if they can edit it, with teh sticky bit only the owner can delete or rename the file. You can set the sticky bit on a folder with this command:
502 |
503 | ```
504 | $ chmod +t someDirectory/
505 | ```
506 |
507 | If the sticky bit is set, its permission string will have a `t` at the end, like this: `drwxrwxr-t`. To unset the sticky bit, use:
508 |
509 | ```
510 | $ chmod -t someDirectory/
511 | ```
512 |
--------------------------------------------------------------------------------
/linux-masterclass/04-users-and-permissions/notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/virtual-tech-school/virtual-tech-notes/20c5e3aa2b2fbc9756c3f95eef98fd36c12bb544/linux-masterclass/04-users-and-permissions/notes.pdf
--------------------------------------------------------------------------------
/linux-masterclass/05-processes/README.md:
--------------------------------------------------------------------------------
1 | Those who would like to make improvements in the future - You can help us improve notes based on [this](https://www.youtube.com/watch?v=cnbvsWKf-qM&list=PL2kSRH_DmWVZp_cu6MMPWkgYh7GZVFS6i&index=5) video.
2 | # Processes
3 | Processes are just programs that are running on linux machine. This processes are generally managed by kernel and each process have a **PID**(process id). Process
4 | are terminated when terminal associated with it is closed.
5 |
6 | ## General commands of processes
7 |
8 | | command | description | |
9 | | ------------- | ------------- |---------------------- |
10 | | `ps` | list current processes of shell |  |
11 | | `ps aux` | list all processes |  |
12 | | `top` | list all real time processes |  |
13 |
14 | ## How process starts
15 |
16 | New process in the linux system starts by mechanism know as **Fork System Call**. In this the new process(child) **clone** the **present process**(parent
17 | process) by requesting the kernel. Kernel decides the resources to the process.
18 |
19 | ```mermaid
20 | graph TD;
21 | init-->|fork system call|gnemeProcess
22 | gnemeProcess-->|fork system call|BashProcess;
23 | BashProcess-->|fork system call| process;
24 | ```
25 | ### Mother Process
26 |
27 | Mother Process is the **first process** initiated by the kernel when system **boot up** which has PID of **1**. Mother process is also known as **init** and this process runs on **root** previledge.
28 |
29 | ### Demon Process
30 |
31 | Demon process are the **child process** of mother. This are responsible for keeping the system running.
32 |
33 | ```mermaid
34 | graph TD;
35 | init-->DemonProcess1;
36 | init-->DemonProcess2;
37 | init-->DemonProcess3;
38 | init-->DemonProcess4;
39 | ```
40 |
41 | ## How process terminates
42 | Termination of process is done by **exit system call** and **wait system call** . Kernel known whether the process is terminated or not by **termination status**. For the successful process termination status is **0**. Termination process includes the cleaning of resources utilized by the process.
43 |
44 | ### Wait system call
45 | Parent process should acknowledge the kernel by **wait system call** for completion of termination process of child. The wait system call is used by a parent process to wait for its child process to terminate and obtain its termination status.
46 |
47 | ### Orphan Process
48 | If parent process dies,then the child process of it is adoped to the **mother**(init) by the kernel for termination of the process. So, that mother can able to acknowlegde the termination process by wait system call. In this case, the child process is known as **orphan process**.
49 |
50 | ```mermaid
51 | graph TD;
52 | Parent-->|X|Child;
53 | Child-->init;
54 | init-->|wait system call|Child;
55 | ```
56 |
57 | ### Zombie Process
58 | When the child process termination is not acknowledge by the parent ,then the child process is treated as **zombie process** by the kernel.Further,if parent process acknowlegde the zombie process termination then this is known as **reaping**. If reaping didn't occurs then the **wait system call** is done by mother to terminate **zombie process**.
59 |
60 | # Signals
61 | It is a notification to the process that something has happened.
62 |
63 | ### Common signals
64 |
65 | | Signal | Description |
66 | | ------------- | ------------- |
67 | | `SIGHUP/HUP/1` | HangUp |
68 | | `SIGINT/INT/2` | Interput |
69 | | `SIGKILL/KILL/9` | Kill |
70 | | `SIGSEGV/SEGV/11` | Segmentation fault |
71 | | `SIGTER/TERM/15` | Terminate |
72 | | `SIGSTOP/STOP/19` | Stop |
73 |
74 |
75 | ### Nice & Renice
76 |
77 | Processes aren't continously run by the system.They are know in timeslots known as time slice in CPU and as cyclic as shown in below example. So, the process will take almost same time. But, we can prioritize the process by **nice & renice** command. And every process has nice which indicates priority value. If the nice value is less,the system will prioritize more or vice versa.
78 |
79 | ---
80 | Process cycle in CPU
81 | ---
82 | ```mermaid
83 | flowchart LR
84 | P1 -->|t1| P2
85 | P2 -->|t2| P3
86 | P3 -->|t3| P4
87 | P4 -->|t4| P1
88 | ```
89 | | Command | Description |
90 | | ------------- | ------------- |
91 | | `nice -n priorityValue newProcess` | for new process |
92 | | `renice priorityValue -p processId` | for already exit process |
93 |
94 | ### Signal Mask
95 |
96 | Signal mask is used to block signals but there are some signals like *kill* cann't be blocked.
97 |
98 | # States of process
99 |
100 | | State of process | Description |
101 | | ------------- | ------------- |
102 | | `R` | The process is running |
103 | | `S` | Interruptable sleep |
104 | | `D` | Uninterruptable sleep |
105 | | `Z` | Zombie |
106 | | `T` | Stopped |
107 |
108 |
--------------------------------------------------------------------------------
/linux-masterclass/05-processes/notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/virtual-tech-school/virtual-tech-notes/20c5e3aa2b2fbc9756c3f95eef98fd36c12bb544/linux-masterclass/05-processes/notes.pdf
--------------------------------------------------------------------------------
/linux-masterclass/06-partitions/README.md:
--------------------------------------------------------------------------------
1 | No notes available. Contribute notes based on [this](https://www.youtube.com/watch?v=PbMT53jaUaU&list=PL2kSRH_DmWVZp_cu6MMPWkgYh7GZVFS6i&index=6) video now!
2 | # File System
3 | ## Type Characteristics
4 |
5 | | Symbol | Type Characteristic | description |
6 | | ------------- | ------------- |-----------|
7 | | d | directory | collection of files|
8 | | l | link | link to a directory of file |
9 | | - | file | stream of data |
10 | | c | character |a character device which passes/shares data char by char|
11 | | b | block | a block device transfer data in big size of blocks |
12 | | p | pipe |transfer one process input to another process output|
13 | | s | socket |same as a pipe but handles more than one process |
14 |
15 | ### Common commands
16 | ```
17 | ls -l /dev
18 | ```
19 | ## Filesystem Hierarchy
20 | * / -> root directory
21 | * /bin -> contains essential & ready to run binaries
22 | * /boot -> contains bootloader files
23 | * /dev -> contains device files
24 | * /etc -> contains configuration files
25 | * /home -> home directory
26 | * /lib -> contains libraries
27 | * /mnt -> temp mounted FS
28 | * /opt -> optional software packages
29 | * /proc -> process info
30 | * /root -> home directory for root
31 | * /sbin -> system binaries which are run by the root
32 | ## Journaling
33 | Used to repair any inconsistencies that occur as the result of an improper shutdown of the computer
34 | Suppose you were copying a file, if the system then also we can able to identify the currupt file by using *journaling*.
35 |
36 | ## Desktop file types
37 | |Destop file types| Description|
38 | |---|---|
39 | | ext 4 | latest & standard choice of file system which support disk space of 1exabyte of file sixe 16 TB|
40 | | Btrfs| Butter/Better file system and it is not stable than other|
41 | | XFS | high performance journaling file system generally good for servers|
42 | | NTFS & FAT| windows file system|
43 | | HFS | MAC file system |
44 |
45 | To check filesystem of linux :-
46 | ```
47 | df -T
48 | ```
49 | We can create multiple partitions in any disk and each parttion act as an individual **block device**.And each block system can act as different filesystem.
50 |
51 | ## Nodes and innodes
52 | Nodes tables are just like dtabase to manage files .In this table each file or directory has innode and contains the information about the file.
53 |
54 | ### Partition Table
55 | To check how a disk is partitioned.
56 | THere are two main parttion schemes
57 | * MBR -> Mast er Boot Record
58 | * GRT -> GUID partition table
59 | ## MBR
60 | It is a traditional partition table ,supports the disk upto *2TB*. WHich has linmitations of 4 parts only known as *primary partitions*. Out of these 4 we can create one extended partition & in that can create multiple logical partitions same as creating primary partitions.
61 |
62 | ### GPT
63 |
64 | This is new standard each partition has globally unique ID(GUID) and usually used with UEFI based looting .
65 |
66 | ## Filesystem Structure
67 |
68 | FS is part of an organized collection of files & directives. It's like a database to manage files.
69 |
70 | FS has 4 major components
71 |
72 | * Bootblock
73 | * SuperBlock
74 | * Innode table
75 | * Data Blocks
76 |
77 | # Inode
78 | Inode, short of index node tables are just like database to manage files in this table each file or directory has inode & it generally describes all the info about file. Contains everything execpt for file & it's name , also contains pointers to datablocks of file.
79 | When file system is created ,some space for the innodes is also allocated as well.
80 | ```
81 | df -i
82 | ```
83 | This is the command to check how many innodes are availabele.
84 |
85 | ```
86 | ls -li
87 | ```
88 | This is the command to check inodes number.
89 | ### How do inodes work and locate file
90 | 
91 | Innode points to the actual data block of file in the file system. Each and every innode contains 15 pointers.When a file is created on a file system, the file system allocates a new inode and stores the file's metadata in the inode data structure. The file system also allocates the necessary data blocks to store the file's contents and links them to the inode by storing their addresses in the inode's data block pointers.
92 |
--------------------------------------------------------------------------------
/linux-masterclass/06-partitions/notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/virtual-tech-school/virtual-tech-notes/20c5e3aa2b2fbc9756c3f95eef98fd36c12bb544/linux-masterclass/06-partitions/notes.pdf
--------------------------------------------------------------------------------
/linux-masterclass/07-kernel/README.md:
--------------------------------------------------------------------------------
1 | Contribute notes based on [this](https://www.youtube.com/watch?v=08SwnaMhL1k&list=PL2kSRH_DmWVZp_cu6MMPWkgYh7GZVFS6i&index=7) video now!
2 |
3 | # Boot Process
4 |
5 | ## Stages of boot process
6 | ### 1. BIOS
7 | basic input output system. It initialises the hardware, it makes sures the hardware is good to go , by running self tests in which it checks , memory is good , hdd, ssd etc.
8 | Main job of Bios is to load the bootloader.
9 |
10 | ### 2. Bootloader
11 | loads the kernel into the memory. Whatever RAM you have , this bootloader is going to load the code of that kernel in the memory based on whatever kernel parameters you are having.
12 | Commonly used boot loader --> GRUB bootloader
13 |
14 | ### 3. Kernel
15 | As soon as it is loaded, it immediately initialises the memory and the devices that are there in the system.
16 | Main job is to load the init process or mother process.
17 | Init process- starts and stops all the essential process is it is very first process (mother process)
18 |
19 | # Levels of abstraction of Linux OS
20 | ### 1. Hardware
21 | CPU,memory ports , HDD , SSD etc.Physical layer which computes what our system is doing.
22 | ### 2. Kernel
23 | Responsible for handling processes, memory, device communication, setting up entire file system,also responsible for for system calls.
24 | ### 3. User Space
25 | All we see in front of us, apps comes under user space.
26 |
27 | ## Privilege levels and protection rings
28 |
29 | Kernel- operates kernel mode
30 | User- operates on user mode
31 |
32 | For security reasons whenever we do anything related to hardware , something as easy as reading/writing, controlling networking port it is done in kernel mode.
33 |
34 | ### System call
35 | Allows us to perform some privileged instruction in the kernel mode then it let's you get back to the user mode. (also known as syscalls)
36 |
37 | System call API- provides user space application, processes, a way to request kernel to do something for us they make some services available to us this service is known as system callAPI.
38 |
39 | # Implementation of init process
40 |
41 | ## 1. System V 2. upstart 3. Systemd
42 | Traditional used earlier in ubuntu New Standard
43 |
44 | ## System V implementation
45 | Start and stops process sequentially.
46 | Disadvantage- performance is not great as processes are starting stopping one at a time.
47 | ### System V runlevels
48 | 0 - shutdown
49 | 1 - single user
50 | 2 - multiuser without networking
51 | 3 - multiuser with networking
52 | 4 - unused
53 | 5 - multiple users with networking & GUI
54 | 6 - Rebooting
55 |
56 | ### command To check all services
57 | service --status-all
58 |
59 | To start stop restart service
60 | sudo whoopsie start/stop/restart
61 |
62 | ## Upstart init implementation
63 | Created to improve system V implementation
64 | Upstart- events in jobs model
65 |
66 | Jobs- actions performed
67 | Events- messages received from other processes
68 |
69 | ## Systemd
70 | Uses goals to get your system up and running.
71 | Goals- targets which needs to be achieved.
72 |
73 | ## Targets
74 |
75 | 1 poweroff.target - shutdown
76 | 2 rescue.target - single user
77 | 3 multiuser.target - for multiusers with networking
78 | 4 graphical.target - multiuser with networking & GUI
79 | 5 reboot.target - reboot
80 |
81 | ### Managing power status of the system
82 | sudo shutdown -h now (to shutdown rightnow)
83 | sudo reboot (to reboot)
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/linux-masterclass/07-kernel/notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/virtual-tech-school/virtual-tech-notes/20c5e3aa2b2fbc9756c3f95eef98fd36c12bb544/linux-masterclass/07-kernel/notes.pdf
--------------------------------------------------------------------------------
/linux-masterclass/08-resource-utilization/README.md:
--------------------------------------------------------------------------------
1 | Improve notes based on [this](https://www.youtube.com/watch?v=m52OeR-mfYo&list=PL2kSRH_DmWVZp_cu6MMPWkgYh7GZVFS6i&index=8) video now!
2 |
3 | # Resource utilization
4 | ```
5 | top
6 | ```
7 | If we run the above command ,we can observe the resource utilization by process running currently.
8 | 
9 |
10 | When we run this command , we can observe that how many tasks are running ,sleeping ,stopped and zombie process. And how much CPU memory used by system (sy) ,nice (ni), otherthan nice (us),hardware (hi), software (si) , virtual machine (st) processes , waiting for system calls (ws).
11 | ```
12 | top -p PID
13 | ```
14 | This commands list resourse utilization of specific process . Here PID stands for process id.
15 |
16 | ## List of files
17 | ```
18 | lsof
19 | ```
20 | 
21 |
22 | tells us about the files that are currently in use and associate process with them.
23 |
24 | ## Threads
25 |
26 | It is an execution unit that is a part of process. A process can have multiple threads all executing at same time.
27 | ```
28 | ps -m
29 | ```
30 | The above command to check the threads of process.
31 |
32 | ## Load Average
33 | Load Average in Linux takes into account the waiting threads and tasks along with processes being executed. Also, it is an average value instead of being an instantaneous value.
34 | 
35 |
36 | ### CPU load
37 | Average number of processes waiting to be executed by CPU.
38 | ## Logging
39 |
40 | Whatever happening in our system is getting saved as logs in `/var` directory .
41 | ```
42 | ls /var/log
43 | ```
44 | 
45 |
46 | logs are created via service `syslog` which is implemented by syslogd daemon and sends all info to system logger.
47 |
48 | ## Logrotate
49 | Designed to ease administration of system that generates large no.of log files by allowing removal ,rotation ,compression and maling of log files.
50 |
51 | ```
52 | ls /etc/logrotate.log
53 | ```
54 | This directory contains the configuration for log rotation of files.
55 |
56 | ```
57 | cat /etc/logrotate.log/apt
58 | ```
59 | 
60 |
61 | 
62 |
63 | In the above example when we observe the apt log file ,we can observe configuration settings.
64 |
--------------------------------------------------------------------------------
/linux-masterclass/08-resource-utilization/notes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/virtual-tech-school/virtual-tech-notes/20c5e3aa2b2fbc9756c3f95eef98fd36c12bb544/linux-masterclass/08-resource-utilization/notes.pdf
--------------------------------------------------------------------------------