jueves, 27 de noviembre de 2008

Script de Perl para renombrar archivos...

#/usr/bin/perl

@files=`ls -1 *.jpg`;
foreach $file ( @files ){
chomp($file);
$newfile=$file;
$newfile=~ s/name\_old/name\_new/;
if (-e $newfile) {
warn "No se puede renombrar $file a $newfile: $newfile ya existe\n";
}
elsif (rename $file, $newfile) {
}
else {
warn "Fallo $file a $newfile $!\n";
}
}

NOTA: Cortesia de Learning Perl.

miércoles, 12 de noviembre de 2008

vsftpd

1) apt-get install vsftpd

2) cp /etc/vsftpd.conf /etc/vsftpd.conf-dist

3) > /etc/vsftpd.conf

4) vi /etc/vsftpd.conf


# Example config file /etc/vsftpd.conf
#
#
##### GENERAL #####
# vsftpd will run in standalone mode
listen=YES

# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
pasv_min_port=20000
pasv_max_port=21000
tcp_wrappers=YES

# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=ftp

# You may fully customise the login banner string:
ftpd_banner=Welcome to OllinStudio FTP service.

# Time out an idle session.
idle_session_timeout=600

# Time out a data connection.
data_connection_timeout=120

# maximum number of clients which may be connected
max_clients=10

# maximum number of clients which may be connected from the
# same source internet address
max_per_ip=3

##### USER #####
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=no

# Uncomment this to allow local users to log in.
local_enable=YES

# Uncomment this to enable any form of FTP write command.
write_enable=YES

# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022

# messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES

# You may restrict local users to their home directories.
chroot_local_user=YES

# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
chroot_list_enable=YES

# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list

# all user and group information in directory listings
# will be displayed as “ftp”
hide_ids=YES


# If userlist_deny=NO, only allow users in the file /etc/vsftpd.user_list
userlist_deny=NO


##### LOG's #########
# Activate logging of uploads/downloads.
xferlog_enable=YES

# the log file
xferlog_file=/var/log/vsftpd.log

# If you want, you can have your log file in standard ftpd xferlog format
xferlog_std_format=YES

##### Debian customization #####
#
# Some of vsftpd's settings don't fit the Debian filesystem layout by
# default. These settings are more Debian-friendly.
#
# This option should be the name of a directory which is empty. Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/vsftpd.pem





5) vi /etc/vsftpd.chroot_list
usuarios permitidos

6) vi /etc/vsftpd.ftpusers
usuarios locales no permitidos, normalmente root, admin, etc.

7) /etc/init.d/vsftpd start


NOTA:

Un error asi:

# /usr/sbin/vsftpd
500 OOPS: missing value in config file for:

Lo solucione verificando que en archivo de configuracion las lineas en blanco fueran eso lineas en blanco y no lineas con un espacio.

viernes, 7 de noviembre de 2008

Webcollab...

Webcollab es una herramienta para la administracion de proyectos.


Instalacion:

1. apt-get install mysql-server-5.0 php5-mysql apache2 libapache2-mod-php5 postfix
2. Bajar la version mas reciente
3. # cd /var/www/
# tar -zxvf webcollab-*.**.tar.gz
# ln -s webcollab-X.XX webcollab
# chmod 666 webcollab/config/config.php
4. En un webbrowser accesar a:
http://your_site/webcollab/setup.php
5. Siga las instrucciones
6. # chmod 444 webcollab/config/config.php


PD: Espero algun dia saber como integrarlo con ldap para asi no tener otra base para usuarios.

miércoles, 5 de noviembre de 2008

Herramientas de monitoreo...

Casi siempre existe la duda de que software usar para monitoreo, quiza este link te pueda ayudar a determinar cual es mejor para tu caso en particular.

http://en.wikipedia.org/wiki/Comparison_of_network_monitoring_systems

Uso Nagios(monitoreo servidores) y Ganglia(nodos de una granja), por ser simples de configurar, mantener y la interfaz sencilla.