1074
Gentoo Linux Gentoo Linux сборник статей Версия 1.5 от 02.04.2008 2008 г.

Gentoo Doc 1.5

Embed Size (px)

Citation preview

Gentoo Linux 1.5 02.04.2008

2008 .

(changelog)...............................................................................1 ...............................................................................................................4 ..............................................................................................5 Gentoo.............................................................6 ..................................................................................................7 Linux....................................................................................8 UNIX.........................................................................................................................8 ................................................................................................................8 .........................................................................................................14 UNIX...........................................................................15 GNU/Linux..............................................................................................................16 Linux ()............................................................................................................19 ..............................................................................................................19 ...............................................................................................................20 .........................................................................................................21 ..........................................................................................22 .......................................................................................................22 .................................................................................................23 ...........................................................................................................24 ..............................................................................................................24 BSD.........................................................................................................................25 BSD.....................................................................................................25 GNU General Public License.................................................................................27 .............................................................................................................27 ..............................................................................................................27 GPL v3................................................................................................................28 GNU GPL....................................................................................................29 Linux : ...........................................30 .........................................................................................................30 .......................................................................................................30 .........................................................................33 .............................................................................................34 System V shared memory......................................................................................35 ................................................................................................37 .......................................................................................................40 .................................................................41 .........................................................................42 ......................................................................43 ...............................................................................43 ................................................................................44 sysctl...................................................................................................44 ...........................................45 GNU libc.........................................................................46 LD, Shared Library, SO .................................................47 /proc.........................................49 .............................................................................................50 /dev..........................................................................................................50i

/dev.............................................................52 DevFS...................................................................................................53 UDEV...................................................................................................54 .............................................................................................54 IDE ...........................................57 SCSI-.................................58 SATA IDE PATA..................................................59 Logical Volume Manager...................................................................................60 Sotware RAID.....................................................................................................64 Device mapper...................................................................................................67 Host-RAID, RAID- .............................67 .............................................................................................68 IP ........................................................................70 ...................................................................................................72 ....................................................................73 ..................................74 ....................................................................................75 .................................................................................................75 iptables.....................................................................75 , NSS PAM.........................................................78 X11 --..................................................................................................80 - X11...............................................................80 ..................................................................81 X11. ......................................................................82 X11. .....................................83 X11. FreeType XFT............................................................................84 X11. .................................................................................85 X11. ......................................................................85 X11. ............................................................................85 ..........................................................................................................85 Linux..........................................................................................88 ................................................................................88 ...................................................................................88 Unix-..................................................90 Linux.................................................................................91 Ext2fs..................................................................................................................91 .........................................................92 ReiserFS.............................................................................................................92 Ext3fs..................................................................................................................93 XFS.....................................................................................................................94 ..............................................................................................95 ......................................................................................96 ........................................................................................98 Linux : ................................99 Windows-............................................................................................103 ..............................................................103 ......................................................................................................103 /.......................................................................................................104 Chat..................................................................................................................105ii

File managers...................................................................................................105 FTP...................................................................................................................105 Graphics...........................................................................................................105 Internet.............................................................................................................105 Mail...................................................................................................................106 Multimedia........................................................................................................106 Office................................................................................................................106 P2P...................................................................................................................106 Gentoo Linux.........................................................................................................107 ?............................................................................................107 Gentoo Linux........................................................................................................108 Gentoo...................................................................................................108 Gentoo.............................................................................................109 Gentoo ............................................................................112 X.org........................................................................................................113 Portage.......................................................................................................113 Portage.....................................................................114 ?................................................................114 ?..........................................................................115 .....................................................................................116 ...........................................................................116 Gentoo Linux: ....................................................................117 ...................................................................................118 - ....................................................................................123 - ..........................................................125 - Gentoo..............................................................................126 : ..........................................................................129 Gentoo Linux x86..........................................139 .............................................................................................139 ....................................................................................................139 ..............................................................................................139 ................................................................................................140 Gentoo.................................................................140 ...................................................................................................141 .............................................................................................141 .............................................................................142 .........................................................................................142 Grub..................................................................................................................142 Lilo....................................................................................................................143 ..........................................................................................143 Gentoo Linux...........................144 1. .........................................................................................144 2. Smart BootManager.............144 3. Knoppix.....................................................................145 4. Stage 1 ......................................................146 5. PXE...........................................147 6. Gentoo Linux-...................................151 Gentoo/x86.........................................................155 1. ......................................................................................................155iii

