martes, 29 de abril de 2008

KDE default desktop

En /etc/sysconfig/desktop

DESKTOP="KDE"
DISPLAYMANAGER="KDE"

Reiniciar X y listo!

martes, 22 de abril de 2008

Mailgraph

Es una herramienta para monitorea un servidor de correo. En ocasiones es necesario migrar dicho servicio entre servidores, sin perder el historico actual, para eso:

1) Instala mailgraph

apt-get install rrdtool mailgraph

2) Configura mailgraph

less /etc/default/mailgraph

3) Define los valores correctos para $rrd, $rrd_virus, $tmp_dir en /usr/lib/cgi-bin/mailgraph.cgi

4) Exporta/importa los archivos rrd:

= Si estas migrando entre iguales arquitecturas con que pongas los archivos mailgraph.rrd y mailgraph_virus.rrd en la ruta correcta.

= Si la migracion es entre diferentes arquitecturas usa:

1. Exportar la base
# rrdtool dump archivo(s).rrd > respaldo.xml

2.Importar la base
# rrdtool restore respaldo.xml


Nota: Este procedimiento esta muy enfocado a que el servidor a donde se migrara la base de mailgraph sea un Debian, sin embargo en terminos generales solo variara el metodo de instalacion.

Script de perl para pruebas del servidor de correo....

Script para pruebas de recepcion de correo, normalmente lo uso para pruebas de stress
=====================================================================================

#!/usr/bin/perl
use MIME::Lite;
$to = $ARGV[0];
$msg = new MIME::Lite
From =>'midir@dominioorigen',
To =>$to,
Subject =>'Mail para prueba de stress',
Type =>'multipart/mixed';

attach $msg
Type =>'TEXT',
Data =>"

Aqui cualquier mensaje
";
$msg->send;





Script para probar que esta detectando correctamente correo spam
================================================================

#!/usr/bin/perl
use MIME::Lite;
$to = $ARGV[0];
$msg = new MIME::Lite
From =>'direccion@dominioorigen',
To =>$to,
Subject =>'Prueba para spam',
Type =>'multipart/mixed';

attach $msg
Type =>'TEXT',
Data =>"


XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X



";
$msg->send;



Script para probar que esta detectando correctamente correo con un adjunto con virus (clamav)
=============================================================================================
!/usr/bin/perl
use MIME::Lite;
$to = $ARGV[0];

### Adjust subject and body message
my $subject = 'A message with 2 parts ...';
my $message_body = "Here's the attachment file(s) you wanted";

### Adjust the filenames
my $my_file = '/home/marce/clam.cab';

### Create the multipart container
$msg = MIME::Lite->new (
From => 'midir@dominoorigen',
To => $to,
Subject => $subject,
Type =>'multipart/mixed'
) or die "Error creating multipart container: $!\n";

### Add the text message part
$msg->attach (
Type => 'TEXT',
Data => $message_body
) or die "Error adding the text message part: $!\n";

### Add the file
$msg->attach (
Type => 'image/gif',
Path => $my_file,
# Filename => $your_file_gif,
Disposition => 'attachment'
) or die "Error adding $file_gif: $!\n";

### Send the Message
MIME::Lite->send('smtp', $mail_host, Timeout=>60);
$msg->send;



NOTA:

En todos estos script se envia por argumento la direccion a quien sera enviado el mail.

jueves, 17 de abril de 2008

Saber informacion de la configuracion de un sistema

AIX:
prtconf
lscfg

IRIX:
hinv - hardware -
chkconfig - software -

MAC OS:
system_profiler

SOLARIS:
prtconf
sysdef

LINUX:
/usr/sbin/lshw

por comandos separados:
uname - Version SO, arquitectura, nombre del host
free - memoria
/proc/cpuinfo - procesador