-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathchmod_presentation.html
More file actions
336 lines (296 loc) Β· 9.93 KB
/
chmod_presentation.html
File metadata and controls
336 lines (296 loc) Β· 9.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Understanding chmod</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
.presentation {
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
width: 100%;
max-width: 900px;
min-height: 500px;
padding: 50px;
position: relative;
}
.slide {
display: none;
animation: fadeIn 0.5s;
}
.slide.active {
display: block;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
h1 {
color: #667eea;
font-size: 2.5em;
margin-bottom: 20px;
}
h2 {
color: #764ba2;
font-size: 2em;
margin-bottom: 20px;
}
p {
font-size: 1.2em;
line-height: 1.6;
color: #333;
margin-bottom: 15px;
}
.code-box {
background: #f5f5f5;
border-left: 4px solid #667eea;
padding: 15px;
margin: 20px 0;
font-family: 'Courier New', monospace;
font-size: 1.1em;
border-radius: 5px;
}
.permission-table {
width: 100%;
margin: 20px 0;
border-collapse: collapse;
}
.permission-table th,
.permission-table td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
.permission-table th {
background: #667eea;
color: white;
}
.permission-table tr:hover {
background: #f5f5f5;
}
.visual-example {
background: #f0f4ff;
padding: 20px;
border-radius: 10px;
margin: 20px 0;
text-align: center;
}
.controls {
position: absolute;
bottom: 20px;
right: 20px;
display: flex;
gap: 10px;
}
button {
background: #667eea;
color: white;
border: none;
padding: 12px 24px;
border-radius: 8px;
cursor: pointer;
font-size: 1em;
transition: all 0.3s;
}
button:hover {
background: #764ba2;
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
button:disabled {
background: #ccc;
cursor: not-allowed;
transform: none;
}
.slide-counter {
position: absolute;
top: 20px;
right: 20px;
color: #667eea;
font-size: 1.1em;
font-weight: bold;
}
.highlight {
background: #ffeb3b;
padding: 2px 5px;
border-radius: 3px;
}
ul {
margin: 20px 0 20px 30px;
font-size: 1.1em;
line-height: 1.8;
}
.emoji {
font-size: 1.5em;
margin-right: 10px;
}
</style>
</head>
<body>
<div class="presentation">
<div class="slide-counter">
<span id="current">1</span> / <span id="total">7</span>
</div>
<!-- Slide 1: Title -->
<div class="slide active">
<h1>π Understanding chmod</h1>
<p style="font-size: 1.5em; margin-top: 40px;">A Simple Guide to File Permissions in Linux/Unix</p>
<p style="margin-top: 60px; color: #666;">chmod lets you control who can read, write, or execute your files</p>
</div>
<!-- Slide 2: What is chmod? -->
<div class="slide">
<h2>π€ What is chmod?</h2>
<p><span class="highlight">chmod</span> stands for "change mode"</p>
<p>It's a command that controls file permissions in Linux and Unix systems.</p>
<div class="visual-example">
<p style="font-size: 1.3em; margin-bottom: 15px;">Think of it like setting locks on a door:</p>
<p>πͺ Who can open it? (read)</p>
<p>βοΈ Who can modify it? (write)</p>
<p>π Who can use it? (execute)</p>
</div>
</div>
<!-- Slide 3: Three Permission Types -->
<div class="slide">
<h2>π Three Permission Types</h2>
<table class="permission-table">
<tr>
<th>Permission</th>
<th>Symbol</th>
<th>What it means</th>
</tr>
<tr>
<td><span class="emoji">π</span>Read</td>
<td>r</td>
<td>View the file contents</td>
</tr>
<tr>
<td><span class="emoji">βοΈ</span>Write</td>
<td>w</td>
<td>Modify or delete the file</td>
</tr>
<tr>
<td><span class="emoji">βΆοΈ</span>Execute</td>
<td>x</td>
<td>Run the file as a program</td>
</tr>
</table>
</div>
<!-- Slide 4: Three User Groups -->
<div class="slide">
<h2>π₯ Three User Groups</h2>
<p>Permissions are set for three types of users:</p>
<ul>
<li><strong>Owner (u)</strong> - The person who created the file</li>
<li><strong>Group (g)</strong> - Users in the same group</li>
<li><strong>Others (o)</strong> - Everyone else</li>
</ul>
<div class="visual-example">
<p style="font-size: 1.2em;">π€ Owner β π₯ Group β π Others</p>
</div>
</div>
<!-- Slide 5: Numeric Method -->
<div class="slide">
<h2>π’ Numeric Method (Easy Way)</h2>
<p>Use numbers to set permissions:</p>
<table class="permission-table">
<tr>
<th>Number</th>
<th>Permission</th>
<th>Calculation</th>
</tr>
<tr>
<td>4</td>
<td>Read (r)</td>
<td>4 + 0 + 0</td>
</tr>
<tr>
<td>2</td>
<td>Write (w)</td>
<td>0 + 2 + 0</td>
</tr>
<tr>
<td>1</td>
<td>Execute (x)</td>
<td>0 + 0 + 1</td>
</tr>
<tr>
<td>7</td>
<td>All (rwx)</td>
<td>4 + 2 + 1</td>
</tr>
</table>
</div>
<!-- Slide 6: Common Examples -->
<div class="slide">
<h2>π‘ Common Examples</h2>
<div class="code-box">
chmod 755 script.sh
</div>
<p>Owner: read, write, execute (7)<br>
Group: read, execute (5)<br>
Others: read, execute (5)</p>
<div class="code-box">
chmod 644 document.txt
</div>
<p>Owner: read, write (6)<br>
Group: read only (4)<br>
Others: read only (4)</p>
</div>
<!-- Slide 7: Quick Reference -->
<div class="slide">
<h2>π Quick Reference</h2>
<div class="code-box">
chmod 777 file β Everyone can do everything<br>
chmod 755 file β Owner full, others read/execute<br>
chmod 700 file β Only owner can access<br>
chmod 644 file β Owner can edit, others can read
</div>
<p style="margin-top: 30px; font-size: 1.1em;">π‘ <strong>Tip:</strong> Use 755 for scripts and programs, 644 for regular files!</p>
</div>
<!-- Navigation Controls -->
<div class="controls">
<button id="prevBtn" onclick="changeSlide(-1)">β Previous</button>
<button id="nextBtn" onclick="changeSlide(1)">Next β</button>
</div>
</div>
<script>
let currentSlide = 0;
const slides = document.querySelectorAll('.slide');
const totalSlides = slides.length;
document.getElementById('total').textContent = totalSlides;
function showSlide(n) {
slides.forEach(slide => slide.classList.remove('active'));
if (n >= totalSlides) currentSlide = totalSlides - 1;
if (n < 0) currentSlide = 0;
slides[currentSlide].classList.add('active');
document.getElementById('current').textContent = currentSlide + 1;
document.getElementById('prevBtn').disabled = currentSlide === 0;
document.getElementById('nextBtn').disabled = currentSlide === totalSlides - 1;
}
function changeSlide(direction) {
currentSlide += direction;
showSlide(currentSlide);
}
document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowLeft') changeSlide(-1);
if (e.key === 'ArrowRight') changeSlide(1);
});
showSlide(0);
</script>
</body>
</html>