2. .................................................................................155 3. .....................................................................................158 4. /.............................................................................159 .............................................................159 Gentoo............................................................................161 ............................................................................................................161 .....................................................................................161 ............................................................161 ............................................................................................161 .........................................................................161 ...........................................................................................162 Gentoo ........................................................................................163 ...................................................................................................164 .......................................................................164 ....................................................................................165 UNICODE ..............................................................................165 Gentoo .............................................................................................166 ........................................................................167 ..................................................................................167 ..................................................................................168 Gentoo Linux x86.......................................................................170 A. Gentoo..........................................................................................173 1. Gentoo Linux............................................................................173 1.a. ..................................................................................................173 2. ............................................175 2.a. .........................................................................175 2.b. - Gentoo....................................................176 2.c. , Gentoo...........177 3. ................................................................................................182 3.a. ....................................................182 3.b. ....................................................183 3.c. ............................................................................185 DHCP....................................................................................186 .............................................................187 ..................................................................188 ifconfig route.......................................................................189 4. ..........................................................................................190 4.a. .............................................190 4.b. ......................................................191 4.c. fdisk .......................................193 4.d. ...................................................................196 ( !).................................................................197 4.e. ..........................................................................................198 5. Gentoo.....................................................199 5.a. ........................................................................199 5.b. : ..............200 5.c. : ..........................................................................................................................201 5.d. ...................................................................202iv

5.e. ......................................................203 6. Gentoo.............................................................205 6.a. ..............................................................205 6.b. Portage...................................................................................207 USE..........................................................................209 7. ...............................................................................................211 7.a. ............................................................................................211 7.b. ............................................................212 7.c. : ..........................................................212 7.d. : genkernel..............................................216 7.e. ............................................................................................218 8. ...................................................................218 8.a. ................................................................218 (JohnBat26): /etc/fstab:.....................................220 8.b. .......................................................................................220 8.c. ................................................................................223 9. .........................................................224 9.a. ...............................................................................224 9.b. ....................................................224 9.c. : cron....................................................................225 9.d. : ....................................................226 9.e. ....................................226 9.f. ....................................................................................226 10. ...............................................................227 10.a. ..................................................................................227 10.b. : GRUB.................................................229 10.c. : LILO....................................................233 10.d. ..........................................................................235 11. Gentoo....................................................................235 11.a. ..........................................................235 12. ?.................................................................................236 12.a. ........................................................................................236 12.b. Gentoo ...............................................................................237 B. Gentoo.............................................................................................238 1. Portage.........................................................................................238 1.a. Portage..................................................................238 1.b. .....................................................................................238 1.c. ..........................................239 1.d. Portage ..........................................................................243 2. USE-.......................................................................................................247 2.a. USE-?............................................................................247 2.b. USE-..................................................................248 2.c. USE- ..............................................................251 3. Portage......................................................................................252 3.a. Portage..............................................................................252 3.b. .................................................................252 3.c. ......................................................................253 3.d. ................................................................255 4. ..............................................................................256v

