|
home /
linux
|
An important concept to remember :
to Linux, everything is a file.
|
Linux experiences
El 'Software Libre' es un asunto de libertad, no de precio.
Para entender el concepto,
debes pensar en 'libre' como en 'libertad de expresión',
no como en 'cerveza gratis'.
[N. del T.: en inglés una misma palabra (free)
significa tanto libre como gratis,
lo que ha dado lugar a cierta confusión].
Hardware, es a dir, ferralla
|
Pots anar directament a la part de software.
|
- Model/Type : 9546x9A
- La CPU es un Pentium a 133 MHz, amb un bus de 66 MHz.
- lspci output (very similar to less /proc/pci) :
00:00.0 Host bridge: Intel Corporation 430MX - 82437MX MTSC (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371FB PIIX ISA [Triton I] (rev 02)
00:02.0 CardBus bridge: Texas Instruments PCI1130 (rev 04)
00:02.1 CardBus bridge: Texas Instruments PCI1130 (rev 04)
00:03.0 VGA compatible controller: Trident TGUI 9660/938x/968x/ (rev d3)
00:05.0 Multimedia video controller: IBM MPEG PCI Bridge
04:00.0 Non-VGA unclassified device: Xircom Cardbus Ethernet 10/100 (rev 03)
|
Millor encara es lspci -v :
00:00.0 Host bridge: Intel Corp. 430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP) (rev 02)
Flags: bus master, medium devsel, latency 32
00:01.0 ISA bridge: Intel Corp. 82371FB PIIX ISA [Triton I] (rev 02)
Flags: bus master, medium devsel, latency 0
[virtual] I/O ports at 01f0
[virtual] I/O ports at 03f4
[virtual] I/O ports at 0170
[virtual] I/O ports at 0374
00:02.0 CardBus bridge: Texas Instruments PCI1130 (rev 04)
Flags: bus master, medium devsel, latency 168
Memory at 10812000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=01, subordinate=03, sec-latency=176
16-bit legacy interface ports at 0001
00:02.1 CardBus bridge: Texas Instruments PCI1130 (rev 04)
Flags: bus master, medium devsel, latency 168
Memory at 10811000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=04, subordinate=06, sec-latency=176
Memory window 0: 60008000-6000d000
I/O window 0: 00000100-0000017f
16-bit legacy interface ports at 0001
00:03.0 VGA compatible controller: Trident Microsystems TGUI 9660/938x/968x (rev d3) (prog-if 00 [VGA])
Flags: medium devsel, IRQ 11
Memory at 08000000 (32-bit, non-prefetchable) [size=4M]
Memory at 08400000 (32-bit, non-prefetchable) [size=64K]
Memory at 08800000 (32-bit, non-prefetchable) [size=4M]
Expansion ROM at 000c0000 [disabled] [size=64K]
00:05.0 Multimedia video controller: IBM MPEG PCI Bridge
Flags: fast devsel, IRQ 11
Memory at 10810000 (32-bit, non-prefetchable) [size=256]
04:00.0 Ethernet controller: Xircom Cardbus Ethernet 10/100 (rev 03)
Subsystem: IBM 10/100 EtherJet Cardbus Adapter
Flags: bus master, medium devsel, latency 64, IRQ 5
I/O ports at 0100
Memory at 6000d000 (32-bit, non-prefetchable)
Memory at 6000c000 (32-bit, non-prefetchable)
Expansion ROM at 60008000 [disabled]
Capabilities: [dc] Power Management version 1
|
- RAM : 48 MB.
- HD : en tinc 4 - dos de 1,2 GB, un de 2,1 GB, i un de 3 GB.
- 1,2 GB SuSE 7.2 fdisk -l :
Device Boot Start End Blocks Id System + "df"
/dev/hda1 1 9 18112+ 83 Linux /boot
/dev/hda2 10 58 98784 82 Linux swap
/dev/hda3 59 589 1070496 83 Linux /
|
- El video es un Trident Cyber 9385, amb 2 MB de RAM.
La comanda SuperProbe diu :
Chipset: Trident Cyber9385 (PCI probed)
Memory: 2048 Kbytes
RAMDAC: Trident Built-In 15/16/24-bit DAC
(with 6-bit wide lookup tables (or in 6-bit mode))
- El monitor que traga el RedHat es el IBM 9514-B TFT Panel.
Se li pot posar 640x480, 800x600 i 1024x768.
7.2 6.2 (no)
Hsync rate = 31.5 - 82.0 (KHz) 48.0 - 65.0
Vsync rate = 60 - 100 (Hz) 60.0 - 75.0
Tinc un monitor extern 9524 14x, que té
Hsync rate = 30.0 - 64.0 (KHz)
Vsync rate = 50-110 (Hz)
Tinc guardat el XF86Config
- Mouse :
linuxTP760:~ # ls -al /dev/mouse
lrwxrwxrwx 1 root root 10 Jan 30 17:08 /dev/mouse -> /dev/psaux
- Red : "10/100 Etherjet PC Card" PCMCIA card, P/N 08L3148.
Com es pot veure a /etc/pcmcia/config
card "IBM 10/100 EtherJet CardBus"
manfid 0x00a4, 0x0113
bind "tulip"
Com que fa servir DHCP,
el fitxer /etc/sysconfig/network-scripts/ifcfg-eth0 té
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
i la configuració es veu amb la comanda ifconfig.
Si l'adreça IP es estàtica, aquest fitxer esdevé :
DEVICE="eth0"
BOOTPROTO="static"
IPADDR="9.136.0.134"
NETMASK="255.255.254.0"
GATEWAY="9.136.0.1"
ONBOOT="yes"
Quan la tarja PCMCIA era
Token Ring, calia :
In file /etc/sysconfig/pcmcia change the line
PCMCIA_SYSTEM="kernel" to PCMCIA_SYSTEM="external"
- Audio & Modem : MWave DSP.
- Té el COM1 anulat ! Serà per la BIOS ?
Solució :
- DOS : PS2.EXE (Help : PS2 ?)
URLs :
- Linux : tpctl
Think Pad configuration
tool for Linux
- Un
XF86config
- El SuSE 8.1 em detecta PCMCIA chipset i82365
/etc/modules.conf : alias eth-pcmcia-0 xircom_cb
Els moduls els agafa de /lib/modules/2.4.19-4GB/kernel/drivers/net/pcmcia
- Resumen de recursos del sistema.
Se obtiene bajo WNT mediante
"Inicio" + "Programas" + "Herramientas Administrativas" + "Diagnosis WNT" + "Recursos"
IRQ 01 i8042prt
IRQ 06 floppy
IRQ 10 Mwave
IRQ 12 i8042prt
IRQ 14 atapi
I/O 0060-0060 i8042prt
I/O 0064-0064 i8042prt
I/O 01CE-01CF VgaSave
I/O 01F0-01F7 atapi
I/O 03B0-03BB VgaSave
I/O 03BC-03BE Parport
I/O 03C0-03DF VgaSave
I/O 03F0-03F5 Floppy
I/O 03F6-03F6 atapi
I/O 03F7-03F7 Floppy
I/O 15EE-15EF tgiul40
I/O 4E30-4E3F Mwave
DMA 02 Floppy
DMA 07 Mwave
MEM 000A.0000-000B.FFFF VgaSave
MEM 0800.0000-081F.FFFF tgiul40
MEM 000D.8000-000D.8FFF PCCCard
MEM 000D.9000-000D.9FFF PCCCard
MEM 000D.A000-000D.AFFF PCCCard
MEM 000D.B000-000D.BFFF PCCCard
MEM 1081.1000-1081.1FFF SockServ
MEM 1081.2000-1081.2FFF SockServ
|
TP 770 X de IBM
|
Ara hi tinc un Suse 8.2.
|
- HD
- poso el Suse 8.2 (via LILO) a /dev/hda6
- Pantalla
- Monitor : IBM ThinkPad 1280x1024 TFT LCD panel (use Sax2)
- Graphics card : Trident Cyber 9397 DVD
- Color and Resolution : 24 bit (16,8 M)
- Geometry : 58 KHz : 54 Hz
- xarxa
- la tarja ETH penja el Linux a l'instalt !
- Yast2 + Network Devices + network card = PCMCIA Ethernet
- Model : Trust.
- CPU : Pentium 90 MHz.
- lspci output ( very similar to less /proc/pci ) :
00:00.0 Class 0406 : Silicon Integrated Systems [SiS] 85C501/2 (rev 39)
00:01.0 Non-VGA unclassified device : Silicon Integrated Systems [SiS] 85C503/5513
00:0d.0 VGA compatible controller : Cirrus Logic GD5434-8 [Alpine] (rev f9)
00:0f.0 Multimedia audio controller : Ensoniq ES1371 [AudioPCI-97] (rev08)
00:11.0 Ethernet controller : Realtek Semiconductor Ltd RT8139 (rev 10)
00:13.0 IDE interface : Quantum Design (H.K.) Ltd QD-8580 (rev 01)
|
- RAM : 16 MB.
- HD : 1 x 500 MB + 1 x 10 GB.
"fdisk -l" says (from /proc/partitions) :
hda 500 MB - Samsung SHD-30560A - CHS 543/32/63
16 hda1 290 MB C:IO
83 hda2 210 MB ext "/" <- LiLo, root=/dev/hda2
82 hda3 32 MB swap <- LiLo, swap=/dev/hda3
hdb CD ROM CD 5233E
hdc 10 GB (8.024 MB) - ST310212A - 512 KB cache - CHS 19846/16/63 (1027/255/63)
5 hdc1
b hdc5 3.500 MB E:NINA
b hdc6 3.000 MB F:ARCADI
b hdc7 260 MB G:LINUXDATA
83 hdc8 737 MB
6 hdc2 510 MB D:SAG70
83 hdc3
|
Com que hdc7 es compartit amb W95 i té format DOS,
al fitxer /etc/fstab hi ha una línia com :
/dev/hdc7 /winshare msdos defaults 0 0
- Video :
la comanda SuperProbe diu :
First video : Super-VGA
Chipset: Cirrus CL-GD5434 (PCI probed)
Memory: 1024 Kbytes
RAMDAC: Cirrus Logic built-in 15/16/24-bit DAC
(with 6-bit wide lookup tables (or in 6-bit mode))
- Monitor : Super VGA 1024x768.
- Red : tarjeta Ethernet "Realtek 8139-series PCI NIC".
HW @ = 00.50.BF.5A.71.59
IRQ = 11, IO = 0x6100-0x61FF
insmod rtl8139.o
PCI latency time (CFLT) is unreasonably low at 0. Setting to 64 clocks.
- Modem : Cirrus 56K external, COM2.
- Sound : Creative Sound Blaster PCI 128 Legacy - IRQ 5, IO 0x220-0x22F
IOH address = 0x220 IRQ = 5 DMA ( 8bits) = 1 DMA (16 bits) = 7
- Resumen de recursos del sistema.
Se obtiene bajo W95 mediante "Control Panel" + "System" + "Device Manager"
+ "Print" (to file)
****** RESUMEN DE IRQ ******
00 - Cronómetro del sistema
01 - Teclado 101/102-teclas estándar o Microsoft Natural Keyboard
02 - Controlador programable de interrupciones
03 - Puerto de comunicaciones (COM2)
04 - Puerto de comunicaciones (COM1)
05 - Sound Blaster AudioPCI 128 Legacy Device
06 - Controlador estándar de disquetes
08 - Sistema CMOS/reloj en tiempo real
10 - Creative Sound Blaster AudioPCI 128
10 - Marcador IRQ para manejo de PCI
11 - Marcador IRQ para manejo de PCI
11 - 32-Bit PCI Fast Ethernet Adapter
13 - Procesador de datos numéricos
14 - Controlador estándar doble PCI IDE
*14 - Controlador primario IDE (FIFO única)
15 - Controlador estándar doble PCI IDE
*15 - Controlador secundario IDE (FIFO única)
******************** RESUMEN DE PUERTO DE ES ********************
0000h-000Fh - Controlador de acceso directo a memoria
0020h-0021h - Controlador programable de interrupciones
0040h-0043h - Cronómetro del sistema
0060h-0060h - Teclado 101/102-teclas estándar o Microsoft Natural Keyboard
0061h-0061h - Altavoz del sistema
0064h-0064h - Teclado 101/102-teclas estándar o Microsoft Natural Keyboard
0070h-0071h - Sistema CMOS/reloj en tiempo real
0081h-0083h - Controlador de acceso directo a memoria
0087h-0087h - Controlador de acceso directo a memoria
0089h-008Bh - Controlador de acceso directo a memoria
008Fh-008Fh - Controlador de acceso directo a memoria
00A0h-00A1h - Controlador programable de interrupciones
00C0h-00DFh - Controlador de acceso directo a memoria
00F0h-00FFh - Procesador de datos numéricos
0170h-0177h - Controlador estándar doble PCI IDE
*0170h-0177h - Controlador secundario IDE (FIFO única)
*01F0h-01F7h - Controlador primario IDE (FIFO única)
01F0h-01F7h - Controlador estándar doble PCI IDE
0200h-0207h - Creative Gameport Joystick
0220h-022Fh - Sound Blaster AudioPCI 128 Legacy Device
02F8h-02FFh - Puerto de comunicaciones (COM2)
0330h-033Fh - Sound Blaster AudioPCI 128 Legacy Device
0376h-0376h - Controlador estándar doble PCI IDE
*0376h-0376h - Controlador secundario IDE (FIFO única)
0378h-037Ah - Puerto de impresora (LPT1)
0388h-038Bh - Sound Blaster AudioPCI 128 Legacy Device
03B0h-03BBh - Cirrus Logic 5434 PCI
03C0h-03DFh - Cirrus Logic 5434 PCI
03F2h-03F5h - Controlador estándar de disquetes
03F6h-03F6h - Controlador estándar doble PCI IDE
*03F6h-03F6h - Controlador primario IDE (FIFO única)
03F8h-03FFh - Puerto de comunicaciones (COM1)
6000h-603Fh - Creative Sound Blaster AudioPCI 128
6100h-61FFh - 32-Bit PCI Fast Ethernet Adapter
******************** RESUMEN DEL USO DE MEMORIA SUPERIOR ***************
000A0000h-000AFFFFh - Cirrus Logic 5434 PCI
000B0000h-000BFFFFh - Cirrus Logic 5434 PCI
000C0000h-000C7FFFh - Cirrus Logic 5434 PCI
F0000000h-F0FFFFFFh - Cirrus Logic 5434 PCI
F1000000h-F10000FFh - 32-Bit PCI Fast Ethernet Adapter
******************** RESUMEN DEL USO DE DMA ********************
01 - Sound Blaster AudioPCI 128 Legacy Device
02 - Controlador estándar de disquetes
04 - Controlador de acceso directo a memoria
07 - Sound Blaster AudioPCI 128 Legacy Device
|
- Model : 330-466 DX2, 6571-LV1.
- CPU : 60 MHz.
- RAM : 64 MB.
- HD : 2 x 300 MB + CD-ROM + test IDE disk(s)
"fdisk -l" says (from /proc/partitions) :
hda 348 MB - WDC AC 1365F - 64 KB cache - CHS 708/16/63
hda1 100 MB C: DOS 7.0 [486C]
hda2 247 MB
hda5 D: Windows [486D]
hdb = CD ROM ATAPI GLC-DOR MRC-D5822 E:
hdc 325 MB - ST 3391A - 120 KB cache - CHS 768/14/62
hdc1 200 MB ext2 "/"
hdc2 125 MB swap
- Tinc un disc Quantum
que em dona
"FAT error 116"
- Tinc un disc Western Digital Caviar 22500 (IBM P/N 76H7236, FRU 76H5822)
que em dona "DLGDIAG error 0207".
- Video : 640x480=60Hz - 800x600=56 Hz - 1024x768=43 Hz entrelazado.
- Monitor : IBM 8515.
- Red : Nowell 2000 adapter, HT-202 CT, ISA.
JP1 (2-3) = mode "JP"
JP3 (4 x OFF) = no boot ROM
JP2 (1 OFF, 2 ON, 3 OFF) => IRQ = 5
JP2 (4 ON, 5 ON, 6 OFF) => I/O base = 340 hex
HW @ = 00.00.E8.12.7A.79
IRQ = 5, IO = 0x340
insmod ne.o
- Resumen de recursos del sistema.
Se obtiene bajo W95 mediante "Control Panel" + "System" + "Device Manager"
+ "Print" (to file)
******************** IRQ SUMMARY ********************
IRQ Usage Summary:
00 - System timer
01 - Standard 101/102-Key or Microsoft Natural Keyboard
02 - Programmable interrupt controller
03 - Communications Port (COM2)
04 - Communications Port (COM1)
05 - NE2000 Compatible
06 - Standard Floppy Disk Controller
08 - System CMOS/real time clock
12 - Standard PS/2 Port Mouse
13 - Numeric data processor
14 - Standard IDE/ESDI Hard Disk Controller
15 - Standard IDE/ESDI Hard Disk Controller
******************** IO PORT SUMMARY ********************
I/O Port Usage Summary:
0000h-000Fh - Direct memory access controller
0020h-0021h - Programmable interrupt controller
0040h-0043h - System timer
0060h-0060h - Standard 101/102-Key or Microsoft Natural Keyboard
0061h-0061h - System speaker
0064h-0064h - Standard 101/102-Key or Microsoft Natural Keyboard
0070h-0071h - System CMOS/real time clock
0081h-0083h - Direct memory access controller
0087h-0087h - Direct memory access controller
0089h-008Bh - Direct memory access controller
008Fh-008Fh - Direct memory access controller
00A0h-00A1h - Programmable interrupt controller
00C0h-00DFh - Direct memory access controller
00F0h-00FFh - Numeric data processor
0170h-0177h - Standard IDE/ESDI Hard Disk Controller
01F0h-01F7h - Standard IDE/ESDI Hard Disk Controller
02F8h-02FFh - Communications Port (COM2)
0340h-035Fh - NE2000 Compatible
0376h-0376h - Standard IDE/ESDI Hard Disk Controller
03B0h-03BBh - Cirrus Logic 5429/30/34
03BCh-03BEh - Printer Port (LPT1)
03C0h-03DFh - Cirrus Logic 5429/30/34
03F2h-03F5h - Standard Floppy Disk Controller
03F6h-03F6h - Standard IDE/ESDI Hard Disk Controller
03F8h-03FFh - Communications Port (COM1)
******************** UPPER MEMORY USAGE SUMMARY ********************
Memory Usage Summary:
000A0000h-000AFFFFh - Cirrus Logic 5429/30/34
000B8000h-000BFFFFh - Cirrus Logic 5429/30/34
000C0000h-000C7FFFh - Cirrus Logic 5429/30/34
******************** DMA USAGE SUMMARY ********************
DMA Channel Usage Summary:
02 - Standard Floppy Disk Controller
04 - Direct memory access controller
|
- Model : PS/2 95, 9595-ALF ("ALF" is the EMEA version of "OLF"), S/N : 551GOB6
- CPU : 486 DX2 25/50 MHz.
- RAM : 40 MB.
- HD :
la ferralla SCSI que es veu,
després d'actualitzar el driver de SCSI a
"IBM MCA SCSI: Version 4.0b" (Albert),
al dmesg (o també a /proc/scsi/scsi) es
Host: scsi0 Channel: 00 Id 00 Lun: 0 Vendor: IBM Model: 0661467 [sda]
Host: scsi0 Channel: 00 Id 01 Lun: 0 Vendor: IBM Model: DALS-3540 [sdb]
Host: scsi0 Channel: 00 Id 02 Lun: 0 Vendor: IBM Model: DALS-3540 [sdc] * boot=/dev/sdc1
Host: scsi0 Channel: 00 Id 03 Lun: 0 Vendor: IBM Model: CDRM00201 [sde]
Host: scsi0 Channel: 00 Id 04 Lun: 0 Vendor: IBM Model: Cp30540 545 MB [sdd]
Es a dir, en resum :
| SCSI id
| /dev/sdN
| Model Size (MB)
| Type
| Misc
|
| 6 | a | 0661467 398 | 7 = FAT | W95 (+P.M.) boots as c:
[6] /dev/sda1 <=> W95 boot, c: MYC = 277 MB.
[5] /dev/sda2 <=> extended
[6] /dev/sda5 <=> d: W95 = 100 MB.
|
| 5 | b | DALS-3540 528
| 7 = FAT |
[6] /dev/sdb1 <=> W98 boot, c: WIN98 = 515 MB.
|
| 4 | c | DALS-3540 528 | 83 = Linux
|
Red Hat 6.1, kernel 2.4.7-6 custom - LOADLIN by Albert
[83] /dev/sdc1 <=> /boot (17 MB)
[5] /dev/sdc2 <=> extended (510 MB)
[82] /dev/sdc5 <=> swap (66 MB)
[83] /dev/sdc6 <=> / (430 MB)
|
| 3 | e | 123 | 83 = Linux |
CD-ROM Toshiba model XM-3401BME [ /dev/cdrom ]
|
| 2 | d | CP30540 529 | 83 = Linux |
[83] /dev/sdd <=> /dBackUp
|
- El CD-ROM SCSI es veu des DOS si posem
CONFIG.SYS - DEVICE=a:\scsi\IBMCDROM.SYS /D:SSCD000
AUTOEXEC.BAT - MSCDEX /D:SSCD000
a:\scsi - IBMCDROM.SYS 17.903 08/09/94 14:04
- Video : XGA amb 1024 KB de RAM.
- Monitor : tinc una 9524
- Red : ibmtr.c (MCA 16/4 Adapter, ISA-16)
HW @ = 08.00.5A.05.D6.05
memory = de000-dffff
El fitxer /etc/sysconfig/network-scripts/ifcfg-tr0 té
DEVICE="tr0"
IPADDR="9.131.242.231"
NETMASK="255.255.254.0"
ONBOOT="yes"
- Description [9595-ALF] and links :
url
Resum de ferralla
|
| TP760
| P90
| 486 DX2
| 9595
|
| Model/Type
| 9546x9A
| Trust
| 330-466 DX2, 6571-LV1
| PS/2 95, 9595-ALF
|
| CPU
| Pentium 133 MHz
| Pentium 90 MHz
| DX2 60 MHz
| 486 DX2 25/50 MHz
|
| Bus
| PCI 66 MHz, pcmcia
| IDE
|
|
|
| RAM
| 48 MB
| 16 MB
| 64 MB
| 40 MB
|
| HD
| 1,2 GB .. 3 GB
| 500 MB + 10 GB
| 2 x 300 MB
| 398+2x528+529 MB
|
| Video
| Trident Cyber 9385
| Cirrus CL-GD5434
| 1024x768=43 Hz i-lazed
| XGA
|
| Monitor
| 9514-B TFT
| Super-VGA 1024x768
| 8515
| 9524
|
| Red
| 10/100 Etherjet
| Realtek 8139-series
| Nowell 2000, HT-202 CT.
| MCA 16/4 adapter, ISA-16
|
| Modem
| MWave DSP
| Cirrus 56K external
|
|
|
| Sound
| MWave DSP
| Creative SB PCI 128 Legacy
|
|
|
| Op. Sys
| RH 6.2
| W95 + BM + Caldera 2.4
| W95 + BM + SuSE 6.4
| W95 + BM + xykra + Debian 2.2
|
Software, c'est a dire, le logicien
|
Pots anar directament a la part de hardware.
|
Caldera 2.4 eDesktop
-
Vaig començar amb el Caldera 2.4,
que detectava el hardware molt bé.
Vaig probar el Red Hat 6.2 i el SuSe 6.4, però no tenien Probe
i tenia de posar els paràmetres a mà.
El Caldera té el lyzardx que va molt bé.
I no et dic res del hwinfo : escriu un fitxer /tmp/hwinfo.txt
que es una maravella : un munt de dades,
i totes expliquen la comanda que s'ha fet servir per obtenir-ho !
Entre altres, crida a sysinfo.
-
Els tamanys de instalació amb el LISA 3.2 son :
Minimum system without X11 : min 109 MB (* Set 2002 *)
Minimum system including X11 : min 197 MB
Small standard system (common required packages) : min 257 MB
Standard system (recommended packages) : min 722 MB
All packages : min 1522 MB
Quick and compact selection
Individual series select
- un inconvenient que he trobat (01/10/02) es que no té
el package de gcc, compilador de C (egcs-1.1.2-30 at RH 6.2)
- Main configuration file under lisa is /etc/system.cnf,
and all other files, as resolv.conf are written from this one.
-
El tinc instalat (complert) en el TP 760 ED.
Com resulta que el COM1 ( únic port serie disponible )
el té anulat, n'he hagut de prescindir.
Ara hi he posat el SuSe 7.2, molt millor que el 6.2 que tenia.
-
De moment, treballo amb el Caldera 2.4 en el Pentium 90.
Es a dir, amb el kernel 2.2.14,
crec.
El únic problema que té es que em diu :
loading keymap: cannot open file /usr/lib/kbd/keytables/es.map
El cert es que sí que tinc
/usr/share/kbd/keymaps/i386/qwerty/es.map.gz
pero hi ha un error en verificar el teclat amb
Lisa + System configuration + hardware configuration + keyboard layout
El RPM que instalo es el kbd-0.99-1
("rpm kbd" or "rpm -q -f es.map.gz")
Solució : put in /etc/rc.d/rc.local
loadkeys es.map.gz
or
/etc/rc.d/init.d/keytable start (uses /etc/sysconfig/keyboard)
|
-
Com té poc disc, he fet l'installació mínima (109 MB).
El programa manegador de instalació i configuració del sistema
es diu lisa.
Això va deixar fora un munt de paquets, es clar.
Els que em calen ( as GPASM ), els vaig afegir mitjançant el RPM.
-
La primera sorpresa fou que, deprés de una instalació neta,
el RPM es queixava del format de la base de dades. Solució :
rpm --initbd
rpm --rebuilddb
-
Per saber de quin paquet ve un fitxer ... ( "zipinfo" en el seguent exemple )
- si tenim a mà un Linux que funcioni :
1-er : s'ha de buscar on es - which zipinfo - diu /usr/bin
2-on : anar-hi - "cd /usr/bin"
3-er : mostrar la informació - "rpm -q -f zipinfo"
- Si NO tenim un Linux, pero tenim el RPM "rpmdb-redhat" instalat,
podem donar
rpm --dbpath /usr/lib/rpmdb/i386-redhat-linux/redhat --whatprovides 'libc.so.6'
- si tenim SuSE, agafem el arxiu ARCHIVES.gz del primer CD i donem
zcat /media/cdrom/ARCHIVES.gz | grep libc.so.6
o bé
zcat /media/cdrom/ARCHIVES.gz grep ./CD1/suse/a1/glibc.rpm
que es el mateix que rpm -qpli sobre el ".rpm".
Dona informacio sobre els seus 7 CD's.
- en altre cas, entrar "libc.so.6" a
rpmfind.net !
- a lo bestia, podem fer :
- rpm -q -a > tot.txt - display all installed packages
- per cada línia del fitxer anterior,
rpm -q -l <nom package> - list files in package
Si fem servir RPM, no
oblidar autorpm !
-
El problema "extrany" m'el donava "crt1.o", que pertanyia a "glibc-fevel".
També el GTKEXTRA-CONFIG, requerit pel GPSIM.
Encara no l'he trobat.
Solució : instalar el GPSIM mitjançant un RPM.
- He comprat un disc dur de 10,242 GB, un SeaGate model
ST310212A,
Ultra ATA/66, 5400 rpm, amb CHS=1023/256/63 ("16383/16/63 LBA" diu l'etiqueta) i seek-time 8,9 msg.
He trobat un magnífic
manual
en PDF.
El Linux hi tenia problemes, ja que en el log (dmesg), l'arrencada em deia
Uniform multi-platform e-ide driver revision 6.30
IDE-0 at 0x1F0-0x1F7 on IRQ 14.
IDE-1 at 0x170-0x177 on IRQ 14.
Per corregirlo, amb l'ajuda del fitxer ide.txt,
li vaig posar un paràmetre d'arrencada al kernel :
/etc/lilo.conf, i es va arreglar.
image ...
read-only
append = "ide1=0x170,0x376,15"
|
El cert es que em vaig fer un tip d'escriure al
Google
i ningú no em va fer gens de cas.
Ara m'he trobat amb la barrera dels 8 GB.
A la Int13h es fan servir 10 bits per seleccionar el cilindre (max 1.024 cyl),
8 bits per triar el capçal (max 256 heads),
i 6 bits per triar el sector (max 63 sectors, as "0" no es fa servir).
Multiplicant 1024 per 256 per 63, i assumint 512 bytes per sector,
obtenim un màxim de 8.455.716.864 bytes.
Mes barreres.
- Activació de la tarja Ethernet :
- al fitxer /etc/rc.d/rc.modules hi he posat insmod rtl8139
- al fitxer /etc/modules.conf hi he posat alias eth0 rtl8139
- he configurat la xarxa amb lisa, pero no s'activaba - ifconfig -a
- he modificat a mà el fitxer /etc/sysconfig/network-scripts/ifcfg-eth0
- DEVICE = "eth0"
- IPADDR = "1.2.3.2"
- NETMASK = "255.255.255.0"
- ONBOOT = yes
- la xarxa s'arrenca des /etc/rc.d/rc3.d/S01network
(soft link a /etc/rc.d/init.d/network)
que agafa parametres de /etc/sysconfig/network
(NETWORKING, HOSTNAME, IF_LIST)
Llavors crida /sbin/ifup que llegeix paràmetres
de /etc/sysconfig/network-scripts/ifcfg-eth0
(IPADDR, NETMASK, BROADCATS, ONBOOT)
- lsmod output :
Module Size Used by
rtl8139 11.804 1 (blank)
- multi-sessions :
- Alt-F7 : graphic boot screen
SuSE 6.4
- all configuration data is in /etc/rc.config
and all scripts are in /sbin/init.d
See /sbin/init.d/rc, called from /etc/inittab
After modifying /etc/rc.config,
run /sbin/SuSEconfig !
- el divertit va ser instalar la tarja Ethernet.
Al donar insmod ne.o des /lib/modules/2.2.14/net deia
unresolved symbol ei_open
unresolved symbol ethdev_init
unresolved symbol ei_interrupt
unresolved symbol ns8390_init
unresolved symbol ei_close
|
Això s'arregla veient que funciona aquesta sequència :
insmod -v 8390
insmod -v ne.o irq=5 io=0x340
Com es ISA, calia especificar dins /etc/modules.conf
alias eth0 ne
options ne IRQ=5 IO=0x340
Sense els parametres de IRQ i IO es queixava de Device Busy.
- lsmod output
Module Size Used by
ne . 1
8390 . 0 [ne]
- La configuració del TCP/IP es fa mitjançant yast.
SuSE 7.2
- El vaig agafar car té el suport de Token Ring incorporat.
-
Els tamanys de instalació son :
Minimum system : 185,04 MB
Minimum graphical system (without KDE) : 357,35 MB
Default system : 952 MB
Default system with Office : 1,26 GB
All packages : 5,15 GB
Es clar que no em cal Office, però sí el KDE.
Així, he tingut que treure packages a mà, com aquestos :
- Applications/Editors/Emacs - emacs (22 MB)
- Applications/Editors/Emacs - emacs-X11 (2 MB)
- Applications/File - mc - Midnight Commander (4 MB)
- Applications/Internet - lynx - text-based WWW browser (2 MB)
- Applications/Mail - mutt - Mail program (2 MB)
- Applications/Mail - pine - Mail program (4 MB)
- Applications/Networking - bitchx - IRC client (2 MB)
- Applications/Networking - openssh - secure shell client (3 MB)
- Applications/Networking - w3m - text based www browser (2 MB)
- Applications/News - tin - news reader (1 MB)
- Applications/Text - a2ps - ASCII to Post Script (2 MB)
- Applications/Text - iamerica - ispell dictionaries (5 MB)
- Development - gpp - GNU C++ compiler (2 MB)
- Development - liggpp - C++- libraries (2 MB)
- Development/System - ncurses-devel - New curses libs (6 MB)
- Documentation - howtoenh - HOWTOs (32 MB)
- Documentation - susetour_en - SuSE tour (9 MB)
- Networking/Daemons - i4l i i4lfirm : ISDN (14 MB)
- Utilities/Printing - gs_X11 - GhostScript for X11 (4 MB)
- Utilities/Printing - gs_lib + gs_fonts + filters - GhostScript for X11 (44 MB)
- X11/Window Managers - WindowMaker : window manager (4 MB)
- X11/Window Managers - fvwm2 : window manager (4 MB)
- X11/Window Managers - icons-xpm : icons in XPM format (13 MB)
- smbclnt : SAMBA client (11 MB)
Aquesta configuració requereix 710 MB.
- El instalador es el yast
- Els logs els posa (configurable mitjançant /etc/syslog.conf) a :
/var/adm/inst-log/*
/var/log/boot.msg
/var/log/messages
Aquí teniu una mostra de /var/log/messages
quan arrenca correctament el TP 760 ED amb una tarja Ethernet PCMCIA.
- La configuració del XF86Config es
mitjançant el sax.
Deixa un log a /var/log/StartLog i a /var/log/ServerLog.
També es pot fer servir XF86Setup, però es mes vell.
El resultat es guarda a /etc/X11/XF86Config.
- El X-server es reinicia amb Ctrl+Alt+BackSpace.
Per a qué serveix això ?
Per passar de modus "gràfic" a modus "consola", i/o quan hi ha problemes de configuració del X11.
- La configuració del sistema es fa
mitjançant el yast.
La xarxa es configura amb el path "System Administration", "Network Configuration",
"Network Base Configuration".
S'hi activa "Ethernet", "Auto-IP i DHCP", "Active".
- Interessant :
linux72:/etc # cat /proc/interrupts
CPU0
0: 103571 XT-PIC timer
1: 2629 XT-PIC keyboard
2: 0 XT-PIC cascade
8: 2 XT-PIC rtc
9: 610 XT-PIC eth0
10: 4 XT-PIC i82365
12: 383 XT-PIC PS/2 Mouse
14: 22626 XT-PIC ide0
NMI: 0
ERR: 0
MIS: 0
|
- La configuració de la xarxa es fa amb el netcfg
linux72:/etc # lsmod
Module Size Used by
af_packet 11648 1 (autoclean)
tulip_cb 33440 2
cb_enabler 2784 2 [tulip_cb]
serial_cs 5664 0 (unused)
ds 6896 2 [cb_enabler serial_cs]
i82365 23440 2
pcmcia_core 43936 0 [cb_enabler serial_cs ds i82365]
ipchains 33408 0 (unused)
|
- La configuració de la xarxa es als seguents fitxers :
- all data in /etc/rc.config
After modifying /etc/rc.config,
run /sbin/SuSEconfig !
- all scripts in /sbin/init.d
- /proc/devices ha de contenir "254 pcmcia" a la
secció "character devices".
Character devices (SuSE) Character devices (RH)
1 mem
2 pty
3 ttyp
4 ttyS
5 cua
7 vcs
10 misc
29 fb
36 netlink
109 lvm
128 ptm
136 pts
162 raw
254 pcmcia
Block devices
1 ramdisk
2 fd
3 ide0
7 loop
9 md
22 ide1
58 lvm
|
Red Hat 6.2 i 7.2
- Com vull fer servir el GPSIM,
i el SuSE es una mica especial ( no té eXdbm ni gtk+extra ),
m'he posat un Red Hat 7.2, amb un kernel 2.4.7-6, crec.
EL Red Hat 6.2 (kernel 2.2.14-5) em troba el PCMCIA, el i82365 i el TULIP
a la primera - el lsmod es perfecte, i el ping també.
- Tinc un altre disc dur de 1,2 GB ( ja van tres, amb el Caldera i el SuSE )
per posar-hi el Red Hat, amb KDE ( i no GNOME ).
- Es comença des DOS fent un disc botable i un altre amb drivers :
rawrite -f f:\images\boot.img -d a: f:\images\pcmcia.img
( posar un altre diskette )
rawrite -f f:\images\drvnet.img -d a: f:\images\pcmciadd.img
Després, es bota amb el primer floppy.
En escollir la opcio "text" no em demana el floppy de "drivers" !?!?!?
El mode "expert" sí que me'l demana,
però ha de treballar en modus gràfic.
Així, hi he posat una pantalla 9524.
No hi ha manera que em detecti el i82365.
Vaig a probar amb la imatge pcmcia.img ( amb els drivers de pcmciadd.img ).
- El Red Hat KDE ocupa 1064 MB d'entrada.
Els mòduls que he tret ( per a que capiga al disc dur ) ara son :
- Amusement/Games - fortune-mod (2,4 M)
- Applications/Archiving - cdrecord (0,9 M)
- Applications/Communications - licq (3,9 M)
- Applications/Communications - licq-kde (1,5 M)
- Applications/Communications - lrzsz (0,3 M)
- Applications/Editors - emacs (23,1 M)
- Applications/Editors - emacs-X11 (6,6 M)
- Applications/Editors - emacs-nox (3,1 M)
- Applications/Editors - psgml (0,5 M)
- Applications/Emulators - wine (16,7 M)
- Applications/Internet - exmh (2,7 M)
- Applications/Internet - metamail (0,3 M)
- Applications/Internet - mozilla (17,5 M)
- Applications/Internet - mozilla-mail (3,3 M)
- Applications/Internet - mozilla-psm (1,2 M)
- Applications/Internet - mutt (2,3 M)
- Applications/Internet - nmh (5,1 M)
- Applications/Internet - pine (4,0 M)
- Applications/Multimedia - ImageMagick (6,9 M)
- Applications/Multimedia - gimp (20,8 M)
- Applications/Publishing - a2ps (5,4 M)
- Applications/Publishing - ghostscript (22,9 M)
- Applications/Publishing - ghostscript-fonts (1,5 M)
- Applications/Publishing - jadetex (3,7 M)
- Applications/Publishing - tetex (37,4 M)
- Applications/Publishing - tetex-afm (3,9 M)
- Applications/Publishing - tetex-dvips (5,2 M)
- Applications/Publishing - tetex-fonts (27,9 M)
- Applications/Publishing - tetex-latex (20,4 M)
- Applications/Publishing - tetex-xdvi (1,0 M)
- Applications/Publishing - xpdf (3,1 M)
- Applications/System - isdn4k-utils (6,4 M)
- Applications/System - samba-client (2,4 M)
- Applications/System - samba-common (5,0 M)
- Applications/System - tamago (2,1 M)
- Applications/System - usbview (0,5 M)
- Applications/System - xisdnload (0,0 M)
- Applications/Text - aspell (7,6 M)
- Applications/Text - openjade (16,4 M)
- Developmet/Languages - pygnome (1,1 M)
- Developmet/Languages - python (7,8 M)
- Developmet/Libraries - 4Suite (7,1 M)
- Developmet/Libraries - PyXML (3,1 M)
- Developmet/Libraries - lesstif (3,9 M)
- Developmet/Libraries - libxml2 (0,8 M)
- Developmet/Libraries - libxslt (0,7 M)
- Developmet/Libraries - pythom-xmlrpc (0,1 M)
- System Environment/Daemons - esound (0,5 M)
- System Environment/Daemons - ntp (2,3 M)
- System Environment/Daemons - printconf (1,9 M)
- System Environment/Libraries - Mesa (2,5 M)
- System Environment/Libraries - arts (3,3 M)
- System Environment/Libraries - foomatic (17,0 M)
- System Environment/Libraries - gnome-libs (3,1 M)
- System Environment/Libraries - libxml (1,4 M)
- User Interface/Desktops - kdebindings-mozilla (0,1 M)
- User Interface/Desktops - koffice (34,5 M)
- User Interface/X - ttfonts-ja (14,2 M)
Això fa una installació de 816 MB.
- El log de l'installació el posa a /tmp/install.log.
El log del sistema es a /var/log/messages.
Un exemple de quan no troba la tarja ethernet.
- La partició del disc dur de 1,2 GB es :
hda1 1-540 1063 MB /
hda2 541-589 96 MB swap
Si posava /boot" en un altre disc, el mkbootdisk no trobava el kernel ...
La partició de "swap" ha de ser del doble dela RAM disponible,
amb un màxim de 128 MB de swap.
- La configuració del X-server es a /etc/X11/XF86Config.
Per detectar el hardware es pot fer servir el SuperProbe.
Per activar el X-windows s'ha de fer servir la comanda startx,
que arrenca el servidor X i executa les comandes que troba a ~/.xinitrc,
que engega els clients X a activar.
Be sure that the last command in .xinitrc is started with exec.
Otherwise, the X server will shut down as soon as it has started
the clients in .xinitrc
Possibles clients : xterm, xclock, wmaker.
The server controls the display directly and is responsible for all input/output
via the keyboard, mouse or display.
The clients do not access the screen directly; they communicate with the server.
- Per saber quina versió de X11 tenim instalat,
i quin driver de pantalla ferà servir :
/etc/X11/X -> symbolic link, as ../../usr/X11R6/bin/XF86_SVGA
SuSE 7.1 : /usr/X11/bin/X -> /var/X11R6/bin/X -> /usr/X11R6/bin/XF86_SVGA
SuSE 8.1 : /usr/X11/bin/X -> /var/X11R6/bin/X -> /usr/X11R6/bin/XFree86
Els links
(and "setup in a nutshell"),
per versió, son :
- 3.3.6 - /usr/X11R6/bin/XF86_SVGA
- 4.x - /usr/X11R6/bin/XFree86.
- La configuració del sistema es fa
mitjançant el linuxconf, que pertany al RPM
linuxconf-1.25r7-2.i386.rpm del RedHat 7.2 CD 2.
- La configuració del sistema X Window es fa mitjançant
el Xconfigurator (6.2)
Mireu el
manual.
- La configuració de la xarxa es fa mitjançant
la comanda netconfig, que es el mateix que editar
/etc/sysconfig/network-scripts/ifcfg-eth0
a la versió 6.2 !
[RH62@mitp /etc/sysconfig] cat network
NETWORKING=yes
HOSTNAME="mitp.midom"
GATEWAY="9.131.242.1"
GATEWAYDEV=""
FORWARD_IPV4="no"
NISDOMAIN=""
[RH62@mitp /etc/sysconfig] cat pcmcia
PCMCIA=yes
PCIC=i82365
PCIC_OPTS=
CORE_OPTS=
[RH62@mitp /etc/sysconfig/network-scripts] cat ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
HOSTNAME=mitp
DOMAIN=par.es.hal.com
IPADDR=""
NETMASK=""
ONBOOT="yes"
- La personalització es fa a
/etc/profile (system wide environment and startup programs)
i/o /etc/bashrc (system wide functions and aliases).
En RH, els alias de root es defineixen a /root/.bashrc i la resta, a ~/.bashrc.
- En el KDE, es pot canviar entre "desktops" mitjançant ALT + Tab.
- Hi ha varies sessions en mode text.
S'escullen amb ALT+Fn, on "n" va de 1 fins a 6.
També es pot passar de una a la seguenta amb
"Shift" + "Cursor Left" (baixar) o "Shift" + "Cursor Right" (pujar).
- Enviar correu a Lotus Notes :
- al fitxer /etc/sendmail.cf, posar
DSrelay.uk.ibm.com
- per enviar el fitxer ./fa.txt
al destinatari sag@tinet.org
amb copia a altemir@es.hal.com
hem de executar
fastmail -c altemir@es.hal.com -s SbjctTest ./fa.txt sag@tinet.org
- Gotchas de
RH 7.1 (intranet)
and web.
SuSE 8.1
La configuració (de xarxa) ja NO es troba a /etc/rc.config
Ara, es standard : /etc/sysconfig/network/ifcfg-eth-pcmcia-0
SuSE 8.2
New file
Debian 2.2 r5i3
- l'escollim perque té MCA, el SCSI i el Token Ring.
- from
this
manual, we get :
- minimal requirements : 12 MB memory, 64 MB disk.
- MCA network cards are not supported by the standard installation system.
- sound devices are not supported by default.
- partitioning scheme :
- there isn't much point in going over 64 MB of swap for most users
- it shouldn't be smaller than 16 MB
- com que no tenim CD,
intento fer anar el NFS per copiar el CD de Debian a un disc local.
El client es el nurantacinc i el servidor el tp760,
que comparteix de CD (sota RH 6.2).
- server : modify /etc/exports so it contains
/mnt/cdrom nurantacinc(ro)
/sharedtp760 nurantacinc(ro)
|
- server : verify portmapper is running : rpcinfo -p
- server : verify NFS mount daemon is started : ps aux | grep rpc,
and you should see
root 727 0.0 1.3 1236 648 ? S 14:04 0:00 rpc.mountd
|
- server : if not, start NFS mount daemon : rpc.mountd
- server : start remote quota server : rpc.rquotad
- server : read /etc/exports again by exportfs -ra [RH only]
- server : verify NFS (file) server process is started : ps aux | grep nfs,
and you should see
root 768 0.0 0.0 0 0 tty1 SW 14:06 0:00 [nfsd]
|
- server : if not, start NFS server process : rpc.nfsd
Otherwise, you get the message
"nfssvc: address already in use"
- server : display nfs status with /etc/rc.d/init.d/nfs status
rpc.mountd (pid 766) is running ...
nfsd (pid 769) is running ...
rpc.rquotad is stopped
|
- server : automate daemons start by
- server : verify shared filesystem is available with
mount /mnt/cdrom
and
df
- server : verify shared filesystem is available with
cat /proc/fs/nfs/exports
- client : rpcinfo -p tp760,
and you should see
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100021 1 udp 1024 nlockmgr
100021 3 udp 1024 nlockmgr
100021 1 tcp 1024 nlockmgr
100021 3 tcp 1024 nlockmgr
100024 1 udp 912 status
100024 1 tcp 914 status
100005 1 udp 666 mountd
100005 1 tcp 668 mountd
100005 2 udp 671 mountd
100005 2 tcp 673 mountd
100005 3 udp 676 mountd
100005 3 tcp 678 mountd
100003 2 udp 2049 nfs
100011 1 udp 927 rquotad
100011 2 udp 927 rquotad
|
Podemos observar que tenemos version 2 de NFS.
- client :
-
mount -t nfs tp760:/mnt/cdrom /tp760
df gets
Filesystem 1k-blocks Used Available Use% Mounted on
tp760:/mnt/cdrom 651.818 651.818 0 100% /tp760
|
cp /tp760/base2_2.tgz /tmp/. gets
NFS not responding, still trying
|
-
mount -o soft tp760:/sharedtp760 /tp760
From the client, we issue cat /tp760/zz and get
cat: /tp760/zz: Input/output error
|
- DF problem and circumvention
.-------------. .-----------. .-----------. .---------------.
| tp760 | ---> | 9.136.0.1 | ---> | 9.136.7.1 | ---> | pc9595 |
| eth0 | .-----------. .-----------. | tr0 |
| | | |
| 9.136.0.193 | .-----------. .-------------. | 9.131.242.231 |
| mtu=1500 | <-- | 9.136.7.2 | <--- | 9.131.242.1 | <-- | mtu=2000 |
.-------------. .-----------. .-------------. .---------------.
- Problema
El ping pc9595 -s 2500 des el tp760 dona
Frag reassembly time exceeded
El ping tp760 -s 2500 des el pc9595 dona
from Gateway(9.131.242.1): Frag needed and DF [don't fragment] set (MTU=1500) [as tp760]
netstat -s mostra fragments dropped and
packet reassembles failed.
- Solució
Al client, fer mount -o soft,rsize=1024,wsize=1024 tp760:/sharedtp760 /tp760
-
URL :
where are the ICMP packets ?
- Question : how to remove the DF flag (in PING packets) ?
- Question : what system do I have with "no_defrag" message at startup ?
- server : debug
We set echo "72" > /proc/sys/sunrpc/nfsd_debug
- client :
- cd /diskID5
- cp /tp760/dists/potato/main/disks-i386/current/base2_2.tgz .
- poso un CD-ROM SCSI, amb ID=3.
Dins dmesg es veu
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 3, lun0
sr0: scsi-1 drive
Uniform CD-ROM driver Revision:3.12
Per muntar-lo, dono mount /dev/scd0 /mnt/cdrom.
Dins /etc/fstab, hi poso
/dev/scd0 /mnt/cdrom iso,noauto,ro 0 0
- anem a instalar el Debian,
vinga
!
O també ftp://debian.linux.ibm.com
Les versions testing de
Debian
se'n diuen sarge
mentre que les unstable
se'n diuen sid
Comandes interessants
- "du . --max-depth=1 -m -h" : veure tamany directoris
- Les comandes de
Caldera son a /usr/man/whatis.
Compte : ocupa 107 K !
- Els paquets instalats de SuSE 7.2
tenen una entrada a /usr/share/doc/packages.
Cada comanda es un directori, amb BUGS, INSTALL, MANUAL, etc.
Per buscar una comanda o veure si es instalada, quan ocupará,
es molt pràctic el "SuSE help-center".
- Els paquets instalats de Red Hat 7.2
tenen una entrada similar a /usr/share/doc/.
- Es molt interessant el fitxer /etc/fstab, que conté els
perifèrics coneguts.
Per exemple, s'hi pot comprovar que
SuSE del floppy en diu /media/floppy a 7.2,
en diu /floppy a 6.2,
mentre RedHat n'hi diu /mnt/floppy.
El fitxer /etc/mtab conté els perifèrics activats (muntats).
- Es també interessant el fitxer
/etc/rc.d/rc.sysinit, que només s'executa un cop cada "boot".
S'ha de mirar en paralel amb less /var/log/messages.
Buscant millor, podem veure que rc.sysinit es crida des /etc/inittab.
Aquí s'expliquen els runlevel, de 0 a 6.
Per a més informació, fer man init,
que jo diria que es de lectura molt recomenable.
N'he fet una pàgina .
- Es impresionant ho bé que va el TAB, el vell tabulador.
Proba-ho !
En una command-line, pica dues lletres ("st", per exemple) i
després 2 cops TAB.
Surtem totes les possibles comandes que comencen per "st".
Si nomes n'hi ha una, te la posa directament a la command-line amb el primer TAB.
Aixó també es vàlid per noms de fitxers !
Si hem de fer un "RPM", per exemple, només cal posar les primeres
lletres en lloc de la ristra que hi ha al seu nom.
Recorda : TAB.
- Fantàstic el servei proporcionat per el man
Usualy under
/usr/local/man
/usr/share/man
/usr/X11R6/man
Sections :
- man 1 intro - introduction to user commands
- man 2 intro - introduction to system calls
man 2 bind
man 2 pipe
man 2 socket
- man 3 intro - introduction to library functions
man 3 string
- man 4 intro - introduction to special files
- man 5 intro - introduction to file formats
- man 6 intro - introduction to games
- man 7 intro - introduction to conversions and miscelany section
- man 8 intro - introduction to administration and privileged commands
- Al fitxer /etc/hosts hi posem els nicknames
( o aliases ) de les adreçes IP mes conegudes.
Es fa servir si /etc/host.conf conté "order hosts,bind".
-
When a program is executed, the process running the program opens three file
descriptors, which are places the program sends its output and gets its input
from : 0 (standard input), 1 (standard output), and 2 (standard error).
The redirect output symbol (>) is shorthand for 1>,
which tells the shell to redirect standard output.
Similarly, < is short for <0, which redirects standard input.
The symbols 2> redirect standard error.
cat x y 1> hold1 2> hold2
cat x y 1> hold 2>&1 file descriptor 2 to be duplicate of file descriptor 1.
ls > dirlist 2>&1 direct both standard input and error to file dirlist
ls 2>&1 > dirlist only standard output to dirlist
X > /tmp/x.out 2>1
See page 487.
- Es molt interessant el
PERFIL, per personalitzar els Alias de Linux, el PATH, etc.
- Al Caldera ( amb BASH ) es el fitxer ".profile-private" del directori $HOME.
- Al SuSE 7.2 ( amb BASH ) , per el (x)Terminal, es el fitxer /etc/profile.
- On RedHat 7.2 ( with BASH ) , the environment is set at /etc/profile,
and system wide functions and aliases are set at $HOME/.bashrc (even Xconsole),
o /etc/bashrc.
Per exemple, per modificar el $PATH, hi posem :
PATH="$PATH:/home/usuari/funcions:"
Tip for newcomers :
learn the sequence of initialization files that occurs before you get
to a command prompt, and understand the difference between
profile/login initialization and rc subshell initialization.
|
(from ~/.bashrc)
Bash knows 3 shells :
- login shell - ~/.profile
- normal shell
- interactive shell - ~/.bashrc
See diferences at "man bash" at Knoppix ! (login shell and interactive shell)
-
To display all lines in the file1 file
that match either the abc or xyz string, enter:
grep -E "abc|xyz" file1
-
In bash, you can make the cd command a little smarter by setting the CDPATH
environment variable. If you cd to a directory, and there's no directory by
that name in the current directory, bash will look for it under the
directories in CDPATH. P.ej.
export CDPATH=$HOME/se:$HOME/se/selinux:$HOME/se/selinux/src
- Rexx per Linux : read
here
- Engegar amb command line o X-windows ?
Es tria al fitxer /etc/inittab, que pot tenir
id:3:initdefault
o
id:5:initdefault
I, cap el final
x:5:respawn:/usr/bin/X11/xdm -nodaemon
o
x:5:respawn:/opt/kde/bin/kdm -nodaemon
See page 147.
Una manera mes dinàmica es :
LILO: linux 5
- Hot Keys
- stty -a displays actual settings
- intr will become SIGINT
- $ stty intr ^Q sets Ctrl-Q to generate SIGINT.
- termios(3) explains some of the low level user programming
used to associate terminal-generated control characters to signals.
Lew Pitcher
- Devices interessants i nomenclatura.
Veure
"device names",
o
man fdisk
o
hdparm
- discs IDE : /dev/hd[a-h]
-
/dev/hda1 = primera partició primaria del primer disc IDE. In GRUB, it becomes hd0
-
/dev/hda5 = primera partició lògica del primer disc IDE.
-
/dev/hdb = segon disc IDE, slave disk on primary IDE controller.
-
/dev/hdc = tercer disc IDE, master disk on secondary IDE controller.
-
/dev/hdd = quart disc IDE, slave disk on secondary IDE controller.
- discs SCSI : /dev/sd[a-p]
Així, /dev/sda es el primer disc SCSI.
/dev/sda1 = primera partició del primer disc SCSI.
- discs ESDI : /dev/ed[a-d]
- discs XTI : /dev/xd[ab]
- CD-ROM : /dev/scd0, also known as /dev/sr0.
- disc floppy : /dev/fd0
Si a la comanda mount /dev/floppy ens dona el missatge
only root can mount /dev/fd0
then include user in /etc/fstab, near noauto.
- ports : /dev/ttyS0 = COM1 (0x03F8h, IRQ=4), /dev/ttyS1 = COM2 (0x02F8h, IRQ=3)
- IDE : ide0 (0x1F0-0x1F7, 0x3F6, IRQ14) ide1 (0x170-0x177, 0x376, IRQ15)
- This should cause the modem
(assuming it's on COM4 in Windows-speak)
to dial the phone number 555-1234 :
echo "ATDT555-1234" > /dev/ttyS3
- Una cosa curiosa es el directori proc.
- cat /proc/cmdline : veure com s'ha arrancat el kernel,
- cat /proc/interrupts | grep ide : see disk activity.
- procinfo : display system status gathered from /proc
- cat /proc/cpuinfo - veure CPU
- cat /proc/meminfo - memoria, as top (més elegant)
- Kernel modules - are services that are included in the kernel as needed,
and removed from memory when done.
Have a look at /lib/modules
Advantadges :
- very convenient under tight memory constraints.
- if the harware configuration is not known at boot time, then loading
the drivers as modules allows to first query (or set) the hardware before
loading the code.
- modules are not bound by the GPL, so developers are free to create binary
modules and distribute them without needing to release their source code.
Related commands :
- lsmod - list loaded modules.
- rmmod - unload loadable modules.
Used by kernel on modules loaded with the -k flag.
- depmod - handle dependency descriptions for loadable kernel modules.
Use depmod -ae to solve all dependencies.
From "help depmod" : depmod creates a makefile-like dependency file,
based on the symbols it finds in the set of modules mentioned in the
configuration file. This dependency file is later used by modprobe
to aumatically load the correct module or stack of modules
- insmod - install loadable kernel modules.
- modprobe - high level handling of loadable modules.
Using modprobe eth0 rather than insmod 3c509
will try to use the alias in /etc/modules.conf rather than the real module name.
modprobe functions in much the same way as insmod,
but it also loads any other modules that are required by the module
you want to load.
- other : ksyms, modules, modinfo, modules.conf.
- Very good on-line book.
- Kernel commands and utilities
- klogd - kernel log daemon.
- ksymoops - decode kernel Oops.
- objdump - display information from object files.
- Spend some time reading this book.
- Security bits.
When a file is created, it is assigned security permissions.
There are 3 levels of security : user, group and other.
Also, file attributes are defined (modified using chmod) :
- 4000 - SetUID on execution (changes to userid 0 upon execution).
- 2000 - SetGID on execution (changes to system group upon execution).
- 1000 - Set the sticky bit (leave the program in swap space).
Useful commands :
- chmod g=r filename : afegir permís de lectura pel grup (u/g/o/a, r/w/x)
- $ chmod +x prog-name : make it executable
- find / -perm +4000 : display all SUID files
- find / -perm +2000 : display all SGID files
- cd - : go to previous directory !
- file system structure
- /bin - executables for every user
- /boot - kernel images, system map, bootstrap, etc
- /dev - special files that represent hardware devices
- /etc - configuration files
- /home - user's home directories
- /lib - system libraries
- /mnt - system mount points for other filesystems
- /proc - virtual file system containing kernel and process info
- /root - home directory for root user
- /sbin - system admin executables, system scripts
- /usr - Unix System Resources
- /usr/src/linux - kernel source
- /usr/doc - documents by package,
as /usr/doc/x3270-3.1.1.9/Docs/Resources.
Maybe under /usr/share/doc, look for index.htm under
- /HOWTO/en-html
- /FAQ/Linux-FAQ
- partition planing
- /
- /home
- swap
- /boot (if you have cylinder problems)
Others could be :
Reasons :
- Security : set /boot partition read-only
- Isolating : /home and /var, so root partition doen't get filled.
- Convenient : /home and /usr, so upgrades keep desktop info.
- arrencada del daemons
- rpc.portmap - sota RH 6.2 des /etc/rc.d/rc3.d/S11portmap
- rpc.mountd ?
- rpc.nfsd ?
- how to restart a daemon :
- syslogd (to read /etc/syslog.conf)
- inetd (to read /etc/inetd.conf)
# kill -SIGHUP inetd ( or # kill -HUP - SuSE 7.2)
or
# /etc/rc.d/init.d/inetd restart (reload ? SuSE 7.2)
- loopback device - ara l'estic estudiant.
- man losetup
- The
Loopback Root Filesystem HOWTO
- 127.0.0.1 is the loopback interface,
which you will have even if you have no real network connection.
- lo interface - this interface is
for packets from a local process that are destined for a local process.
See page 511.
-
En un
Mailing List, he trobat
It is configurable.
options loop max_loop=n
in modules.conf, or if youre using it builtin
max_loop=n at kernel options.
- Steps for loop mounting under Linux
Loop mounting an ISO file under Linux allows you to view and use the ISO file as if you have burned it to a CD.
No CD writer or blank CDs are required to do this.
You must login as root to use the following commands.
/mnt/path must exist (mkdir -p /mnt/path)
To loop mount an ISO file using Linux run
mount -t iso9660 openlinux.iso /mnt/path -o loop,ro
After the ISO is mounted you can
cd /mnt/cdrom
to use the CD as if it was in your drive.
When finished use the command
umount /mnt/cdrom
to unmount the ISO file.
You cannot be in the /mnt/cdrom directory when you run these commands.
Before : losetup /dev/loop0 /home/theISOS/rh7.3.1.iso
After : losetup -d loop0
We are assuming that you already have a CD/DVD in your SLED/SLES base machine.
Now we want to create ISO image of that CD/DVD.
Using DD command:
person@NOVELLDESK:~> dd if=/dev/cdrom of=SLED.iso
Using the CAT command you can achieve same result:
person@NOVELLDESK:~> cat /dev/cdrom > SLED.iso
Lets use it.
We are assuming that you are in same directory in which you have created the ISO of your CD/DVD.
First create the mount directory. Second, mount it. Third, use it :
person@NOVELLDESK:~> sudo mkdir /mnt/ISO
person@NOVELLDESK:~> sudo mount SLED.iso -o loop /mnt/ISO
url
- md5 - ara l'estic estudiant.
Si anem a ftp://raleigh.linux.ibm.com/pub/SuSE/i386/en/8.0
veurem que hi ha un fitxer de tipus md5.
- Qué es ?
When you download a file, you can use MD5 to guarantee that you have
the correct, unaltered file by comparing its hash with the original.
You are essentially verifying the file's integrity.
- Com es fa servir ?
- modem - ara l'estic estudiant.
Few PPP
scripts.
- Recuperar el Main Boot Record (SuSE 7.2) :
lilo -u /dev/hda
- Shell commands (use "help" at bash)
alias /unalias bg / fg cd
echo eval exec
exit export help
popd pushd pwd
set / unset type umask
- Si has fet un cat de un fitxer binari, et pot quedar la configuració de la pantalla en modus gràfic.
Per recuperar-lo, es pot fer un reset.
- Veure els processos que consumeixen CPU : top (root only).
- how to set the date :
p9111-520:~ # date 11241431 { means MMDDhhmm - no Year ? }
Wed Nov 24 14:31:00 CET 2010
p7029-6E3:~ # date -s "11 NOV 2011 12:35:00"
Fri Nov 11 12:35:00 CET 2011
- Trucs LS :
- dir /od = ls -alt
- dir /os = ls -alrS
- Verificar i reparar el sistema de fitxers (as chkdsk) : fsck (root only).
FSCK(8) FSCK(8)
NAME
fsck - check and repair a Linux file system
SYNOPSIS
fsck [ -sAVRTNP ] [ -C [ fd ] ] [ -t fstype ] [filesys ... ] [--] [ fs-
specific-options ]
DESCRIPTION
fsck is used to check and optionally repair one or more Linux file systems.
filesys can be a device name (e.g. /dev/hdc1, /dev/sdb2),
a mount point (e.g. /, /usr, /home),
or an ext2 label or UUID specifier (e.g. UUID=8868abf6-98b8-bfc24057f7bd or LABEL=root).
- Esborrar el LILO del MBR ( Master Boot Record ) :
boot a DOS floppy with FDISK.EXE and run FDISK /MBR.
- Network configuration, files and programs
resolv.conf configures the DNS client. Not present => disabled.
modules.conf configure the devices
- Network troubleshooting
[URL]
ifconfig -a see own devices, IP + Bcast address, Mask, etc. [root]
ifconfig eth0 down bring down the Ethernet interface
ifconfig eth0 up bring up the Ethernet interface
ping localhost verificar accés al protocol
ping <IP propia> verificar accés a la interficie
ping -f [host] : flood ping
route view routing table and Gateway
ping <IP GW> verificar accés al gateway (default router)
ping www.cdrom.com verificar accés al DNS
netstat display the status of all TCP/IP network services
traceroute maps out the route a packet takes to the target host
tcpdump packet sniffer
RH6.2 - tcpdump-3.4-19.rpm
Better is snort.
whois as whois seattlewireless.com
strobe try to open every socket sequentially
nmap utility to scan the port use
fuser identify the process using a file or a socket
lsof list of open files
lsof -i -n -P
arp -a display what machine has a given MAC
nslookup / dig convert IP to name or viceversa
|
arp manage the ARP (Address Resolution Protocol) cache
nslookup convert IP address to name. gethostbyaddr (?)
getent get entries from administrative database
dig as nslookup and more
Al SuSE 6.4, el tamany màxim del ping es 65467.
Al Caldera 2.4, 65.469 diu "too large",
però 65.468 (i 65.466) fa un "dump",
i 65.467 (i 65.465) senzillament no va.
169.254.64.0 is a network reserved for autoconfiguration.
- FTP and Telnet configuration
If /var/log/secure contains
localhost in.ftpd : cannot execute /usr/sbin/in.ftpd
then install FTP Server : wu-ftp ( "rpm -q wu-ftpd" )
localhost in.telnet : cannot execute /usr/sbin/in.telnetd
then install Telnet Server : telnet-sever ( "rpm -q telnet-server" )
FTP service is controlled from the /etc/inetd.conf file.
The line looks like
ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a
and is automatically invoked whenever someone connects to the FTP port.
Ports are logical associations from a network connection to a specific service.
See the /etc/services file for the complete list.
FTP uses port 21.
When a connection is detected, the FTP daemon /usr/sbin/in.ftpd
is invoked and the session begins.
Before you are asked for a user, ftpd is started.
The ftpdaemons (a wu) are initiated as root
(try opening an ftp connection from command prompt)
before you log-in, the process will be running as root, but as soon as
you log-in as a user, the ftpd will be suexeced to your username.
You can easily monitor the process with ps aux | grep ftp[d]
and see how it happens.
/etc/ftphosts file which lists hosts that *are not* allowed to use ftp.
/etc/ftpusers file which lists users that *are not* allowed to use ftp.
All ftpd files come from wu-ftpd package (RH 6.2).
If FTP into your machine fails after a large timeout (client sees
connected, but not FTP server ready), you have a problem
with /etc/resolv.conf.
Thanks again, Albert.
- Veure qui té una adreça IP : nslookup o dig.
Veure quina màquina té una adreça MAC : arp -a.
- Text-mode browser : lynx
Configuration file : /usr/lib/lynx.cfg (SuSE 7.2)
So, to install Nessus, we can use :
lynx -source http://install.nessus.org | sh
Or, to convert HTML to ASCII, use :
lynx -dump source.html > ascii.txt
See the /etc/lynx.cfg file !
- *** Get a network sniffer for ETH0 LAN ***
- Veure els processos actius : ps -A o pstree -d o top
La comanda que segueix es kill.
- Veure qui hi ha conectat i que fa : w.
La comanda who treu informació similar.
- Veure el LOG del sistema : dmesg.
Una manera mes pràctica es dmesg | less.
- Veure el LOG del sistema dinàmicament :
tail -f /var/log/messages.
I anem a un altre command-line i fem l'acció que volem monitoritzar.
- Símbols de la imatge del VMLINUZ : /boot/System.map
Símbols dels mòduls del kernel : ksyms (su only).
Pots veure
els de SuSE amb PCMCIA i TCP/IP funcionant.
- Configuració del(s) disc(s) dur(s).
La paraula clau es fdisk.
S'hi ha de tenir molt de compte.
La part "descriptiva" es la comanda fdisk -l, que treu un llistat
de tots els discs i les seves particions. Per exemple :
Disk /dev/hda : 64 heads, 63 sectors, 589 cylinders
Units = cylinders of 4032 * 512 bytes.
Device Start End
/dev/hda1 1 9 Linux ("/boot")
/dev/hda2 10 58 Linux Swap
/dev/hda3 59 589 Linux ("/")
La llista de possibles tipus de particions és :
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Nowell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Nowell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
- ldd - "List Dynamic Dependencies",
print shared library dependencies.
- ldconfig - determine run-time link bindings. Rebuilds the cache.
Result is /etc/ld.so.conf
The directory in which a (new) dynamic library is installed
must
/etc/ld.so.conf, and ldconfig must be run after that.
- ln - make links between files.
ln [option] TARGET LINK_NAME
Samples :
ln /usr/local/bin x (hard link)
ln -s /etc/init.d/pcmcia S08pcmcia (soft link)
If some program (as rpm) has problems following links,
use namei to display the real path.
- tar archiving utility -
Manual (1 big page).
|
-t : list contents
-c : create
-x : extract
-f : filename follows
-u : update
-v : verbose
-z : use gzip
tar -xzf foo.tar.gz blah.txt = extract the file blah.txt from foo.tar.gz
tar -czf tot.tar *.c = create
Compte !
cd /home/sebas/cmds
tar -czf /home/sebas/prova/uno.tgz *
tar -tf uno.tgz
aturar_VMX.sh
crear_backup.log
pero
tar -czf dos.tgz /home/sebas/cmds/*
tar -tf dos.tgz
home/sebas/cmds/aturar_VMX.sh
home/sebas/cmds/crear_backup.log
|
- grep - print lines matching a pattern.
The command takes the form :
grep pattern flags [file]
Main flags recognized by grep :
-c print only a count of matching lines.
-i ignore case distinctions in comparisons.
-l print only the name of each input file tha contains a matched line.
-n print the line number of each matched line.
-r read all files under each directory. *** does NOT work (SuSE 7.2) ***
-v reverse the sense of the matching, so that only unmatched lines are printed.
Es a dir, el grep fa búsqueda dins de fitxers.
grep -i 'hello.*world' *.c main.h
Si no volem que la shell amb la busqueda surti com a resultat,
posarem "sqare brackets" en alguna lletra del pattern :
... then it matches "portmap", but it does not match "por[t]map",
One from O'Reilly "Essential System Administration".
ps aux | grep "portmap"
bin 288 0.0 0.9 1212 428 ? S 08:24 0:00 portmap
root 891 0.0 1.0 1360 504 tty2 S 10:36 0:00 grep portmap
ps aux | grep "por[t]map"
bin 288 0.0 0.9 1212 428 ? S 08:24 0:00 portmap
- find - find files.
find / -name access_log 2>/dev/null discard error messages
find / -size +100000000c show files larger than 100 MB
Here's a good
intro, and
here is another.
- shortcuts
- CTRL + ALT + BACKSPACE : exit X server.
- CTRL + ALT + "+" : change video resolution.
- tree - visualizador de directorios.
Get it here
by selecting tree-1.2.tgz
- rdev - query/set image root device,
swap device (swapdev, rdev -s),
RAM disk size (ramsize, rdev -r),
video mode (vidmode, rdev -v) or
rootflags (rootflags, rdev -R). (root only)
This is, rdev outputs /etc/mtab for the current root file system.
- .iso - what to do with an ".iso" file
Jo tinc "Adaptec Easy CD Creator" versió 3.01a (284), i
faig "File" + "Create CD from Disk Image" ... fàcil !
You can use it, without burning a CD !
To create a ".iso", see mkisofs !
Thanks, Albert.
- dd - convert and copy a file
Per crear una imatge de un diskette en 1 sol fitxer, es dona :
[sebas@mitp img] dd if=/dev/fd0 of=pm60_1.img
El tamany ha de ser de 1.474.560, que son 1440 de 1024 bytes.
Per inicialitzar un DASD (esborrant el vell contingut), es millor fer servir :
[sebas@s390] dd if=/dev/zero of=/dev/dasdf
- motd - message of the day.
The text in file /etc/motd is displayed after a successful login.
- envir seting to edit cmd line:
set -o vi
set -o emacs
-
The "^M" things are from dos/windows files: DOS carriage returns are "\n\r", unix "\n".
The extra character shows up as "^M".
Use dos2ux (or dos2unix depending on your flavor of unix) to convert windows text files.
- vi - Linux editor. See man vi for syntax highlighting.
vi is in one of two modes : text (input) or command.
You can enter command mode by hitting ESC.
|
Moving within a Line
h = left
j = down
k = up
l = right
0 = ir al inicio de la linea
$ = ir al final de la linea
Moving by Line Position
H = move the cursor to the top line on the screen.
L = move the cursor to the last line on the screen
M = move the cursor to the middle line on the screen
Moving by Redrawing the Screen
z = redraws the screen with the current line at the top of the screen
z- = redraws the screen with the current line at the bottom of the screen
z. = redraws the screen with the current line at the center of the screen
/<string> go forward to next line containing "string"
n do the last command again, repeat previous search
A ("a" upper) add text at the end of the line
D ("d" upper) delete to end of line
dd delete a line and put it in the buffer ("4dd" deletes 4 lines)
r <return> split line (replace Blank by RET.
J ("j" upper) join current line and following line
u undo last change
x delete a character
y yank : copy the highlighted text into a register.
yy yank a line - put it in the buffer ("4yy" yanks 4 lines)
p add the buffer past the cursor position.
P ("p" upper) add the buffer before the current location.
+<number> move "number" lines forward.
-<number> move "number" lines backward.
r [file] insert [file] after cursor
1 go to first line of file (:1<intro>)
$ go to last line of file (:$<intro>)
: go to a command prompt
:%s/up/right/ substitute "up" for "right" for first thru last
:w write the file to disk
:q! quit editing, discard changes
:wq! write to disk and quit editing
|
Here's Top Ten
Tips,
some
more
and
all
Edit /etc/vimrc :
" enable syntax highlighting
so ${VIMRUNTIME}/syntax/syntax.vim
Edit bt : xterm -bg black -fg white -geometry 120x60 -e vi $1 &
chmod 777 bt
bt filename
- CoolEdit - Linux editor.
Download at SourceForge
or
Home.
- Hex editors :
- od -h hda_mbr.img (*** warning : swaps bytes ***)
- khexdit hda_mbr.img (*** best, GUI ***)
- emacs hda_mbr.img (not yet in hex)
- hexdump hda_mbr.img (*** best, command line ***)
- Manegament de usuaris ( es recomena linuxconf )
- useradd (or adduser)
Es crea un usuari amb la clau bloquejada (use passwd)
- userdel
- passwd
Si volem desbloquejar la password d'un usuari, fem passwd -u -f sebas.
Després, el usauri ferà passwd per posar-s'en una.
- force user to change the password : chage -M 0 nomusuari
-
Manual RH 7.0
- PCMCIA
- Ordres
- cardctl config -
SuSE RH
Socket 0 no pcmcia driver in /proc/devices
not configured (no card)
Vcc 3.3V Vpp1 3.3V Vpp2 3.3V
interface type is "cardbus"
irq 5 [exclusive] [level]
function 0:
io 0x0100-0x017f [32 bit]
- cardctl status -
SuSE RH
Socket 0 no pcmcia driver in /proc/devices
no card (no card)
3.3V CardBus card
function 0: [ready]
- cardctl ident -
SuSE RH
Socket 0 no pcmcia driver in /proc/devices
no product info available
product info: "IBM", "10/100 EtherJet CardBus", "IBMC-10/100", "1.04"
manfind: 0x00a4, 0x0113
function: 6 (network)
PCI id: 0x115d, 0x0003
- lsmod -
SuSE RH
af_packet 11648 (autoclean) pcmcia-core (only)
ds 6896
i82365 23440
pcmcia_core 43936 [ds i82365]
ipchains 33408 (unused) *** no card ***
tulip_cb 33440
cb_enabler 2784 [tulip_cb]
af_packet 11648 (autoclean)
ds 6896 [cb_enabler]
i82365 23440
pcmcia_core 43936 [cb_enabler ds i82365]
ipchains 33408 (unused) *** eth0 ***
serial_cs 5664
tulip_cb 33440
cb_enabler 2784 [tulip_cb]
af_packet 11648 (autoclean)
ds 6896 [serial_cs cb_enabler]
i82365 23440
pcmcia_core 43936 [serial_cs cb_enabler ds i82365]
ipchains 33408 (unused) *** eth0 + mdm ***
- lspci - list all PCI devices.
El mode "super-verbose" es lspci -vvx.
- modprobe /lib/modules/2.4.7-6/kernel/drivers/pcmcia/yenta_socket.o
- modprobe i82365
- insmod ./xircom_tulip_cb.o
- /etc/rc.d/init.d/pcmcia stop - shut down the PCMCIA system.
- /etc/rc.d/init.d/pcmcia start - (re)start the PCMCIA system.
- Fitxers
- mkfs and mkswap - create File System and Swap.
- The bogomips (bogus Meaningless Indicator of Processor Speed)
I have got.
Fes cat /proc/cpuinfo i mira la darrera línia ...
O bé dmesg | grep Bogo
| IBM 9595 (DX2 25 MHz) | 24,88 |
| IBM 330 (DX2 60 MHz) | 33,28 |
| Pentium 90 MHz | 35,84 |
| TP 760 ED (Pentium 133 MHz) | 52,84 |
| S/390 (9672 R74) | 301,46 |
| T30 + Knoppix, 1,8 MHz CPU | 3.578,26 |
| P4 2.519,184 MHz CPU | 5.020,05 |
Want to know what it is ?
Read this
mini-HOWTO
or /usr/doc/HOWTO/mini/BogoMIPS under Red Hat.
Services
Lets display a list of all runlevels and services used by them:
bcnlab029:~ # chkconfig --list
Makefile 0:off 1:off 2:off 3:off 4:off 5:off 6:off
SuSEfirewall2_init 0:off 1:off 2:off 3:off 4:off 5:off 6:off
SuSEfirewall2_setup 0:off 1:off 2:off 3:off 4:off 5:off 6:off
aaeventd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
autofs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
autoyast 0:off 1:off 2:off 3:off 4:off 5:off 6:off
boot.apparmor 0:off 1:off 2:on 3:on 4:off 5:on 6:off B:on
cron 0:off 1:off 2:on 3:on 4:off 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:off 5:on 6:off
gpm 0:off 1:off 2:off 3:off 4:off 5:off 6:off
gssd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
haldaemon 0:off 1:off 2:off 3:on 4:off 5:on 6:off
idmapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ipmi 0:off 1:off 2:off 3:off 4:off 5:off 6:off
kbd 0:off 1:on 2:on 3:on 4:off 5:on 6:off S:on
lm_sensors 0:off 1:off 2:off 3:off 4:off 5:off 6:off
mdadmd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
microcode 0:off 1:on 2:on 3:on 4:off 5:on 6:off S:on
multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:off 5:on 6:off
xinetd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ypbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
xinetd based services:
chargen: off
chargen-udp: off
cups-lpd: off
daytime: off
daytime-udp: off
echo: off
echo-udp: off
fam: off
netstat: off
rsync: off
servers: off
services: off
swat: off
systat: off
time: off
time-udp: off
vnc: off
Startup scripts
LinuxJournal,
How-To,
Definim la feina a fer a /etc/init.d - "the scripts for controlling the system are placed in /etc/init.d/":
lab029:/etc/init.d # cat sebasCmd.sh
#!/bin/bash
fn=/home/sebas/logs/sebasCmd.log
date_name=`date +"%y/%m/%d"`
time_name=`date +"%H:%M"`
echo "("$time_name") +++ SEBAScmd - today is ("$date_name")." >> $fn
echo "("$time_name") +++ SEBAScmd - we are at level ..." >> $fn
runlevel >> $fn
ps -ef | grep AppS >> $fn
logger -p user.info "("$time_name") +++ +++ +++ +++ SAG : /etc/init.d/sebasCmd.sh - today is {"$date_name"} - log in file (" $fn ")."
I la activem:
lab029:/etc/rc.d/rc5.d # ln -s /etc/init.d/sebasCmd.sh S88sebas
Que llença "S88sebas" ?
/sbin/init -> /etc/inittab "si::nom:/etc/init.d" -> /etc/rc.d/rc
- How to know if the kernel is 32 or 64 bit ?
Per veure-ho es pot fer :
- uname -m
- if "i386" or "i686" then 32 bit
- if "x86_64" then 64 bit
- if "ppc64" then 64 bit :
wiki.
- How to know the kernel version you are running
Per veure-ho es pot fer :
- uname -a
- cat /proc/version
- cat /etc/issue {the best, IMHO}
- ls -al /boot
- ls -al /lib/modules
- kernel versions related to distribution versions
| Caldera 2.2 | 2.2.5 (Apr 99) |
|
| Caldera 2.3 | 2.2.10 (Sep 99) |
|
| Caldera 2.4 | 2.2.14 |
|
| Caldera 3.1 | 2.4.2-11 (Jul 01) |
|
| Caldera 3.1.1 | 2.4.13-9 |
|
|
|
| Debian 1.1 Buzz | |
|
| Debian 1.2 Rex | 2.0.27 |
|
| Debian 1.3 Bo | |
|
| Debian 2.0 Hamm | |
|
| Debian 2.1 Slink | 2.0.36 |
|
| Debian 2.2 Potato | 2.2.19 (Aug 00) |
|
| Debian 3.0 Woody | 2.n.nn (Jul 02) |
|
|
|
| Knoppix 3.3 | 2.4.22 (24092003) |
|
| Knoppix 3.7 | 2.4.27 & 2.6.9 (08122004) |
|
|
|
| Mandrake 6.1 Helios | 2.2.13 (Sep 99) |
|
| Mandrake 7.0 Air | 2.2.14 (Jan 00) |
|
| Mandrake 7.1 Helium | (Jun 00) |
|
| Mandrake 7.2 Odyssey | 2.2.17-21.mnk (Oct 00) |
|
| Mandrake 8.0 Traktopel | 2.4.3-20mdk (May 01) |
|
| Mandrake 8.1 Vitamin | 2.4.8 (Sep 01) |
|
| Mandrake 8.2 Cooker | 2.4.18 (Mar 02) | mini system (65 MB)
|
| Mandrake 9.0 | |
|
| Mandrake 10.0 | 2.6.3 (Jun 04) |
|
|
Mandrake 9.1
| 2.4.21 (Mar 03)
| KDE 1.3, Gnome 2.2, Apache 2, Mozilla 1.3, OpenOffice 1.0.2
|
|
|
| Mandriva Linux 2007 Spring
| |
KDE 3.5.6, GNOME 2.18, Firefox and Thunderbird 2.0
Metisse, the most innovative accelerated 3D desktop technology;
open source telephony with WengoPhone;
Google desktop applications including Picasa and Earth;
|
|
|
| Red Hat 1.0 Mothers-Day | 1.2.11 |
|
| Red Hat 1.1 Mothers-Day | 1.2.11 |
|
| Red Hat 2.0 | 1.2.13 (Fall 95) |
|
| Red Hat 2.1 | 1.2.13-1 |
|
| Red Hat 3.0.3 | 1.2.13-2 |
|
| Red Hat 3.0.4 Rembrandt | 2.0.10 (Aug 96) |
|
| Red Hat 4.0 Colgate | 2.0.18-5 |
|
| Red Hat 4.1 Vanderbilt | 2.0.27 (Jan 97) |
|
| Red Hat 4.2 Biltmore | 2.0.30-2 |
|
| Red Hat 5.0 Hurricane | 2.0.32-2 |
|
| Red Hat 5.1 Manhattan | 2.0.34-0.6 |
|
| Red Hat 5.2 Apollo | 2.0.36-0.7 |
|
| Red Hat 6.0 Hedwig | 2.2.5-14 |
|
| Red Hat 6.0 Lorax (beta) | 2.2.12 (Jun 99) |
|
| Red Hat 6.1 Cartman | 2.2.12-20 |
|
| Red Hat 6.1.92 Piglet (beta) | 2.2.16-17 (Feb 00) |
|
| Red Hat 6.2 Zoot | 2.2.14-5 |
|
| Red Hat 6.9.5 Pinstripe (beta) | 2.2.15-2.5.0 (Jul 00) |
|
| Red Hat 7.0 Guiness | 2.2.16-22 (Sep 00) |
|
| Red Hat 7.0.90 Fisher (beta) | 2.4.0 (Jan 01) |
|
| Red Hat 7.0.91 Wolverine (beta) | 2.4.1 (Feb 01) |
|
| Red Hat 7.1 Seawolf | 2.4.2-2 |
|
| Red Hat 7.1.93 Roswell (beta) | 2.4.6-3 (Jun 01) |
|
| Red Hat 7.2 Enigma | 2.4.7-6 / 2.4.7-10 / 2.4.9-13 |
|
| Red Hat 7.3 Valhalla | |
|
| Red Hat 8.0 Psyche |
2.4.18
| gcc 3.2, glibc 2.2.90, GNOME 2.0, KDE 3.0.3, XFree86 4.2.0
|
|
|
| Slackware 3.0 | 1.2.13 / 1.3.18 |
|
| Slackware 3.1 Slackware96 | 2.0.27 |
|
| Slackware 3.9 | 2.0.37 (May 99) |
|
| Slackware 4.0 | 2.2.6 (May 99) |
|
| Slackware 7.0 | 2.2.13 (Oct 99) |
|
| Slackware 7.1 | 2.2.16 (Jun 00) |
|
| Slackware 8.0 | 2.2.19 / 2.4.5 |
|
|
|
| SuSE 4.2 | 1.3.97 |
|
| SuSE 5.0 | 2.0.30 |
|
| SuSE 5.1 | 2.0.32 |
|
| SuSE 5.2 | |
|
| SuSE 5.3 | 2.0.35 |
|
| SuSE 6.0 | 2.0.36 |
|
| SuSE 6.1 | 2.2.5 (Apr 99) |
|
| SuSE 6.2 | 2.2.10 (Aug 99) |
|
| SuSE 6.3 | 2.2.13 (Dec 99) |
|
| SuSE 6.4 | 2.2.14 (Apr 00) |
|
| SuSE 7.0 | 2.2.16 / 2.4.0_test1 |
|
| SuSE 7.0 s/390 | 2.2.16 |
|
| SuSE 7.1 | 2.2.18 / 2.4.0 |
|
| SuSE 7.2 | 2.4.4-17 |
|
| SuSE 7.3 | 2.4.10 |
|
| SuSE 8.0 | 2.4.18 (Apr 02) | KDE 3.0, Apache 1.3.23, Samba 2.2.3
|
| SuSE 8.1 | 2.4.19 (Oct 02) | gcc 3.2, KDE 3.0.3, GNOME 2.0, Apache 2.0.40, Samba 2.2.5, ext3, USB 2.0, WEP
|
| SuSE 8.2 | 2.4.20 (Mar 03) |
|
| SuSE 9.0 | 2.4.21 (Sep 03) |
|
| SLES 9 | 2.6 | SUSE Linux Enterprise Server
|
| SuSE n.n | 2.6.nn (mes 0n) | BlueZ (Bluetooth protocol stack)
|
Linux HQ
kernel
The current Linux kernel versions are
here (helsinki), and also
kernel
version numbering scheme.
The also hold Linux FAQs and LDP !
Remember :
Versions r.x.y, where x is an even number, are stable versions,
and only bug fixes will be applied as y is incremented.
So from version 2.0.2 to 2.0.3, there were only bug fixes, and no new features.
Versions r.x.y, where x is an odd number,
are beta-quality releases for developers only,
and may be unstable and may crash,
and are having new features added to them all the time.
For Red Hat names, look
here.
And old releases
here.
Few distributions have their kernels are listed
here.
- URL últimas versiones :
Kernel /
intranet
- Links distribucions :
- Caldera
-
Debian
-
Knoppix
- Linux Live CD.
Usar "knx-hdinstall" desde consola root
-
Linex
-
Mandarke
-
Red Hat
- TurboLinux
-
Ubuntu - Debian based -
(Hoary Hedgehog, Breezy Badger, Dapper Drake) -
funded by the South African internet multimillionaire
and occasional cosmonaut Mark Shuttleworth.
Article
Sites :
What happened to Live CD ?
While Ubuntu 5.10 (Breezy Badger) had a Live CD
(an Ubuntu CD that runs directly off your Memory and the Disc,
without installing anything to hard-disk)
and an Install CD,
Ubuntu 6.06 'Dapper Drake' and later versions
have a "Desktop" and an "Alternate" CD.
The Desktop CD contains a Live session with an installer, once started up;
it does not have the classical text installer.
The Alternate CD has the old text-installer, with no Live session available.
Un lloc que mesura les distribucions, etc :
DistroWatch.
Red Hat
Manuals
Nice
Install Guide,
all
RHL-9 manuals :
getting started, customization, reference, security, sys admin, glossary ...
RHEL5
Administration.
LVM (rh),
LVM How-To.
Magazine.
$DISPLAY & related apps
Configuració : system-config-packages - requires $DISPLAY !
[sebas@lab cmds]$ export 'DISPLAY=99.145.102.166:0.0' ; Xming's IP !
[sebas@lab cmds]$ echo $DISPLAY
99.145.102.166:0.0
[sebas@lab cmds]$ xterm &
[1] 7499
[sebas@lab cmds]$ Xlib: connection to "99.145.102.166:0.0" refused by server
Xlib: No protocol specified
xterm Xt error: Can't open display: 99.145.102.166:0.0
[1]+ Exit 1 xterm
[sebas@lab cmds]$
Edit X0.hosts to include RH client's IP :
c:\Program Files\Xming> type X0.hosts
localhost
99.137.164.154
[sebas@lab cmds]$ xterm &
[1] 7550
[sebas@lab cmds]$ Warning: Cannot convert string "nil2" to type FontStruct
xterm: unable to open font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1", trying "fixed"....
Tambe podem fer servir
gedit & o
gvim &
New User : useradd + passwd. See /home/<user>/ directory is created.
List of installed software for reinstallation
RPM based distributions (RHEL, Fedora Core, Cent OS, Suse Linux etc) -
Use rpm command to get list of all installed software:
$ rpm -qa > ./installed-software.log
To install all software:
# yum -y install $(cat ./installed-software.log)
url
logrotate
/var/lib/logrotate.status Default state file.
/etc/logrotate.conf Configuration options.
/var/log/messages {
rotate 5
weekly
postrotate
/sbin/killall -HUP syslogd
endscript
}
To run it daily:
sag@p7029:/etc/cron.daily> cat logrotate
#!/bin/sh
TMPF=`mktemp /tmp/logrotate.XXXXXXXXXX`
/usr/sbin/logrotate /etc/logrotate.conf 2>&1 | tee $TMPF
EXITVALUE=${PIPESTATUS[0]}
if [ $EXITVALUE != 0 ]; then
# wait a sec, we might just have restarted syslog
sleep 1
# tell what went wrong
/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
/bin/logger -t logrotate -f $TMPF
fi
rm -f $TMPF
exit 0
Or :
cat /etc/cron.daily/logrotate
#! /bin/sh
/usr/sbin/logrotate /etc/logrotate.conf
To
read
conf file :
p7029:/var/log # logrotate -f /etc/logrotate.conf
Shutting down slpd done
Starting slpd done
Reload syslog service done
Reload syslog service done
Mail
The default MDA on Red Hat Linux systems is procmail.
Postfix Installation on RH, and how to remove "sendmail" :
rpm -e sendmail sendmail-cf sendmail-doc --nodeps
+ kill PID (ps -ef | grep 'sendmail')
ISOs
mount -o loop -t iso9660 <isofilename> <mountpoint>
gcc C compiler
-bash-3.00$
gcc --help
Usage: gcc [options] file...
Options:
-pass-exit-codes Exit with highest error code from a phase
--help Display this information
--target-help Display target specific command line options
(Use '-v --help' to display command line options of sub-processes)
-dumpspecs Display all of the built in spec strings
-dumpversion Display the version of the compiler
-dumpmachine Display the compiler's target processor
-print-search-dirs Display the directories in the compiler's search path
-print-libgcc-file-name Display the name of the compiler's companion library
-print-file-name=<lib> Display the full path to library
-print-prog-name=<prog> Display the full path to compiler component
-print-multi-directory Display the root directory for versions of libgcc
-print-multi-lib Display the mapping between command line options and multiple library search directories
-print-multi-os-directory Display the relative path to OS libraries
-Wa,<options> Pass comma-separated on to the assembler
-Wp,<options> Pass comma-separated on to the preprocessor
-Wl,<options> Pass comma-separated on to the linker
-Xassembler <arg> Pass on to the assembler
-Xpreprocessor <arg> Pass on to the preprocessor
-Xlinker <arg> Pass on to the linker
-save-temps Do not delete intermediate files
-pipe Use pipes rather than intermediate files
-time Time the execution of each subprocess
-specs=<file> Override built-in specs with the contents of
-std=<standard> Assume that the input sources are for
-B <directory> Add to the compiler's search paths
-b <machine> Run gcc for target , if installed
-V <version> Run gcc version number , if installed
-v Display the programs invoked by the compiler
-### Like -v but options quoted and commands not executed
-E Preprocess only; do not compile, assemble or link
-S Compile only; do not assemble or link
-c Compile and assemble, but do not link
-o <file> Place the output into
-x <language> Specify the language of the following input files
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of guessing the language based on the file's extension
Options starting with -g, -f, -m, -O, -W, or --param are automatically passed on to the various sub-processes invoked by gcc.
In order to pass other options on to these processes the -W options must be used.
TCP/IP RH
Hostname & Default Gateway: edit /etc/sysconfig/network file to set HOSTNAME=thename and GATEWAY=<ip>.
[root@linux5 /etc/sysconfig]# cat network
NETWORKING=yes
HOSTNAME="mybox.mydomain.com"
DHCP_HOSTNAME="mybox.mydomain.com"
GATEWAY=1.2.3.4
DNS and Domain: edit /etc/resolv.conf file to set NAMESERVER=thename and DOMAIN=thename.
[root@lab2 etc]# cat resolv.conf
; generated by /sbin/dhclient-script
search bar.es.hal.com
nameserver 9.64.163.21
nameserver 9.64.162.21
IP por DHCP :
[root@linux5 /etc/sysconfig/network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=00:0D:60:7A:42:FA
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
DHCP_HOSTNAME="labss8.bar.es.com"
check_link_down() {
return 1;
}
Visualitzem el default Gateway amb:
[root@labss1 dhcp]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
9.137.164.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 9.137.164.1 0.0.0.0 UG 0 0 0 eth0
I les dades del DHCP amb:
$ cat /var/lib/dhcp/dhclient-eth0.leases
lease {
interface "eth0";
fixed-address 9.137.164.154;
option subnet-mask 255.255.255.0;
option dhcp-lease-time 43200;
option routers 9.137.164.1;
option dhcp-message-type 5;
option domain-name-servers 9.64.163.21,9.64.162.21;
option dhcp-server-identifier 9.64.163.10;
option domain-name "bar.es.hal.com";
renew 4 2011/4/28 19:42:05;
rebind 5 2011/4/29 00:48:45;
expire 5 2011/4/29 02:18:45;
}
IP estàtica:
[root@linux5 /etc/sysconfig/network-scripts]# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=no
IPADDR=192.168.78.83
NETMASK=255.255.255.0
GATEWAY=192.168.78.1
Display all IP data {with a parse pending...} :
lab2 $ #!/bin/bash
if [ `id -u` -ne 0 ]
then
echo "Must be running as root"
exit 1
fi
echo "La MAC es :"
ifconfig eth0 | grep HWaddr
echo "La IP es :"
ifconfig eth0 | grep "inet addr:"
echo "El Default Gateway es :"
route -n | grep "UG"
echo "Els DNS son :"
cat /etc/resolv.conf | grep "nameserver"
echo "El domini es :"
cat /etc/resolv.conf | grep ".com"
Display own IP:
/sbin/ifconfig eth0 | grep "inet addr" | cut -d "B" -f 1 | cut -d ":" -f 2 | sed 's/^ *//;s/ *$//'
Use
conky + "${addr eth0}"
Network restart :
[root@lab2 etc]# /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
xInetd :
[root@lab2 ~]# /etc/init.d/xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
ifdown/up :
[root@lab2 ~]# ifdown eth0
[root@lab2 ~]# ifup eth0
[root@lab2 ~]# ifconfig eth0
Samba
yum install samba & vi /etc/samba/smb.conf
Creer le share public
[public]
comment = Public Stuff
path = /public
public = yes
writable = yes
printable = no
Alors
/etc/init.d/smb start
smbpasswd -a
Et voila!
Users
adduser u1 -p pu1 -n ; dont create "u1" group, but use "users" group instead.
passwd u1 ; set (short) pwd.
Remote Desktop
Use Remote VNC at Windows, and configure access at RH via System -> Preferences -> Remote desktop (remove "Ask for your confirmation").
VNC.
SLES 10 (p7029 & p9111)
Configure (command line) using yast from root.
SLES 10 Install & Admin
doc.
Interesting files for troubleshooting :
/proc/cpuinfo
/proc/dma
/proc/interrupts
/proc/iomem
/proc/ioports
/proc/meminfo
/proc/modules
/proc/mounts
/proc/partitions
/proc/version
/var/log/boot.msg
/var/log/messages
/var/log/faillog
/var/log/warn
/var/log/YaST2/y2log
An interesting file executed at end /etc/init.d/halt.local :
sebas@p7029-6E3:~/cmds> cat tanquem.sh
#!/bin/sh
#
# Feina que volem fer quan es tanqui la maquina : enviar una linia a /var/log/messages
#
tDate=`date +%F`
tTime=`date +"%H:%M"`
fLog="/home/sebas/cmds/txt/txtEnd.txt"
rm -f $fLog
lHead="SAG End01 v1.1 - soc (`hostname`) i son les "$tTime" del "$tDate"." ;
echo "+++ ============================================" > $fLog
echo $lHead >> $fLog
df -h >> $fLog
w >> $fLog
echo "--- ============================================" >> $fLog
logger -p user.info -f $fLog
Admin Guide.
Forum Novell.
/etc/init.d/before.local = user defined resource control script which should be executed _before_ runlevel is entered.
/etc/init.d/after.local = user defined resource control script which should be executed _after_ runlevel is entered.
Download (FTP3) : /suse/release_cds/sles-10-ppc - Power PC.
X11, SaX, xMing
To have a graphical envir into P9111, do :
- on T400, edit X0.hosts to include p9111's IP.
- on T400, start Xming (a small icon appears in tray area).
- on p9111, do export DISPLAY="<T400.IP>:0"
- on p9111 now you launch the command "xeyes &" and "xterm &" and SaX2 & (under root) ... but the window shall open on T400 desktop !
SuSE (11)
Nowell
documentation.
(auto) Yast : /root/autoinst.xml,
"hwinfo --netcard"
/root/autoyast.xml
/var/adm/autoinstall/cache
Cloned SUSE 11 virtual machine does not have
network connectivity after reboot.
DHCP & DNS server(s)
Quin port fan servir ?
By default BIND listen DNS queries on port 53
Required packages :
- DHCP : dhcp-server
- DNS : bind
SolutionBase:
Configuring a DHCP server
with SuSE's YaST ;
Configuring a DNS server
with SuSE's YaST ;
DNS & SLES.
TCP/IP SuSE
Hostname : edit /etc/HOSTNAME (mind UpperCase) file to set the_name.
Static IP : edit /etc/sysconfig/network/ifcfg-eth<id> to set IPADDR='1.2.3.4' and BOOTPROTO=static
p9111-520:/etc/sysconfig/network # cat ifcfg-eth0
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='9.137.166.102'
MTU=''
NAME='IBM 82546EB Gigabit Ethernet Controller (Copper)'
NETMASK='255.255.255.128'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto' or 'onboot'
UNIQUE='0R2q.iOeGlAIwnbF'
USERCONTROL='no'
_nm_name='bus-pci-0000:d0:01.0'
Dynamic IP :
p9111-520:/etc/sysconfig/network # cat ifcfg-eth0
BOOTPROTO=’dhcp’
NETMASK=’255.255.255.0’
NETWORK=’’
STARTMODE=’auto’
USERCONTROL=’no’
IPADDR=’’
Default Gateway :
p9111-520:/etc # cat /etc/sysconfig/network/routes
default 111.112.113.114 - -
To display it, use:
p9111-520:/etc # route -nv
To restart communications, use
linux5:/etc/sysconfig/network # /etc/init.d/network restart
DNS & domain :
p9111-520:/etc # cat resolv.conf
nameserver 9.64.163.21
nameserver 9.64.162.21
domain bar.es.hal.com
search bcn.es.hal.com
DNS cfg : NAMED.CONF + 1 text file by zone
DHCP cfg :(port 67)
/etc/dhcp3/dhcpd.conf
/var/lib/dhcp3/dhcpd.leases
USB disc
To use a USB disc on SuSE, do :
- connect the USB disc to SuSE system
- tail -f /var/log/messages for device, as sdb: sdb1
- mkdir /tmp/USB
- mount /dev/sdb1 /tmp/USB
FTP server @ SLES 10
VSFTPD
url,
doc.
p9111-520:/home/sag/soft/ftp # wget https://security.appspot.com/downloads/vsftpd-2.3.4.tar.gz
p9111-520:/home/sag/soft/ftp # tar -xvzf vsftpd-2.3.4.tar.gz
p9111-520:/home/sag/soft/ftp # cd vsftpd-2.3.4/
p9111-520:/home/sag/soft/ftp # make
p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # ls -l vsftpd
-rwxr-xr-x 1 root root 125584 Oct 25 19:11 vsftpd
p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd /usr/local/sbin/vsftpd
p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd.conf.5 /usr/local/man/man5
p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd.8 /usr/local/man/man8
p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd.conf /etc
p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # mkdir /usr/share/empty/
p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp RedHat/vsftpd.pam /etc/pam.d/ftp // allow non-anonymous login
Standalone : edit /etc/vsftpd.conf, and verify:
anonymous_enable=NO
local_enable=YES
write_enable=YES
listen=YES
Start FTP daemon manually:
[root@localhost root]# /usr/local/sbin/vsftpd &
[1] 2104
If we want to run FTP daemon from
xinetd,
then
a) remove "LISTEN=YES from /etc/vsftpd.conf :
# --- listen=YES
b) then, verify
/etc/xinetd.conf :
defaults
{
log_type = FILE /var/log/xinetd.log
log_on_success = HOST EXIT DURATION
log_on_failure = HOST ATTEMPT
# only_from = localhost
instances = 30
cps = 50 10
}
includedir /etc/xinetd.d
c) create
ftp in
/etc/xinetd.d and watch
/var/log/xinetd.log:
# vsftpd is the secure FTP server.
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
per_source = 5
instances = 200
no_access = 192.168.1.3
banner_fail = /etc/vsftpd.busy_banner
log_on_success += PID HOST DURATION
log_on_failure += HOST
}
Restart xinetd using /etc/init.d/xinetd restart and try ftp localhost.
Filezilla
Per instalar Filezilla a SuSE 10, fem :
- anar a
SuSE Search + select "SuSE SLE 10" + posar "Filezilla" -> baixar FileZilla-3.1.0.1-4.1.i586.rpm
- rpm -ivh FileZilla-3.1.0.1-4.1.i586
- Filezilla available at "Computer" + "Favorite Applications / More Applications"
Dubtes
- VMware tools for SLES 11 ?
- update to KDE 4.1
- ./vmware-config-tools.pl
-
By default opensuse installs the open-vm-tools and vmware-kmp-pae.
To install the vmware tools you should first remove those packages.
- .
Ubuntu
Wiki
Community
Ubuntu Guide
Ubuntu Geek
Instalació VMWare Server,
8.04.
Ubuntu & Default GW.
Actualització
apt-get update
apt-cache
apt-cdrom
apt-config
apt-extracttemplates
apt-ftparchive
apt-get
apt-key
apt-mark
apt-sortpkgs
aptitude search X
o
apt-cache search
Download.
Installing VMware
Player or
Server [***]
on Ubuntu
Has
patch + shell !
Activate
Telnet.
Install
SSH.
Doc (gracias, Bruno !)
sudo apt-get install openssh-server
Verify it works :
ps -aef | grep sshd
Install sendemail (in debian lenny) :
# apt-get install sendemail
TCP/IP
IP, mask, gw : /etc/network/interfaces
DNS : /etc/resolv.conf
Hostname : /etc/hostname
url
Comanda per agafar IP del DHCP : sudo dhclient
Comanda per ficar IP fixe : sudo ifconfig eth0 192.168.3.4 netmask 255.255.255.0 up
Comanda per reiniciar la xarxa : sudo /etc/init.d/networking restart
Restart Web server : sudo /etc/init.d/apache2 restart
To register to DNS : in /etc/dhcp3/dhclient.conf set send host-name "<my_hostname>"; : the hostname needs to be updated in DNS (to use nslookup)
Display (local) open ports :
sudo nmap localhost -PN
Net Cfg using Cmd Line.
mail
Install
PostFix, default MTA for Ubuntu.
theuser@eyeOS_ubuntu:~$ postfix
The program 'postfix' is currently not installed. You can install it by typing:
sudo apt-get install postfix
bash: postfix: command not found
theuser@eyeOS_ubuntu:~$
setting inet_interfaces: all
/etc/aliases does not exist, creating it.
WARNING: /etc/aliases exists, but does not have a root alias.
Postfix is now set up with a default configuration. If you need to make changes, edit
/etc/postfix/main.cf (and others) as needed. To view Postfix configuration values, see postconf.
After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.
Running newaliases
* Stopping Postfix Mail Transport Agent postfix [ OK ]
* Starting Postfix Mail Transport Agent postfix [ OK ]
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
theuser@eyeOS_ubuntu:~$
NAME
postfix - Postfix control program
SYNOPSIS
postfix [-Dv] [-c config_dir] command
DESCRIPTION
This command is reserved for the superuser. To submit mail, use the Postfix sendmail command.
theuser@eyeOS_ubuntu:~$ mail -s "prova" bisc2k9@gmail.com < ./main.eyecode
The program 'mail' can be found in the following packages:
* heirloom-mailx
* mailutils
Try: sudo apt-get install
bash: mail: command not found
theuser@eyeOS_ubuntu:~$
Problemes
NetworkManager
device not managed
Try changing [ifupdown] managed=false to true in /etc/NetworkManager/nm-system-settings.conf
Restart network manager : sudo /etc/init.d/network-manager restart
url.
How To Recover Windows MBR using Ubuntu Live CD
If you want to restore Windows Bootloader
and for some reason cannot use the windows installation cd,
there is a simple way to do it:
Doc,
Doc,
Doc
Un altre mètode (després de botar Live CD) :
grub-install copies GRUB images into the DIR/boot directory
specified by --root-directory,
and uses the grub shell to install grub into the boot sector.
grub-install man
Un altre mètode :
You can try SuperGrub live cd to fix your the MBR of your disk :
url,
WiKi,
homepage,
get the
ISO...
RPM
- list of all installed packages :
rpm -qa
"l /var/log/YaST2/" for a list of YaST2 logs
- verificar requisits d'un paquet :
rpm -i --test nom_paket.rpm
- posar un paquet :
rpm -ivh nom_paket.rpm
- treure un paquet :
"rpm -e nom_paket.rpm"
- software install
guide
- use GDB
- we get a core file
- determine its type using file core
- use gdb -c core to fix it
- use strace.
See this
HOW TO.
Also ltrace can help (library calls) :
wiki,
man.
- create a boot disk
# uname -r
2.2.14-5.0
# mkbootdisk --device /dev/fd0 2.2.14-5.0
; mkbootdisk-1.2.5-3 (RH 6.2)
; pre-requisit : mkinitrd => mkinitrd-2.4.1-2 (RH 6.2)
- save your configuration files.
Here is a list of valuable files you should save.
/etc/fstab
/etc/hosts
/etc/hosts.allow
/etc/host.conf
/etc/hosts.deny
/etc/inetd.conf
/etc/inittab
/etc/lilo.conf
/etc/networks
/etc/resolv.conf # DNS client. See page 333.
/etc/smb.conf # Samba configuration. See page 391.
- engegar en modus "safe mode" o "single user"
LILO boot : linux single
o
LILO boot : linux 1
Això és el que es fa quan els comptes de usuari (inclòs
root)
expiren.
User acoount has expired
També es pot fer
LILO: {image name} init=/bin/sh rw
Ara només cal fer /sbin/mount -a (or mount -rw /dev/hda1 /mnt)
per muntar la resta de particions i
poder fer servir passwd i linuxconf.
You can also try to erase the password field in the file /etc/shadow.
The password is crypted and is between the first and second ":".
You must end up with a line like this :
root::11825:0:10000::::
Then, use passwd to change root password.
Un altre sequencia es :
- boot Toms floppy.
Get it now !
- mount the original root partition on /mnt, as
mount -t ext2 /dev/hda1 /mnt
after fdisk -l
- edit /mnt/etc/shadow so the root password is removed
- umount /mnt
- shutdown
- reboot and set new root password
- Rescue Packages
- Rescue floppy list.
Each PC should have an associated floppy box containing :
- Windows rescue floppy
- BootMagic recovery floppy
- Linux boot floppy
- verify your system is not
"0wn3d"
- "netstat" - see recent connections
- "rpm -V" - verify MD5 that have changed
Common actions
| |
Suse 6.4 i 7.2 |
Caldera 2.4 |
Red Hat 6.2 i 7.2 |
| Instalador |
yast |
lisa |
|
| Log Instalacion |
/var/adm/inst-log/* |
|
/tmp/install.log |
| Boot logs |
8.1 : /var/log/messages |
Alt-F7 = GUI
Alt-F10 = char
Alt-F12 = RC log (/etc/rc.d/rc)
|
|
| Configuración sistema |
SuSEconfig 8.1 : yast2 |
hwinfo -> /tmp/hwinfo.txt
lisa
/etc/system.cnf & /etc/lst.cnf
|
linuxconf |
| Configuración usuarios |
yast |
useradd userdel usermod |
userconf |
| Alias |
|
global : /etc/config.d/shells/bashrc
privat : ~/.profile-private
|
|
| Configuración red |
netcfg
yast (/etc/rc.config)
|
|
netconf (all, as linuxconf)
netconfig (networking)
netcfg (under X11)
|
| Configuración X11 |
sax
sax2 under SuSE 8.1
|
lizardx SuperProbe /etc/X11/XF86Config |
SuperProbe Xconfigurator xconf |
| Boot files |
/etc/inittab
/sbin/init.d/boot
/sbin/init.d/boot.local
/sbin/init.d/rc N
|
/etc/inittab |
/etc/inittab
/etc/rc.d/init.d
|
| Net cfg files |
All data : /etc/rc.config
/etc/modules.conf
Gateway : /etc/route.conf
|
/etc/rc.d/rc.modules
/etc/modules.conf
/etc/sysconfig/network
./network-scripts/ifcfg-eth0
|
/etc/sysconfig/network
./network-scripts/ifcfg-tr0
|
| Per saber ... |
DNS : cat /etc/resolv.conf or nslookup
Gateway : route -v
|
|
IP address : ifconfig
DNS : cat /etc/resolv.conf or nslookup
Gateway : route -v or netstat -rn
DHCP : pump --status
|
| NFS |
/etc/rpc
rup
rpc.rusersd (rusers)
rpc.rwalld (rwall)
rpcinfo -p [<hostname>]
|
/etc/exports
rpc.portmap (portmapper)
rpc.mountd
rpc.nfsd
rpcinfo -p [<hostname>]
|
| Sound config |
|
|
sndconfig |
Acrònims, noms, projectes - parafernàlia de Linux, WWW, etc
Si tens un nom i no saps que fà,
pots fer primer
- "man <nom>", ("man 2 shutdown" si es el 2-on "shutdown", sockets) o
- "info <nom>" o
- "help <nom>" o
- "<nom> --help" o
- "rpm -q <nom>"
Si no va bé, pots mirar un
index d'aplicacions,
on també hi ha un buscador.
Sempre es pot probar una busqueda a
Google
Si tot falla, proba
el meu diccionari.
Ho he escrit tot jo, així que en tinc totes les culpes.
Single vs. double quotes
Use man 7 glob (wildcard expansion)
and man 8 glob (section QUOTING)
Linux I have got
- T30 + BM => Knoppix 3.3
- T30 + BM + W2K + VM => SuSE 8.2
- P90 + BM =>
- P4 + BM =>
- CD => Knoppix 3.3 and 3.7
- CD => Kernel 2.6.6 at Auditor Security Collection
Floppy disk use - save W2K file
- mkdir fpy
- mount /dev/fd0 /fpy
- mount /dev/hda1 /mnt
- cd /mnt
- cd Documents
- cp sistemasolar.doc /fpy/ss.doc
- umount /fpy
How to send an Email
Basic
#!/bin/bash
df -h | mail -s “disk space report” calvin@cnh.com
Medium
#!/bin/bash
df -h > /tmp/mail_report.log
free -m >> /tmp/mail_report.log
mail -s “disk and RAM report” calvin@cnh.com < /tmp/mail_report.log
Complete : mutt allows "attachments" :
#!/bin/bash
tar -zcf /tmp/backup.tar.gz /home/calvin/files
echo | mutt -a /tmp/backup.tar.gz -s “daily backup of data” calvin@cnh.com
URL
Using
smtp-client.pl :
smtp-client.pl --server smtp.gmail.com --from someone@gmail.com --to some@body.else --subject Blah --attach /path/to/a/picture.png
It can also authenticate with a Gmail username and password among other things.
How to use an external SMTP server
$ cat /etc/mail/sendmail.mc
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST',`smtp.your.provider')
dnl #
divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4.
dnl # If you make changes to /etc/mail/sendmail.mc,
dnl # you will need to regenerate the /etc/mail/sendmail.cf file
dnl # by confirming that the sendmail-cf package is installed and then performing a
dnl #
dnl # make -C /etc/mail
dnl #
include('/usr/share/sendmail-cf/m4/cf.m4')dnl
To reconfigure it, do :
- edit sendmail.mc
- rebuild sendmail.cf : m4 sendmail.mc > /etc/sendmail.cf
- restart daemon : /sbin/service sendmail stop and /sbin/service sendmail start
Login welcome message
The contents of /etc/motd are displayed by login after a successful login but just before it executes the login shell.
login as: sebas
sebas@99.137.164.154's password:
Last login: Mon May 24 11:53:18 2010 from sig-9-145-107-205.uk.hal.com
. inici MOTD
Benvinguts a LAB.
. final MOTD
How to add a new disc
We create a new (extended) partition, create a filesystem, make a directory to mount it, and mount it.
fdisk /dev/hdb + "n" (add a new partition) + "e" (extended) + "p" (print partition table) + "w" (write)
mkfs -t ext3 /dev/hdb1
mkdir /opt2
mount -t ext3 /dev/hdb1 /opt2
Maybe we want to mount it at system boot, so we edit /etc/fstab:
/dev/hdb1 /opt2 ext3 defaults 1 2
url
LVM
Overview of the main elements in an LVM system:
hda1 hdc1 (PV:s on partitions or whole disks)
\ /
\ /
diskvg (VG)
/ | \
/ | \
usrlv rootlv varlv (LV:s)
| | |
ext2 reiserfs xfs (filesystems)
url
Useful commands :
- lvm pvdisplay ; physical volume
- lvm vgdisplay ; volume group
- lvm lvdisplay ; logical volume
Few interesting commands
nohup : keep processes running after you exit from a shell.
nohup command-name & ; continue running in the background after you log out from a shell.
fdisk -l : Partition table manipulator (-l = "list")
smartctl : Control and Monitor Utility for SMART Disks
smartctl -a /dev/hda
smartctl -i /dev/hda
smartctl -Hc /dev/hda **** Health Check ****
smartctl -A /dev/hda
smartctl -l error /dev/hda
smartctl -t short /dev/hda
smartctl -t long /dev/hda
smartctl -l selftest /dev/hda
man smartctl and man smartd
smartd dæmon that does regular monitoring.
Configuration file is /etc/smartd.conf.
Logs his information with SYSLOG in /var/log/messages
{RH} /etc/rc.d/init.d/smartd start and /etc/rc.d/init.d/smartd stop can be used to start and stop the dæmon
How to write into /var/log/messages
#!/bin/sh
tDate=`date +%F`
tTime=`date +"%H:%M"`
fLog="/home/sebas/cmds/cron/txtLog.txt"
rm -f $fLog
lHead="SAG Kron01 - soc (`hostname`) i son les "$tTime" del "$tDate"." ;
echo "+++ ============================================" > $fLog
echo $lHead >> $fLog
netstat -ano | grep 1352 >> $fLog
df -h >> $fLog
echo "--- ============================================" >> $fLog
logger -p user.info -f $fLog
Using only keyboard
- Ctrl + Esc = process table
- Ctrl + Tab = switch between desktops
- Alt + Tab = switch between applications
- Alt + F4 = close window
- "lletra" = seleccionar la icona del escriptori de nom que comença amb la lletra
- moure cursor amb el teclat : Shift + Alt + NumLock + "cursors"
10 SysAdmin tricks
- unmount the unresponsive DVD drive
- get your screen back when it's hosed
- collaboration with screen
- get back the root password
- SSH back door
- remote VNC session through an SSH tunnel
- checking your bandwidth
- command-line scripting and utilities
- spying on the console
- random system information collection
DeveloperWorks
10 Greatest Open Source Software Of 2009
- Inkscape ( Vector Graphics Editor )
- 7-Zip ( Archiver )
- VLC ( Media Player )
- VirtualBox ( Virtualization )
- Miro ( Internet TV )
- TrueCrypt ( Disk Encryption )
- Calibre ( eBook Converter and Reader )
- GnuCash ( Financial Management )
- GIMP ( Graphics / Simple Photo Editing )
- Audacity ( Sound Editor / Recorder )
url
Few more :
- Firefox 3.x - nuff said!
- Thunderbird 2.x - Another amazing software from the Mozilla with tons of plug-ins for email client.
- OpenOffice - Great Microsoft Office replacement.
- Pidgin - IM all your friends in one place.
- MPlayer - Now supports most of the Bluray and HD-DVD codecs.
- Nmap - The ultimate network exploration and security auditing tool.
Pending
- "chroot jail"
- Frozen Bubble
game
- Wmaker - NeXTstep-like X window manager.
- how to switch from KDE to Gnome (on the fly ?)
- how to emulate Win/DOS "start ." ?
- guindous migration to Linux :
Books
-
The One Page Linux Manual
homepage
and
pdf.
-
A practical guide to Linux
Mark G. Sobell
Addison Wesley, 1999 (9th printing)
ISBN 0-201-89549-8
-
Red Hat Linux 6 Unleashed
David Pitts and Bill Ball
Sams, 1999
ISBN 0-672-31689-7
-
Linux complete
LDC compiled by Grant Taylor
Sybex, 1999
ISBN 0-7821-2567-0
-
Linux Device Drivers
Alessandro Rubini and Jonathan Corbet
O'reilly, 2001
ISBN 0-59600-008-1
Available on-line both in
html
and
pdf
Here's also an
image
-
Using
Samba
Linux Tricks & Tips : numéro spécial
Samba