Instalar un modulo de Perl CPAN
May 30, 2006 in Notas rápidas
Lite’
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Apr | Jun » | |||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
May 20, 2006 in Notas rápidas
Pues nada que es uno de los mensajes de que no eres el amo del cdrdao
solucionalo rápido así:
chmod 4755 /usr/bin/cdrdao
May 19, 2006 in Notas rápidas
Sacado de por ahi…
Los dichosos ^M!.
Con demasiada frecuencia ocurre que importamos un texto de MS-DOS a UNIX, y al editarlo con el vi (por ejemplo), sale lleno de “^M” al final de todas las líneas. Lo primero, decir que no hay problema en el vim, porque si pones la opción “autotext” (:set autotext), el vim automáticamente detecta el tipo de fichero que es (DOS o UNIX), y si es DOS, quita los ^M de la pantalla. Esto de los ^M ocurre porque el delimitador de línea de los ficheros de texto en DOS es CR-LF (carriage return-linefeed, o sea, retorno de carro y salto de línea), y en UNIX son simplemente LF. Así, muchas herramientas de UNIX (al menos por defecto), buscan como delimitador de línea el LF, así que al final de cada línea hay un caracter extraño (el CR).
Esto, en vi, se puede arreglar fácilmente con la orden
:%s/<ctrl-V><ctrl-M>//
Te comento por encima qué significa este chorizo: El “%” sirve para que se sustituya en todas las líneas, y no sólo en la actual, la “s” para que se realice una sustitución, el Ctrl-V Ctrl-M es necesario para que el vi no se crea que estamos pulsando un ENTER (Ctrl-V sirve para insertar literales), y, por supuesto, se sustituye por nada, así que entre la segunda y la tercera barras no ponemos nada.
Por si no te gusta el vi, puedes cambiar el formato de los ficheros de texto desde la línea de órdenes, escribiendo:
sed 's/<ctrl-V><ctrl-M>//' fichero-CRLF >fichero-LF
Actualización : el ^M copiado de texto a consola se muestra como dos caracteres , pero realmente es uno. En la consola se puede generar con control+v + m con lo que un sed -i ‘d/^M/’ fichero deberia funcionar siempre y cuando ^M sea un solo caracter y no dos.
eth1 Link encap:Ethernet HWaddr 00:11:25:57:BC:69
inet addr:62.151.24.74 Bcast:62.151.24.79 Mask:255.255.255.240
inet6 addr: fe80::211:25ff:fe57:bc69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:174549467 errors:0 dropped:0 overruns:0 frame:0
TX packets:190245054 errors:29876265 dropped:0 overruns:0 carrier:29876265
collisions:32648117 txqueuelen:1000
RX bytes:1089220947 (1.0 GiB) TX bytes:2670160874 (2.4 GiB)
Base address:0×4400 Memory:d0340000-d0360000
Las colisiones son _normales_ en redes CSMA/CD como Ethernet con lo que
la cantidad absoluta de colisiones no es un problema, siempre y cuando
no exceda el 3% de las transmisiones totales. Esto es, si
colisiones * 100 / ( transmisiones + colisiones ) <= 4
3264811700 / 222893171 = 14,6
como mucho debería ser 4
¿Podrías mirar si las tarjetas están generando muchas interrupciones? Puedes
saberlo con un cat /proc/interrupts:
ender@bonzo:~$ cat /proc/interrupts
CPU0
0: 145243168 XT-PIC timer
1: 658148 XT-PIC keyboard
2: 0 XT-PIC cascade
5: 12889488 XT-PIC soundblaster
8: 3 XT-PIC rtc
10: 2222796 XT-PIC usb-uhci
12: 6588303 XT-PIC eth0 <======= Este valor.
14: 1522717 XT-PIC ide0
15: 10359 XT-PIC ide1
NMI: 0
LOC: 145243899
ERR: 0
MIS: 0
¿Sube *a lo bestia* cuando haces una transferencia? Debería subir en uno por
cada paquete.
solucionado cuando han forzado el switch a full duplex
mii-tool –force 100baseTx-FD eth1
Colisiones en inteface eth1
referencias
http://linux-ip.net/html/tools-ethernet.html
~# netstat -in
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 1248529355 0 0 01238671872 0 0 0 BMRU
eth1 1500 0 304093570 0 0 0345828281 45713974 0 0 BMRU
lo 16436 0 3590482 0 0 0 3590482 0 0 0 LRU
lo:1 16436 0 – no statistics available – LRU
eth1 Link encap:Ethernet HWaddr 00:11:25:57:BC:69
inet addr:62.151.24.74 Bcast:62.151.24.79 Mask:255.255.255.240
inet6 addr: fe80::211:25ff:fe57:bc69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:304226299 errors:0 dropped:0 overruns:0 frame:0
TX packets:346020913 errors:45713974 dropped:0 overruns:0 carrier:45713974
collisions:50035841 txqueuelen:1000
RX bytes:1487723678 (1.3 GiB) TX bytes:1302534086 (1.2 GiB)
Base address:0×4400 Memory:d0340000-d0360000
Cambiar de half-duplex a full-duplex
# mii-tool eth0
eth0: 10 Mbit, half duplex, link ok
Port Speed Description
10baseT-HD 10 megabit half duplex
10baseT-FD 10 megabit full duplex
100baseTx-HD 100 megabit half duplex
100baseTx-FD 100 megabit full duplex
~# mii-tool eth0
eth0: negotiated 100baseTx-FD, link ok
~# mii-tool -v
eth0: negotiated 100baseTx-FD, link ok
product info: vendor 00:aa:00, model 56 rev 0
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
eth1: negotiated 100baseTx-FD, link ok
product info: vendor 00:aa:00, model 56 rev 0
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
# mii-tool –force 100baseTx-FD
# mii-tool eth0
eth0: 100 Mbit, full duplex, link ok
tambien se puede forzar en los parametros de los modulos dependiendo de la tarjeta
http://www.cites.uiuc.edu/network/autosense.html
Cisco Catalyst Switches
Departmental Switches
On most multi-module Cisco switches, you can display the current port status with the command:
show port mod/port(s)
The Duplex and Speed columns of the table will tell you what the current port mode is set to. If the port has been forced to a specific mode, that mode will simply be listed. If the port is set to auto-negotiation, but nothing is plugged into it, the speed and duplex will be reported as auto. If the current mode was the result of a successful auto-negotiation, the labels will be prefixed with “a-” (e.g. a-100 or a-full). To change the mode of a port, you can use the following commands:
set port speed mod/port(s) mode, with mode being either 10, 100, or auto.
set port duplex mod/port(s) mode, with mode being either full or half.
If a port has its speed mode set to auto, the duplex mode will also be set to auto and you will not be able to change it. In order to change the duplex mode, you will need to set the speed mode to 10 or 100. For more information, see the Cisco Catalyst 5000 series Ethernet/Fast Ethernet Module manual.
If you are depending on auto-negotiation, please be sure that portfast is configured on, and etherchannel should be set to off.
May 19, 2006 in Apache, Debian
Instalar eaccelerator
Requirements
————
apache >= 1.3, mod_php >= 4.1, autoconf, automake, libtool, m4
apt-get install php4-dev
#/usr/src/
wget http://keihanna.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc2.tar.bz2
tar jxvf eaccelerator-0.9.4-rc2.tar.bz2
cd eaccelerator-0.9.4-rc2
export PHP_PREFIX=”/usr”
$PHP_PREFIX/bin/phpize
./configure \
–enable-eaccelerator=shared \
–with-php-config=$PHP_PREFIX/bin/php-config
export PHP_PREFIX=”/usr/local”
make
You must specify the real prefix where PHP is installed in the “export”
command. It may be “/usr” “/usr/local”, or something else.
Step 2. Installing eAccelerator
make install
pepito2:/usr/src/eaccelerator-0.9.4-rc2# make install
Installing shared extensions: /usr/lib/php4/20020429/
front3
Installing shared extensions: /usr/lib/php4/20020429/
To install as PHP extension:
en /etc/php/apache2/php.ini
extension=”eaccelerator.so”
# memoria a usar
eaccelerator.shm_size=”256″
eaccelerator.cache_dir=”/var/cache/eaccelerator”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=”"
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
Step 4. Creating cache directory
mkdir /var/cache/eaccelerator
chmod 0777 /var/cache/eaccelerator
# errores:
error: C++ preprocessor “/lib/cpp” fails sanity check
soluicon: apt-get install g++
May 19, 2006 in Apache, Debian
Last hit: 09:17:07 atop runtime: 0 days, 00:58:20 09:17:08
All: 638924 reqs ( 182.65/sec) 3433539K ( 981.6K/sec) ( 5.4K/req)
2xx: 455415 (71.3%) 3xx: 175745 (27.5%) 4xx: 7746 ( 1.2%) 5xx: 10 ( 0.0%)
R ( 30s): 5195 reqs ( 173.17/sec) 25405K ( 846.8K/sec) ( 4.9K/req)
2xx: 3447 (66.4%) 3xx: 1715 (33.0%) 4xx: 33 ( 0.6%) 5xx: 0 ( 0.0%)
REQS REQ/S KB KB/S URL
103 3.4 2983 99.4 /
56 1.9 239 8.0 /tickerdata/story2.dat
47 1.6 104 3.6 /home/today/patina.js
44 1.5 82 2.8 /home/styles/home_d0e2ee.css
Primera linea
-Last hit -> ultima peticion
-tiempo uptime
-hora actual
Peticiones totales ( peticiones/segundo )
Kbs totales ( kbs / segundo )
media kb por peticion
2xx -> codigo 222
3xx -> codigo 3xx
4xx -> codigo 4xx
4xx -> codigo 5xx
2ª linea es igual pero de hace 30 segundos, para ver si todo va bien en el momento actual
Teclas : s -> menu de ordenacion
r Sort by REQUESTS
R Sort by REQUESTS/SECOND
b Sort by BYTES
B Sort by BYTES/SECOND
May 19, 2006 in Notas rápidas, redes
Para ver si llegan datos de la ip 192.168.1.100 al puerto 80
tcpdump -i eth0 host 192.168.1.100 and port 80
May 19, 2006 in Debian
Para cds:
mkisofs -f -J -R -r -V -o micarpeta/ > raw.raw
cdrecord dev=ATAPI:/dev/hdc -multi -tao raw.raw
Para dvd:
growisofs
-Z /dev/dvd -> session incial
-M /dev/dvd -> añade sesion
-dvd-compat -> compatibilidad con dvd players
-overburn
-speed=N
-input-charset=ISO-8859-1
-R Rockride
-J Joliet
growisofs -speed=4 -R -J -input-charset=ISO-8859-1 -Z /dev/hdc -over-burn -dvd-compat VIDEO_TS
no poner directorio/ por que no hace el directorio sino que copia el contenido
May 19, 2006 in Notas rápidas
tener instalado el paquete readpst
copiar la carpeta de outlook Spam.pst
$ readpst -w -o /tmp/ Spam.pst
Opening PST file and indexes...
About to start processing first record...
Processing items...
Processing Folder "Elementos eliminados"
No items to process in folder "Elementos eliminados", should have been 0Processing Folder "Spam para enviar"
"Spam para enviar" - 106 items done, skipped 0, should have been 106
"Carpetas personales" - 0 items done, skipped 0, should have been 0
Finished.
genera un fichero como /tmp/Spam para enviar con formato mbox
lo renombro a spam.mbox
… asi me lo aprendí yo:
sa-learn --spam --mbox spam.mbox
May 19, 2006 in redes
subneting
ip -> xxx.xxx.xxx.xxx -> 4 octetos (0-254) -> 4 x 8 = 32 bits
clase a
10.0.0.0 – 10.255.255.255
máscara /8
clase b
172.16.0.0 – 172.31.255.255
máscara /12
clase c
192.168.0.0 – 192.168.255.255
máscara /16
172.30.50.80/255.255.255.240
255.255.255 -> 11111111 111111111 11111111-> 24 bits
ahora más el ultimo
240 -> 11110000 -> 4 bits fijos y 4 libres
24 + 4 -> 28 bits
entonces 255.255.255.240 es lo mismo que /28
con 4 bits podemos representar 2^4 = 16 ips
Senin con N | WordPress | Entries (RSS) | Comments (RSS) | 15 queries. 0.419 seconds.