4.a. ........................................................................................256 4.b. rc-update........................................................................260 4.c. ......................................................................................260 4.d. ..................................................261 4.e. ................................................264 5. ........................................................................................265 5.a. .................................................................................265 5.b. .................................................267 5.c. ...................................................269 C. Portage............................................................................................271 1. ...........................................................................................271 1.a. Portage.........................................................................................271 1.b. ....................................................................................272 1.c. .......................................................273 1.d. ....................................................................................274 2. ..............................................................274 2.a. Portage...................................................................................274 2.b. ..................................................................................274 2.c. ......................................................275 2.d. ...........................................................................276 2.e. Gentoo....................................................................................277 2.f. Portage...................................................................................277 3. ...........................................278 3.a. ...................................................................278 3.b. ........279 3.c. ...........................................279 4. Portage...............................................................280 4.a. etc-update.................................................................................................280 4.b. dispatch-conf.............................................................................................281 4.c. quickpkg....................................................................................................282 5. ........................................................282 5.a. Portage......................................282 5.b. ebuild.....................283 5.c. , Portage............................................284 6. ebuild.....................................................................................284 6.a. Emerge Ebuild........................................................................................284 6.b. ...................................................................284 6.c. Ebuild....................................................287 6.d. ................................................................287 D. Gentoo...............................................................................289 1. .....................................................................................289 1.a. .........................................................................289 2. ................................................................................290 2.a. .........................................................................290 2.b. .............................................................................291 2.c. ..............................................................292 3. ..........................................................................293 3.a. ......................................................................................293 3.b. .......................................................................294vi

3.c. DHCP........................................................................................................294 3.d. ADSL............................................................................................296 3.e. APIPA ( IP-)...................................296 3.f. .....................................................................297 3.g. ( 802.1d)...............................................297 3.h. MAC-...............................................................................................298 3.i. ..............................................................................298 3.j. ( 802.1q)...................................................299 4. .........................................................................................299 4.a. ..................................................................................................299 4.b. WPA........................................................................................300 4.c. Wireless tools.............................................................................302 4.d. ESSID...................................................305 5. ......................................................................306 5.a. -......................................................306 5.b. - wireless tools.......................................................307 6. ..........................................................................................308 6.a. ...................................................................................308 6.b. ifplugd........................................................................................................309 Gentoo..........................................................310 .............................................................................................................310 A. ...................................................................................310 1. ..................................................310 2. ......................................................................................313 3. ........................................................................................315 4. ............................................................................320 5. /...........................................................321 6. ...........................................................................323 7. PAM..............................................................................................................326 8. TCP.........................................................................................327 9. .....................................................................................327 10. .................................................................................330 11. .....................338 12. .................................................................................339 13. .........................................................................353 14. ..........................................................................358 Hardened Gentoo.....................................................................................................360 .............................................................................................................360 .............................................................................................................362 ............................................................................................................364 ........................................................................................................367 ...........................................................................................................367 ......................................................................................................367 ..............................................................................................367 ..........................................................................................367 ................................................................................................................368 Gentoo Linux.......................................................................................369 Gentoo.................................................................369 1. Gentoo .................................................................................369vii

2. ......................................................................370 3. .....................................................371 HOWTO ..................................................................373 /var/lib/portage/world ...............................................373 profile .........................................................................................373 USE- ....................................................................................................373 ( toolchain) ..........374 emerge -U -u ......................374 toolchain ................................374 . ..........................................................................375 . ..........................................................375 . .................................................................................376 Gentoo Linux GCC..............................................377 1. .....................................................................................................377 2. ...............................................................377 3. GCC-3.3 3.4 ............................................378 4. GCC .....................................................381 5. .........................................................................................382 Gentoo X.Org........................................................................................................384 X- 6.X.......................384 1. X Window Server?......................................................................384 2. Xorg............................................................................................385 3. Xorg...........................................................................................386 4. xorg.conf....................................................................................388 5. .......................................................................................................390 X- 7.X (.)..............392 Introduction.......................................................................................................392 Preparation ......................................................................................................392 Emerge Modular X.org ....................................................................................394 Installation .......................................................................................................394 GL Issues.........................................................................................................396 Configuration file locations have changed ......................................................397 Other problems and solutions .........................................................................397 XkbOptions...........................................................................................................398 "XkbOptions" ...............................................................................398 ...........................................................................................................398 HOWTO Xorg and Fonts (.)............................................................................400 HOWTO...........................................................................400 ............................................................................................400 DPI..............................................................................400 Windows/Mac Linux........401 .................................................................401 (Hinting)..................................................................402 .......................................................403 /etc/X11/xorg.conf............................................................................................406 : /etc/X11/xorg.conf ( )....................................409 ........................................................................................409 Mozilla Firefox and Thunderbird.......................................................................410 ................................................................412viii

