<?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>neverbyte.net &#187; Blog</title>
	<atom:link href="http://www.neverbyte.net/categoria/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.neverbyte.net</link>
	<description>Blog técnico de Iván Alonso</description>
	<lastBuildDate>Mon, 05 Jul 2010 16:06:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Número de comentarios</title>
		<link>http://www.neverbyte.net/archivo/numero-de-comentarios/</link>
		<comments>http://www.neverbyte.net/archivo/numero-de-comentarios/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 16:06:30 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[neverbyte.net]]></category>
		<category><![CDATA[Usabilidad]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/numero-de-comentarios/</guid>
		<description><![CDATA[He añadido al theme de este blog un indicador del número de comentarios al final de cada post (en la vista principal y en la vista de archivos). Era reticente a incluirlo, ya que no creo que esta sea una página susceptible de recibir comentarios (y creo que queda bastante feo ver únicamente una ristra [...]]]></description>
			<content:encoded><![CDATA[<p>He añadido al <em>theme</em> de este blog un indicador del número de comentarios al final de cada post (en la vista principal y en la vista de archivos). Era reticente a incluirlo, ya que no creo que esta sea una página susceptible de recibir comentarios (y creo que queda bastante feo ver únicamente una ristra de &#8220;sin comentarios&#8221;), pero al final me he animado a ello, por ver si realmente hay una mejora en la usabilidad.</p>
<p>En <em>WordPress</em>, lo único que hay que añadir, dentro del <em>loop</em> principal, es:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>#comments&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_number<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sin comentarios (a&amp;uacute;n)'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Un comentario'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'% comentarios'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/numero-de-comentarios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I recommend Ubuntu</title>
		<link>http://www.neverbyte.net/archivo/i-recommend-ubuntu/</link>
		<comments>http://www.neverbyte.net/archivo/i-recommend-ubuntu/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 09:31:58 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/i-recommend-ubuntu/</guid>
		<description><![CDATA[Una gracia que llevaba un tiempo rondando por mi buzón de chorradas pendientes:]]></description>
			<content:encoded><![CDATA[<p>Una gracia que llevaba un tiempo rondando por mi buzón de chorradas pendientes:</p>
<p style="text-align: center;"><img src="http://www.neverbyte.net/wp-content/uploads/2010/04/201004201131.jpg" width="535" height="273" alt="201004201131.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/i-recommend-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manifiesto “En defensa de los derechos fundamentales en internet” (II)</title>
		<link>http://www.neverbyte.net/archivo/manifiesto-%e2%80%9cen-defensa-de-los-derechos-fundamentales-en-internet%e2%80%9d-ii/</link>
		<comments>http://www.neverbyte.net/archivo/manifiesto-%e2%80%9cen-defensa-de-los-derechos-fundamentales-en-internet%e2%80%9d-ii/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 09:20:08 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/manifiesto-%e2%80%9cen-defensa-de-los-derechos-fundamentales-en-internet%e2%80%9d-ii/</guid>
		<description><![CDATA[El Consejo de Ministros aprobará hoy viernes en Sevilla – en pleno puente de San José – ese engendro llamado “Ley de Economía Sostenible”, que incluye la conocida como “Ley Sinde”, que permitirá el cierre de páginas web en sólo cuatro días. Me sumo a los blogs que republican hoy el manifiesto conjunto del pasado [...]]]></description>
			<content:encoded><![CDATA[<p>El Consejo de Ministros aprobará hoy viernes en Sevilla – en pleno puente de San José – ese engendro llamado “Ley de Economía Sostenible”, que incluye la conocida como “Ley Sinde”, que permitirá el cierre de páginas web en sólo cuatro días. Me sumo a los blogs que republican hoy <a href="http://www.neverbyte.net/archivo/manifiesto-%E2%80%9Cen-defensa-de-los-derechos-fundamentales-en-internet%E2%80%9D/">el manifiesto conjunto del pasado mes de diciembre</a>. Es la primera vez en este blog que se repite una entrada, pero la extrema gravedad del tema lo merece. Si tienes página en la red, si publicaste en su momento el manifiesto, si la red es para ti algo importante; te invito a hacer lo mismo:</p>
<p>Ante la inclusión en el Proyecto de Ley de Economía sostenible de modificaciones legislativas que afectan al libre ejercicio de las libertades de expresión, información y el derecho de acceso a la cultura a través de Internet, los periodistas, <i>bloggers</i>, usuarios, profesionales y creadores de Internet manifestamos nuestra firme oposición al proyecto, y declaramos que:</p>
<ol>
<li><b>Los derechos de autor no pueden situarse por encima de los derechos fundamentales de los ciudadanos</b>, como el derecho a la privacidad, a la seguridad, a la presunción de inocencia, a la tutela judicial efectiva y a la libertad de expresión.</li>
<li><b>La suspensión de derechos fundamentales es y debe seguir siendo competencia exclusiva del poder judicial</b>. Ni un cierre sin sentencia. Este anteproyecto, en contra de lo establecido en el artículo 20.5 de la Constitución, pone en manos de un órgano no judicial -un organismo dependiente del ministerio de Cultura-, la potestad de impedir a los ciudadanos españoles el acceso a cualquier página web.</li>
<li><b>La nueva legislación creará inseguridad jurídica en todo el sector tecnológico español</b>, perjudicando uno de los pocos campos de desarrollo y futuro de nuestra economía, entorpeciendo la creación de empresas, introduciendo trabas a la libre competencia y ralentizando su proyección internacional.</li>
<li><b>La nueva legislación propuesta amenaza a los nuevos creadores y entorpece la creación cultural</b>. Con Internet y los sucesivos avances tecnológicos se ha democratizado extraordinariamente la creación y emisión de contenidos de todo tipo, que ya no provienen prevalentemente de las industrias culturales tradicionales, sino de multitud de fuentes diferentes.</li>
<li><b>Los autores</b>, como todos los trabajadores, <b>tienen derecho a vivir de su trabajo con nuevas ideas creativas, modelos de negocio y actividades</b> asociadas a sus creaciones. Intentar sostener con cambios legislativos a una industria obsoleta que no sabe adaptarse a este nuevo entorno no es ni justo ni realista. Si su modelo de negocio se basaba en el control de las copias de las obras y en Internet no es posible sin vulnerar derechos fundamentales, deberían buscar otro modelo.</li>
<li>Consideramos que <b>las industrias culturales necesitan para sobrevivir alternativas modernas, eficaces, creíbles y asequibles y que se adecuen a los nuevos usos sociales</b>, en lugar de limitaciones tan desproporcionadas como ineficaces para el fin que dicen perseguir.</li>
<li><b>Internet debe funcionar de forma libre y sin interferencias políticas</b> auspiciadas por sectores que pretenden perpetuar obsoletos modelos de negocio e imposibilitar que el saber humano siga siendo libre.</li>
<li><b>Exigimos que el Gobierno garantice por ley la neutralidad de la Red en España</b>, ante cualquier presión que pueda producirse, como marco para el desarrollo de una economía sostenible y realista de cara al futuro.</li>
<li><b>Proponemos una verdadera reforma del derecho de propiedad intelectual</b> orientada a su fin: devolver a la sociedad el conocimiento, promover el dominio público y limitar los abusos de las entidades gestoras.</li>
<li><b>En democracia las leyes y sus modificaciones deben aprobarse tras el oportuno debate público</b> y habiendo consultado previamente a todas las partes implicadas. No es de recibo que se realicen cambios legislativos que afectan a derechos fundamentales en una ley no orgánica y que versa sobre otra materia.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/manifiesto-%e2%80%9cen-defensa-de-los-derechos-fundamentales-en-internet%e2%80%9d-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Siguiendo con el rediseño (II)</title>
		<link>http://www.neverbyte.net/archivo/siguiendo-con-el-rediseno-ii/</link>
		<comments>http://www.neverbyte.net/archivo/siguiendo-con-el-rediseno-ii/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 13:06:58 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[diseño]]></category>
		<category><![CDATA[neverbyte.net]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/siguiendo-con-el-rediseno-ii/</guid>
		<description><![CDATA[En el último post lo había dejado todo a medio hacer, y la verdad es que el aspecto de la web en general dejaba mucho que desear. Sólo necesitaba buscar un rato libre para terminar lo que había empezado. De todos modos los tonos claros no me estaban gustando nada, y no me daba la [...]]]></description>
			<content:encoded><![CDATA[<p>En <a href="http://www.neverbyte.net/archivo/siguiendo-con-el-rediseno/">el último post</a> lo había dejado todo a medio hacer, y la verdad es que el aspecto de la web en general dejaba mucho que desear. Sólo necesitaba buscar un rato libre para terminar lo que había empezado.</p>
<p style="text-align: center;"><img src="http://www.neverbyte.net/wp-content/uploads/2010/03/Captura-de-pantalla-2010-03-18-a-las-13.51.31.png" width="480" height="239" alt="Captura de pantalla 2010-03-18 a las 13.51.31.png" /></p>
<p>De todos modos los tonos claros no me estaban gustando nada, y no me daba la sensación de que lo que estaba construyendo tuviera relación alguna con la temática de la web (supuestamente informática y temas afines). Por casualidad visité <a href="http://www.vostok.es/blog/">The Cosmonauts</a>, el blog del estudio <a href="http://vostok.es/">Vostok</a>, y me encantó el esquema de colores, con grises claros y oscuros, y un naranja chillón para los enlaces como contraste, y me propuse hacer algo parecido (desde la admiración por un trabajo bien hecho, <strike>espero que esto no se considere un plagio demandable</strike>).</p>
<p style="text-align: center;"><img src="http://www.neverbyte.net/wp-content/uploads/2010/03/Captura-de-pantalla-2010-03-18-a-las-13.51.58.png" width="480" height="247" alt="Captura de pantalla 2010-03-18 a las 13.51.58.png" /></p>
<p>He mantenido parcialmente la cabecera (aunque ligeramente subida para que el borde de la página corte la imagen del sello), y he conservado el diseño a dos columnas. He añadido un fondo con textura, que creo que enriquece más que un color plano. También he utilizado un naranja distinto al suyo, que creo que llamaba demasiado la atención (aunque considero cambiarlo por un tono <i>arenisca</i> para que sea similar a la cabecera), y he cambiado algunas fuentes a <i>Verdana</i> (una de mis favoritas de siempre). Para los colores grises de los textos sí que he utilizado los mismos tonos que ellos, ya que es donde creo que han dado en el clavo para una lectura cómoda. También he añadido un redondeado en los <i>posts</i> (aunque <i>Internet Explorer</i> sigue en su línea de utilizar únicamente lo que quiere).</p>
<p>He eliminado el subtítulo que tenía anteriormente, he editado los colores del <i>AdSense</i> (que antes eran rosas, en las capturas ya se ve en ambos casos con el nuevo color) y he pasado a blanco y negro con algo menos de contraste los iconos de las redes sociales, y con eso y un bizcocho, el tema está cambiado de nuevo.</p>
<p>¿Opiniones? ¿Se me ha colado algún fallo?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/siguiendo-con-el-rediseno-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Permitir el hotlinking desde Google Reader con htaccess</title>
		<link>http://www.neverbyte.net/archivo/permitir-el-hotlinking-desde-google-reader-con-htaccess/</link>
		<comments>http://www.neverbyte.net/archivo/permitir-el-hotlinking-desde-google-reader-con-htaccess/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 10:14:09 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[hotlinking]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/?p=596</guid>
		<description><![CDATA[Es decir, que quienes estén leyendo tus posts desde Google Reader puedan ver las imágenes aún cuando tengas activado un anti-hotlinking que impide verlas desde fuera de tu propia página. En el archivo .htaccess del directorio raíz de tu blog, añadiremos: &#60;IfModule mod_rewrite.c&#62; RewriteEngine On RewriteCond %&#123;HTTP_REFERER&#125; !^$ RewriteCond %&#123;HTTP_REFERER&#125; !neverbyte.net &#91;NC&#93; # Allow Google [...]]]></description>
			<content:encoded><![CDATA[<p>Es decir, que quienes estén leyendo tus posts desde <strong>Google Reader</strong> puedan ver las imágenes aún cuando tengas activado un <em>anti-hotlinking</em> que impide verlas desde fuera de tu propia página.</p>
<p>En el archivo <em>.htaccess</em> del directorio raíz de tu blog, añadiremos:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_rewrite.c<span style="color: #000000; font-weight: bold;">&gt;</span>
RewriteEngine On
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_REFERER<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>^$
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_REFERER<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>neverbyte.net <span style="color: #7a0874; font-weight: bold;">&#91;</span>NC<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #666666; font-style: italic;"># Allow Google Reader Access</span>
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_REFERER<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>^http<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>?:<span style="color: #000000; font-weight: bold;">//</span>www.google.<span style="color: #7a0874; font-weight: bold;">&#40;</span>com<span style="color: #000000; font-weight: bold;">|</span>es<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>reader<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>m<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>?view<span style="color: #000000; font-weight: bold;">/</span>.<span style="color: #000000; font-weight: bold;">*</span>$ <span style="color: #7a0874; font-weight: bold;">&#91;</span>NC<span style="color: #7a0874; font-weight: bold;">&#93;</span>
RewriteRule .<span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #7a0874; font-weight: bold;">&#40;</span>jpg<span style="color: #000000; font-weight: bold;">|</span>jpeg<span style="color: #000000; font-weight: bold;">|</span>gif<span style="color: #000000; font-weight: bold;">|</span>bmp<span style="color: #000000; font-weight: bold;">|</span>png<span style="color: #7a0874; font-weight: bold;">&#41;</span>$ - <span style="color: #7a0874; font-weight: bold;">&#91;</span>F<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Esto permite la lectura de imágenes desde tu propia página (<strong>neverbyte.net</strong> en este caso) así como desde Google Reader, mediante una expresión regular que permite obtener cualquier dirección de Google Reader: mediante protocolo http o https (seguro), mediante navegador web o móvil (/m/) y desde la versión internacional o la española de Google (.com o .es).</p>
<p>Lógicamente, esto puede personalizarse mucho más, pero como introducción para empezar nos vale. <a href="http://www.nvcc.edu/home/drodgers/ceu/resources/test_regexp.asp">Aquí</a> podéis probar vuestras expresiones regulares fácilmente, y en <a href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html">askapache</a> podéis encontrar algunos trucos interesantes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/permitir-el-hotlinking-desde-google-reader-con-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>¿Dónde está el cliente telnet en Windows Vista/7?</title>
		<link>http://www.neverbyte.net/archivo/%c2%bfdonde-esta-el-cliente-telnet-en-windows-vista7/</link>
		<comments>http://www.neverbyte.net/archivo/%c2%bfdonde-esta-el-cliente-telnet-en-windows-vista7/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:04:47 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/%c2%bfdonde-esta-el-cliente-telnet-en-windows-vista7/</guid>
		<description><![CDATA[Por alguna oscura razón no puede encontrarse ni lanzarse desde línea de comandos (ni desde el menú inicio, ejecutar). Es necesario abrir el Panel de control, Programas, Activar o desactivar las características de Windows, y en la nueva ventana, marcar el checkbox de Cliente Telnet. A partir de ese momento, el cliente ya estará disponible.]]></description>
			<content:encoded><![CDATA[<p>Por alguna oscura razón no puede encontrarse ni lanzarse desde línea de comandos (ni desde el menú inicio, ejecutar). Es necesario abrir el <b><i>Panel de control</i></b>, <b><i>Programas</i></b>, <i><b>Activar o desactivar las características de Windows</b></i>, y en la nueva ventana, marcar el <i>checkbox</i> de <b><i>Cliente Telnet</i></b>.</p>
<p>A partir de ese momento, el cliente ya estará disponible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/%c2%bfdonde-esta-el-cliente-telnet-en-windows-vista7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You have advanced to level 1</title>
		<link>http://www.neverbyte.net/archivo/you-have-advanced-to-level-1/</link>
		<comments>http://www.neverbyte.net/archivo/you-have-advanced-to-level-1/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 12:58:10 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Proyecto Euler]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/?p=587</guid>
		<description><![CDATA[He estado resolviendo algunos problemas del Proyecto Euler y, tras conseguir los primeros veinticinco, me ha sorprendido con esto: Parece que esté avanzando en un videojuego. Ya estoy dentro del veinte por ciento de usuarios que han hecho algo más que resolver los dos primeros (algo que hice hace un par de años). Ha costado [...]]]></description>
			<content:encoded><![CDATA[<p>He estado resolviendo algunos problemas del <a href="http://projecteuler.net">Proyecto Euler</a> y, tras conseguir los primeros veinticinco, me ha sorprendido con esto:</p>
<p style="text-align: center;"><a href="http://www.neverbyte.net/wp-content/uploads/2010/01/project-euler.png"><img class="size-full wp-image-588  aligncenter" title="project-euler" src="http://www.neverbyte.net/wp-content/uploads/2010/01/project-euler.png" alt="" width="543" height="144" /></a></p>
<p>Parece que esté avanzando en un videojuego. Ya estoy dentro del veinte por ciento de usuarios que han hecho algo más que resolver los dos primeros (algo que hice hace un par de años). Ha costado volver a ponerme con el tema, pero estoy aprovechando que quería conseguir algo más de soltura con <em>Python</em> para, en vez de ponerme a hacer tutoriales insípidos, practicar con problemas de otro tipo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/you-have-advanced-to-level-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problema con algunos botones en Eclipse con Ubuntu 9.10</title>
		<link>http://www.neverbyte.net/archivo/problema-con-algunos-botones-en-eclipse-con-ubuntu-9-10/</link>
		<comments>http://www.neverbyte.net/archivo/problema-con-algunos-botones-en-eclipse-con-ubuntu-9-10/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 13:39:12 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[errores]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/problema-con-algunos-botones-en-eclipse-con-ubuntu-9-10/</guid>
		<description><![CDATA[Si estás utilizando la última versión de Ubuntu (9.10 Karmic Koala) y la última versión de Eclipse (descargada de su propia página web, no la que se obtiene de los repositorios de Ubuntu), es posible que des con un error en el que algunos botones de determinados menús no reaccionan a las pulsaciones del ratón [...]]]></description>
			<content:encoded><![CDATA[<p>Si estás utilizando la última versión de Ubuntu (9.10 Karmic Koala) y la última versión de Eclipse (descargada de su propia página web, no la que se obtiene de los repositorios de Ubuntu), es posible que des con un error en el que algunos botones de determinados menús no reaccionan a las pulsaciones del ratón como deberían (aunque sí a las combinaciones de teclas <i>Alt-letra</i>, por ejemplo). Parece estar debido a algunos &#8220;trucos&#8221; gráficos que hace eclipse para saltarse algunas cosas del <i>gdk</i>, y para solucionarlo lo que hay que hacer es lanzar eclipse desde un script como este:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GDK_NATIVE_WINDOWS</span>=<span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>eclipse-<span style="color: #000000;">3.5</span><span style="color: #000000; font-weight: bold;">/</span>eclipse</pre></div></div>

<p>Cambiando el <i>path</i> último por aquél en el que resida la instalación de Eclipse, claro.</p>
<p>Solución encontrada en <a href="http://www.norio.be/blog/2009/10/problems-eclipse-buttons-ubuntu-910">norio.be</a>. Otra opción es utilizar la versión de Eclipse del repositorio de Ubuntu, con esa versión el error no aparece.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/problema-con-algunos-botones-en-eclipse-con-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS-323: Utilizar Tucan Manager desde línea de comandos</title>
		<link>http://www.neverbyte.net/archivo/dns-323-utilizar-tucan-manager-desde-linea-de-comandos-rapidshare-megaupload-etc/</link>
		<comments>http://www.neverbyte.net/archivo/dns-323-utilizar-tucan-manager-desde-linea-de-comandos-rapidshare-megaupload-etc/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 20:13:11 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[DNS-323]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tucan Manager]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/dns-323-utilizar-tucan-manager-desde-linea-de-comandos-rapidshare-megaupload-etc/</guid>
		<description><![CDATA[Vamos a instalar en nuestra máquina DLink DNS-323 la aplicación Tucan Manager, un software capaz de realizar descargas de servidores como Rapidshare, Megaupload, etc. Dado que Tucan Manager está desarrollada en Python, lo primero que haremos será instalar el intérprete de este lenguaje: wget http://www.drak0.com/files/dns323/Python-2.5.2-2.tgz funpkg -i Python-2.5.2-2.tgz Tras esto nos descargamos e instalamos Tucan [...]]]></description>
			<content:encoded><![CDATA[<p>Vamos a instalar en nuestra máquina <i>DLink DNS-323</i> la aplicación <i>Tucan Manager</i>, un software capaz de realizar descargas de servidores como Rapidshare, Megaupload, etc. Dado que <i><b>Tucan Manager</b></i> está desarrollada en <i>Python</i>, lo primero que haremos será instalar el intérprete de este lenguaje:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.drak0.com<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>dns323<span style="color: #000000; font-weight: bold;">/</span>Python-2.5.2-2.tgz
funpkg <span style="color: #660033;">-i</span> Python-2.5.2-2.tgz</pre></div></div>

<p>Tras esto nos descargamos e instalamos <i>Tucan Manager</i>, mediante:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>forja.rediris.es<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1470</span><span style="color: #000000; font-weight: bold;">/</span>tucan-0.3.9.tar.gz
<span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-d</span> tucan-0.3.9.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> tucan-0.3.9.tar
<span style="color: #7a0874; font-weight: bold;">cd</span> tucan-0.3.9<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Y con esto los <i>scripts</i> de <i>Python</i> estarán disponibles donde deben. Si intentamos ejecutar la aplicación esta no funcionará (al menos en un sistema <i>DNS-323</i>). Si comprobamos la cabecera de cualquiera de los archivos, veremos que indica que para ejecutarse utilizará:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /usr/bin/env python</span></pre></div></div>

<p>Que es un directorio que no existe. Lo solucionamos con:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">env</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">env</span></pre></div></div>

<p>Tendremos nuestro <i>script</i> en <i>/usr/local/bin</i>, y desde allí podríamos teóricamente lanzarlo mediante</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>tucan</pre></div></div>

<p>Pero eso nos devolverá un error ya que estará intentando lanzarse con el interfaz gráfico (y nos dirá que no encuentra el paquete <i>pygtk</i>). La forma de ignorar esto es lanzar tucan con el parámetro <i>&#8211;cli</i> (y para eso no podemos utilizar <i>env</i>, debemos lanzarlo con el intérprete de <i>python</i>):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">python <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>tucan <span style="color: #660033;">--cli</span></pre></div></div>

<p>Aquí tenéis un <a href="http://forums.tucaneando.com/viewtopic.php?f=6&amp;t=200&amp;p=540#p540">manual de todas las opciones que tenéis para usar tucan desde línea de comandos</a>, donde la más interesante será utilizarlo como un demonio que se descargue todos los enlaces incluidos en un archivo de texto (un enlace por línea), y que se ocupe de las descargas de modo completamente transparente. Comenzaremos a utilizar la aplicación con:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">tucan <span style="color: #660033;">-w</span> updates
tucan <span style="color: #660033;">-c</span> <span style="color: #660033;">-i</span> archivo.txt</pre></div></div>

<p>Si tenemos un error de <i>No module named ImageFile</i>, podemos solucionarlo descargándonos la librería <i>pil</i> (<i>Python image library</i>) e instalándola:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>effbot.org<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>Imaging-1.1.6.tar.gz
<span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-d</span> Imaging-1.1.6.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvf</span> Imaging-1.1.6.tar
<span style="color: #7a0874; font-weight: bold;">cd</span> Imaging-1.1.6<span style="color: #000000; font-weight: bold;">/</span>
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Tras esta compilación e instalación (que tardará un rato), aún nos faltan algunos otros proyectos que darán lugar a errores futuros si no los tenemos instalados. Primero instalaremos la librería <b>tesseract-OCR</b>, que tenemos disponible mediante el sistema de instalación de <i>optware</i> &#8211; <i>ipkg</i> (si no lo tenéis configurado, podéis hacerlo con el <a href="http://wiki.dns323.info/howto:optware">este tutorial</a> con apenas media docena de instrucciones). Instalaremos la librería (y todas sus dependencias automáticamente), mediante:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ipkg <span style="color: #c20cb9; font-weight: bold;">install</span> tesseract-ocr
ipkg <span style="color: #c20cb9; font-weight: bold;">install</span> tesseract-ocr-lang-eng</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/dns-323-utilizar-tucan-manager-desde-linea-de-comandos-rapidshare-megaupload-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mejorando el uso de MLDonkey en un DNS-323</title>
		<link>http://www.neverbyte.net/archivo/mejorando-el-uso-de-mldonkey-en-un-dns-323/</link>
		<comments>http://www.neverbyte.net/archivo/mejorando-el-uso-de-mldonkey-en-un-dns-323/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 11:40:10 +0000</pubDate>
		<dc:creator>Iván Alonso</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[DLink DNS-323]]></category>
		<category><![CDATA[MLDonkey]]></category>
		<category><![CDATA[shell scripts]]></category>

		<guid isPermaLink="false">http://www.neverbyte.net/archivo/mejorando-el-uso-de-mldonkey-en-un-dns-323/</guid>
		<description><![CDATA[Encontré un script de ejecución para MLDonkey mejor que el incluye el sistema de fonz por defecto, en el blog Writings on the wall. No me funcionaba tal y como estaba escrito, así que tuve que cambiar un par de cosas y ahora parece que hace lo que debe. Ahora, puede especificarse en el arranque [...]]]></description>
			<content:encoded><![CDATA[<p>Encontré un <i>script</i> de ejecución para <i>MLDonkey</i> mejor que el incluye el sistema de <i>fonz</i> por defecto, en el blog <a href="http://bfg100k.blogspot.com/2008/02/enhanced-mldonkey-script-for-your-dns.html">Writings on the wall</a>. No me funcionaba tal y como estaba escrito, así que tuve que cambiar un par de cosas y ahora parece que hace lo que debe.</p>
<p>Ahora, puede especificarse en el arranque si quieres que la máquina se pare cuando terminen de descargarse todos los archivos de <i>MLDonkey</i>, o si sólo quieres que sea el propio <i>MLDonkey</i> el que se cierre, gracias a una tarea en el <i>crontab</i> que comprueba periódicamente el estado del servidor.</p>
<p>El <i>script</i> es el siguiente, sólo teniendo que cambiar la contraseña de tu usuario administrador de <i>MLDonkey</i> (para poder conectarte al servidor de descargas y poder pedirle su estado actual):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Found in:</span>
<span style="color: #666666; font-style: italic;"># http://bfg100k.blogspot.com/2008/02/enhanced-mldonkey-script-for-your-dns.html</span>
<span style="color: #666666; font-style: italic;"># Some things changed by Ivan Alonso (www.neverbyte.net)</span>
<span style="color: #666666; font-style: italic;">#  - Changed the pattern searched in the mldonkey downloads status</span>
<span style="color: #666666; font-style: italic;">#  - Changed FUNSH variable with SHELL</span>
<span style="color: #666666; font-style: italic;">#  - Some minor changes in the echo messages</span>
<span style="color: #666666; font-style: italic;">#  - Some paths changed to fit with the default installation paths</span>
<span style="color: #666666; font-style: italic;">#    (fonz fun plug and shadowandy mldonkey versions)</span>
&nbsp;
<span style="color: #666666; font-style: italic;">###################################################################</span>
<span style="color: #666666; font-style: italic;"># author: Sidney Chong (bfg100k[at]gmail[dot]com)                 #</span>
<span style="color: #666666; font-style: italic;"># version: 0.2                                                    #</span>
<span style="color: #666666; font-style: italic;"># date: 18/02/2008                                                #</span>
<span style="color: #666666; font-style: italic;">#                                                                 #</span>
<span style="color: #666666; font-style: italic;"># Version History                                                 #</span>
<span style="color: #666666; font-style: italic;"># ---------------                                                 #</span>
<span style="color: #666666; font-style: italic;"># v0.1 - expanded ShadowAndy(http://www.shadowandy.net) script    #</span>
<span style="color: #666666; font-style: italic;">#        to be more robust on startup as well as added functions  #</span>
<span style="color: #666666; font-style: italic;">#        to check status, stop, restart and auto-stop when        #</span>
<span style="color: #666666; font-style: italic;">#        downloads are completed.                                 #</span>
<span style="color: #666666; font-style: italic;"># v0.2 - added option to shutdown the DNS-323 when downloads are  #</span>
<span style="color: #666666; font-style: italic;">#        completed. By default, the script only stops the         #</span>
<span style="color: #666666; font-style: italic;">#        mldonkey process when there are no more active downloads.#</span>
<span style="color: #666666; font-style: italic;">#                                                                 #</span>
<span style="color: #666666; font-style: italic;">###################################################################</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #800000;">${SHELL}</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #666666; font-style: italic;">#setup the ENV variables if not found</span>
  <span style="color: #666666; font-style: italic;">#this can happen when running from crontab</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Environment variables not found, including fun_plug defaults.&quot;</span>
  . <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>HD_a2<span style="color: #000000; font-weight: bold;">/</span>ffp<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MLDONKEY_DIR</span>=<span style="color: #ff0000;">&quot;/mnt/HD_a2/mldonkey&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TMPDIR</span>=<span style="color: #ff0000;">&quot;/mnt/HD_a2/mldonkey/temp&quot;</span>
&nbsp;
<span style="color: #007800;">MLNETBINDIR</span>=<span style="color: #ff0000;">&quot;/mnt/HD_a2/ffp/bin&quot;</span>
<span style="color: #007800;">MLNETLOG</span>=<span style="color: #ff0000;">&quot;/mnt/HD_a2/mldonkey/mlnet.log&quot;</span>
<span style="color: #007800;">TMP_CRONTAB</span>=<span style="color: #ff0000;">&quot;/mnt/HD_a2/ffp/var/log/crontab.tmp&quot;</span>
<span style="color: #007800;">TMP_DL_STATUS</span>=<span style="color: #ff0000;">&quot;/mnt/HD_a2/ffp/var/log/dl.status.tmp&quot;</span>
<span style="color: #007800;">ADMIN_PSWD</span>=<span style="color: #ff0000;">&quot;PUT HERE YOUR MLDONKEY ADMIN PASSWD&quot;</span>
&nbsp;
mlnet_start<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting mlnet startup sequence... &quot;</span>
  <span style="color: #666666; font-style: italic;">#check if mlnet is already running. if yes, do nothing</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span>mlnet_status<span style="color: #000000; font-weight: bold;">`</span> = <span style="color: #ff0000;">&quot;running&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;INFO: mldonkey already running! Nothing to do.&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">return</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;">#check for inproper clean up from the past</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #800000;">${MLDONKEY_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>mlnet.pid <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #800000;">${MLDONKEY_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>mlnet.pid
  <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${MLDONKEY_DIR}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;mldonkey directory found.&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;mldonkey directory (<span style="color: #007800;">${MLDONKEY_DIR}</span>) not found. Creating one...&quot;</span>
    <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #800000;">${MLDONKEY_DIR}</span>
    <span style="color: #666666; font-style: italic;">#change ownership of the folder to the user account we will use to run mlnet</span>
    <span style="color: #666666; font-style: italic;">#chown 504:703 ${MLDONKEY_DIR}</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #666666; font-style: italic;">#chmod 664 ${MLDONKEY_DIR}/*</span>
  <span style="color: #800000;">${MLNETBINDIR}</span><span style="color: #000000; font-weight: bold;">/</span>mlnet <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${MLNETLOG}</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
  <span style="color: #666666; font-style: italic;">#${MLNETBINDIR}/mlnet -run_as_useruid 504 &gt; ${MLNETLOG} 2&gt;&amp;1 &amp;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${MLDONKEY_DIR}</span>/incoming&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> <span style="color: #800000;">${MLDONKEY_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>incoming<span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> <span style="color: #800000;">${MLDONKEY_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>incoming<span style="color: #000000; font-weight: bold;">/*</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  _mlnet_setup_softstop stop_when_done
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;mlnet startup sequence completed.&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Check <span style="color: #007800;">${MLNETLOG}</span> for more details.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
mlnet_stop<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Stopping mlnet... &quot;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span>mlnet_status<span style="color: #000000; font-weight: bold;">`</span> = <span style="color: #ff0000;">&quot;running&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Killing mlnet process... &quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #800000;">${MLDONKEY_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>mlnet.pid <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #800000;">${MLDONKEY_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>mlnet.pidxargs <span style="color: #c20cb9; font-weight: bold;">kill</span>
    <span style="color: #000000; font-weight: bold;">else</span>
      <span style="color: #c20cb9; font-weight: bold;">pidof</span> mlnet  <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">kill</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;done. All mlnet processes killed.&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;INFO: mlnet not running! Nothing to kill.&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  _mlnet_setup_softstop
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;mlnet stop sequence completed.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># this routine checks to see if mlnet is still alive</span>
<span style="color: #666666; font-style: italic;"># and if there are any downloads active.</span>
<span style="color: #666666; font-style: italic;"># if no downloads are active, it attempts to stop mlnet.</span>
<span style="color: #666666; font-style: italic;"># if &quot;off_when_done&quot; option is specified, it will attempt to</span>
<span style="color: #666666; font-style: italic;"># shutdown the DNS-323 as well.</span>
_mlnet_softstop<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`date`</span>: Checking downloads... &quot;</span>
  <span style="color: #666666; font-style: italic;">#touch ${TMP_DL_STATUS}</span>
  <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> <span style="color: #800000;">${TMP_DL_STATUS}</span> <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;http://admin:<span style="color: #007800;">${ADMIN_PSWD}</span>@127.0.0.1:4080/submit?q=vd&quot;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-q</span> <span style="color: #ff0000;">'&lt;td class=&quot;dl al np&quot;&gt;R&lt;/td&gt;'</span> <span style="color: #800000;">${TMP_DL_STATUS}</span>
  <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;downloads are still active!&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;no active downloads found!&quot;</span>
    mlnet_stop
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> = <span style="color: #ff0000;">&quot;off_when_done&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;attempting to shutdown the DNS-323 now. Bye Bye!&quot;</span>
      <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>shutdown
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #800000;">${TMP_DL_STATUS}</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># this routine sets up softstop as a cron job that runs every half hour</span>
<span style="color: #666666; font-style: italic;"># to ADD the cron job, pass &quot;add&quot; into the routine,</span>
<span style="color: #666666; font-style: italic;"># to ADD the cron job with shutdown option, pass &quot;off_when_done&quot;,</span>
<span style="color: #666666; font-style: italic;"># any other values (or no value) means REMOVE by default</span>
_mlnet_setup_softstop<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Setting up softstop on crontab... &quot;</span>
  crontab <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${TMP_CRONTAB}</span>
  <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/mlnet.sh softstop/d'</span> <span style="color: #800000;">${TMP_CRONTAB}</span>
  <span style="color: #007800;">TMP_NAME</span>=<span style="color: #ff0000;">&quot;&quot;</span>
  <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    stop_when_done<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #007800;">TMP_NAME</span>=<span style="color: #ff0000;">&quot;softstop&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;INFO: This job will stop mldonkey when all downloads are completed.&quot;</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
    off_when_done<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #007800;">TMP_NAME</span>=<span style="color: #ff0000;">&quot;softstop_off&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;INFO: This job will attempt to shutdown the DNS-323 when all downloads are completed.&quot;</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Removing job from crontab... &quot;</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
  <span style="color: #000000; font-weight: bold;">esac</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${TMP_NAME}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #666666; font-style: italic;"># sanity check - do not allow adding any job if mlnet is not already running</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span>mlnet_status<span style="color: #000000; font-weight: bold;">`</span> = <span style="color: #ff0000;">&quot;running&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Adding cron job to run every half hour... &quot;</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;0,30 * * * * /mnt/HD_a2/ffp/start/mlnet.sh <span style="color: #007800;">${TMP_NAME}</span> &gt;&gt; /mnt/HD_a2/mldonkey/mlnet.log 2&gt;&amp;1&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #800000;">${TMP_CRONTAB}</span>
      <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'/^\s*$/d'</span> <span style="color: #800000;">${TMP_CRONTAB}</span>
    <span style="color: #000000; font-weight: bold;">else</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ERROR: mlnet is not running. NOT adding job to crontab.&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  crontab <span style="color: #800000;">${TMP_CRONTAB}</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #800000;">${TMP_CRONTAB}</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;done.&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
mlnet_restart<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  mlnet_stop
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Waiting 10 secs before starting daemon...&quot;</span>
  <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">10</span>
  mlnet_start
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
mlnet_status<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(pidof mlnet)</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;running&quot;</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;stopped&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
  stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    mlnet_stop
    <span style="color: #000000; font-weight: bold;">;;</span>
  softstop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    _mlnet_softstop
    <span style="color: #000000; font-weight: bold;">;;</span>
  softstop_off<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    _mlnet_softstop off_when_done
    <span style="color: #000000; font-weight: bold;">;;</span>
  set_off_when_done<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    _mlnet_setup_softstop off_when_done
    <span style="color: #000000; font-weight: bold;">;;</span>
  set_stop_when_done<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    _mlnet_setup_softstop stop_when_done
    <span style="color: #000000; font-weight: bold;">;;</span>
  restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    mlnet_restart
    <span style="color: #000000; font-weight: bold;">;;</span>
  status<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    mlnet_status
    <span style="color: #000000; font-weight: bold;">;;</span>
  start<span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    mlnet_start
    <span style="color: #000000; font-weight: bold;">;;</span>
  <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 start | stop | restart | status | set_off_when_done | set_stop_when_done&quot;</span>
    <span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.neverbyte.net/archivo/mejorando-el-uso-de-mldonkey-en-un-dns-323/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
