<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AlvaroLara.com</title>
	<atom:link href="http://www.alvarolara.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alvarolara.com</link>
	<description>desarrollo Web, Android, SEO Burgos</description>
	<lastBuildDate>Wed, 19 Jun 2013 19:28:27 +0000</lastBuildDate>
	<language>es-ES</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>convertir formato de libros electrónicos por consola</title>
		<link>http://www.alvarolara.com/2013/06/19/convertir-formato-de-libros-electronicos-por-consola/</link>
		<comments>http://www.alvarolara.com/2013/06/19/convertir-formato-de-libros-electronicos-por-consola/#comments</comments>
		<pubDate>Wed, 19 Jun 2013 19:19:59 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[tutoriales]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1470</guid>
		<description><![CDATA[¿Quién no ha oído hablar de Calibre en estos últimos años? posiblemente todas las personas que dispongan de un libro electrónico. Se trata de una potente biblioteca para gestionar y organizar libros e incluye un magnífico conversor entre formatos multimedia, pero&#8230; ¿cómo convertir formatos si nos encontramos en un servidor o si queremos crear un]]></description>
				<content:encoded><![CDATA[<p>¿Quién no ha oído hablar de <strong>Calibre</strong> en estos últimos años? posiblemente todas las personas que dispongan de un <strong>libro</strong> electrónico.<br />
Se trata de una potente biblioteca para gestionar y organizar libros e incluye un magnífico conversor entre formatos multimedia, pero&#8230; ¿cómo convertir <strong>formatos</strong> si nos encontramos en un servidor o si queremos crear un servicio web de conversión de formatos de libros?</p>
<h3>instalar Calibre</h3>
<p>Para instalar calibre, basta con un simple:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> calibre</pre></td></tr></table></div>

<p><img src="http://www.alvarolara.com/wp-content/uploads/2013/06/calibre.png" alt="calibre" width="600" height="320" class="aligncenter size-full wp-image-1488" /></p>
<h3>detrás de la interfaz</h3>
<p>Aunque el modo natural de ejecución de Calibre es mediante interfaz gráfica, en el backend hace uso de multitud de programas y librerías como <strong>pdftohtml</strong> para la conversión de pdf a html, <strong>calibre-smtp</strong> que se encarga de enviar correos, <strong>calibre-server</strong> que permite tener una instancia de Calibre en un servidor para crear una estructura Cliente-Servidor, <strong>ebook-viewer</strong> que visualiza todo tipo de ficheros de ebooks y <strong>ebook-convert</strong> que permite convertir entre todos los formatos de libros electrónicos.</p>
<h3>ebook-convert</h3>
<p>Para convertir formatos de libros hay que usar este potente conversor integrado en la instalación de Calibre en sistemas GNU/Linux, y para usarlo, basta con poner el comando y el fichero de entrada y salida:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">ebook-convert ficheroentrada ficherosalida</pre></td></tr></table></div>

<p>Ficheros soportados:</p>
<ul>
<li>AZW4</li>
<li>CHM</li>
<li>Comic</li>
<li>DJVU</li>
<li>DOCX</li>
<li>EPUB</li>
<li>FB2</li>
<li>HTLZ</li>
<li>HTML</li>
<li>LIT</li>
<li>LRF</li>
<li>MOBI</li>
<li>ODT</li>
<li>PDB</li>
<li>PDF</li>
<li>PML</li>
<li>RB</li>
<li>RTF</li>
<li>Recipe</li>
<li>SNB</li>
<li>TCR</li>
<li>TXT</li>
</ul>
<p><img src="http://www.alvarolara.com/wp-content/uploads/2013/06/ebook-convert-calibre.png" alt="ebook-convert-calibre" width="600" height="320" class="aligncenter size-full wp-image-1491" /></p>
<p>Fuentes: <a href="http://manual.calibre-ebook.com/cli/cli-index.html" target="_blank">Command Line Interface &#8211; Calibre user manual</a> y <a href="http://manual.calibre-ebook.com/cli/ebook-convert.html" target="_blank">ebook-convert &#8211; Calibre user manual</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/19/convertir-formato-de-libros-electronicos-por-consola/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>diferencias entre POP e IMAP</title>
		<link>http://www.alvarolara.com/2013/06/16/diferencias-entre-pop-e-imap/</link>
		<comments>http://www.alvarolara.com/2013/06/16/diferencias-entre-pop-e-imap/#comments</comments>
		<pubDate>Sun, 16 Jun 2013 08:09:50 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[conocimiento libre]]></category>
		<category><![CDATA[curiosidades]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1206</guid>
		<description><![CDATA[Cuando queremos leer el correo electrónico, normalmente lo hacemos a través de sitios web como hotmail.com, gmail.com yahoo.com&#8230; etc. pero además de esta interfaz, se puede leer a través de otras aplicaciones de escritorio como Outlook, Thunderbird, KMail, Evolution o aplicaciones móviles como las que vienen por defecto en iOS y Android. Pero para que]]></description>
				<content:encoded><![CDATA[<p>Cuando queremos leer el <strong>correo electrónico</strong>, normalmente lo hacemos a través de sitios <strong>web</strong> como hotmail.com, gmail.com yahoo.com&#8230; etc. pero además de esta interfaz, se puede leer a través de otras <strong>aplicaciones</strong> de escritorio como Outlook, Thunderbird, KMail, Evolution o aplicaciones móviles como las que vienen por defecto en iOS y Android. Pero para que estas aplicaciones se puedan conectar a nuestro servidor de correo, hacen falta unos <strong>protocolos</strong> que hagan esa labor.<br />
Pues bien, esos protocolos existen y son <strong>POP e IMAP</strong>.</p>
<h3>POP</h3>
<p>También conocido como POP3, tiene la ventaja principal de que carpetas, mensajes&#8230; etc. se guardan en nuestro ordenador, con lo que nos permite leer el correo recibido sin estar conectado a la red.</p>
<h3>IMAP</h3>
<p>La principal diferencia que encontramos respecto al anterior protocolo es que tanto los mensajes como las carpetas se guardan en el servidor (hotmail.com, gmail.com yahoo.com..etc.). Esto, que puede parecer un inconveniente, es muy útil para conectarse desde ordenadores compartidos, ya que los mensajes no pueden ser leídos por terceras personas, al no quedarse en el PC.</p>
<h3>¿qué diferencias hay entre ambos?</h3>
<p>La principal diferencia es que IMAP permite leer el correo sin tener que descargarlo en el equipo local. Todas las operaciones se realizan en el servidor y no en el equipo de usuario como hace POP3.</p>
<p>Además, permite la conexión de múltiples usuarios o programas gestores de correo de forma simultánea a un mismo propietario.</p>
<p>Permite la obtención parcial o total de los mensajes y sus adjuntos, así como, soporte para búsquedas en la parte del servidor.</p>
<h3>¿cuál recomiendas?</h3>
<p>He trabajado con ambos en múltiples programas y se lo he instalado a bastantes clientes, pero mi recomendación es usar siempre <strong>IMAP</strong>, de tal manera que si por equivocación el equipo donde está instalado el cliente de correo se estropea o no arranca, el correo seguirá <strong>conservándose</strong> en el servidor y si podremos acceder a el a través de otros clientes en otros equipos, mientras que si este hubiese estado configurado con <strong>POP</strong>, al no haber podido acceder al equipo donde estaba el cliente, <strong>perderíamos</strong> el correo ya que no se conserva nada en el servidor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/16/diferencias-entre-pop-e-imap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>conexión FTP con una cuenta SSH</title>
		<link>http://www.alvarolara.com/2013/06/15/conexion-ftp-con-una-cuenta-ssh/</link>
		<comments>http://www.alvarolara.com/2013/06/15/conexion-ftp-con-una-cuenta-ssh/#comments</comments>
		<pubDate>Sat, 15 Jun 2013 20:07:45 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[conocimiento libre]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[tutoriales]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1420</guid>
		<description><![CDATA[SSH es un protocolo para acceso remoto a equipos por consola similar a Telnet, pero mucho mas avanzado e integrado por defecto en distribuciones Linux de servidor. Lo que quizás no sepas es que este protocolo permite acceder al aquipo donde esté instalado a través de un cliente FTP por defecto. acceso mediante un cliente]]></description>
				<content:encoded><![CDATA[<p>SSH es un protocolo para acceso <strong>remoto</strong> a equipos por consola similar a Telnet, pero mucho mas avanzado e integrado por defecto en distribuciones Linux de servidor. </p>
<p>Lo que quizás no sepas es que este protocolo permite acceder al aquipo donde esté instalado a través de un cliente FTP por defecto.</p>
<h3>acceso mediante un cliente FTP</h3>
<p>Instalamos un cliente FTP en nuestro equipo como por ejemplo Filezilla:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> filezilla</pre></td></tr></table></div>

<p>Ahora vamos al gestor de sitios, añadimos uno nuevo y:</p>
<ul>
<li>En servidor: ponemos la IP del servidor donde está instalado SSH.</li>
<li>En protocolo: seleccionamos SFTP &#8211; SSH File Transfer Protocol</li>
<li>En usuario: ponemos un usuario del sistema. No es recomendable entrar como root.</li>
</ul>
<p><img src="http://www.alvarolara.com/wp-content/uploads/2013/06/filezilla-ssh-ftp.png" alt="filezilla-ssh-ftp" width="600" height="391" class="aligncenter size-full wp-image-1455" /></p>
<p>A continuación pulsamos sobre &#8216;<strong>Conectar</strong>&#8216; y accederemos a la carpeta del usuario con el que hayamos accedido.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/15/conexion-ftp-con-una-cuenta-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>instalación y configuración de vsftpd</title>
		<link>http://www.alvarolara.com/2013/06/15/instalacion-y-configuracion-de-vsftpd/</link>
		<comments>http://www.alvarolara.com/2013/06/15/instalacion-y-configuracion-de-vsftpd/#comments</comments>
		<pubDate>Sat, 15 Jun 2013 19:47:18 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[tutoriales]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1419</guid>
		<description><![CDATA[Vsftpd (Very Secure FTP Daemon) o demonio FTP muy seguro es un servidor FTP liviano, potente y altamente configurable. Se encuentra en los repositorios de todas las distribuciones Linux. Por su parte, un FTP (File Transfer Protocol) o Protocolo de Transferencia de Archivos es uno de los protocolos estándar más utilizados en Internet para la]]></description>
				<content:encoded><![CDATA[<p><strong>Vsftpd</strong> (Very Secure FTP Daemon) o demonio FTP muy seguro es un <strong>servidor FTP</strong> liviano, potente y altamente configurable. Se encuentra en los repositorios de todas las distribuciones Linux.</p>
<p>Por su parte, un FTP  (File Transfer Protocol) o Protocolo de Transferencia de Archivos es uno de los <strong>protocolos</strong> estándar más utilizados en Internet para la transferencia de grandes bloques de datos a través de redes que soporten <strong>TCP/IP</strong>. Existen variantes que implementen túneles SSH sobre FTP denominados FTP.</p>
<p>El uso más <strong>extendido</strong> es para acceder al servidor web para modificar, subir, eliminar o modificar permisos de archivos o directorios.</p>
<p>En esta entrada vamos a ver cómo <strong>instalarlo</strong> y <strong>configurarlo</strong> con una <a href="http://www.alvarolara.com/2013/06/14/instalar-apache-php-mysql-y-phpmyadmin-en-ubuntu/">instalación previa de apache</a>.</p>
<h3>instalación</h3>
<p>Para su instalación, basta con un simple comando:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> vsftpd</pre></td></tr></table></div>

<h3>configuración</h3>
<p>El nivel de complejidad de la configuración variará según qué <strong>necesidades</strong> tengamos. EL fichero de configuración se encuentra en <strong>/etc/vsftp.conf</strong> y viene configurado por defecto con características como FTP anónimo y otra serie de cosas, que a mi personalmente no me gustan, por lo que el primer paso va a ser <strong>editarlo</strong>:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd.conf</pre></td></tr></table></div>

<p><strong>Comentamos</strong> las siguientes líneas:</p>
<ul>
<li><strong>anonymous_enable</strong>: desactiva FTP anónimo.</li>
<li><strong>ftpd_banner</strong>: mensaje de bienvenida.</li>
</ul>
<p>A continuación, establecemos los siguientes parámetros para enjaular a determinados usuarios, es decir, evitar que anden por otros directorios que no sean los que nosotros indicamos:</p>
<ul>
<li>chroot_local_user=YES</li>
<li>chroot_list_enable=YES</li>
<li>chroot_list_file=/etc/vsftpd/chroot_list</li>
</ul>
<p>Con esto terminamos de configurar las opciones básicas. Lo que tenemos que hacer ahora es crear el fichero <strong>chroot_list</strong> que contendrá una lista de los usuarios a enjaular de la siguiente forma:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>vsftpd<span style="color: #000000; font-weight: bold;">/</span>chroot_list</pre></td></tr></table></div>

<p>y dentro introducimos la lista de usuarios del <strong>sistema</strong> que queremos enjaular:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">usuario1
usuario2</pre></td></tr></table></div>

<p>Sólo tendremos que crear tantas líneas con usuarios del sistema que vayan a tener acceso al FTP como queramos.<br />
Los usuarios del servicio FTP serán los usuarios del sistema. </p>
<h3>usuarios</h3>
<p>Se pueden crear nuevos usuarios con el simple comando:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> adduser –home <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html –no-create-home –shell <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> usuario</pre></td></tr></table></div>

<p>con el cual no se creará carpeta home por defecto pero se le vinculará la de apache. Habrá que dar permisos a la carpeta /var/www/html para que nuestro usuario pueda escribir.</p>
<p>Otra forma es con los usuarios existentes en el sistema, crear una carpeta www que redireccione a /var/www/html:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> www</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>www <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>html</pre></td></tr></table></div>

<p>La última opción será crear usuarios fantasma, es decir, usuarios que no existan como tal en el sistema pero que si esten en un fichero de texto en formato usuario y contraseña. Para ello, <a href="http://www.esdebian.org/articulos/24066/configuracion-vsftpd-usuarios-fantasma" target="_blank">mirar esta entrada</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/15/instalacion-y-configuracion-de-vsftpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vincular tu sitio web a Google+</title>
		<link>http://www.alvarolara.com/2013/06/15/vincular-tu-sitio-web-a-google/</link>
		<comments>http://www.alvarolara.com/2013/06/15/vincular-tu-sitio-web-a-google/#comments</comments>
		<pubDate>Sat, 15 Jun 2013 18:53:32 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[tutoriales]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1392</guid>
		<description><![CDATA[A estas alturas, todo el mundo sabe que el buscador por excelencia y la web más visitada del mundo, es Google, por lo que si estamos aplicando técnicas SEO sobre nuestro sitio web, es muy importante que consideremos hacerlo sobre este. Por otra parte, Google+ es una de las redes sociales del momento e integra]]></description>
				<content:encoded><![CDATA[<p>A estas alturas, todo el mundo sabe que el buscador por excelencia y la web más visitada del mundo, es <strong>Google</strong>, por lo que si estamos aplicando técnicas SEO sobre nuestro sitio web, es muy importante que consideremos hacerlo sobre este. Por otra parte, <strong>Google+</strong> es una de las redes sociales del momento e integra en ella todos los servicios de Google. </p>
<p>Si disponemos de una web <strong>personal</strong> y de una <strong>cuenta</strong> de Google, podemos hacer que aparezca nuestra imagen de perfil de Google+ en el resultado de <strong>búsqueda</strong> cuando aparezca un resultado de nuestra página, tal y como muestro a continuación.</p>
<p><a href="http://www.alvarolara.com/wp-content/uploads/2013/06/vincular-web-google+.png"><img src="http://www.alvarolara.com/wp-content/uploads/2013/06/vincular-web-google+.png" alt="vincular-web-google+" width="509" height="120" class="aligncenter size-full wp-image-1426" /></a></p>
<p>pero&#8230; ¿cómo se hace?</p>
<h3>crear un enlace a Google+</h3>
<p>Lo primero que debemos de hacer es crear un enlace en la web que queremos vincular a nuestra URL del perfil de Google+:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;https://plus.google.com/107589561804715919091?rel=author&quot;&gt;Google&lt;/a&gt;</pre></td></tr></table></div>

<p>El enlace debe contener el parámetro <strong>?rel=author</strong>. Si falta este parámetro, Google no podrá asociar tu contenido a tu perfil de Google+.</p>
<h3>enlace recíproco desde Google+</h3>
<p>Añade un enlace recíproco que permita acceder al sitio o a los sitios que acabas de actualizar desde tu perfil, para ello:</p>
<ul>
<li>Edita la sección <a href="http://plus.google.com/me/about/edit/co" target="_blank">Colaborador en</a>.
<li>En el cuadro de diálogo que aparece, haz clic en la opción <strong>Añadir enlace personalizado</strong> e introduce la URL del sitio web.</li>
<li>También puedes hacer clic en la lista desplegable para especificar quién puede ver el enlace.</li>
<li>Haz clic en <strong>Guardar</strong>.</li>
</ul>
<p><img src="http://www.alvarolara.com/wp-content/uploads/2013/06/googleplus-vinculos.png" alt="googleplus-vinculos" width="397" height="307" class="aligncenter size-full wp-image-1436" /></p>
<p>Y ya estaría, ahora sólo queda esperar y que alguien busque contenido que hayas publicado en tu página.</p>
<p><strong>Fuente:</strong> <a href="http://support.google.com/webmasters/bin/answer.py?hl=es&#038;answer=1408986" target="_blank">Soporte Google</a>.<br />
<strong>Nota:</strong> puede tardar dias en reflejarse en los resultados de búsqueda.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/15/vincular-tu-sitio-web-a-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>instalar Apache, PHP, MySQL y phpMyAdmin en Ubuntu</title>
		<link>http://www.alvarolara.com/2013/06/14/instalar-apache-php-mysql-y-phpmyadmin-en-ubuntu/</link>
		<comments>http://www.alvarolara.com/2013/06/14/instalar-apache-php-mysql-y-phpmyadmin-en-ubuntu/#comments</comments>
		<pubDate>Fri, 14 Jun 2013 20:16:59 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1407</guid>
		<description><![CDATA[Un servidor web es el programa que muestra las páginas webs en tu navegador y Apache es el servidor web más usado del mundo: gratuito, modular, multiplataforma y de código abierto. Se puede combinar con múltiples bases de datos, scripts de configuración e interfaces web para facilitar tareas al usuario. También existen suites de programas]]></description>
				<content:encoded><![CDATA[<p>Un <strong>servidor</strong> web es el programa que muestra las páginas webs en tu <strong>navegador</strong> y Apache es el servidor web más usado del mundo: gratuito, modular, <strong>multiplataforma</strong> y de código abierto. </p>
<p>Se puede combinar con múltiples bases de datos, scripts de configuración e interfaces web para facilitar tareas al usuario.</p>
<p>También existen suites de programas especialmente compilados que instalan todo de golpe (sobre todo para platadormas windows), pero si lo vamos a desplegar en un entorno de <strong>producción</strong>, es recomendable instalar sólo las <strong>librerías y módulos</strong> que vayamos a usar, para evitar exponer el menor número de brechas de seguridad a los hackers.</p>
<p>Vamos a ver cómo instalarlo en <strong>Ubuntu</strong> con PHP, MySQL y phpMyAdmin:</p>
<h3>instalar Apache</h3>
<p>Abrimos una consola y ponemos:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> apache2</pre></td></tr></table></div>

<p>Comprobamos si funciona abriendo un navegador con la URL:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>127.0.0.1</pre></td></tr></table></div>

<p>o bien:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>localhost</pre></td></tr></table></div>

<p>Instalamos PHP 5 cómo módulo:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> php5 libapache2-mod-php5</pre></td></tr></table></div>

<p>Reiniciamos el servidor web:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

<p>El directorio <strong>www</strong> por defecto es:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></td></tr></table></div>

<p>Si no estuviese creado, lo podemos crear:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></td></tr></table></div>

<p>Si no tenemos permiso para manipular su contenido, se lo damos con lo siguiente. Cambiamos el propietario del directorio y el grupo que debe usarlo. Reemplazar USUARIO con el nombre de usuario que estamos utilizando:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> USUARIO:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></td></tr></table></div>

<p>Se le dan permisos de lectura y ejecución para todos y de escritura sólo al propietario:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</pre></td></tr></table></div>

<p>Ahora creamos el <strong>info.php</strong> para comprobar el funcionamiento de PHP:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>info.php</pre></td></tr></table></div>

<p>Pegar lo siguiente dentro, luego guardar y cerrar:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">phpinfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Comprobar entrando a la dirección:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>127.0.0.1<span style="color: #000000; font-weight: bold;">/</span>info.php</pre></td></tr></table></div>

<p>Tendría que aparecer toda la información de configuración del PHP y sus módulos instalados. Seguimos con la instalación del servidor y el cliente de MySQL.</p>
<h3>instalar MySQL</h3>
<p>Instalamos este magnifico SGBD:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> mysql-server</pre></td></tr></table></div>

<p>Pedirá clave para el usuario root de MySQL y luego la confirmación.</p>
<h3>instalar PHP</h3>
<p>Ahora podemos instalar todos los módulos PHP restantes, siendo la mayoría opcionales:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl</pre></td></tr></table></div>

<p>Reiniciamos de nuevo el servidor web:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

<h3>instalar phpMyAdmin</h3>
<p>Y ahora instalamos la interfaz web para administrar MySQL y sus bases de datos, phpMyAdmin:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> phpmyadmin</pre></td></tr></table></div>

<p>Preguntará para que servidor web configurar, elegir <strong>apache2</strong> y continuar. Luego pedirá configurar la base de datos con dbconfig-common elegir que <strong>No</strong>.</p>
<p>Comprobamos si funciona entrando a:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//</span>127.0.0.1<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin</pre></td></tr></table></div>

<p>Si no funciona, ejecutar:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></td></tr></table></div>

<p>Pegar lo siguiente dentro, luego salvar y cerrar:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">Include <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>phpmyadmin<span style="color: #000000; font-weight: bold;">/</span>apache.conf
<span style="color: #000000; font-weight: bold;">&lt;/</span><span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">&gt;</span>
Reiniciar el servidor web nuevamente:
<span style="color: #000000; font-weight: bold;">&lt;</span>pre <span style="color: #007800;">lang</span>=<span style="color: #ff0000;">&quot;bash&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

<p>Y con eso ya debería estar todo funcionando.</p>
<h3>archivos importantes</h3>
<p><strong>virtual hosts habilitados</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-enabled</pre></td></tr></table></div>

<p><strong>virtual host por default, (se pueden hacer copias)</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>sites-available<span style="color: #000000; font-weight: bold;">/</span>default</pre></td></tr></table></div>

<p><strong>archivo de configuración de PHP</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></td></tr></table></div>

<p><strong>archivo de configuración global de MySQL</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>my.cnf</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/14/instalar-apache-php-mysql-y-phpmyadmin-en-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ejecutar Wowza y Apache en el puerto 80</title>
		<link>http://www.alvarolara.com/2013/06/14/ejecutar-wowza-y-apache-en-el-puerto-80/</link>
		<comments>http://www.alvarolara.com/2013/06/14/ejecutar-wowza-y-apache-en-el-puerto-80/#comments</comments>
		<pubDate>Fri, 14 Jun 2013 19:39:38 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[conocimiento libre]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wowza]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1394</guid>
		<description><![CDATA[Si queremos ejecutar Wowza y Apache en el mismo servidor, van a entrar en conflicto y no va a ser posible arrancar uno si el otro ya lo estaba. Para solucionar esto, hay que parar uno de los dos servicios o bien modificar apache para que pueda escuchar también al puerto 80. Estos son los]]></description>
				<content:encoded><![CDATA[<p>Si queremos ejecutar Wowza y Apache en el mismo servidor, van a entrar en conflicto y no va a ser posible arrancar uno si el otro ya lo estaba. Para solucionar esto, hay que parar uno de los dos servicios o bien modificar apache para que pueda escuchar también al puerto 80. Estos son los pasos:</p>
<h3>cargar los módulos</h3>
<p>Lo primero que tendremos que hacer es cargar los módulos mod_proxy y mod_proxy_http en apache.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod mod_proxy
<span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod mod_proxy_http</pre></td></tr></table></div>

<p>En 10.04</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy
<span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod proxy_http</pre></td></tr></table></div>

<h3>modificar httpd.conf</h3>
<p>editamos el fichero httpd.conf situado en /etc/apacahe2/httpd2.conf</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apachae<span style="color: #000000; font-weight: bold;">/</span>httpd.conf</pre></td></tr></table></div>

<p>y añadimos las siguientes líneas dentro de la etiqueta &lt;VirtualHost&gt;:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
DocumentRoot <span style="color: #ff0000;">&quot;/var/www/&quot;</span>
ServerName localhost:<span style="color: #000000;">80</span>
&nbsp;
ProxyPass <span style="color: #000000; font-weight: bold;">/</span>open http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>open
ProxyPassReverse <span style="color: #000000; font-weight: bold;">/</span>open http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>open
ProxyPass <span style="color: #000000; font-weight: bold;">/</span>send http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>send
ProxyPassReverse <span style="color: #000000; font-weight: bold;">/</span>send http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>send
ProxyPass <span style="color: #000000; font-weight: bold;">/</span>idle http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>idle
ProxyPassReverse <span style="color: #000000; font-weight: bold;">/</span>idle http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>idle
ProxyPass <span style="color: #000000; font-weight: bold;">/</span>close http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>close
ProxyPassReverse <span style="color: #000000; font-weight: bold;">/</span>close http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>close
ProxyPass <span style="color: #000000; font-weight: bold;">/</span>fcs http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>fcs
ProxyPassReverse <span style="color: #000000; font-weight: bold;">/</span>fcs http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">1935</span><span style="color: #000000; font-weight: bold;">/</span>fcs
<span style="color: #000000; font-weight: bold;">&lt;</span>Proxy <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    Order Allow,Deny
    Allow from all
<span style="color: #000000; font-weight: bold;">&lt;/</span>Proxy<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/14/ejecutar-wowza-y-apache-en-el-puerto-80/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>descargar adjuntos de correo desde consola (II)</title>
		<link>http://www.alvarolara.com/2013/06/01/descargar-adjuntos-de-correo-desde-consola-ii/</link>
		<comments>http://www.alvarolara.com/2013/06/01/descargar-adjuntos-de-correo-desde-consola-ii/#comments</comments>
		<pubDate>Sat, 01 Jun 2013 17:18:36 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[tutoriales]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1370</guid>
		<description><![CDATA[Después de ver la primera parte, os traigo una segunda en la cual descargamos adjuntos de dos cuentas de correo, lo extraemos, sacamos los ficheros wav que se hayan enviado, los comprimimos a mp3 y por ultimo los subimos a un directorio de un servidor mediante FTP. ¿complejo, eh? no tanto. instalar las dependencias En]]></description>
				<content:encoded><![CDATA[<p>Después de ver la <a href="http://www.alvarolara.com/2013/05/12/descargar-adjuntos-de-correo-desde-consola-i/" target="_blank">primera parte</a>, os traigo una segunda en la cual descargamos adjuntos de dos cuentas de correo, lo extraemos, sacamos los ficheros wav que se hayan enviado, los comprimimos a mp3 y por ultimo los subimos a un directorio de un servidor mediante FTP. ¿complejo, eh? no tanto.</p>
<h3>instalar las dependencias</h3>
<p>En esta ocasión vamos a usar offlineimap para conectarnos a un servidor de correo imap, mpack para estraet adjuntos y lame para convertir de wav a mp3:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> offlineimap mpack <span style="color: #c20cb9; font-weight: bold;">lame</span></pre></td></tr></table></div>

<h3>crear directorios</h3>
<p>Estos servirán para almacenar los mensajes de cada cuenta de correo:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> mail-cuenta1 
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> mail-cuenta2</pre></td></tr></table></div>

<p>y estos otros para almacenar temporalmente los adjuntos:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> adjuntos
<span style="color: #7a0874; font-weight: bold;">cd</span> adjuntos
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> cuenta1
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> cuenta2</pre></td></tr></table></div>

<h3>ficheros</h3>
<p>Editar el fichero <strong>.offlineimaprc</strong> y añadir información de las dos cuentas de correo:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>general<span style="color: #7a0874; font-weight: bold;">&#93;</span>
accounts = cuenta1,cuenta2
&nbsp;
ui = Noninteractive.Basic
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Account cuenta1<span style="color: #7a0874; font-weight: bold;">&#93;</span>
localrepository = cuenta1Local
remoterepository = cuenta1Servidor
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Repository cuenta1Local<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = Maildir
localfolders = ~<span style="color: #000000; font-weight: bold;">/</span>mail-cuenta1<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Repository cuenta1Servidor<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = IMAP
remoteport = <span style="color: #000000;">143</span>
remotehost = imap.servidor.com
remoteuser = cuenta1<span style="color: #000000; font-weight: bold;">@</span>servidor.com
remotepass = contrasenya
usetls = tls
&nbsp;
&nbsp;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Account cuenta2<span style="color: #7a0874; font-weight: bold;">&#93;</span>
localrepository = cuenta2Local
remoterepository = cuenta2Servidor
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Repository cuenta2Local<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = Maildir
localfolders = ~<span style="color: #000000; font-weight: bold;">/</span>mail-cuenta2<span style="color: #000000; font-weight: bold;">/</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Repository cuenta2Servidor<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #7a0874; font-weight: bold;">type</span> = IMAP
remoteport = <span style="color: #000000;">143</span>
remotehost = imap.servidor.com
remoteuser = cuenta2<span style="color: #000000; font-weight: bold;">@</span>servidor.com
remotepass = contrasenya
usetls = tls</pre></td></tr></table></div>

<p><strong>leer-cuenta1.sh</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">directorioadjuntos</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>adjuntos<span style="color: #000000; font-weight: bold;">/</span>cuenta1<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">directoriocorreo</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>mail-cuenta1<span style="color: #000000; font-weight: bold;">/</span>INBOX<span style="color: #000000; font-weight: bold;">/</span>new<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #007800;">directorioremoto</span>=cuenta1
<span style="color: #007800;">tiempo</span>=<span style="color: #000000;">300</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Descargar el correo a adjuntos.&quot;</span>  
        offlineimap <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> munpack <span style="color: #660033;">-C</span> <span style="color: #007800;">$directorioadjuntos</span> <span style="color: #007800;">$directoriocorreo</span>
        <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$directoriocorreo</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Eliminar ficheros descargados que NO sean wav.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #007800;">$directorioadjuntos</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.wav&quot;</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-delete</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Renombrar ficheros descargados y convertirlos a mp3.&quot;</span>
        <span style="color: #000000; font-weight: bold;">for</span> audio <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$directorioadjuntos</span><span style="color: #000000; font-weight: bold;">*</span>.wav; <span style="color: #000000; font-weight: bold;">do</span>
                <span style="color: #007800;">nuevoaudio</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">stat</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">%</span>y <span style="color: #007800;">$audio</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">'.'</span> <span style="color: #660033;">-f1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">' '</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #c20cb9; font-weight: bold;">lame</span> <span style="color: #660033;">-b</span> <span style="color: #000000;">128</span> <span style="color: #660033;">-h</span> <span style="color: #007800;">$audio</span> <span style="color: #007800;">$directorioadjuntos</span><span style="color: #007800;">$nuevoaudio</span>.mp3
        <span style="color: #000000; font-weight: bold;">done</span>    
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Subiendo ficheros de adjuntos por FTP.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">sh</span> ftp.sh <span style="color: #007800;">$directorioadjuntos</span> <span style="color: #007800;">$directorioremoto</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Eliminar ficheros adjuntos.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$directorioadjuntos</span><span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #000000; font-weight: bold;">*</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Esperando <span style="color: #007800;">$tiempo</span> segundos.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$tiempo</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p><strong>leer-cuenta2.sh</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">directorioadjuntos</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>adjuntos<span style="color: #000000; font-weight: bold;">/</span>cuenta2<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">directoriocorreo</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>mail-cuenta2<span style="color: #000000; font-weight: bold;">/</span>INBOX<span style="color: #000000; font-weight: bold;">/</span>new<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #007800;">directorioremoto</span>=cuenta2
<span style="color: #007800;">tiempo</span>=<span style="color: #000000;">300</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">true</span>; <span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Descargar el correo a adjuntos.&quot;</span>  
        offlineimap <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> munpack <span style="color: #660033;">-C</span> <span style="color: #007800;">$directorioadjuntos</span> <span style="color: #007800;">$directoriocorreo</span>
        <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$directoriocorreo</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Eliminar ficheros descargados que NO sean wav.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #007800;">$directorioadjuntos</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.wav&quot;</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-delete</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Renombrar ficheros descargados y convertirlos a mp3.&quot;</span>
        <span style="color: #000000; font-weight: bold;">for</span> audio <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$directorioadjuntos</span><span style="color: #000000; font-weight: bold;">*</span>.wav; <span style="color: #000000; font-weight: bold;">do</span>
                <span style="color: #007800;">nuevoaudio</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">stat</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">%</span>y <span style="color: #007800;">$audio</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">'.'</span> <span style="color: #660033;">-f1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">' '</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #c20cb9; font-weight: bold;">lame</span> <span style="color: #660033;">-b</span> <span style="color: #000000;">128</span> <span style="color: #660033;">-h</span> <span style="color: #007800;">$audio</span> <span style="color: #007800;">$directorioadjuntos</span><span style="color: #007800;">$nuevoaudio</span>.mp3
        <span style="color: #000000; font-weight: bold;">done</span>    
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Subiendo ficheros de adjuntos por FTP.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">sh</span> ftp.sh <span style="color: #007800;">$directorioadjuntos</span> <span style="color: #007800;">$directorioremoto</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Eliminar ficheros adjuntos.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$directorioadjuntos</span><span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #000000; font-weight: bold;">*</span>
&nbsp;
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Esperando <span style="color: #007800;">$tiempo</span> segundos.&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #007800;">$tiempo</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p><strong>ftp.sh</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">directorioadjuntos</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">directorioremoto</span>=<span style="color: #007800;">$2</span>
&nbsp;
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ftp</span> <span style="color: #660033;">-inv</span> www.servidor.com <span style="color: #cc0000; font-style: italic;">&lt;&lt;FINFTP
user usuario contrasenya
binary
cd www.servidor.com/directorio/$directorioremoto
lcd $directorioadjuntos
mput *.mp3
quit
FINFTP</span></pre></td></tr></table></div>

<h3>ejecutar</h3>
<p>para ejecutarlo, basta con dar permisos de ejecución:</p>
<pre>
chmod +x leer-cuenta1.sh
chmod +x leer-cuenta2.sh
</pre>
<p>y ejecutar cada uno de los ficheros. Si estos se ejecutan en u servidor remoto, tal vez quieras revisar esta entrada sobre <a href="http://www.alvarolara.com/2013/05/24/ejecutar-comandos-en-segundo-plano-en-linux/" target="_blank">cómo ejecutar comandos en segundo plano en Linux</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/06/01/descargar-adjuntos-de-correo-desde-consola-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>manual de JavaHelp</title>
		<link>http://www.alvarolara.com/2013/05/31/manual-de-javahelp/</link>
		<comments>http://www.alvarolara.com/2013/05/31/manual-de-javahelp/#comments</comments>
		<pubDate>Fri, 31 May 2013 10:46:40 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[tutoriales]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1305</guid>
		<description><![CDATA[JavaHelp, esa magnífica librería con la que podemos crear ayudas para aplicaciones Java, muy útil tiempos atrás y que ahora está casi obsoleta al no sacar nuevas actualizaciones&#8230; Melancolías aparte, JavaHelp sigue resultando muy útil sobretodo cuando nuestra aplicación va destinada a un público no profesional, que pocas veces ha cogido un ordenador y que]]></description>
				<content:encoded><![CDATA[<p><strong>JavaHelp</strong>, esa magnífica librería con la que podemos crear <strong>ayudas</strong> para aplicaciones <strong>Java</strong>, muy útil tiempos atrás y que ahora está casi obsoleta al no sacar nuevas actualizaciones&#8230; Melancolías aparte, JavaHelp sigue resultando muy útil sobretodo cuando nuestra <strong>aplicación</strong> va destinada a un <strong>público no profesional</strong>, que pocas veces ha cogido un ordenador y que no sabe por dónde coger nuestra aplicación. </p>
<p>En esta breve entrada voy a explicar cómo descargar, añadir JavaHelp en nuestro proyecto, cómo generar documentación y cómo indexar contenido para el buscador interno de la propia librería.</p>
<h3>descargar JavaHelp</h3>
<p>Aunque aún no han cerrado la <a href="https://javahelp.java.net/" target="_blank">página oficial</a>, es difícil encontrar el enlace de <strong>descarga</strong> de la misma, así que subo el .jar a mi web y lo podéis descargar desde <a href="http://www.alvarolara.com/wp-content/uploads/2013/05/javahelp-2.0.02.zip">aquí</a>.<br />
Lo <strong>descomprimís</strong>, <strong>copiáis el jar</strong> que hay dentro en la carpeta <strong>/lib</strong> del proyecto Java y después lo añadimos como librería.</p>
<h3>directorios ayuda</h3>
<p>Hay que <strong>crear unos directorios</strong> donde van a estar los ficheros de ayuda, tanto html como índices para cargar con JavaHelp. Para ello mi recomendación personal es incluirlos dentro de la carpeta src, así si nuestro proyecto se encuentra en /src/proyecto, creamos un directorio help y dentro de este otro llamado html, de tal manera que queden así:</p>
<pre>
/src/proyecto/help
/src/proyect/help/html
</pre>
<h3>ficheros de ayuda</h3>
<p>En la carpeta help, <strong>creamos</strong> los siquientes ficheros:</p>
<pre>
help.hs
indice.xml
mapa.jhm
tablacontenidos.xml
</pre>
<p>de tal manera que cada uno de ellos contenga lo siguiente:<br />
<strong>help.sh:</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'ISO-8859-1'</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE helpset PUBLIC &quot;-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 1.0//EN&quot; &quot;http://java.sun.com/products/javahelp/helpset_1_0.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;helpset</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Ayuda Generador de Guiones Sociales<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;maps<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Pagina por defecto al mostrar la ayuda --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;homeID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>manual<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/homeID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #808080; font-style: italic;">&lt;!-- Que mapa deseamos --&gt;</span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mapref</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;mapa.jhm&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/maps<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #808080; font-style: italic;">&lt;!-- Las Vistas que deseamos mostrar en la ayuda --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;view<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tabla Contenidos<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tabla de contenidos<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javax.help.TOCView<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>tablacontenidos.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/view<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;view<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Indice<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>El indice<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javax.help.IndexView<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>indice.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/view<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;view<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Buscar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Buscar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javax.help.SearchView<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data</span> <span style="color: #000066;">engine</span>=<span style="color: #ff0000;">&quot;com.sun.java.help.search.DefaultSearchEngine&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			JavaHelpSearch
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/view<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/helpset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><strong>indice.xml:</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'ISO-8859-1'</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE index PUBLIC &quot;-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN&quot; &quot;http://java.sun.com/products/javahelp/index_1_0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;index</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;indexitem</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Manual&quot;</span>    <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;manual&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;indexitem</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Instalar&quot;</span>    <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;instalar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/index<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><strong>mapa.jhm:</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'ISO-8859-1'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE map</span>
<span style="color: #00bbdd;">PUBLIC &quot;-//Sun Microsystems Inc.//DTD JavaHelp Map Version 2.0//EN&quot; &quot;http://java.sun.com/products/javahelp/map_2_0.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;map</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mapID</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;manual&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;html/1-manual.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mapID</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;instalar&quot;</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;html/2-instalar.html&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/map<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><strong>tablacontenidos.xml:</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;toc</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
	<span style="color: #808080; font-style: italic;">&lt;!--  categoryclosedimage=&quot;FolderClosed&quot; categoryopenimage=&quot;FolderOpened&quot; topicimage=&quot;ItemIco&quot;--&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tocitem</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Manual&quot;</span>    <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;manual&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tocitem</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Instalar&quot;</span>    <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;instalar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tocitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/toc<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>y en la carpeta <strong>html</strong> creamos dos ficheros simples:<br />
<strong>1-manual.html:</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Manual&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;h1&gt;Manual&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p><strong>2-instalar.html:</strong></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Instalar&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;h1&gt;Instalar&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>se pueden tener tantos ficheros <strong>html como queramos</strong>, pero habrá que <strong>indicarlos</strong> también en los <strong>ficheros anteriores</strong> o no funcionará.</p>
<h3>compilar los índices de ayuda</h3>
<p> JavaHelp lleva dentro una pestaña que es un buscador de contenido, pero para que funcione, hay que indexar los ficheros html a un formato propietario ya que la búsqueda se realiza sobre estos indices y no sobre los ficheros. Comentar que cada vez que se modifique algo de cualquier fichero html, habrá que volver a recompilar.</p>
<p>Descargamos todas las <a href="http://www.alvarolara.com/wp-content/uploads/2013/05/javahelp2_0_05.zip">librerías de JavaHelp</a>  y las descomprimimos por ejemplo en el escritorio.</p>
<p>Ahora vamos a la <strong>carpeta</strong> donde esté la carpeta <strong>help</strong> del proyecto:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>workspace<span style="color: #000000; font-weight: bold;">/</span>proyecto<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>proyecto<span style="color: #000000; font-weight: bold;">/</span>help<span style="color: #000000; font-weight: bold;">/</span></pre></td></tr></table></div>

<p>y una vez allí, conociendo la <strong>ruta</strong> de donde hemos extraído las <strong>librerías anteriores</strong>, ejecutamos el siguiente comando para generar los índices de búsqueda:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">java <span style="color: #660033;">-jar</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>Escritorio<span style="color: #000000; font-weight: bold;">/</span>jh2.0<span style="color: #000000; font-weight: bold;">/</span>javahelp<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>jhindexer.jar html</pre></td></tr></table></div>

<p>nos creará una carpeta llamada <strong>JavaHelpSearch</strong>, ahora ya podemos llamar a nuestra ayuda desde la aplicación.</p>
<h3>llamar a javahelp desde código</h3>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.help.HelpBroker</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.help.HelpSet</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Prueba<span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Método llamado al cargar la ayuda.</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> cargarAyuda<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Carga el fichero de ayuda</span>
	<span style="color: #003399;">File</span> fichero <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;src/com/proyecto/help/help.hs&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003399;">URL</span> hsURL <span style="color: #339933;">=</span> fichero.<span style="color: #006633;">toURI</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Crea el HelpSet y el HelpBroker</span>
	HelpSet helpset <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HelpSet<span style="color: #009900;">&#40;</span>getClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getClassLoader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, hsURL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	HelpBroker hb <span style="color: #339933;">=</span> helpset.<span style="color: #006633;">createHelpBroker</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Pone ayuda a item de menu al pulsar F1. mntmIndice es el JMenuitem</span>
	hb.<span style="color: #006633;">enableHelpOnButton</span><span style="color: #009900;">&#40;</span>mntmIndice, <span style="color: #0000ff;">&quot;manual&quot;</span>, helpset<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	hb.<span style="color: #006633;">enableHelpKey</span><span style="color: #009900;">&#40;</span>principal.<span style="color: #006633;">getContentPane</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;ventana_principal&quot;</span>, helpset<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	logger.<span style="color: #006633;">error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error al cargar la ayuda: &quot;</span> <span style="color: #339933;">+</span> e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Por último, si queremos que la <strong>ayuda</strong> esté <strong>incluida</strong> dentro de un <strong>jar</strong> (para distribuirlo todo en el mismo paquete), os recomiendo revisar <a href="http://www.alvarolara.com/2013/05/29/abrir-uri-desde-dentro-de-un-jar/" target="_blank">esta otra entrada</a>.</p>
<p><strong>Fuente:</strong> <a href="http://www.chuidiang.com/java/herramientas/javahelp/ejemplo-javahelp.php" target="_blank">Chuidiang</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/05/31/manual-de-javahelp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>herramientas para dominios II: conocer empresa de hosting</title>
		<link>http://www.alvarolara.com/2013/05/30/herramientas-para-dominios-ii-conocer-empresa-de-hosting/</link>
		<comments>http://www.alvarolara.com/2013/05/30/herramientas-para-dominios-ii-conocer-empresa-de-hosting/#comments</comments>
		<pubDate>Thu, 30 May 2013 14:44:04 +0000</pubDate>
		<dc:creator>walo</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[conocimiento libre]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[tutoriales]]></category>

		<guid isPermaLink="false">http://www.alvarolara.com/?p=1201</guid>
		<description><![CDATA[Después de conocer el whois de un dominio, vamos a conocer la empresa que alberga el hosting de un determinado dominio. ¿para qué? bueno, pues puede servir para contratar los mismos servicios, porque tal página funciona muy bien o simplemente a modo de &#8216;cotilleo&#8217;. cómo conocer la empresa de hosting Existen numerosas web que analizan]]></description>
				<content:encoded><![CDATA[<p>Después de conocer el <a href="http://www.alvarolara.com/2013/05/19/herramientas-para-dominios-i-conocer-whois/" target="_blank"><strong>whois</strong> de un dominio</a>, vamos a conocer la <strong>empresa</strong> que alberga el <strong>hosting</strong> de un determinado dominio. ¿para qué? bueno, pues puede servir para contratar los mismos servicios, porque tal página funciona muy bien o simplemente a modo de &#8216;cotilleo&#8217;.</p>
<h3>cómo conocer la empresa de hosting</h3>
<p>Existen numerosas web que analizan los registros DNS de los dominios y obtienen abundante información, entre ellas qué empresa de hosting está albergando un dominio. Vamos a ver dos webs y un método por consola:</p>
<ul>
<li><a href="http://www.whoishostingthis.com/" target="_blank"><strong>http://www.whoishostingthis.com/:</strong></a> rellenamos el formulario con la web y veremos qué hosting tiene.</li>
<li><a href="http://whois.domaintools.com/" target="_blank"><strong>http://whois.domaintools.com/:</strong></a> rellenamos el formulario, accedemos a la pestaña &#8220;Server Stats&#8221; y ahi veremos la empresa de hosting que lo alberga.<br />
<img src="http://www.alvarolara.com/wp-content/uploads/2013/05/domaintools.png" alt="domaintools" width="549" height="249" class="alignleft size-full wp-image-1334" />
</li>
<li><strong>línea de comandos:</strong> como siembre, Linux tiene un as bajo la manga para todo y es posible conocer esto a través de la línea de comandos, para ello hay que instalar jwhois:

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> jwhois</pre></td></tr></table></div>

<p>A continuación, hacemos un <strong>ping</strong> al dominio, para conocer la <strong>IP</strong>:<br />
<img src="http://www.alvarolara.com/wp-content/uploads/2013/05/ping-alvarolara.png" alt="ping-alvarolara" width="549" height="115" class="alignleft size-full wp-image-1336" /><br />
y a continuación lanzamos el comando <strong>jwhois</strong> con la IP que acabamos de obtener:<br />
<img src="http://www.alvarolara.com/wp-content/uploads/2013/05/jwhois-alvarolara.png" alt="jwhois-alvarolara" width="549" height="304" class="alignleft size-full wp-image-1341" /></p>
<li>
</ul>
<p>Y ya sabremos qué empresa de hosting está detrás del dominio.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alvarolara.com/2013/05/30/herramientas-para-dominios-ii-conocer-empresa-de-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