, Linux Konsole ...............................413 , ....................413 startx.............................................................................413 XEmacs............................................................................................................414 .........................................................................................414 ..............................................................................................414 ( JohnBat26), : ~/.fonts.conf:.................................415 nVidia Gentoo Linux........................................417 1. .....................................................................................................417 2. .........................................................................................417 3. ....................................................................................................422 4. .............................................................................423 ATI Gentoo Linux.........................................425 1. .................................................................................425 2. ....................................................................................................426 3. .......................................................................427 HOWTO fbsplash......................................................................................................428 ............................................................................................................428 gensplash?......................................................................................428 fbsplash (framebuffer splash)?.......................................................428 frame buffer?...............................................................428 fbsplash splashutils.........................................................................429 ...................................................................................429 ........................................................................................429 ()..........................................................................429 / ( genkernel)...........430 splashutils......................................................................................430 / ( ).....................................430 initramfs .................................................................................430 initramfs?........................................................................................431 initramfs ...............................431 initramfs ........................................................431 gensplash..................................................432 bootsplash gensplash...................................................433 gensplash................................................433 ........................................................................................434 .............................................................................................434 Grub..........................................................................434 Lilo.............................................................................435 ....................................................................435 Gensplash ..............................................................435 ...................................................................................436 3.............................................................436 ..............................................................................................436 /usr ...................................................................436 ...............................................................436 .................................................................................................................437 Hardware 3D Acceleration Guide (.).................................................................438 1. Introduction.......................................................................................................438ix

2. Install Xorg and configure your kernel..............................................................439 3. Install X11-DRM and configure direct rendering..............................................440 4. Test 3D acceleration.........................................................................................441 5. Using the CVS sources....................................................................................441 6. Tweak your performance..................................................................................442 7. Troubleshooting................................................................................................444 8. Acknowledgments............................................................................................445 9. References.......................................................................................................445 Gentoo KDE..........................................................................................................446 HOWTO KDE 3.x.x...........................................................446 1. K Desktop Environment?......................................................446 2. KDE............................................................................................446 3. KDE...........................................................................................449 KDE (31).........................451 Gentoo KDE 4.0 Guide (.)..............................................................................457 1. ....................................................................................................457 2. KDE 3.5.........................................................464 3. FAQ ( )...........................................................464 GNOME.......................................................................467 1. GNOME?....................................................................................467 2. GNOME.....................................................................................467 UTF-8 Gentoo.............................................................................469 1. ..........................................469 2. ........................................................................................................469 3. UTF-8 Gentoo Linux..................................................................471 4. .............................................................................473 Gentoo Linux............................................481 1. .........................................................................................................481 2. .....................................................................481 3. locale................................................................................485 4. ..............................................................................487 5. X..................................................................487 5.1: /.......488 Gentoo Linux ALSA............................................................................492 1. .........................................................................................................492 2. ALSA..............................................................................................492 3. / ALSA.....................................................................497 ALSA USE.....................................................................................................500 4. ALSA.............................................................................503 Gentoo ( 2).........................................................507 Gentoo....................................507 Portage...............................................................................................507 Portage..........................................................................................508 .............................................................508 ?......................................................................509 ..............................................................................510 .....................................................................................510 Portage....................................................................................................510 .......................................................................511x

..................................................................................511 ..........................................................511 ..................................................................................512 .....................................................512 - ........................................................514 :............................................................................514 ........................................................................................515 USE-...........................................................................................................516 =)................................................518 :.......................................................................518 . ', DE..............................................................................519 Gentoo Java...........................................................................................................520 Java Gentoo.........................................................520 1. Java ?.........................................................................................520 2. ................................................................................521 3. ...............................................................522 4. ..................................................523 5. ...............................................................................................524 6. CLASSPATH ...............................525 7. Java- ......................................................................526 8. USE , Java...........................................................527 9. ........................................................................528 Java Gentoo.....................................................529 1. .....................................................................................................529 2. java-config.............................................................................530 3. .....................................................................530 4. ... !........................................................................531 5. .....................................................................531 Gentoo GPRS........................................................................................................532 GPRS USB ()........................................................................532 GPRS Linux................................................................................535 .........................................................................................................535 ......................................................................................................535 ...............................................................................................535 ........................................................................................................537 ...................................................................................538 .......................................................538 .....................................................................................................539 , Toonel. (Linux).................................................539 ...........................................................540 GPRS KPPP..............................................................................................541 GPRS Bluetooth........................................................................................543 HOWTO Internet..............................................................................544 VPN....................................................................................................544 ..........................................................................544 .........................................................................................544 .........................................................................................544 pptpconfig..................................................................545 ................................................................................546xi

