Thursday, June 24, 2010

rm -rf * : Too many arguments

El otro dia que estaba queriendo borrar unos archivos que ya no necesitaba, pero el problema es que eran demasiados para el limite de argumentos que soporta el kernel de linux, y este error ocurre cada vez que el usuario pasa mas argumentos de los que el sistema soporta, y esto aplica a todos los comandos como: ls, cp, rm, etc.

Asi que habia que buscar una alternativa (workaround) para el comando rm -rf *, entonces es cuando otros comandos de Bourne Shell pueden ser utiles para completar esta tarea, asi que aqui les muestro dos alternativas:

for i in *; do rm -rf $i; done

De esta forma el comando for toma un archivo a la vez y lo coloca en la variable $i; dentro del loop se ejecuta el comando rm para finalmente borrar el archivo; resultado, los archivos son eliminados, que es lo que se deseaba desde el principio.

Otra alternativa para realizar esta tarea es mediante el comando find:

find . -type f -name '*' -exec rm -rf {}\;

El comando find pasa cada archivo que coincide con la busqueda y ejecuta el comando rm -rf en cada uno de ellos, completando al final la tarea deseada.

Hay otras alternativas, pero las dejo para la investigacion, de hecho una de ellas es el modificar, en el kernel de Linux, la variable que permiten incrementar el limite de parametros que se pueden pasar en una linea de comandos, pero ojo, esto require del conocimiento de los cambios que se haran y de como compilar un nuevo kernel de Linux; una pista, busquen en /include/linux/binfmts.h.

Saludos y hasta la proxima.

___ ___ _ ___ _
| __|_ ___| \(_)__ _ __| _ ) |___ __ _
| _/ _/ _ \ |) | / _` |_ / _ \ / _ \/ _` |
|_|\__\___/___/|_\__,_/__|___/_\___/\__, |
|___/

Tuesday, June 8, 2010

What is Gopher?

gopher n. 1. Any of various short tailed, burrowing mammals of the family Geomyidae, of North America. 2. (Amer. colloq.) Native or inhabitant of Minnesota: the Gopher State. 3. (Amer. colloq.) One who runs errands, does odd-jobs, fetches or delivers documents for office staff. 4. (computer tech.) Software following a simple protocol for tunneling through a TCP/IP internet.

If we use that last definition and with one click of your browser (I hope you are using Firefox) you've just taken several years back in Internet time. Close your eyes and grip your terminal. Imagine there's no Websites (it's easy if you try). Imagine that there's a Commodore 64 on your desk, or maybe a 386.

Now open them again.

You're in the year 1991, when University of Minnesota computer scientists, fed up with the limitations of FTP for downloading files and the overhead of having to log into computers for everything, decided to come up with a friendlier method of accessing data over the then largely vacant and much smaller Internet. The result was Gopher, a simple and easy to understand menu system that allowed once hideously complicated systems and services to be strung together for straightforward usage. And Gopher Was Good.

In fact, Gopher was so good that for several years, Gopher sites sprang up all over. You could get weather reports on Gopher, news, mailing lists, even software.

Then Mosaic came out barely a year or so later and plunged the world into darkness and all seemed lost under the choking strands of the World Wide Web. And Gopherspace lay all but forgotten.

But Gopher's still out there. And what's more, you'll find it surprisingly useful, even years after the Web became a household word. Why?

  • It's easy to set up.
  • It's easy to write content for and facilitates organization.
  • It doesn't need much system power to run -- either from the server or from your computer. It can run on systems with little CPU power or memory.
  • It supports many things that the Web does, even if it looks less attractive. You can still view images, search and download programs, and ...
  • ... since Gopher has less data to transfer, it's frequently faster.

Save the Gopher! Explore Gopherspace with Veronica-2 and find out about the hidden world the Gophers once dug. And think how different the world would be if that darn Mosaic had never been written ... :-)

So how do you get to gopher, well click in any of the following urls, and no it's not http:// it's gopher://
Do you search the gopher?
 ___       ___  _         ___ _    
| __|_ ___| \(_)__ _ __| _ ) |___ __ _
| _/ _/ _ \ |) | / _` |_ / _ \ / _ \/ _` |
|_|\__\___/___/|_\__,_/__|___/_\___/\__, |
|___/

Friday, June 4, 2010

La aspiradora del sistema solar.

Si Jupiter se le conoce tambien como la aspiradora del sistema solar, por que? Dado su gran tamanio y campo magnetico que se extiende a millones de kilometros de distancia, es capaz de atrapar objetos muy distantes en su orbita, tal fue el caso del cometa Shoemaker-Levi 9 que en el 94 se desintegro al ingresar a la atmosfera de Jupiter.

El anio pasado tambien en julio, Jupiter aparecio de repente con una mancha gigantesca, producto del encuentro del planeta con algun cometa o meteorito (foto inferior).
Pero nuevamente ayer, como se muestra en la foto de arriba, se puede observar un destello producto del ingreso de otro objeto en la atmosfera de Jupiter.

Muchos astronomos piensan que esa cualidad de Jupiter de ser capaz de atraer mucho del material errante en el sistema solar ha permitido la existencia de vida aqui en la tierra, pues de lo contrario, es posible que nuestro planeta fuese bombardeado por un cometa o meteorito cada 50 anios aproximadamente.