]> git.piffa.net Git - doc/.git/blob - ricettario.html
Merge branch 'master' of chrome:/home/git/doc
[doc/.git] / ricettario.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
3
4 <html lang="it">
5 <head>
6   <meta name="generator" content=
7   "HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org">
8   <meta http-equiv="Content-Type" content=
9   "text/html; charset=iso-8859-1">
10   <meta name="generator" content=
11   "Docutils 0.5: http://docutils.sourceforge.net/">
12
13   <title>Ricettario</title>
14   <style type="text/css">
15
16   /*
17   Author: Peter Parente
18   Date: 2008/01/22
19   Version: 1.0
20   Copyright: This stylesheet has been placed in the public domain - free to edit and use for all uses.
21   */
22
23   body {
24   font: 100% sans-serif;
25   background: #ffffff;
26   color: black;
27   margin: 2em;
28   padding: 0em 2em;
29   }
30   pre.literal-block {
31          overflow: auto;
32     padding: 5px;
33     background-color: #eeffcc;
34     color: #333333;
35     line-height: 120%;
36     border: 1px solid #ac9;
37     border-left: none;
38     border-right: none;
39   }
40
41   p.topic-title {
42   font-weight: bold;
43   }
44
45   table.docinfo {
46   text-align: left;
47   margin: 2em 0em;
48   }
49
50   a[href] {
51   color: #436976;
52   background-color: transparent;
53   }
54
55   a.toc-backref {
56   text-decoration: none;
57   }
58
59   h1 a[href] {
60   color: #003a6b;
61   text-decoration: none;
62   background-color: transparent;
63   }
64
65   a.strong {
66   font-weight: bold;
67   }
68
69   img {
70   margin: 0;
71   border: 0;
72   }
73
74   p {
75   margin: 0.5em 0 1em 0;
76   text-align: justify;
77   line-height: 1.5em;
78   }
79
80
81   p a:visited {
82   color: purple;
83   background-color: transparent;
84   }
85
86   p a:active {
87   color: red;
88   background-color: transparent;
89   }
90
91   a:hover {
92   text-decoration: none;
93   }
94
95   p img {
96   border: 0;
97   margin: 0;
98   }
99
100   p.rubric {
101   font-weight: bold;
102   font-style: italic;
103   }
104
105   h1.title {
106   color: #003a6b;
107   font-size: 250%;
108   margin-bottom: 0em;
109   }
110
111   h2.subtitle {
112   color: #003a6b;
113   border-bottom: 0px;
114   }
115
116   h1, h2, h3, h4, h5, h6 {
117   color: #555;
118   background-color: transparent;
119   margin: 0em;
120   padding-top: 0.5em;
121   }
122
123   h1 {
124   font-size: 160%;
125   margin-bottom: 0.5em;
126   border-bottom: 2px solid #aaa;
127   }
128
129   h2 {
130   font-size: 140%;
131   margin-bottom: 0.5em;
132   border-bottom: 1px solid #aaa;
133   }
134
135   h3 {
136   font-size: 130%;
137   margin-bottom: 0.5em;
138   }
139
140   h4 {
141   font-size: 110%;
142   font-weight: bold;
143   margin-bottom: 0.5em;
144   }
145
146   h5 {
147   font-size: 105%;
148   font-weight: bold;
149   margin-bottom: 0.5em;
150   }
151
152   h6 {
153   font-size: 100%;
154   font-weight: bold;
155   margin-bottom: 0.5em;
156   }
157
158   dt {
159   font-style: italic;
160   }
161
162   dd {
163   margin-bottom: 1.5em;
164   }
165
166   div.admonition, div.note, div.tip, div.caution, div.important {
167   margin: 2em 2em;
168   padding: 0em 1em;
169   border-top: 1px solid #aaa;
170   border-left: 1px solid #aaa;
171   border-bottom: 2px solid #555;
172   border-right: 2px solid #555;
173   }
174
175   div.important {
176   background: transparent url('../images/important.png') 10px 2px no-repeat;
177   }
178
179   div.caution {
180   background: transparent url('../images/caution.png') 10px 2px no-repeat;
181   }
182
183   div.note {
184   background: transparent url('../images/note.png') 10px 2px no-repeat;
185   }
186
187   div.tip {
188   background: transparent url('../images/tip.png') 10px 2px no-repeat;
189   }
190
191   div.admonition-example {
192   background: transparent url('../images/tip.png') 10px 2px no-repeat;
193   }
194
195   div.admonition-critical-example {
196   background: transparent url('../images/important.png') 10px 2px no-repeat;
197   }
198
199   p.admonition-title {
200   font-weight: bold;
201   border-bottom: 1px solid #aaa;
202   padding-left: 30px;
203   }
204
205   table.docutils {
206   text-align: left;
207   border: 1px solid gray;
208   border-collapse: collapse;
209   width: 100%;
210   margin: 1.5em 0em;
211   }
212
213   table.docutils caption {
214   font-style: italic;
215   }
216
217   table.docutils td, table.docutils th {
218   padding: 0.25em 0.5em;
219   }
220
221   table.docutils th {
222   background-color: #dddddd;
223   }
224
225   div.sidebar {
226   width: 33%;
227   float: right;
228   margin: 0em 2em;
229   padding: 0em 1em;
230   border-top: 1px solid #aaa;
231   border-left: 1px solid #aaa;
232   border-bottom: 2px solid #555;
233   border-right: 2px solid #555;
234   }
235
236   p.sidebar-title {
237   margin-bottom: 0em;
238   color: #003a6b;
239   border-bottom: 1px solid #aaa;
240   font-weight: bold;
241   }
242
243   p.sidebar-subtitle {
244   margin-top: 0em;
245   font-style: italic;
246   color: #003a6b;
247   }
248
249   </style>
250 </head>
251
252 <body>
253   <div class="document" id="ricettario">
254     <h1 class="title">Ricettario</h1>
255
256     <h2 class="subtitle" id=
257     "appunti-e-note-sparse-per-corsi-di-reti-su-linux">Appunti e
258     note sparse per corsi di reti su Linux</h2>
259
260     <blockquote>
261       <table class="docutils field-list" frame="void" rules="none">
262         <col class="field-name">
263         <col class="field-body">
264
265         <tbody valign="top">
266           <tr class="field">
267             <th class="field-name">Author:</th>
268
269             <td class="field-body">Andrea Manni</td>
270           </tr>
271
272           <tr class="field">
273             <th class="field-name">Copyright:</th>
274
275             <td class="field-body">GFDL</td>
276           </tr>
277
278           <tr class="field">
279             <th class="field-name">Version:</th>
280
281             <td class="field-body">1.0</td>
282           </tr>
283         </tbody>
284       </table>
285     </blockquote>
286
287     <div class="contents topic" id="indice">
288       <p class="topic-title first">Indice</p>
289
290       <ul class="auto-toc simple">
291         <li>
292           <a class="reference internal" href="#comandi" id="id1"
293           name="id1">1&nbsp;&nbsp;&nbsp;Comandi</a>
294
295           <ul class="auto-toc">
296             <li>
297               <a class="reference internal" href=
298               "#propieta-dei-files" id="id2" name=
299               "id2">1.1&nbsp;&nbsp;&nbsp;Propieta' dei files</a>
300
301               <ul class="auto-toc">
302                 <li><a class="reference internal" href=
303                 "#primo-carattere" id="id3" name=
304                 "id3">1.1.1&nbsp;&nbsp;&nbsp;Primo
305                 carattere</a></li>
306
307                 <li><a class="reference internal" href=
308                 "#manipolare-i-permessi-dei-file" id="id4" name=
309                 "id4">1.1.2&nbsp;&nbsp;&nbsp;Manipolare i permessi
310                 dei file</a></li>
311               </ul>
312             </li>
313           </ul>
314         </li>
315
316         <li>
317           <a class="reference internal" href="#tar-archiviazione"
318           id="id5" name="id5">2&nbsp;&nbsp;&nbsp;TAR:
319           archiviazione</a>
320
321           <ul class="auto-toc">
322             <li><a class="reference internal" href=
323             "#esempi-creare-un-archivio" id="id6" name=
324             "id6">2.1&nbsp;&nbsp;&nbsp;Esempi: creare un
325             archivio</a></li>
326
327             <li><a class="reference internal" href=
328             "#esempi-visualizzare-il-contenuto-di-un-archivio" id=
329             "id7" name="id7">2.2&nbsp;&nbsp;&nbsp;Esempi:
330             visualizzare il contenuto di un archivio</a></li>
331
332             <li><a class="reference internal" href=
333             "#esempi-esplodere-un-archivio" id="id8" name=
334             "id8">2.3&nbsp;&nbsp;&nbsp;Esempi: esplodere un
335             archivio</a></li>
336           </ul>
337         </li>
338
339         <li><a class="reference internal" href=
340         "#navigazione-nei-filesystems-virtuali-proc-e-sys" id="id9"
341         name="id9">3&nbsp;&nbsp;&nbsp;Navigazione nei filesystems
342         virtuali: proc e sys</a></li>
343
344         <li>
345           <a class="reference internal" href="#reti-tcp-ip" id=
346           "id10" name="id10">4&nbsp;&nbsp;&nbsp;Reti: TCP/IP</a>
347
348           <ul class="auto-toc">
349             <li><a class="reference internal" href=
350             "#il-livello-network" id="id11" name=
351             "id11">4.1&nbsp;&nbsp;&nbsp;Il livello
352             Network:</a></li>
353
354             <li><a class="reference internal" href=
355             "#il-livello-internet" id="id12" name=
356             "id12">4.2&nbsp;&nbsp;&nbsp;Il livello
357             Internet</a></li>
358
359             <li><a class="reference internal" href=
360             "#documentazione-su-ip" id="id13" name=
361             "id13">4.3&nbsp;&nbsp;&nbsp;Documentazione su
362             IP</a></li>
363           </ul>
364         </li>
365
366         <li>
367           <a class="reference internal" href="#maschere-di-rete"
368           id="id14" name="id14">5&nbsp;&nbsp;&nbsp;Maschere di
369           rete</a>
370
371           <ul class="auto-toc">
372             <li><a class="reference internal" href="#messa-in-and"
373             id="id15" name="id15">5.1&nbsp;&nbsp;&nbsp;Messa in
374             AND</a></li>
375           </ul>
376         </li>
377
378         <li>
379           <a class="reference internal" href="#cavi-di-rete" id=
380           "id16" name="id16">6&nbsp;&nbsp;&nbsp;Cavi di Rete</a>
381
382           <ul class="auto-toc">
383             <li><a class="reference internal" href=
384             "#riferimenti-per-cavi-ethernet-ecc" id="id17" name=
385             "id17">6.1&nbsp;&nbsp;&nbsp;Riferimenti per cavi /
386             ethernet ecc.:</a></li>
387
388             <li><a class="reference internal" href="#tipi-di-wifi"
389             id="id18" name="id18">6.2&nbsp;&nbsp;&nbsp;Tipi di
390             WiFi:</a></li>
391
392             <li><a class="reference internal" href="#wimax" id=
393             "id19" name="id19">6.3&nbsp;&nbsp;&nbsp;WiMax:</a></li>
394
395             <li><a class="reference internal" href="#hiperlan" id=
396             "id20" name=
397             "id20">6.4&nbsp;&nbsp;&nbsp;Hiperlan:</a></li>
398           </ul>
399         </li>
400
401         <li>
402           <a class="reference internal" href=
403           "#breve-sommario-dei-comandi-relativi-al-networking" id=
404           "id21" name="id21">7&nbsp;&nbsp;&nbsp;Breve sommario dei
405           comandi relativi al networking</a>
406
407           <ul class="auto-toc">
408             <li><a class="reference internal" href="#ifconfig" id=
409             "id22" name=
410             "id22">7.1&nbsp;&nbsp;&nbsp;ifconfig</a></li>
411
412             <li><a class="reference internal" href="#ping" id=
413             "id23" name="id23">7.2&nbsp;&nbsp;&nbsp;ping</a></li>
414
415             <li><a class="reference internal" href="#route" id=
416             "id24" name="id24">7.3&nbsp;&nbsp;&nbsp;route</a></li>
417
418             <li><a class="reference internal" href="#traceroute"
419             id="id25" name=
420             "id25">7.4&nbsp;&nbsp;&nbsp;traceroute</a></li>
421
422             <li><a class="reference internal" href="#host" id=
423             "id26" name="id26">7.5&nbsp;&nbsp;&nbsp;host</a></li>
424
425             <li><a class="reference internal" href="#instradamento"
426             id="id27" name=
427             "id27">7.6&nbsp;&nbsp;&nbsp;Instradamento:</a></li>
428
429             <li><a class="reference internal" href="#tcpdump" id=
430             "id28" name=
431             "id28">7.7&nbsp;&nbsp;&nbsp;tcpdump</a></li>
432           </ul>
433         </li>
434
435         <li><a class="reference internal" href="#sessione-ftp" id=
436         "id29" name="id29">8&nbsp;&nbsp;&nbsp;Sessione FTP</a></li>
437
438         <li><a class="reference internal" href="#todo" id="id30"
439         name="id30">9&nbsp;&nbsp;&nbsp;ToDo</a></li>
440       </ul>
441     </div>
442
443     <p>Generato con: <a class="reference external" href=
444     "http://docutils.sourceforge.net/rst.html">http://docutils.sourceforge.net/rst.html</a></p>
445
446     <div class="section" id="comandi">
447       <h1><a class="toc-backref" href=
448       "#id1">1&nbsp;&nbsp;&nbsp;Comandi</a></h1>
449
450       <p>Appunti ed esempi sull'utilizzo di alcuni comandi
451       comuni.</p>
452
453       <div class="section" id="propieta-dei-files">
454         <h2><a class="toc-backref" href=
455         "#id2">1.1&nbsp;&nbsp;&nbsp;Propieta' dei files</a></h2>
456
457         <p>Vediamo come leggere l'output del comando
458         <em>ls</em>:</p>
459         <pre class="literal-block">
460 ls -l
461
462 drwxr-xr-x 2 andrea staff   4096 2008-09-16 22:05 cartella
463  |  |  |     |      |       |    |                Nome file
464  |  |  |     |      |       |    Data di creazione e ora
465  |  |  |     |      |       inodes (non e' la dimensione del file)
466  |  |  |     |      gruppo
467  |  |  |     utente
468  |  |  ooo = others
469  |  ggg = group
470  uuu = user
471 </pre>
472
473         <dl class="docutils">
474           <dt>UGO</dt>
475
476           <dd>Acronimo per: User - Groups Others</dd>
477         </dl>
478
479         <table border="1" class="docutils">
480           <colgroup>
481             <col width="6%">
482             <col width="20%">
483             <col width="74%">
484           </colgroup>
485
486           <thead valign="bottom">
487             <tr>
488               <th class="head" colspan="3">Propieta'</th>
489             </tr>
490           </thead>
491
492           <tbody valign="top">
493             <tr>
494               <td colspan="3">rwx</td>
495             </tr>
496
497             <tr>
498               <td>r</td>
499
500               <td>readable</td>
501
502               <td>Il file e' leggibile</td>
503             </tr>
504
505             <tr>
506               <td>w</td>
507
508               <td>writable</td>
509
510               <td>Il file e' scrivibile e modificabile</td>
511             </tr>
512
513             <tr>
514               <td>x</td>
515
516               <td>excecute</td>
517
518               <td>Il file e' eseguibile</td>
519             </tr>
520           </tbody>
521         </table>
522
523         <div class="section" id="primo-carattere">
524           <h3><a class="toc-backref" href=
525           "#id3">1.1.1&nbsp;&nbsp;&nbsp;Primo carattere</a></h3>
526
527           <p>Il primo carattere indica la natura o il tipo del
528           <em>file</em>:</p>
529           <pre class="literal-block">
530 -rw-r--r-- 1 andrea andrea    26 2008-09-16 22:03 dns.conf
531 lrw-r--r-- 1 andrea andrea     0 2008-09-16 22:07 link_dns
532 drwxr-xr-x 1 andrea andrea 77352 2008-09-16 21:47 cartella
533 </pre>
534
535           <table border="1" class="docutils">
536             <colgroup>
537               <col width="14%">
538               <col width="86%">
539             </colgroup>
540
541             <thead valign="bottom">
542               <tr>
543                 <th class="head" colspan="2">Tipi comuni</th>
544               </tr>
545             </thead>
546
547             <tbody valign="top">
548               <tr>
549                 <td>d</td>
550
551                 <td>directory</td>
552               </tr>
553
554               <tr>
555                 <td>-</td>
556
557                 <td>file</td>
558               </tr>
559
560               <tr>
561                 <td>l</td>
562
563                 <td>link</td>
564               </tr>
565             </tbody>
566           </table>
567         </div>
568
569         <div class="section" id="manipolare-i-permessi-dei-file">
570           <h3><a class="toc-backref" href=
571           "#id4">1.1.2&nbsp;&nbsp;&nbsp;Manipolare i permessi dei
572           file</a></h3>
573
574           <dl class="docutils">
575             <dt>chmod</dt>
576
577             <dd>Cambia i parametri <em>rwx</em> dell'oggetto</dd>
578
579             <dt>chown</dt>
580
581             <dd>Cambia il proprietario</dd>
582
583             <dt>chgrp</dt>
584
585             <dd>Cambia il gruppo</dd>
586           </dl>
587
588           <p>Per la sintassi e le opzioni vedere le pagine
589           <tt class="docutils literal"><span class=
590           "pre">man</span></tt> dei singoli comandi.</p>
591         </div>
592       </div>
593     </div>
594
595     <div class="section" id="tar-archiviazione">
596       <h1><a class="toc-backref" href=
597       "#id5">2&nbsp;&nbsp;&nbsp;TAR: archiviazione</a></h1>
598
599       <p>Breve lista delle opzioni del comando <tt class=
600       "docutils literal"><span class="pre">tar</span></tt>
601       (archiviazione dei files)</p>
602
603       <table class="docutils option-list" frame="void" rules=
604       "none">
605         <col class="option">
606         <col class="description">
607
608         <tbody valign="top">
609           <tr>
610             <td class="option-group"><kbd><span class="option">-c
611             <var>nome_arch</var></span></kbd></td>
612
613             <td>creare un archivio con nome <tt class=
614             "docutils literal"><span class=
615             "pre">nome_arch</span></tt></td>
616           </tr>
617
618           <tr>
619             <td class="option-group"><kbd><span class=
620             "option">-t</span></kbd></td>
621
622             <td>visualizzare il contenuto di un archivio</td>
623           </tr>
624
625           <tr>
626             <td class="option-group"><kbd><span class=
627             "option">-x</span></kbd></td>
628
629             <td>estrarre da un archivio</td>
630           </tr>
631
632           <tr>
633             <td class="option-group"><kbd><span class=
634             "option">-f</span></kbd></td>
635
636             <td>nome dell'archivio</td>
637           </tr>
638
639           <tr>
640             <td class="option-group"><kbd><span class=
641             "option">-z</span></kbd></td>
642
643             <td>compresso con gunzip</td>
644           </tr>
645
646           <tr>
647             <td class="option-group"><kbd><span class=
648             "option">-j</span></kbd></td>
649
650             <td>compresso con bzip2</td>
651           </tr>
652         </tbody>
653       </table>
654
655       <div class="section" id="esempi-creare-un-archivio">
656         <h2><a class="toc-backref" href=
657         "#id6">2.1&nbsp;&nbsp;&nbsp;Esempi: creare un
658         archivio</a></h2>
659
660         <dl class="docutils">
661           <dt>tar -cf nome_archivio.tar cartella_da_archiviare</dt>
662
663           <dd>crea un archivio nome_archivio.tar dalla cartella
664           cartella_da_archiviare</dd>
665
666           <dt>tar -zcf nome_rchivio.tar.gz
667           cartella_da_archiviare</dt>
668
669           <dd>crea un archivio compresso con gunzip
670           nome_rchivio.tar.gz dalla cartella
671           cartella_da_archiviare</dd>
672
673           <dt>tar -jcf nome_archivio.tb2
674           cartella_da_archiviare</dt>
675
676           <dd>crea un archivio compresso con bzip2
677           nome_rchivio.tar.gz dalla cartella
678           cartella_da_archiviare</dd>
679         </dl>
680       </div>
681
682       <div class="section" id=
683       "esempi-visualizzare-il-contenuto-di-un-archivio">
684         <h2><a class="toc-backref" href=
685         "#id7">2.2&nbsp;&nbsp;&nbsp;Esempi: visualizzare il
686         contenuto di un archivio</a></h2>
687
688         <dl class="docutils">
689           <dt>tar -tf nome_archivio.tar</dt>
690
691           <dd>Per visualizzare e basta il contenuto di un
692           archivio</dd>
693         </dl>
694       </div>
695
696       <div class="section" id="esempi-esplodere-un-archivio">
697         <h2><a class="toc-backref" href=
698         "#id8">2.3&nbsp;&nbsp;&nbsp;Esempi: esplodere un
699         archivio</a></h2>
700
701         <dl class="docutils">
702           <dt>tar -xf nome_archivio.tb2</dt>
703
704           <dd>Esplode l'archivio</dd>
705
706           <dt>tar -zxf nome_archivio.tb2</dt>
707
708           <dd>Esplode un archivio compresso con gunzip</dd>
709
710           <dt>tar -jxf nome_archivio.tb2</dt>
711
712           <dd>Esplode un archivio compresso con bzip2</dd>
713         </dl>
714       </div>
715     </div>
716
717     <div class="section" id=
718     "navigazione-nei-filesystems-virtuali-proc-e-sys">
719       <h1><a class="toc-backref" href=
720       "#id9">3&nbsp;&nbsp;&nbsp;Navigazione nei filesystems
721       virtuali: proc e sys</a></h1>
722
723       <p>Per meglio comprendere la natura dei filesystems virtuali
724       <strong>proc</strong> e <strong>sys</strong> possiamo provare
725       a muoverci al loro interno, vedere alcuni degli esempi piu'
726       interessanti e provare anche a intervenire su di essi.</p>
727
728       <div class="danger">
729         <p class="first admonition-title">!PERICOLO!</p>
730
731         <p class="last">Non sparate dei valori a <em>caso</em> su
732         oggetti come ventole di raffreddamento: potreste cuocere le
733         CPU e provocare danni irreparabili (quindi niente echo &gt;
734         ...)</p>
735       </div>
736
737       <p>Storia:</p>
738       <pre class="literal-block">
739 51  cat /proc/
740 52  cat /proc/cpuinfo
741 53  htop
742 54  cat /proc/meminfo
743 55  free
744 56  cat /sys/devices/system/cpu/cpu0/cpuidle/state0
745 57  cat /sys/devices/system/cpu/cpu0/cpuidle/state0/usage
746 58  cat /sys/devices/system/cpu/cpu0/cpuidle/state0/power
747 59  cat /sys/devices/system/cpu/cpu0/crash_notes
748 60  cat /sys/devices/system/cpu/cpu0/topology/core_id
749 61  cat /sys/devices/system/clocksource/clocksource0/available_clocksource
750 62  cat /sys/devices/system/clocksource/clocksource0/current_clocksource
751 63  cat /proc/meminfo
752 64  cat /sys/class/thermal/cooling_device
753 65  cat /sys/class/thermal/cooling_device0/cur_state
754 66  cat /sys/class/thermal/cooling_device0/cur_state
755 67  echo "1" &gt; /sys/class/thermal/cooling_device0/cur_state
756 68  cat /sys/class/thermal/cooling_device0/cur_state
757 69  echo "0" &gt; /sys/class/thermal/cooling_device0/cur_state
758 70  echo "0" &gt; /sys/class/thermal/cooling_device1/cur_state
759 71  echo "1" &gt; /sys/class/thermal/cooling_device1/cur_state
760 72  cat /sys/class/thermal/cooling_device1/cur_state
761 73  echo "0" &gt; /sys/class/thermal/cooling_device1/cur_state
762 74  echo "0" &gt; /sys/class/thermal/cooling_device1/max_state
763 75  cat /sys/class/thermal/cooling_device1/max_state
764 76  echo "7" &gt; /sys/class/thermal/cooling_device1/max_state
765 77  echo "7" &gt; /sys/class/thermal/cooling_device1/cur_state
766 78  echo "7" &gt; /sys/class/thermal/cooling_device0/
767 79  echo "7" &gt; /sys/class/thermal/cooling_device0/max_state
768 80  cat /sys/class/thermal/cooling_device0/max_state
769 81  echo "7" &gt; /sys/class/thermal/cooling_device0/cur_state
770 82  cat /sys/class/thermal/cooling_device0/cur_state
771 83  echo "0" &gt; /sys/class/thermal/cooling_device0/cur_state
772 84  echo "0" &gt; /sys/class/thermal/cooling_device1/cur_state
773 85* cat /sys/class/thermal/cooling_device1/
774 86  cat /sys/class/thermal/cooling_device1/cur_state
775 87  cat /sys/class/thermal/cooling_device0/cur_state
776 88  cat /sys/class/hwmon/hwmon0/fan1_pwm
777 89  cat /sys/class/net/eth0/address
778 90  cat /sys/class/net/eth0/broadcast
779 91  cat /sys/class/net/eth0/features
780 92  cat /sys/class/net/eth0/flags
781 93  cat /sys/class/net/eth0/mtu
782 94  cat /sys/class/net/eth0/statistics/rx_errors
783 95  cat /sys/class/net/eth0/statistics/rx_bytes
784 96  cd /tmp/
785 97  history &gt; proc_nav
786 </pre>
787     </div>
788
789     <div class="section" id="reti-tcp-ip">
790       <h1><a class="toc-backref" href=
791       "#id10">4&nbsp;&nbsp;&nbsp;Reti: TCP/IP</a></h1>
792
793       <p>Il modello OSI: 7 livelli. Il modello TCP/IP: 4
794       livelli.</p>
795
796       <p>Link ai livelli dell'OSI: - <a class="reference external"
797       href=
798       "http://it.wikipedia.org/wiki/Open_Systems_Interconnection">http://it.wikipedia.org/wiki/Open_Systems_Interconnection</a>
799       - <a class="reference external" href=
800       "http://upload.wikimedia.org/wikipedia/commons/5/56/Rm-osi_parallel.png">
801       http://upload.wikimedia.org/wikipedia/commons/5/56/Rm-osi_parallel.png</a></p>
802
803       <p>Comparazione livelli OSI / TCP/IP:</p>
804       <pre class="literal-block">
805   OSI             TCP/IP
806 -------------   ------------
807 Applicazione    Applicazione
808 Presentazione
809 Sessione
810 -------------   ------------
811 Trasporto       Trasporto
812 -------------   ------------
813 Network         Internet
814 -------------   ------------
815 Collegamento    Network
816 Fisico
817 -------------   ------------
818 </pre>
819
820       <p>Il modello TCP/IP e' quindi una semplificazione del
821       modello OSI.</p>
822
823       <p>Per una descrizione dei vari livelli del TCP/IP vedere: -
824       <a class="reference external" href=
825       "http://www.tutorialpc.it/tcp1.asp">http://www.tutorialpc.it/tcp1.asp</a>
826       - <a class="reference external" href=
827       "http://www.docmirror.net/it/linux/howto/misc/NET-3-HOWTO/">http://www.docmirror.net/it/linux/howto/misc/NET-3-HOWTO/</a>
828       - <a class="reference external" href=
829       "http://it.wikipedia.org/wiki/TCP/IP">http://it.wikipedia.org/wiki/TCP/IP</a></p>
830
831       <div class="section" id="il-livello-network">
832         <h2><a class="toc-backref" href=
833         "#id11">4.1&nbsp;&nbsp;&nbsp;Il livello Network:</a></h2>
834
835         <p>Il livello "Network" e' quello che si occupa di far
836         funzionare l'hardware di rete. E' quindi dipendente dalla
837         macchina su cui viene implementato lo stack TCP/IP.</p>
838       </div>
839
840       <div class="section" id="il-livello-internet">
841         <h2><a class="toc-backref" href=
842         "#id12">4.2&nbsp;&nbsp;&nbsp;Il livello Internet</a></h2>
843
844         <p>Alias: secondo livello...</p>
845
846         <p>il livello internet si occupa di indirizzamenti, di
847         suddivisione in frammenti, e instradamenti in TCP/IP. I
848         protocolli che lavorano a questo livello,che Ã¨ internet,
849         interagiscono con i livelli immediatamente superiore ed
850         inferiore.</p>
851
852         <dl class="docutils">
853           <dt>I protocolli che lavorano a questo livello sono:</dt>
854
855           <dd>
856             <ul class="first last simple">
857               <li>ARP</li>
858
859               <li>ICMP</li>
860
861               <li>IP</li>
862
863               <li>IGMP</li>
864             </ul>
865           </dd>
866         </dl>
867
868         <p>Links:</p>
869
870         <ul class="simple">
871           <li><a class="reference external" href=
872           "http://www.tutorialpc.it/tcp1.asp">http://www.tutorialpc.it/tcp1.asp</a></li>
873
874           <li><a class="reference external" href=
875           "http://www.docmirror.net/it/linux/howto/misc/NET-3-HOWTO/">
876           http://www.docmirror.net/it/linux/howto/misc/NET-3-HOWTO/</a></li>
877
878           <li><a class="reference external" href=
879           "http://it.wikipedia.org/wiki/TCP/IP">http://it.wikipedia.org/wiki/TCP/IP</a></li>
880         </ul>
881       </div>
882
883       <div class="section" id="documentazione-su-ip">
884         <h2><a class="toc-backref" href=
885         "#id13">4.3&nbsp;&nbsp;&nbsp;Documentazione su IP</a></h2>
886
887         <p>Documentazione su IP:</p>
888
889         <ul>
890           <li>
891             <p class="first"><a class="reference external" href=
892             "http://www.freesoft.org/CIE/Course/Section3/7.htm">http://www.freesoft.org/CIE/Course/Section3/7.htm</a>
893             Tutorial in inglese</p>
894           </li>
895
896           <li>
897             <p class="first">Consigliato: Manuale del TCP/IP
898             dell'Apogeo.</p>
899           </li>
900
901           <li>
902             <dl class="first docutils">
903               <dt><a class="reference external" href=
904               "http://www.disi.unige.it/person/BelleG/Reti99/Appunti/Appunti1/Cap6c/Cap6c.html">
905               http://www.disi.unige.it/person/BelleG/Reti99/Appunti/Appunti1/Cap6c/Cap6c.html</a></dt>
906
907               <dd>
908                 <p class="first last">Tutorial in italiano
909                 relativamente semplice</p>
910               </dd>
911             </dl>
912           </li>
913         </ul>
914       </div>
915     </div>
916
917     <div class="section" id="maschere-di-rete">
918       <h1><a class="toc-backref" href=
919       "#id14">5&nbsp;&nbsp;&nbsp;Maschere di rete</a></h1>
920
921       <p>Analizziamo gli indirizzi IP e le sotto reti</p>
922
923       <p>Consideriamo gli indirizzi IP della classe C:</p>
924       <pre class="literal-block">
925  212.22.136.0  (0 mi permette di identificare la rete)
926
927 andrea 212.22.136.177   11010100.00010110.10001000. 10110001
928 giulio 212.22.136.178   11010100.00010110.10001000. 10110010
929 papo   212.22.136.166   11010100.00010110.10001000. 10100110
930 </pre>
931
932       <p>Cosa notiamo?</p>
933
934       <p>Be'... Che la parte relativa alla rete ovviamente non
935       cambia:</p>
936       <pre class="literal-block">
937 11010100.00010110.10001000. che corrisponde a 212.22.136.
938 </pre>
939
940       <p>Questa e' la sotto rete</p>
941       <pre class="literal-block">
942 255.255.255.0
943 </pre>
944
945       <div class="section" id="messa-in-and">
946         <h2><a class="toc-backref" href=
947         "#id15">5.1&nbsp;&nbsp;&nbsp;Messa in AND</a></h2>
948
949         <p>Come calcola il computer le sotto reti per il routing
950         dei pacchetti?</p>
951
952         <p>Facendo la MESSA in AND dell'host0/rete host1/rete</p>
953
954         <p>Proviamo con andrea e papo:</p>
955         <pre class="literal-block">
956 andrea IP               11010100.00010110.10001000. 10110001
957 andrea rete             11111111.11111111.11111111. 00000000
958 risultato andrea:       11010100.00010110.10001000
959
960 papo IP                 11010100.00010110.10001000. 10100110
961 papo rete               11111111.11111111.11111111. 00000000
962 risultato papo          11010100.00010110.10001000
963
964 Confrontiamoli: 11010100.00010110.10001000
965                 11010100.00010110.10001000
966
967 Sono uguali -&gt; stessa rete
968 </pre>
969       </div>
970     </div>
971
972     <div class="section" id="cavi-di-rete">
973       <h1><a class="toc-backref" href=
974       "#id16">6&nbsp;&nbsp;&nbsp;Cavi di Rete</a></h1>
975
976       <p>link a cavi coassiali / thin :</p>
977
978       <ul class="simple">
979         <li><a class="reference external" href=
980         "http://www.dia.uniroma3.it/~necci/coax_s.htm">http://www.dia.uniroma3.it/~necci/coax_s.htm</a></li>
981
982         <li>Link ai vari tipi di cavi ethernet UTP twisted pairs
983         <a class="reference external" href=
984         "http://www.lineaedp.it/01NET/HP/0,1254,1_ART_78376,00.html?lw=10001">
985         http://www.lineaedp.it/01NET/HP/0,1254,1_ART_78376,00.html?lw=10001</a></li>
986       </ul>
987
988       <div class="section" id="riferimenti-per-cavi-ethernet-ecc">
989         <h2><a class="toc-backref" href=
990         "#id17">6.1&nbsp;&nbsp;&nbsp;Riferimenti per cavi /
991         ethernet ecc.:</a></h2>
992
993         <blockquote>
994           <ul class="simple">
995             <li><a class="reference external" href=
996             "http://it.wikipedia.org/wiki/IEEE_802.3">http://it.wikipedia.org/wiki/IEEE_802.3</a></li>
997
998             <li><a class="reference external" href=
999             "http://it.wikipedia.org/wiki/Fast_Ethernet">http://it.wikipedia.org/wiki/Fast_Ethernet</a></li>
1000
1001             <li><a class="reference external" href=
1002             "http://it.wikipedia.org/wiki/Fast_Ethernet">http://it.wikipedia.org/wiki/Fast_Ethernet</a></li>
1003
1004             <li><a class="reference external" href=
1005             "http://it.wikipedia.org/wiki/10Base5">http://it.wikipedia.org/wiki/10Base5</a></li>
1006           </ul>
1007         </blockquote>
1008       </div>
1009
1010       <div class="section" id="tipi-di-wifi">
1011         <h2><a class="toc-backref" href=
1012         "#id18">6.2&nbsp;&nbsp;&nbsp;Tipi di WiFi:</a></h2>
1013
1014         <dl class="docutils">
1015           <dt>Wifi:</dt>
1016
1017           <dd>
1018             <blockquote class="first">
1019               <ul class="simple">
1020                 <li><a class="reference external" href=
1021                 "http://it.wikipedia.org/wiki/Wifi">http://it.wikipedia.org/wiki/Wifi</a></li>
1022
1023                 <li><a class="reference external" href=
1024                 "http://it.wikipedia.org/wiki/IEEE_802.11">http://it.wikipedia.org/wiki/IEEE_802.11</a>
1025                 Standard WiFi</li>
1026               </ul>
1027             </blockquote>
1028
1029             <p class="last"><a class="reference external" href=
1030             "http://en.wikipedia.org/wiki/IEEE_802.11#802.11b">http://en.wikipedia.org/wiki/IEEE_802.11#802.11b</a></p>
1031           </dd>
1032         </dl>
1033       </div>
1034
1035       <div class="section" id="wimax">
1036         <h2><a class="toc-backref" href=
1037         "#id19">6.3&nbsp;&nbsp;&nbsp;WiMax:</a></h2>
1038
1039         <ul class="simple">
1040           <li><a class="reference external" href=
1041           "http://it.wikipedia.org/wiki/WiMAX">http://it.wikipedia.org/wiki/WiMAX</a></li>
1042         </ul>
1043       </div>
1044
1045       <div class="section" id="hiperlan">
1046         <h2><a class="toc-backref" href=
1047         "#id20">6.4&nbsp;&nbsp;&nbsp;Hiperlan:</a></h2>
1048
1049         <ul class="simple">
1050           <li><a class="reference external" href=
1051           "http://it.wikipedia.org/wiki/Hyperlan">http://it.wikipedia.org/wiki/Hyperlan</a></li>
1052         </ul>
1053       </div>
1054     </div>
1055
1056     <div class="section" id=
1057     "breve-sommario-dei-comandi-relativi-al-networking">
1058       <h1><a class="toc-backref" href=
1059       "#id21">7&nbsp;&nbsp;&nbsp;Breve sommario dei comandi
1060       relativi al networking</a></h1>
1061
1062       <div class="section" id="ifconfig">
1063         <h2><a class="toc-backref" href=
1064         "#id22">7.1&nbsp;&nbsp;&nbsp;ifconfig</a></h2>
1065
1066         <p>Configurare un device di rete:</p>
1067
1068         <blockquote>
1069           # ifconfig eth0 192.168.0.1 # ifconfig eth0 down #
1070           abbatte una scheda di rete # ifconfig eth0:1 192.168.0.1
1071           # abilita una scheda di rete virtuale # ifconfig eth0:1
1072           192.168.1.1 # abilita una scheda di rete VIRTUALE
1073         </blockquote>
1074       </div>
1075
1076       <div class="section" id="ping">
1077         <h2><a class="toc-backref" href=
1078         "#id23">7.2&nbsp;&nbsp;&nbsp;ping</a></h2>
1079
1080         <p>Test della connessione tra due hosts (ICMP):</p>
1081         <pre class="literal-block">
1082 ping 192.168.0.254      # ping all'infinito un indirizzo IP, per fermarlo: CTR + c
1083 ping -c 2 192.168.0.254 # manda solo due pacchetti poi si interrompe
1084 </pre>
1085       </div>
1086
1087       <div class="section" id="route">
1088         <h2><a class="toc-backref" href=
1089         "#id24">7.3&nbsp;&nbsp;&nbsp;route</a></h2>
1090
1091         <p>Modifica delle tabelle di instradamento / routing:</p>
1092         <pre class="literal-block">
1093 # route -n      #visualizza la tabella di routing attuale
1094 # route add default gw 192.168.0.254    #aggiunge un gateway di default
1095 # route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.254
1096         # aggiunge la rotta per una rete
1097 # route add -host 192.168.1.2 gw 192.168.0.254
1098         # aggiunge la rotta per un singolo host
1099 # route del ... # elimina una rotta precedentemente attivata
1100 es:     # route del -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.254
1101 </pre>
1102       </div>
1103
1104       <div class="section" id="traceroute">
1105         <h2><a class="toc-backref" href=
1106         "#id25">7.4&nbsp;&nbsp;&nbsp;traceroute</a></h2>
1107
1108         <p>Ricerca dei passaggi (hops) attraverso i quali
1109         comunicano due hosts:</p>
1110         <pre class="literal-block">
1111 traceroute 192.168.0.254        # visualizza gli hops frapposti tra noi e un IP
1112 </pre>
1113       </div>
1114
1115       <div class="section" id="host">
1116         <h2><a class="toc-backref" href=
1117         "#id26">7.5&nbsp;&nbsp;&nbsp;host</a></h2>
1118
1119         <p>Risoluzione di nomi di dominio / IP:</p>
1120         <pre class="literal-block">
1121 $ host bender.piffa.net  # risolve l'indirizzo IP di bender.piffa.net
1122 $ host 212.22.136.248    # risoluzione inversa  di un indirizzo IP
1123 </pre>
1124       </div>
1125
1126       <div class="section" id="instradamento">
1127         <h2><a class="toc-backref" href=
1128         "#id27">7.6&nbsp;&nbsp;&nbsp;Instradamento:</a></h2>
1129
1130         <p>Per poter utilizzare le funzionalita' di routing del
1131         kernel di Linux e' necessario abilitare l'ip-forwarding
1132         dello stesso kernel</p>
1133
1134         <p>Si puo' verificare se l'instradamento (IP forwarding) e'
1135         abilitato leggendo in /proc il valore di:</p>
1136         <pre class="literal-block">
1137 $ cat /proc/sys/net/ipv4/ip_forward
1138 </pre>
1139
1140         <p>Si puo' scrivere un valore diverso con echo e il
1141         re-indirizzamento dell'output:</p>
1142         <pre class="literal-block">
1143 # echo "1" &gt; /proc/sys/net/ipv4/ip_forward
1144 </pre>
1145
1146         <div class="note">
1147           <p class="first admonition-title">Nota</p>
1148
1149           <p class="last">Vedi pag: 295 del manuale cartaceo</p>
1150         </div>
1151       </div>
1152
1153       <div class="section" id="tcpdump">
1154         <h2><a class="toc-backref" href=
1155         "#id28">7.7&nbsp;&nbsp;&nbsp;tcpdump</a></h2>
1156
1157         <ul class="simple">
1158           <li><a class="reference external" href=
1159           "http://openmaniak.com/tcpdump.php">http://openmaniak.com/tcpdump.php</a></li>
1160         </ul>
1161
1162         <p>Analizzatore di traffico a riga di comando:</p>
1163         <pre class="literal-block">
1164 $ tcpdump -q             # Output semplificato, usare -v -vv per maggior dettaglio
1165 $ tcpdump udp            # Per catturare il traffico UDP
1166 $ tcpdump port http      # Per catturare il traffico sulla porta 80 (http)
1167 $ tcpdump src 192.168.1.100 and dst 192.168.1.2 and port ftp
1168                          # Per catturare il traffico FTP tra src (sorgente) e dst (destinazione)
1169                          # sulla porta di FTP
1170 $ tcpdump -A             # Per visualizzare il contenuto dei pacchetti intercettati
1171 </pre>
1172       </div>
1173     </div>
1174
1175     <div class="section" id="sessione-ftp">
1176       <h1><a class="toc-backref" href=
1177       "#id29">8&nbsp;&nbsp;&nbsp;Sessione FTP</a></h1>
1178
1179       <p>Breve lista dei comandi per una sessione FTP (non usate
1180       FTP, usate SFTP...):</p>
1181       <pre class="literal-block">
1182 ftp nome_host           # stabilire la connessione
1183                         # poi chiedera' la password dell'utente
1184                         # se avete sbagliato utente: user
1185
1186 help                    # Lista dei comandi disponibili
1187 help [nome_comando]     # cosa fa quel comando
1188 put                     # per caricare un file
1189 get                     # per scaricare un file
1190 ls                      # lo sapete cosa fa...
1191 cd                      # fa il cambio directory
1192 lcd                     # cambio directory in LOCALE
1193 mput/mget               # per lavorare su file multipli
1194 prompt                  # per uscire dalla modalita' interattiva
1195                         # (non vi chiede conferma di ogni singola operazione
1196                         #  sul singolo file...)
1197 binary                  # entra in modalita' trasferimento binario
1198 ascii                   # entra in modalita' trasferimento ascii
1199 bye                     # per chiudere la sessione
1200 </pre><!-- NOTE
1201 sftp funziona _circa_ con gli stessi comandi. -->
1202     </div>
1203
1204     <div class="section" id="todo">
1205       <h1><a class="toc-backref" href=
1206       "#id30">9&nbsp;&nbsp;&nbsp;ToDo</a></h1>
1207
1208       <p>Mancano (non inseriti in questo file ma presenti come
1209       frammenti di testo semplice):</p>
1210
1211       <ul class="simple">
1212         <li>Raid</li>
1213
1214         <li>firewall</li>
1215
1216         <li>bsd gestione pacchetti</li>
1217
1218         <li>backup</li>
1219
1220         <li>apache</li>
1221
1222         <li>storie varie</li>
1223       </ul>
1224     </div>
1225   </div>
1226 </body>
1227 </html>