pppoe.........................................................................................................547 DIAL-UP.....................................................................548 ....................................................................................548 ........................................................549 Call back........................................................................................550 GPRS.........................................................................551 ..................................................................................551 USB-.........................................................551 COM-........................................................552 Bluetooth.......................................................................552 IrDA................................................................................553 CDMA (SKYLINK).....................................................554 .............................................................................554 ........................................................554 Gentoo.......................................................555 .............................................................................................................555 ? .........................................................555 .................................................................................................555 Gentoo .....................555 ...............................................................................................555 ................................................................................556 ...................................................................556 dvb_core...........................................................................................................556 /etc/channels.conf............................................................................................556 ........................................................................................557 ..............................................................................................558 ............................................................................558 ................................................................560 OpenVPN..................561 .......................................................................564 1. .........................................................................................................564 .................................................................................................564 ....................................................565 2. .......................................................................................................565 BIOS.................................................................................................................565 USE-..................................................................................565 ........................................................................................566 (runlevel) "battery"................................................567 ACPI-....................................................................567 3. ............................................................................569 ..........................................................................................570 ..........................................................................570 .............................................................571 .....................................................................................574 4. LCD Power Management.................................................................................574 (standby).....................................................................575 ..................................................................................575 .........................................................................576 (idle time) - laptop-mode...................................577xii

....................................................................578 hdparm.............................................................................................................578 " "....................................................................................578 6. ......................................................579 ........................................................................................579 .....................................579 USB...........................................................................579 7. : sleep, standby, suspend to disk.......................................580 Sleep (S3)........................................................................................................580 Hibernate (S4)..................................................................................................581 8. ...................................................................................583 Gentoo ........................................................................................................586 MySQL .........................................................586 1. MySQL............................................................................586 2. ............................................................................588 3. MySQL..................................................................589 4. MySQL................................................................................593 PostgreSQL Guide...............................................................................................599 1. Introduction..................................................................................................599 2. PostgreSQL configuration...........................................................................600 3. Using PostgreSQL......................................................................................603 Gentoo ......................................................................608 Gentoo Subversion............................................................................................608 HOWTO Subversion Apache2 WebDav.....................608 udev Gentoo...............................................................................617 1. udev?...............................................................................................617 2. udev Gentoo...................................................................619 3. .....................................................................................620 4. ............................................................623 Gentoo LDAP-DNS Guide (.)...........................................................................624 1. Introduction.......................................................................................................624 2. Configuring LDAP-DNS....................................................................................624 3. Configuring OpenLDAP....................................................................................625 4. Testing the Installation......................................................................................626 Samba PDC LDAP.....627 .................................................................................627 OpenLDAP............................................................................................................627 OpenLDAP......................................................................627 OpenLDAP...........................................................................628 SAMBA.................................................................................................................630 OpenLDAP......................................................................................630 SAMBA...................................................................................632 LDAP...................................................634 .............................................................................636 .................................................................................636 .........................................................................................637 .........................................................................637 .................................................................................638 .....................................................639xiii

