20110829

Renombrado de ficheros por lotes - Batch renaming files

Me ha vuelto a pasar!!! He ejecutado el siguiente script desde la línea de comandos para el renombrado de archivos en lotes:
for i in `ls`; do mv $i BKP_$i; done

mediante el cual, añado el prefijo BKP_ a todos los ficheros del directorio de trabajo, peeeeero lo he hecho en la ruta equivocada!!! Así que tengo un montón de archivos a los que les he añadido un prefijo que tengo que quitar.
La solución (o una de ellas) me la ofrece el comando cut. Con él, podemos seleccionar de una cadena de texto, los caracteres que queramos mostrar o quitar (--complement).
El nuevo script para reparar el entuerto sería:
for i in `ls`; do mv $i `echo $i| cut -c 1-4 --complement`; done

Y problema resuelto.

Ups, I did it again!!! I have run the following script from the command line to rename some files:
for i in `ls`; do mv $i BKP_$i; done

to add the prefix BKP_ to all files in the current directory, but I did it on the wrong path!!! So I have lots of files with a prefix to remove.
The solution (or at least, one of them) is to use the command cut. We can use it to choose some characters from a string.
The script to repair my mistake and remove (--complement) this prefix is:
for i in `ls`; do mv $i `echo $i| cut -c 1-4 --complement`; done

And its done!!!

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.

20110826

Event ID 7000 Network Load Balancing

La vuelta de mis tan merecidas vacaciones no está siendo tan ****** como en un principio pensé. Parece que algunos servidores y/o servicios también se han ido de vacaciones y no quieren volver. 
Tengo un W2K3 x86 + SP2 que me está dando una poca guerra. He tenido que aplicar un parche al mismo por un problema que si lo veo resuelto ya comentaré, y durante el inicio del mismo, he visto que me aparecía un alert indicando un error en el visor de sucesos.
Me dirijo al mismo ejecutando eventvwr y en el apartado system, veo el id de suceso: 7000 con Origen: Service Control Manager y la descripción:
El servicio Network Load Balancing no pudo iniciare debido al siguiente error:
No se puede iniciar el servicio, porque está deshabilitado o porque no tiene dispositivos asociados a él.

Busco un poco y encuentro, entre otras muchas páginas, una de Microsoft y otra de Symantec, en las que se resuelve este problema editando el registro para que no se notifique el mismo. Según Microsoft, el error puede aparecer si se hace referencia al servicio Equilibrio de carga de red como un componente en el grupo de inicio de un servicio de otro fabricante.

En mi caso he buscado y puede que el cliente de Backup Exec tenga algo que ver, ya que este aviso aparece aunque no tengas instalado dicho servicio!!. De todos modos, he ejecutado el proceso descrito en los enlaces abajo.

After I came back(up) from my holiday period, I've find out that some server/services had gone to enjoy their vacations too.
I have a  W2K3 x86 + SP2 which wants to have some fun with me! I have to apply a patch on it to solve an issue that will be explained here if I beat it!. But on the next boot, <IRONIC>Yahooo!!! Thanks Microsoft!! I like to reboot my servers just for applying a simple patch</IRONIC>, an alert window advice me that something has failed with the message:
At least one service or driver failed during system startup. Use Event Viewer to examine the event log for his issue may occur if the Network Load Balancing service is referhis issue may occur if the Network Load Balancing service is referenced as a component in the startup group of a third-party service.enced as a component in the startup group of a third-party service.details.

Where I find an error with Event id: 7000, Source: Service Control Manager and description:
The Network Load Balancing service failed to start due to the following error: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. Network Load Balancing is not installed on the system.

After some Internet searching I found some pages, incluiding Microsoft and Symantec  sites, that report this issue and show how to solve it.
The Microsoft site says that this issue may occur if the Network Load Balancing service is referenced as a component in the startup group of a third-party service.
Anyway I have solved the problem by following the procedure explained in the following links:

Sources: 

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.

20110823

Microsoft: Tipos de claves de producto - Product key types

Hoy he tenido que descargar unas ISO de la web de Microsoft, y he visto esto que me ha parecido que podría ser de utilidad para alguno de los lectores del blog (si es que hay alguno a parte de mi madre!):
KMS: Los servicios de administración de clave (KMS) permiten a las organizaciones activar sistemas dentro de su propia red. Así ya no resulta necesario que los equipos individuales conecten con Microsoft para activar productos.

MAK: La clave de activación múltiple (MAK) requiere que cada equipo se conecte una única vez al servidor de activación de Microsoft. Una vez que se hayan activado los equipos, no será necesaria ninguna otra comunicación con Microsoft.

VL Key: Las claves de Volume License (VLK) se utilizan para las activaciones por volumen.


Today I had to download some ISO from the Microsoft web site, and I have seen this that could be interesting for some of my readers (If there is someone apart from my mother!):
KMS: Key Management Service (KMS) allows organizations to activate systems within their own network, eliminating the need for individual computers to connect to Microsoft for product activation.

MAK: A Multiple Activation Key (MAK) requires each computer to connect to a Microsoft activation server one time. Once computers are activated, no further communication with Microsoft is required.

VL Key: A Volume License (VL) Key is used for volume activations.

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.