Consola: gestores de descarga

Si, también se puede descargar archivos desde consola:

axelhttp://axel.alioth.debian.org/

Ya había hecho un pequeño resumen de este gestor (aquí) entre las características se podría decir que es liviano, veloz y eficiente, no tengo ningún problema con este gestor de descarga. Para usarlo basta con ejecutar:

axel enlace_archivo

aria2http://aria2.sourceforge.net/

Otro gestor que va haciendo eco es este, entre lo relevante de este gestor es la posibilidad de usarlo como cliente torrent. Cuenta con un sin fin de opciones, muy parecido al clásico wget. Para lanzar el programa:

aria2c enlace_archivo

wgethttp://www.gnu.org/software/wget/

Que se puede decir de este gestor, es el que viene instalado en el SO, el más completo, aunque personalmente he tenido problemas con algunas descargas, ya que el programa no reconocía correctamente los enlaces.

wget enlace_archivo

Cabe mencionar que los tres programas se encuentran en los repositorios de ubuntu, para instalarlos se puede hacer mediante Synaptic o por consola:

sudo apt-get install nombre_programa

bmon: monitoreando la red por consola

Creo que ya encontré que le falta al escritorio KDE, y es tener un monitor de red, si bien existe un plasmoid para monitorear la red, de este no se puede quitar el icono.

En la siguiente imagen se muestra de mejor manera lo que quiero decir, remarque con color rojo todo el plasmoid, como se puede observar hay un molesto ícono de red (a parte de los monitores de red):

Ya que el programa se encuentra en los repositorios, su instalación es bastante sencilla, en consola:

sudo aptitude install bmon

Y el modo de usar, también consola:

bmon

Incluso cuenta con un visualizador «gráfico», para activarlo es necesario presionar la tecla g (sobra mencionar que el programa tiene que estar funcionando), si la ventana de la consola no es lo suficientemente grande, el programa mostrará una alerta indicando que se debe ampliar la ventana.

Consola: arreglar comando ls

Instale crunch (con make), que es un generador de textos, luego de probarlo y desintalarlo, vaya sorpresa!

Al ejecutar la orden (comando) ls (que sirve para listar los archivos y directorios) en consola tenía el siguiente texto:

crunch version 2.4
usage: crunch <min-len> <max-len> [charset] [-o wordlist.txt] [-t [FIXED]@@@@] [-s startblock] [-c number]orusage: crunch <min-len> <max-len> [-f <path to charset.lst> charset-name] [-o wordlist.txt] [-t [FIXED]@@@@] [-s startblock] [-c number]
min-len is the minimum length string you want crunch to start atmax-len is the maximum length string you want crunch to end at
[charset] is optional.  You may specify a character set for crunch to use on the command line or if you leave it blank crunch will use abcdefghijklmnopqrstuvwxyz as the character set.  NOTE: If you want to include the space character in your character set you use enclose your character set in quotes i.e. "abc "
[-f <path to charset.lst> <charset-name>] is the alternative to setting the character set on command line.  This parameter allows you to specify a character set from the charset.lst.NOTE: You may either not specify a charset, you may specify a character set on the command line, or you may specify -f <path to charset.lst> <charset-name>.  You can only do one.
[-t [FIXED]@%^] is optional and allows you to specify a pattern, eg: @@god@@@@ where the only the @'s will change.  You can specify @ or % or ^  which will allow to change letters numbers and symbols.  For example @@dog%^ abcd 1234 @#$% the @'s will chnage with the characters the % will change with the numbers and the ^ will change with the symbols you specifed.  If you use %dog^ + 1234 @#$% the plus sign is a placeholder.
[-s startblock] is optional and allows you to specify the starting string, eg: 03god22fs
[-i] is optional and will invert the output.  Instad of aaa, aab, aac you will get aaa, baa, caa, etc
[-o wordlist.txt] is optional allows you to specify the file to write the output to, eg: wordlist.txt
[-c number] is optional and specifies the number of lines to write to output file, only works if -o START is used, eg: 60  The ouput files will be in the format of starting letter-ending letter for example: ./crunch 1 1 -f /pentest/password/crunch/charset.lst mixalpha-numeric-all-space -o START -c 60 will result in 2 files: a-7.txt and 8-\ .txt  The reason for the slash in  the second filename is the ending character is space and ls has to escape it to print it.  Yes you will need to put in the \ when specifing the filename.
[-b size] is optional and will break apart the output file based on the size you specify.  you must specify the size as a number followed by kb, mb, gb, kib, mib, or gib.  kb, mb, and gb are based on the power of 10 (i.e. 1 kb = 1000 bytes).  kib, mib, and gib are based on the power of two (i.e. 1 kb = 1024 bytes).  To use this option you must specify -o START.  NOTE There is no space between the number and the type.  For example 500mb is correct, 500 mb is NOT correct.
[-z option] is optional and will compress the outfile using bzip, gzip, or lzma
[-p string-of-letters] is optional crunch will now generate permutations instead of combinations.  The string of letters is the string of letters you use to permute.  This parameter ignores min and max
[-m string1 string2 string3 ...] is optional crunch will now generate permututions of the strings you specify.  This parameter ignores min and max
[-r] is optional and resume a previous crunch session.  You must use the same syntax as the original command.  This option will not work with the -p or -m options.
examples:./crunch 1 8crunch will display a wordlist that starts at a and ends at zzzzzzzz
./crunch 1 6 abcdefgcrunch will display a wordlist using the charcterset abcdefg that starts at a and ends at gggggg
./crunch 1 8 -f charset.lst mixalpha-numeric-all-space -o wordlist.txtcrunch will use the mixalpha-numberic-all-space character set from charset.lst and will write the wordlist to a file named wordlist.txt.  The file will start with a and end with "        "
./crunch 8 8 -f charset.lst mixalpha-numeric-all-space -o wordlist.txt -t @@dog@@@ -s cbdogaaa crunch will generate a 8 character wordlist using the mixalpha-number-all-space characterset from charset.lst and will write the wordlist to a file named wordlist.txt.  The file will start at cbdogaaa and end at "  dog   "

Que no es exactamente la lista de archivos y directorios, después de romperme la cabeza por un par de horas y leyendo algo por aquí y por allá y aplicando el principio KISS solucione este pequeño problema de la manera más fácil que pude.

Primero debemos probar que las rutas /usr/bin y /bin se encuentren el path, hay dos formas de hacer esto (en consola claro):

  • cat /etc/environment
  • echo $PATH

El resultado:

PATH=»/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games»

Por tanto todo esta bien aquí, continuamos.

Luego localizar (físicamente) el comando ls (para ver el archivo de error), para esto en consola:

which ls

Lo que devuelve:

/usr/sbin/ls

Ahora si escribimos la ruta completa del comando ls (la que se encuentra en /bin) para ver si este se encuentra en buen estado:

/bin/ls

Eureka! tenemos la lista de directorios y archivos, pero claro es mucho más sencillo usar ls que la ruta completa, lo que solamente quedaría crear un enlace a /bin/ls y copiarlo (reemplazarlo) a /usr/sbin/ls (que es el que tiene problemas).

Axel: gestor de descargas ligero

Siempre estuve acostumbrado a usar el famoso wget para realizar la descarga de archivos, y como siempre pasa en entornos Gnu/Linux hay varias alternativas para realizar la misma tarea, es por esto que empecé a buscar algo parecido a wget, hasta que dí con Axel.

De la descripción de synatic:

Axel intenta acelerar el proceso de descarga usando conexiones múltiples para un solo archivo. También puede usar múltiples servidores de réplica para una descarga. Axel intenta ser lo más ligero posible (25-30k enformato binario), para que pueda ser útil como clon de wget en sistemas donde el tamaño es crítico.

Luego de usarlo uno se queda contento, ya que se nota que la velocidad es un poco mejor a la de wget, la visualización de igual manera, aunque sea en la consola te da una mejor vista del progreso de la descarga.

Para  instalarlo, desde consola claro:

sudo aptitude install axel

Y para usarlo, igualmente por consola:

axel archivo

O si se tiene varios orígenes del archivo:

axel archivo url1 url2