............................................................................................................639 ...........................................................640 1. .........................................................................................................640 2. postfix..........................................................................641 3. Courier-imap.....................................................................................................642 4. Cyrus-sasl.........................................................................................................643 5. SSL- Postfix Apache........................................................643 6. SSL SASL Postfix....................................................644 7. MySQL..............................................................................................................646 8. Apache phpMyAdmin....................................................................................647 9. Vmail-........................................................................................648 10. MySQL .........................649 11. Squirrelmail.....................................................................................................652 12. Mailman..........................................................................................................652 13. Anti-Virus........................................................654 14. .....................................................................................................654 15. Troubleshooting..............................................................................................655 qmail/vpopmail..................................658 1. .........................................................................................................658 2. qmail (" ")......................................................................658 3. vpopmail...........................................................................................................660 4. Courier POP/IMAP...........................................................................................662 5. qmail ( )........................................................................662 6. Horde / IMP...................................................................................663 7. ................................................................................665 8. .......................................................................667 Mutt...............................668 1. E-Mail...........................................................................................668 2. Fetchmail..........................................................................................................668 3. Procmail............................................................................................................669 4. Mutt.....................................................................................671 5. SMTP................................................................................................................674 ..............................................676 1. devfs?..............................................................................................676 ........................................................................................................677 ..........................................................................................................677 2. ..............................................................678 3. ........................................................679 4. , ....................................................680 Ebuild HOWTO (.).............................................................................................683 1.a. The Portage tree............................................................................................683 1.b. Ebuild scripts.................................................................................................685 1.c. File system Locations....................................................................................695 1.d. The Portage scripts and utilities....................................................................696 1.e. Package Dependencies................................................................................700 1.f. Testing and deploying....................................................................................701 rpm- Gentoo..................................................................704 gcc.........................................................................................707 , ...........................................708xiv

, ...............................................712 , .....................................................................716 , ...............................................718 .....................................................................................................721 ................................................................................................721 .............................................................................................................721 LiveCD Gentoo Linux........................................723 .............................................................................................................723 .............................................................................723 ...............................................................................724 KDE....................................................................................................727 .....................................................................................727 Gentoo.........................................................................................................729 2.6: ...........................................................................729 .................................................................729 Gentoo Linux...................730 1. .....................................................................................................730 2. ......................................731 3. ..................................................................732 4. ...........................................733 5. .................................................................................................735 .............................................736 .........................................................................................................736 mplayer................................................................................................................736 XMMS...................................................................................................................736 Mozilla............................................737 Navigator(Seamonkey/Firefox)........................................................................737 Firefox Seamonkey..................................................737 ...................................................................738 Firefox Seamonkey....................................................738 Thumbnail' ........................................738 IDE hdparm...........................................739 .............................................................................742 , ....................................................................745 1. X ............................................................................................745 2. .......................................................745 WIKI............................................................................................................747 HOWTO hal ........................................................................747 hal-0.5.10 ........................................................................................................747 portage ........................................................................................747 xorg ...........................................................................747 .....................................................................................................747 X- .......................................................................................749 .............................................................................................................749 Touchpad.........................................................................................................750 HOWTO Ivman.....................................................................................................750 .................................................................................................................750 ..................................................................................750 ................................................................................................750xv

......................................................................................................752 .............................................................................................................754 ............................................................................................754 ......................................................................754 ............................................................................................754 CD/DVD................................................................................................765 ...................................................................................765 DVD.....................................................................................................769 .........................................................................................................769 Portage..................................................................................................775 Portage NFS..........................................................................................775 Portage..............................................................................................778 Portage Setup Howto ......................................................................................778 Portage Overlay....................................................................................................782 .........................................................................................................782 Portage Overlay.............................................................................782 ebuild............................................................................782 digest-................................................................................782 deltup...............................................................784 ?.................................................................................................784 ...................................................................................784 ..............................................................................................................................785 ..............................................................................................................................786 ............................................................................787 ..........................................................................791 .................................................................................................................792 MS Windows -...................................................................792 Udev.................................................................................................................795 CFLAGS .............797 nano.................................................................................................800 Udev ..........................................................801 glibc.........................................................................................804 USB-flash.................................................................................808 - NTFS ntfs-3g.........................811 ................................................................................................814 Apache2.........................................................................................814 iptables .............................................................818 iptables.......................................................................823 ........................................................................840 vsftpd.............................................................................................847 Jabber Server...................................................................................................850 Counter-Strike..............................................................851 Samba Win2k............................................................852 Samba PDC LDAP ..........................................................................................................................856 .........................................................................869 X.........................................................................................................889xvi

X...................................................................889 X..................................................................893 Xorg X11 ...............................................................................895 Xorg. .....................................................................899 Xgl..................................................................................................899 XGL..................................................................................................................902 ..................................................924 Cedega 5.1.......................................................................................................925 ................................................................................926 ccache emerge.....................................................................934 Keymap.................................................................................................................934 ...................................................................................936 2. .........................................................................................................936 Gentoo, ?................................936 Gentoo ?...................................................................936 3. .........................................................................................................936 , "-O9 -ffast-math -fomit-frame-pointer". ? ........................................................937 root ( )?................937 ?........................................................937 root su?.........937 devfs?......................................................................................938 Gentoo ? ........................................938 (), ?......................938 - , ?.......................939 ISO -?....................................................939 / ?..................940 . ? ..........................................................................................................................940 Windows GRUB LILO, . ? ........................................................................................941 Gentoo, Stage1 Stage2?...................941 4. .....................................................................................942 ?.............................................................942 ./configure . ?................943 emerge, ?.....................943 , rsync ?....................................................943 . , ? ............943 /usr/portage/distfiles. ? ..........................................................................................................................943 /var/tmp/portage? / var/tmp/portage? .............................................................................................944 5. ................................................................................................944 ?..........................944 crontab?. .944 numlock ?............................................................945 ?.............................................945 X - root' ( su)....................945xvii

6. ...............................................................................................945 ReiserFS - , ..........................946 7. ......................................................................................................946 ?.......................................................946 ?...................................946 . ? ..........................................................................................................................946 8. ...........................................................................................................947 Gentoo Linux?......................................................947 CD Gentoo Linux?............................................................947 . ?..............................947 ...................................................................948 ..........................................................................................................948 ? ...............................................................................948 ? .....................................................................................948 root ?....................................................................950 .............................................................................................951 man...................................................................................................951 cd......................................................................................................951 ls.......................................................................................................951 cp......................................................................................................952 rm......................................................................................................952 df.......................................................................................................952 ?...................................953 ?..................................................................................................953 ?...........................................................................953 ?.............................................954 ...................................................................................................................955 , .....................................................968 MAN ( )...................................................................................970 Emerge.................................................................................................................970 ...................................................................986 1. make.conf..................................................................................................986 2. xorg.conf NVIDIA Geforce...............................................................988 3. xorg.conf ATI radeon:.....................................................................991 4. /etc/fstab.................................................................................................997 Gentoo Linux..............................................................................998 Unix Toolbox.............................................................................................................999 1. SYSTEM...........................................................................................................999 1.1 Hardware Informations...............................................................................999 1.2 Load, statistics and messages.................................................................1000 1.3 Users........................................................................................................1000 1.4 Limits........................................................................................................1000 1.5 Runlevels..................................................................................................1001 1.6 Reset root password................................................................................1002 1.7 Kernel modules........................................................................................1003 1.8 Compile Kernel.........................................................................................1003 2. PROCESSES.................................................................................................1004xviii

2.1 Listing and PIDs.......................................................................................1004 2.2 Priority......................................................................................................1004 2.3 Background/Foreground..........................................................................1004 2.4 Top...........................................................................................................1004 2.5 Signals/Kill................................................................................................1005 3. FILE SYSTEM................................................................................................1005 3.1 Permissions..............................................................................................1005 3.2 Disk information........................................................................................1005 3.3 Boot..........................................................................................................1005 3.4 System mount points/Disk usage.............................................................1006 3.5 Who has which files opened....................................................................1006 3.6 Mount/remount a file system....................................................................1007 3.7 Mount an SMB share...............................................................................1007 3.8 Mount an image.......................................................................................1008 3.9 Create and burn an ISO image................................................................1008 3.10 Create a file based image......................................................................1009 3.11 Create a memory file system.................................................................1009 3.12 Disk performance...................................................................................1010 4. NETWORK.....................................................................................................1010 4.1 Debugging (See also Traffic analysis) (page 18).....................................1010 4.2 Routing.....................................................................................................1010 4.3 Configure additional IP addresses...........................................................1010 4.4 Change MAC address..............................................................................1011 4.5 Ports in use..............................................................................................1011 4.6 Firewall.....................................................................................................1011 4.7 IP Forward for routing..............................................................................1011 4.8 NAT Network Address Translation...........................................................1012 4.9 DNS..........................................................................................................1012 4.10 DHCP.....................................................................................................1013 4.11 Traffic analysis.......................................................................................1013 4.12 Traffic control (QoS)...............................................................................1014 4.13 NIS Debugging.......................................................................................1015 5. SSH SCP........................................................................................................1016 5.1 Public key authentication.........................................................................1016 5.2 Check fingerprint......................................................................................1017 5.3 Secure file transfer...................................................................................1017 5.4 Tunneling..................................................................................................1017 6. VPN WITH SSH..............................................................................................1019 6.1 Single P2P connection.............................................................................1019 6.2 Connect two networks..............................................................................1020 7. RSYNC...........................................................................................................1020 7.1 Rsync on Windows...................................................................................1021 8. SUDO.............................................................................................................1022 8.1 Configuration............................................................................................1022 9. ENCRYPT FILES...........................................................................................1023 9.1 A single file...............................................................................................1023 9.2 tar and encrypt a whole directory.............................................................1023 9.3 tar zip and encrypt a whole directory.......................................................1023 10. ENCRYPT PARTITIONS..............................................................................1023xix

10.1 Linux.......................................................................................................1023 10.2 FreeBSD.................................................................................................1024 11. SSL CERTIFICATES....................................................................................1025 11.1 Procedure...............................................................................................1026 11.2 Configure OpenSSL...............................................................................1026 11.3 Create a certificate authority..................................................................1026 11.4 Create a certificate signing request.......................................................1026 11.5 Sign the certificate..................................................................................1027 11.6 Create united certificate.........................................................................1027 11.7 View certificate information....................................................................1027 12. CVS..............................................................................................................1027 12.1 Server setup...........................................................................................1027 12.2 Test it......................................................................................................1029 12.3 SSH tunneling for CVS...........................................................................1029 12.4 CVS commands and usage...................................................................1030 13. SVN..............................................................................................................1030 13.1 Server setup...........................................................................................1030 13.2 SVN commands and usage...................................................................1032 14. USEFUL COMMANDS.................................................................................1032 14.1 less.........................................................................................................1032 14.2 vi.............................................................................................................1033 14.3 mail.........................................................................................................1033 14.4 tar...........................................................................................................1034 14.5 dd............................................................................................................1034 14.6 screen.....................................................................................................1035 14.7 Find........................................................................................................1036 14.8 Miscellaneous.........................................................................................1036 15. INSTALL SOFTWARE.................................................................................1037 15.1 List installed packages...........................................................................1037 15.2 Add/remove software.............................................................................1037 15.3 Library path............................................................................................1037 16. CONVERT MEDIA........................................................................................1037 16.1 Text encoding.........................................................................................1037 16.2 Unix - DOS newlines..............................................................................1038 16.3 PDF to Jpeg and concatenate PDF files................................................1038 16.4 Convert video.........................................................................................1038 16.5 Copy an audio cd...................................................................................1038 17. PRINTING....................................................................................................1038 17.1 Print with lpr............................................................................................1038 18. DATABASES................................................................................................1039 18.1 PostgreSQL............................................................................................1039 18.2 MySQL...................................................................................................1039 18.1 SQLite....................................................................................................1040 19. DISK QUOTA...............................................................................................1041 19.1 Linux setup.............................................................................................1041 19.2 FreeBSD setup.......................................................................................1041 19.3 Assign quota limits.................................................................................1041 20. SHELLS........................................................................................................1042 20.1 bash........................................................................................................1042xx

20.2 tcsh.........................................................................................................1043 21. SCRIPTING..................................................................................................1044 21.1 Basics.....................................................................................................1044 21.2 Bourne script example...........................................................................1045 21.3 Some sed commands............................................................................1045 21.4 Some useful commands.........................................................................1045 22. PROGRAMMING..........................................................................................1046 22.1 C basics..................................................................................................1046 22.2 C example..............................................................................................1046 22.3 C++ basics............................