<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>El blog de neonigma</title>
	
	<link>http://www.nacho-alvarez.es</link>
	<description>Humor, Noticias, Informática...</description>
	<lastBuildDate>Fri, 20 Aug 2010 08:00:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/neonigmablog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="neonigmablog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Despliegue de scripts en Bash con OCS Inventory para GNU/Linux</title>
		<link>http://www.nacho-alvarez.es/?p=715</link>
		<comments>http://www.nacho-alvarez.es/?p=715#comments</comments>
		<pubDate>Sun, 15 Aug 2010 21:15:09 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
		
		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=715</guid>
		<description><![CDATA[OCS Inventory es una fantástica aplicación que recopila información sobre el hardware y software de equipos que hay en la red que ejecutan el programa de cliente OCS ("agente OCS de inventario"). Esta información la envían los agentes al servidor de inventariado. OCS puede utilizarse para visualizar el inventario a través de una interfaz web. [...]]]></description>
			<content:encoded><![CDATA[<p>OCS Inventory es una fantástica aplicación que recopila información sobre el hardware y software de equipos que hay en la red que ejecutan el programa de cliente OCS ("agente OCS de inventario"). Esta información la envían los agentes al servidor de inventariado. OCS puede utilizarse para visualizar el inventario a través de una interfaz web. </p>
<p>OCS Inventory ofrece la posibilidad de, además de realizar un inventariado, <strong>desplegar software</strong> en forma de <em>scripts</em> <strong>Bash</strong> en el equipo donde se ejecuta el agente.</p>
<p>El <em>modus operandi</em> sería el siguiente:</p>
<ol>
<li>El agente envía un <strong>inventario</strong> al servidor OCS</li>
<li>El servidor procesa el inventario y comprueba si hay <strong>paquetes de software</strong> asignados para el despliegue en el equipo que ejecuta el agente que envía dicho inventario</li>
<li>Si existen paquetes asignados a este agente, el servidor de comunicación y/o despliegue lo envía al agente mediante <strong>protocolo SSL</strong></li>
<li> El agente realiza un <em>handshake</em> con el servidor, descarga el paquete y lo ejecuta. Una vez ejecutado, devuelve un código que puede ser de éxito o de error. Se adjunta a continuación la tabla completa de casos de error y éxito.</li>
<table border="1">
<tr>
<td><strong>Código de estado</strong></td>
<td><strong>Significado</strong></td>
</tr>
<tr>
<td>WAITING NOTIFICATION</td>
<td>El servidor está esperando comunicación del agente para notificar que hay algo para descargar.</td>
<tr>
<td>NOTIFIED</td>
<td>El agente ha sido notificado sobre un paquete a descargar. Esperando el código de resultado.</td>
</tr>
<tr>
<td>SUCCESS [code]</td>
<td>El agente ha descargado exitosamente un paquete y ha ejecutado comandos o ha almacenado datos extraídos. Con la acción "Lanzar", este estado podría completarse con el código de retorno de la ejecución.</p>
<tr>
<td>ERR_ALREADY_SETUP</td>
<td>El paquete ya fue instalado previamente en este equipo.</td>
</tr>
<tr>
<td>ERR_BAD_ID</td>
<td>El agente es incapaz de descargar un paquete porque no puede encontrar la ID Del mismo en el servidor de despliegue.</td>
</tr>
<tr>
<td>ERR_BAD_DIGEST</td>
<td>Los datos descargados tienen un mal <em>digest</em>, por lo que el agente no ejecuta comandos asociados.</td>
</tr>
<tr>
<td>ERR_DOWNLOAD_PACK</td>
<td>El agente fue incapaz de descomprimir el fichero ZIP o TAR.GZ descargado.</td>
</tr>
<tr>
<td>ERR_BUILD</td>
<td>El agente fue incapaz de reconstruir los fragmentos del paquete.</td>
</tr>
<tr>
<td>ERR_EXECUTE</td>
<td>El agente fue incapaz de ejecutar el comando asociado al paquete.</td>
</tr>
<tr>
<td>ERR_CLEAN</td>
<td>El agente fue incapaz de limpiar el paquete descargado.</td>
</tr>
<tr>
<td>ERR_TIMEOUT</td>
<td>El agente fue incapaz de descargar durante el período DOWNLOAD_TIMEOUT.</td>
</tr>
<tr>
<td>ERR_ABORTED</td>
<td>El usuario canceló la ejecución del comando del paquete (ha escogido notificarlo, y le ha permitido cancelarlo).</td>
</tr>
<tr>
<td>ERR_EXECUTE_PACK</td>
<td>No utilizado</td>
</tr>
</table>
</ol>
<p>OCS Inventory está formado por las siguientes partes:</p>
<p><center><img src="http://www.ocsinventory-ng.org/uploads/images/ng-architecture.png"/></center></p>
<ol>
<li><strong>Agentes</strong> instalados en sistemas Windows o GNU/Linux: programas escritos en PERL</li>
<li>Un <strong>servidor de gestión</strong> que se compone de:</li>
<li style="list-style:none">
<ol>
<li><strong>Servidor de comunicación</strong>: servidor escrito en PERL que recibe los inventariados de los agentes y los almacena en la base de datos.</li>
<li><strong>Servidor de despliegue:</strong> se encarga de desplegar software en los equipos agentes. Puede ser el mismo que el servidor de comunicación. Obligatorio Apache con SSL activado.</li>
<li><strong>Consola de administración:</strong> interfaz Web escrita en PHP y visible mediante navegador. Lee directamente de la base de datos.</li>
</ol>
</li>
</ol>
<ul>
<li><strong>Instalación completa de OCS Inventory</strong></li>
</ul>
<p>En primer lugar debemos instalar tanto el agente como el servidor de comunicación, de despliegue y la consola de administración. </p>
<p>Lo ideal es que tengamos instalado un servidor Apache preparado y los módulos de PERL para los agentes y el servidor de comunicación. Instalamos lo necesario:</p>
<div class="igBar"><span id="lbash-22"><a href="#" onclick="javascript:showPlainTxt('bash-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-22">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2 php5 <span style="color: #c20cb9; font-weight: bold;">perl</span> mysql-server-<span style="color: #000000;color:#800000;">5.1</span> libphp-pclzip php5-gd libapache2-mod-perl2 php5-mysql libxml-simple-perl libcompress-zlib-perl libdbi-perl libdbd-mysql-perl libapache-dbi-perl libnet-ip-perl libsoap-lite-perl</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora comenzamos instalando un <strong>agente</strong> en cualquier equipo que vaya a realizar un inventariado y enviarlo al servidor:</p>
<div class="igBar"><span id="lbash-23"><a href="#" onclick="javascript:showPlainTxt('bash-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-23">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ocsinventory-agent</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Continuamos con la <strong>consola de administración</strong>, que no la vamos a instalar de los repositorios porque suele dar algún que otro problema en la configuración:</p>
<ul>
<li>Descargamos la consola de administración Web:</li>
</ul>
<div class="igBar"><span id="lbash-24"><a href="#" onclick="javascript:showPlainTxt('bash-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-24">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>launchpad.net<span style="color: #000000; font-weight: bold;">/</span>ocsinventory-server<span style="color: #000000; font-weight: bold;">/</span>stable-<span style="color: #000000;color:#800000;">1.3</span><span style="color: #000000; font-weight: bold;">/</span>1.3.2<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>OCSNG_UNIX_SERVER-1.3.2.tar.gz</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<ul>
<li>Lo movemos a nuestro servidor Apache:</li>
</ul>
<div class="igBar"><span id="lbash-25"><a href="#" onclick="javascript:showPlainTxt('bash-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-25">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> OCSNG_UNIX_SERVER-1.3.2.tar.gz <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<ul>
<li>Lo descomprimimos:</li>
</ul>
<div class="igBar"><span id="lbash-26"><a href="#" onclick="javascript:showPlainTxt('bash-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-26">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvzf OCSNG_UNIX_SERVER-1.3.2.tar.gz</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<ul>
<li>Entramos en el directorio:</li>
</ul>
<div class="igBar"><span id="lbash-27"><a href="#" onclick="javascript:showPlainTxt('bash-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-27">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #7a0874; font-weight: bold;">cd</span> OCSNG_UNIX_SERVER-1.3.2</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<ul>
<li>Comenzamos la instalación:</li>
</ul>
<div class="igBar"><span id="lbash-28"><a href="#" onclick="javascript:showPlainTxt('bash-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-28">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>setup.sh</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>No voy a detallar el proceso de instalación, está bien explicado <a href="http://wiki.intropedro.com/index.php?title=Instalar_el_servidor_de_ocs_inventory">aquí</a>. Sólo voy a poner unos incisos a la explicación anterior, <strong>leedlos antes de seguirla y tenerlos en cuenta</strong>.</p>
<p>No os preocupéis si veis mensajes como:</p>
<div class="igBar"><span id="lbash-29"><a href="#" onclick="javascript:showPlainTxt('bash-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-29">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Checking <span style="color: #000000; font-weight: bold;">for</span> SOAP::Lite PERL module...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">***</span> Warning: PERL module SOAP::Lite is not installed <span style="color: #000000; font-weight: bold;">!</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;This module is only required by OCS Inventory NG SOAP Web Service.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;Do you wish to <span style="color: #7a0874; font-weight: bold;">continue</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span> ?</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;Checking <span style="color: #000000; font-weight: bold;">for</span> XML::Entities PERL module...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">***</span> Warning: PERL module XML::Entities is not installed <span style="color: #000000; font-weight: bold;">!</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;This module is only required by OCS Inventory NG SOAP Web Service.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;Do you wish to <span style="color: #7a0874; font-weight: bold;">continue</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>y<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span> ?</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Esto sólo se utiliza para el servicio Web (experimental y para desarrolladores), y no influye para el despliegue de software en los agentes.</p>
<p>En todo caso, debemos tener cuidado en estas respuestas:</p>
<div class="igBar"><span id="lbash-30"><a href="#" onclick="javascript:showPlainTxt('bash-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-30">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Which host is running database server <span style="color: #7a0874; font-weight: bold;">&#91;</span>localhost<span style="color: #7a0874; font-weight: bold;">&#93;</span> ?127.0.0.1</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;OK, database server is running on host 127.0.0.1 ;-<span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;Where to copy Administration Server static files <span style="color: #000000; font-weight: bold;">for</span> PHP Web Console</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>ocsinventory-reports<span style="color: #7a0874; font-weight: bold;">&#93;</span> ?<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>ocsinventory-reports</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;OK, using directory <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>ocsinventory-reports to <span style="color: #c20cb9; font-weight: bold;">install</span> static files ;-<span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;Where to create writable<span style="color: #000000; font-weight: bold;">/</span>cache directories <span style="color: #000000; font-weight: bold;">for</span> deployement packages and</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp;IPDiscover <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ocsinventory-reports<span style="color: #7a0874; font-weight: bold;">&#93;</span> ?<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>ocsinventory-reports</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En los dos últimos casos casos, contestaré <strong>/var/www/ocsinventory-reports</strong> para almacenar tanto el servidor como los paquetes de despliegue en esa ruta.</p>
<p>Si tenemos problemas en la instalación, por ej. se sale de la misma por no estar los módulos PERL instalados, los instalamos a mano:</p>
<div class="igBar"><span id="lbash-31"><a href="#" onclick="javascript:showPlainTxt('bash-31'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-31">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">perl</span> -MDBD::mysql <span style="color: #660033;">-e</span> <span style="color: #000000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># si nos pregunta, pulsamos INTRO</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">install</span> YAML</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">install</span> Apache::DBI</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">install</span> DBD::mysql</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">install</span> Compress::Zlib <span style="color: #666666; font-style: italic;"># si nos pregunta, pulsamos INTRO</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">install</span> XML::Simple</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">install</span> Net::IP</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Continuamos con la instalación del <strong>servidor de comunicación</strong> desde los repositorios. Esto lo vamos a hacer en la máquina servidora.</p>
<div class="igBar"><span id="lbash-32"><a href="#" onclick="javascript:showPlainTxt('bash-32'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-32">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ocsinventory-server</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A partir de aquí tenemos un servidor OCS Inventory totalmente funcional.</p>
<p>Ahora, en la o las máquinas que vayan a utilizarse como clientes (puede ser la misma también si se quiere), instalaremos el agente de OCS Inventory (en el método de instalación escogemos <strong>http</strong> y en el nombre <strong>127.0.0.1</strong>):</p>
<div class="igBar"><span id="lbash-33"><a href="#" onclick="javascript:showPlainTxt('bash-33'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-33">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ocsinventory-agent</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>desde el que podemos mandar inventarios con la siguiente orden:</p>
<div class="igBar"><span id="lbash-34"><a href="#" onclick="javascript:showPlainTxt('bash-34'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-34">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> ocsinventory-agent <span style="color: #660033;">--server</span> ip.ip.ip.ip</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Sin embargo, lo que nos ocupa aquí es el poder desplegar software en los agentes, es decir, que cuando un agente envíe un inventariado, compruebe en el servidor de despliegue si hay paquetes para él. En caso afirmativo, el agente descargará el paquete <strong>tar.gz</strong>, lo descomprimirá y ejecutará el script que lleve dentro el fichero comprimido.</p>
<p>Para esto, vamos a utilizar el mismo equipo servidor en el que está instalado el servidor de comunicación en PERL, activando en éste el soporte SSL y convirtiéndolo también en servidor de despliegue. </p>
<p>Vamos a ejecutar los siguientes tres comandos para activar el soporte SSL en Apache:</p>
<div class="igBar"><span id="lbash-35"><a href="#" onclick="javascript:showPlainTxt('bash-35'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-35">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod ssl</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Enabling module ssl.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">See <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>apache2.2-common<span style="color: #000000; font-weight: bold;">/</span>README.Debian.gz on how to configure SSL and create self-signed certificates.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Run <span style="color: #ff0000;">'/etc/init.d/apache2 restart'</span> to activate new configuration<span style="color: #000000; font-weight: bold;">!</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> a2ensite default-ssl</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Enabling site default-ssl.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Run <span style="color: #ff0000;">'/etc/init.d/apache2 reload'</span> to activate new configuration<span style="color: #000000; font-weight: bold;">!</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <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</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora nos vamos a apoyar del excelente tutorial de Vicente Navarro en <a href="http://www.vicente-navarro.com/blog/2009/02/22/crear-los-certificados-ssl-para-nuestro-servidor-web-https-con-apache-openssl-y-debian-lenny/">este post</a>. Concretamente, necesitamos sólo la parte que generará un certificado <strong>cacert.pem</strong>, esta parte está nombrada en el tutorial como <strong>Crear un certificado firmado por nuestra propia autoridad certificadora</strong> y haremos todos los pasos que se indican hasta llegar a la parte <strong>Cuidado con ponerle contraseña a la clave privada</strong></p>
<p>Donde pone <i>y cambiar la configuración del sitio para que lo use:</i>, se refiere al archivo <strong>/etc/apache2/sites-enabled/default-ssl</strong>, donde tenemos que cambiar las rutas de <strong>SSLCertificateFile</strong> y <strong>SSLCertificateKeyFile</strong>.</p>
<p>Una vez generado el certificado <strong>cacert.pem</strong> firmado por nuestra propia autoridad certificadora, reiniciado el servidor (nos pedirá el password proporcionado al generar el certificado) ya podemos instalar la consola de administración accediendo por primera vez a nuestro servidor SSL:</p>
<div class="igBar"><span id="lbash-36"><a href="#" onclick="javascript:showPlainTxt('bash-36'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-36">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">https:<span style="color: #000000; font-weight: bold;">//</span>localhost<span style="color: #000000; font-weight: bold;">/</span>ocsreports<span style="color: #000000; font-weight: bold;">/</span>install.php</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Seguimos los pasos para configurar la base de datos y listo. Una vez terminado el proceso, vamos a:</p>
<div class="igBar"><span id="lbash-37"><a href="#" onclick="javascript:showPlainTxt('bash-37'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-37">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">https:<span style="color: #000000; font-weight: bold;">//</span>localhost<span style="color: #000000; font-weight: bold;">/</span>ocsreports<span style="color: #000000; font-weight: bold;">/</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>y entramos con <strong>usuario</strong> admin y <strong>contraseña</strong> admin</p>
<p>A partir de aquí podemos <strong>realizar nuestro primer inventariado con cualquier agente</strong> (sudo ocsinventory-agent --server 127.0.0.1), nos vamos al directorio del servidor <strong>/var/lib/ocsinventory-agent/http:__127.0.0.1_ocsinventory</strong> y copiamos allí el fichero <strong>cacert.pem</strong>.</p>
<div class="igBar"><span id="lbash-38"><a href="#" onclick="javascript:showPlainTxt('bash-38'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-38">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ocsinventory-agent<span style="color: #000000; font-weight: bold;">/</span>http:__127.0.0.1_ocsinventory$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>misc<span style="color: #000000; font-weight: bold;">/</span>demoCA<span style="color: #000000; font-weight: bold;">/</span>cacert.pem .</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En este punto, ya podemos crear un paquete con un script para desplegar en cualquier agente.</p>
<p><br/></p>
<ul>
<li><strong>Creación y despliegue de scripts</strong></li>
</ul>
<p>Vamos a habilitar mediante la consola de administración el despliegue o <strong>distribución de software</strong>. Para ello vamos al menú de configuración:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs001.png" target="_blank"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs001.png" alt="" title="ocs001" width="100%" class="alignnone size-medium wp-image-754" /></a></center></p>
<p>y activamos la opción correspondiente, bajando además el tiempo de ciclo de latencia que es algo elevado:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs001.png" target="_blank"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs002.png" alt="" title="ocs002" width="100%" class="alignnone size-medium wp-image-754" /></a></center></p>
<p>Ahora vamos a crear un script cualquiera, lo vamos a asignar a un equipo en concreto (en el que se ejecuta un agente) y vamos a hacer la prueba de despliegue. El script que vamos a utilizar puede ser este mismo, lo llamamos <strong>myscript</strong> por ejemplo:</p>
<div class="igBar"><span id="lbash-39"><a href="#" onclick="javascript:showPlainTxt('bash-39'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-39">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;¡¡ESTOY EJECUTANDO SOFTWARE DESPLEGADO CON OCS INVENTORY!!&quot;</span>;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Información sobre tu CPU&quot;</span>;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">lscpu</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> teeworlds <span style="color: #660033;">--assume-yes</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;¡¡JUEGO INSTALADO, A DISFRUTAR DE LAS VACACIONES!!&quot;</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Vamos a comprimir este script:</p>
<div class="igBar"><span id="lbash-40"><a href="#" onclick="javascript:showPlainTxt('bash-40'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-40">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">tar</span> cvzf myscript.tar.gz myscript</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y ahora vamos a crear el paquete software en la consola de administración de OCS Inventory. Vamos a la Web y escogemos la opción <strong>Crear</strong> del menú <strong>Distribución software</strong>.</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs003.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs003.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Introducimos los datos del nuevo paquete, indicando que tenemos un fichero comprimido <strong>myscript.tar.gz</strong> y que lanzaremos un script que tiene en su interior llamado <strong>myscript</strong> con prioridad 5 (podemos ponerle prioridad 0 que es prioridad absoluta).</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs004.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs004.png" width="80%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Si al aceptar nos da el mensaje de error <strong>ERROR: can't create or write in /var/lib/ocsinventory-reports/download/xxxxxxxxx folder, please refresh when fixed.  (or try disabling php safe mode)</strong>, tenemos que cambiar estas rutas en la base de datos. Podemos hacerlo de la siguiente manera:</p>
<div class="igBar"><span id="lbash-41"><a href="#" onclick="javascript:showPlainTxt('bash-41'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-41">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ mysql <span style="color: #660033;">-u</span> root <span style="color: #660033;">-p</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mysql<span style="color: #000000; font-weight: bold;">&gt;</span> UPDATE config SET <span style="color: #007800;">TVALUE</span>=<span style="color: #ff0000;">&quot;/var/www/ocsinventory-reports&quot;</span> WHERE <span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;DOWNLOAD_PACK_DIR&quot;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">mysql<span style="color: #000000; font-weight: bold;">&gt;</span> UPDATE config SET <span style="color: #007800;">TVALUE</span>=<span style="color: #ff0000;">&quot;/var/www/ocsinventory-reports&quot;</span> WHERE <span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;IPDISCOVER_IPD_DIR&quot;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>y reiniciamos el proceso, creando de nuevo el paquete.</p>
<p>A continuación dejamos los siguientes datos como están porque nuestro paquete no es muy grande y no queremos fragmentar su envío. Pulsamos en <strong>Enviar</strong> y el paquete queda creado. </p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs005.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs005.png" width="80%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Realizamos ahora el proceso de <strong>activación del paquete</strong>. Escogemos la opción <strong>activar</strong> del menú <strong>Distribución software</strong>. </p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs006.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs006.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Nos vamos a la fila que muestra el paquete recién creado y pulsamos en el botón <strong>Activar</strong>.</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs007.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs007.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Dejamos marcada <strong>Activación manual</strong> y especificamos como <strong>URL https</strong> y como <strong>Partes URL</strong> la misma cadena <strong>https://127.0.0.1/ocsinventory-reports/download</strong></p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs008.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs008.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Al aceptar, se nos informa de que el paquete ya se ha activado y lo podemos <strong>afectar</strong>. Aquí, afectar un paquete se refiere a <strong>asignarlo a un equipo o a un conjunto de ellos</strong>.</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs009.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs009.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>El último paso es asignar o afectar un paquete a un equipo. Para ello escogemos un equipo de la lista de los que tenemos inventariados:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs010.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs010.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Pulsamos en la opción <strong>Personalizar</strong> de la lista de opciones disponibles para un equipo concreto:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs011.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs011.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Pulsamos en <strong>adicionar paquete</strong>:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs012.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs012.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>De la lista de paquetes, localizamos la fila del paquete deseado y pulsamos en el botón <strong>Afectar</strong>. A la pregunta de si estamos seguros, respondemos que sí.</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs013.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs013.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Podemos ver que el paquete queda asignado al equipo y esperando notificación de envío.</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs014.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/08/ocs014.png" width="100%" class="alignnone size-medium wp-image-761" /></a></center></p>
<p>Ahora la ejecución de un inventariado por parte del agente instalado en el equipo afectado, provocará que éste se descargue del servidor el paquete disponible para él. Lo vemos:</p>
<div class="igBar"><span id="lbash-42"><a href="#" onclick="javascript:showPlainTxt('bash-42'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-42">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">neonigma<span style="color: #000000; font-weight: bold;">@</span>neonigma-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> ocsinventory-agent <span style="color: #660033;">--debug</span> <span style="color: #660033;">--info</span> <span style="color: #660033;">--logfile</span> logfile.log</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #c20cb9; font-weight: bold;">sudo</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> password <span style="color: #000000; font-weight: bold;">for</span> neonigma: </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Writing config file.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Making working directory <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;color:#800000;">1281884908</span>.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Retrieving info <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;color:#800000;">1281884908</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Initialize ssl layer...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Connect to server: 127.0.0.1<span style="color: #000000; font-weight: bold;">/</span>ocsinventory-reports<span style="color: #000000; font-weight: bold;">/</span>download...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Starting SSL connection...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Info <span style="color: #c20cb9; font-weight: bold;">file</span>: </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Success. :-<span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Beginning work. I am <span style="color: #000000;color:#800000;">26331</span>.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Checking timeout <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;color:#800000;">1281884908</span>... OK</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: New period. Nb of cycles: <span style="color: #000000;color:#800000;">10</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Downloading <span style="color: #000000;color:#800000;">1281884908</span>-<span style="color: #000000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Success :-<span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a fragment latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">10</span> seconds</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Download of <span style="color: #000000;color:#800000;">1281884908</span>... Finished.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Execute orders <span style="color: #000000; font-weight: bold;">for</span> package <span style="color: #000000;color:#800000;">1281884908</span>.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Building package <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;color:#800000;">1281884908</span>.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Checking signature <span style="color: #000000; font-weight: bold;">for</span> .<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>build.tar.gz.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Digest format: Hexadecimal</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Digest algo: MD5</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Digest OK...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">=<span style="color: #000000; font-weight: bold;">&gt;</span> retrieving tar...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">=<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> is at <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">tar</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">myscript</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Building of <span style="color: #000000;color:#800000;">1281884908</span>... Success.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Launching myscript...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">¡¡ESTOY EJECUTANDO SOFTWARE DESPLEGADO CON OCS INVENTORY<span style="color: #000000; font-weight: bold;">!!</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Información sobre tu CPU</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Architecture: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i686</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">CPU op-mode<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;color:#800000;">64</span>-bit</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">CPU<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;color:#800000;">4</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Thread<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> per core: &nbsp; &nbsp;<span style="color: #000000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Core<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> per socket: &nbsp; &nbsp;<span style="color: #000000;color:#800000;">4</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">CPU socket<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span>: &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Vendor ID: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AuthenticAMD</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">CPU family: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;color:#800000;">16</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Model: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;color:#800000;">4</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Stepping: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;color:#800000;">3</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">CPU MHz: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;color:#800000;">800.000</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Virtualization: &nbsp; &nbsp; &nbsp; &nbsp;AMD-V</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">L1d cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 64K</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">L1i cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 64K</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">L2 cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;512K</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">L3 cache: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6144K</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Reading package lists... Done</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Building dependency <span style="color: #c20cb9; font-weight: bold;">tree</span> &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Reading state information... Done</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">The following extra packages will be installed:</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; teeworlds-data</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Suggested packages:</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; teeworlds-server</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">The following NEW packages will be installed:</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; teeworlds teeworlds-data</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000;color:#800000;">0</span> upgraded, <span style="color: #000000;color:#800000;">2</span> newly installed, <span style="color: #000000;color:#800000;">0</span> to remove and <span style="color: #000000;color:#800000;">5</span> not upgraded.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Need to get 5288kB of archives.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">After this operation, 8364kB of additional disk space will be used.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Get:<span style="color: #000000;color:#800000;">1</span> http:<span style="color: #000000; font-weight: bold;">//</span>mirrors.nfsi.pt<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span> lucid<span style="color: #000000; font-weight: bold;">/</span>universe teeworlds-data 0.5.1-3ubuntu1 <span style="color: #7a0874; font-weight: bold;">&#91;</span>5114kB<span style="color: #7a0874; font-weight: bold;">&#93;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Get:<span style="color: #000000;color:#800000;">2</span> http:<span style="color: #000000; font-weight: bold;">//</span>mirrors.nfsi.pt<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span> lucid<span style="color: #000000; font-weight: bold;">/</span>universe teeworlds 0.5.1-3ubuntu1 <span style="color: #7a0874; font-weight: bold;">&#91;</span>174kB<span style="color: #7a0874; font-weight: bold;">&#93;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Fetched 5288kB <span style="color: #000000; font-weight: bold;">in</span> 4s <span style="color: #7a0874; font-weight: bold;">&#40;</span>1209kB<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Selecting previously deselected package teeworlds-data.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#40;</span>Reading database ... <span style="color: #000000;color:#800000;">274481</span> files and directories currently installed.<span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Unpacking teeworlds-data <span style="color: #7a0874; font-weight: bold;">&#40;</span>from ...<span style="color: #000000; font-weight: bold;">/</span>teeworlds-data_0.5.1-3ubuntu1_all.deb<span style="color: #7a0874; font-weight: bold;">&#41;</span> ...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Selecting previously deselected package teeworlds.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Unpacking teeworlds <span style="color: #7a0874; font-weight: bold;">&#40;</span>from ...<span style="color: #000000; font-weight: bold;">/</span>teeworlds_0.5.1-3ubuntu1_i386.deb<span style="color: #7a0874; font-weight: bold;">&#41;</span> ...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Processing triggers <span style="color: #000000; font-weight: bold;">for</span> man-db ...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Processing triggers <span style="color: #000000; font-weight: bold;">for</span> desktop-file-utils ...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Processing triggers <span style="color: #000000; font-weight: bold;">for</span> python-gmenu ...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Rebuilding <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>applications<span style="color: #000000; font-weight: bold;">/</span>desktop.C.cache...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Processing triggers <span style="color: #000000; font-weight: bold;">for</span> python-support ...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Setting up teeworlds-data <span style="color: #7a0874; font-weight: bold;">&#40;</span>0.5.1-3ubuntu1<span style="color: #7a0874; font-weight: bold;">&#41;</span> ...</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Setting up teeworlds <span style="color: #7a0874; font-weight: bold;">&#40;</span>0.5.1-3ubuntu1<span style="color: #7a0874; font-weight: bold;">&#41;</span> ...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">¡¡JUEGO INSTALADO, A DISFRUTAR DE LAS VACACIONES<span style="color: #000000; font-weight: bold;">!!</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Package <span style="color: #000000;color:#800000;">1281884908</span>... Done. Sending message...</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Sending message <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000;color:#800000;">1281884908</span>, <span style="color: #007800;">code</span>=SUCCESS_0.</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Cleaning <span style="color: #000000;color:#800000;">1281884908</span> package.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unlink</span> <span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span>task_done</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unlink</span> <span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight: bold;">done</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unlink</span> <span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span>since</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unlink</span> <span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>myscript</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">rmdir</span> tmp</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unlink</span> <span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span>info</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unlink</span> <span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span>task</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unlink</span> <span style="color: #000000;color:#800000;">1281884908</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;color:#800000;">1281884908</span>-<span style="color: #000000;color:#800000;">1</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">rmdir</span> <span style="color: #000000;color:#800000;">1281884908</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a fragment latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">10</span> seconds</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: Now pausing <span style="color: #000000; font-weight: bold;">for</span> a cycle latency =<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000;color:#800000;">5</span> seconds</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: No <span style="color: #c20cb9; font-weight: bold;">more</span> package to download.</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">DOWNLOAD: End of work...</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><br/><br />
<strong>REFERENCIAS</strong><br />
<a href="http://www.ocsinventory-ng.org/">http://www.ocsinventory-ng.org/</a><br />
<a href="http://es.wikipedia.org/wiki/OCS_Inventory">http://es.wikipedia.org/wiki/OCS_Inventory</a><br />
<a href="http://wiki.intropedro.com/index.php?title=Instalar_el_servidor_de_ocs_inventory">http://wiki.intropedro.com/index.php?title=Instalar_el_servidor_de_ocs_inventory</a><br />
<a href="http://www.vicente-navarro.com/blog/2009/02/22/crear-los-certificados-ssl-para-nuestro-servidor-web-https-con-apache-openssl-y-debian-lenny">http://www.vicente-navarro.com/blog/2009/02/22/crear-los-certificados-ssl-para-nuestro-servidor-web-https-con-apache-openssl-y-debian-lenny</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=715</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Habilitar Wi-Fi en HP 2133 con Fedora 12</title>
		<link>http://www.nacho-alvarez.es/?p=709</link>
		<comments>http://www.nacho-alvarez.es/?p=709#comments</comments>
		<pubDate>Sat, 17 Jul 2010 15:58:37 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=709</guid>
		<description><![CDATA[Me dejo aquí un pequeño tip que tengo que buscar cada vez que tengo movimiento en mi netbook con Fedora. a) wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2 b) tar xjf broadcom-wl-4.150.10.5.tar.bz2 c) cd broadcom-wl-4.150.10.5/driver d) b43-fwcutter -w /lib/firmware wl_apsta_mimo.o Fuente: http://hp2133.umsw.de/]]></description>
			<content:encoded><![CDATA[<p>Me dejo aquí un pequeño <em>tip</em> que tengo que buscar cada vez que tengo movimiento en mi netbook con Fedora.</p>
<p>a) wget <a href="http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2">http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2</a><br />
b) tar xjf broadcom-wl-4.150.10.5.tar.bz2<br />
c) cd broadcom-wl-4.150.10.5/driver<br />
d) b43-fwcutter -w /lib/firmware wl_apsta_mimo.o</p>
<p>Fuente: <a href="http://hp2133.umsw.de/">http://hp2133.umsw.de/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=709</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bugs en Python Soaplib 0.8.1. WSDL no reconocido por Axis o Soapui / Use specific ‘len(elem)’ or ‘elem is not None’ test instead</title>
		<link>http://www.nacho-alvarez.es/?p=700</link>
		<comments>http://www.nacho-alvarez.es/?p=700#comments</comments>
		<pubDate>Tue, 22 Jun 2010 20:17:52 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=700</guid>
		<description><![CDATA[Existen varios bugs reconocidos en la generación y uso del WSDL en soaplib v8.1. Los clientes Soapui y Axis no van a aceptar el WSDL generado por soaplib. El primer bug se reconoce aquí: http://github.com/jkp/soaplib/issues/#issue/12 Está solucionado en el trunk de soaplib, editamos el fichero /usr/local/lib/python2.6/dist-packages/soaplib-0.8.1-py2.6.egg/soaplib/serializers/primitive.py y cambiamos una línea que nos indican aquí: http://github.com/jkp/soaplib/commit/1dd0aa6e01ebb04a7c802f261c93534061de8b7d [...]]]></description>
			<content:encoded><![CDATA[<p>Existen varios bugs reconocidos en la generación y uso del WSDL en soaplib v8.1. Los clientes Soapui y Axis no van a aceptar el WSDL generado por soaplib.</p>
<p>El primer bug se reconoce aquí: <a href="http://github.com/jkp/soaplib/issues/#issue/12">http://github.com/jkp/soaplib/issues/#issue/12</a></p>
<p>Está solucionado en el trunk de soaplib, editamos el fichero /usr/local/lib/python2.6/dist-packages/soaplib-0.8.1-py2.6.egg/soaplib/serializers/primitive.py y cambiamos una línea que nos indican aquí:</p>
<p><a href="http://github.com/jkp/soaplib/commit/1dd0aa6e01ebb04a7c802f261c93534061de8b7d">http://github.com/jkp/soaplib/commit/1dd0aa6e01ebb04a7c802f261c93534061de8b7d</a></p>
<p>El segundo bug visto en <a href="http://skysbird.bsdchina.org/?p=171">este enlace</a> da una salida como ésta al acceder al servicio Web:</p>
<p><i>FutureWarning: The behavior of this method will change in future versions. Use specific ‘len(elem)’ or ‘elem is not None’ test instead.</i></p>
<p>Este bug provoca errores al utilizar el cliente Java desde Axis. En este caso buscaríamos dos líneas del fichero wsgi_soap.py con la siguiente sentencia:</p>
<div class="igBar"><span id="lpython-55"><a href="#" onclick="javascript:showPlainTxt('python-55'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PYTHON:</span>
<div id="python-55">
<div class="python" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;font-weight:bold;">if</span> payload:</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>las dos líneas vamos a cambiarlas por:</p>
<div class="igBar"><span id="lpython-56"><a href="#" onclick="javascript:showPlainTxt('python-56'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PYTHON:</span>
<div id="python-56">
<div class="python" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;font-weight:bold;">if</span> payload <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">None</span>:</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Una solución a mano es modificar los ficheros <strong>primitive.py</strong> y <strong>wsgi_soap.py</strong> y compilarlos con </p>
<div class="igBar"><span id="lbash-57"><a href="#" onclick="javascript:showPlainTxt('bash-57'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-57">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">python <span style="color: #660033;">-mcompileall</span> .</div>
</li>
</ol>
</div>
</div>
</div>
<p>
una vez dentro de cada ruta de los ficheros mencionados (es decir, dos veces en total).</p>
<p>Soaplib genera entonces un WSDL correcto, que Axis acepta perfectamente. Axis podrá también acceder sin problemas al servicio Web.</p>
<p>La mejor solución es generar un <a href="http://peak.telecommunity.com/DevCenter/PythonEggs#building-eggs">egg</a> nuevo para la instalación con easy_install.</p>
<p><strong>Pasos:</strong></p>
<p>1. Nos bajamos el código de soaplib <a href="http://github.com/downloads/jkp/soaplib/soaplib-0.8.1.tar">de aquí</a>, por ejemplo en <b>~/Descargas</b>.<br />
2. Modificamos el fichero primitive.py y el fichero wsgi_soap.py<br />
3. Generamos un nuevo egg: </p>
<div class="igBar"><span id="lbash-58"><a href="#" onclick="javascript:showPlainTxt('bash-58'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-58">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">python setup.py bdist_egg</div>
</li>
</ol>
</div>
</div>
</div>
<p>
Esto crea un nuevo fichero en ~/Descargas/soaplib-0.8.1/dist/soaplib-0.8.1-py2.6.egg</p>
<p>4. Eliminamos todas las referencias al egg del soaplib antiguo, así como a sus ficheros: </p>
<div class="igBar"><span id="lbash-59"><a href="#" onclick="javascript:showPlainTxt('bash-59'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-59">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">easy_install <span style="color: #660033;">-mxN</span> PackageName</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>5. También a sus ficheros: </p>
<div class="igBar"><span id="lbash-60"><a href="#" onclick="javascript:showPlainTxt('bash-60'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-60">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>path.to<span style="color: #000000; font-weight: bold;">/</span>python2.6<span style="color: #000000; font-weight: bold;">/</span>site-packages<span style="color: #000000; font-weight: bold;">/</span>soaplib-0.8.1-py2.6.egg</div>
</li>
</ol>
</div>
</div>
</div>
<p>
6. Podemos instalar el nuevo egg: </p>
<div class="igBar"><span id="lbash-61"><a href="#" onclick="javascript:showPlainTxt('bash-61'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-61">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">easy_install ~<span style="color: #000000; font-weight: bold;">/</span>Descargas<span style="color: #000000; font-weight: bold;">/</span>soaplib-0.8.1<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>soaplib-0.8.1-py2.6.egg</div>
</li>
</ol>
</div>
</div>
</div>
<p>
<br/><br />
Podemos probar wsdl2java descargando e instalando Axis:</p>
<p>1. Descargar Axis: </p>
<div class="igBar"><span id="lbash-62"><a href="#" onclick="javascript:showPlainTxt('bash-62'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-62">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>apache.rediris.es<span style="color: #000000; font-weight: bold;">/</span>ws<span style="color: #000000; font-weight: bold;">/</span>axis2<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;color:#800000;">1</span>_5_1<span style="color: #000000; font-weight: bold;">/</span>axis2-1.5.1-bin.zip</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>2. Descomprimir Axis:</p>
<div class="igBar"><span id="lbash-63"><a href="#" onclick="javascript:showPlainTxt('bash-63'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-63">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">unzip</span> axis2-1.5.1-bin.zip</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>3. Accedemos a las utilidades de Axis:</p>
<div class="igBar"><span id="lbash-64"><a href="#" onclick="javascript:showPlainTxt('bash-64'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-64">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">cd</span> axis2-1.5.1<span style="color: #000000; font-weight: bold;">/</span>bin</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>4. Establecer variable JAVA_HOME:</p>
<div class="igBar"><span id="lbash-65"><a href="#" onclick="javascript:showPlainTxt('bash-65'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-65">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">JAVA_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>jvm<span style="color: #000000; font-weight: bold;">/</span>jre</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>5. Lanzar wsdl2java contra nuestro servidor ejecutando:</p>
<div class="igBar"><span id="lbash-66"><a href="#" onclick="javascript:showPlainTxt('bash-66'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-66">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">.<span style="color: #000000; font-weight: bold;">/</span>wsdl2java.sh <span style="color: #660033;">-uri</span> http:<span style="color: #000000; font-weight: bold;">//</span>127.0.0.1:<span style="color: #000000;color:#800000;">8080</span><span style="color: #000000; font-weight: bold;">/</span>ws?wsdl</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=700</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bibliografías múltiples con LaTeX: bibliografía tras cada capitulo con Flexbib</title>
		<link>http://www.nacho-alvarez.es/?p=689</link>
		<comments>http://www.nacho-alvarez.es/?p=689#comments</comments>
		<pubDate>Sun, 16 May 2010 16:33:03 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=689</guid>
		<description><![CDATA[Para un trabajo grupal de un curso de LPIC1 que estoy realizando necesitaba insertar una bibliografía al finalizar cada capitulo, y no quería dejar de utilizar Flexbib para BibTeX por las virtudes que ya comenté en esta entrada. Entre otras cosas, Flexbib permite: Un traducción de las partículas and, in, editors, etc. de acuerdo con [...]]]></description>
			<content:encoded><![CDATA[<p>Para un trabajo grupal de un curso de LPIC1 que estoy realizando necesitaba insertar una bibliografía al finalizar cada capitulo, y no quería dejar de utilizar <strong><a href="http://www.latex.um.es/retazos/leccion_15/flexbib.html">Flexbib</a></strong> para BibTeX por las virtudes que ya comenté en <a href="http://www.nacho-alvarez.es/?p=44">esta entrada</a>. Entre otras cosas, <strong>Flexbib</strong> permite:</p>
<ul>
<li>Un traducción de las partículas and, in, editors, etc. de acuerdo con el idioma seleccionado. Este es el punto más importante, puesto que podemos tener partículas "y", "en", "editores" para nuestro idioma.</li>
<li>Seleccionar un modelo de cita numérico o un modelo autor-año sin necesidad de hacer cambios en el argumento de \bibliographystyle bibliografía</li>
<li>Cuando el número de autores es superior a dos puede elegirse si se utilizan todos los autores o sólo el primero seguido del grupo «y otros», o lo que corresponda según el idioma en el modelo de citas autor-año.</li>
<li>Es posible seleccionar el tipo de letra utilizado para los autores y los títulos</li>
<li>Las bases de datos añaden a los campos estándard nuevos campos como abstract, comment, url, isbn, mrnumber, translator que son gestionados por flexbib.</li>
</ul>
<p>Para poder tener una bibliografía al finalizar cada capítulo, hacemos uso del paquete <strong><a href="http://www.ctan.org/tex-archive/macros/latex/contrib/bibtopic/">bibtopic</a></strong>. Lo primero que vamos a hacer es hacer una copia de los <strong>.bib</strong> necesarios y guardarlos también en otra ubicación, por si acaso. En nuestro ejemplo, vamos a tener <strong>dos capítulos</strong> y por tanto, <strong>dos .bib</strong>, uno llamado <strong><em>bibliodebian.bib</em></strong> y otro llamado <strong><em>biblioubuntu.bib</em></strong>. Ahora eliminamos todos los intentos de creación de varias bibliografías en nuestro directorio de trabajo:</p>
<div class="igBar"><span id="lbash-74"><a href="#" onclick="javascript:showPlainTxt('bash-74'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-74">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">*</span>.aux</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">*</span>.bbl</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">*</span>.blg</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Añadimos <strong>bibtopic</strong> a la lista de paquetes a usar:</p>
<div class="igBar"><span id="llatex-75"><a href="#" onclick="javascript:showPlainTxt('latex-75'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">LATEX:</span>
<div id="latex-75">
<div class="latex" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/index.php?title=%5Cusepackage"><span style="color: #800000;">usepackage</span></a><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">bibtopic</span><span style="color: #E02020; ">}</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a href="http://plagatux.es">Piponazo</a> me informa que este paquete tiene dependencias del paquete <strong>texlive-bibtex-extra</strong>, yo lo tendría ya instalado, pero el que no lo tenga, debe hacerlo:</p>
<div class="igBar"><span id="lbash-76"><a href="#" onclick="javascript:showPlainTxt('bash-76'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-76">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> texlive-bibtex-extra</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En mi caso, yo estructuro cada capitulo con su <strong>\chapter</strong>, <strong>\section</strong> y <strong>\subsection</strong> variados dentro de un <strong>\include{fichero}</strong>. Antes de estos <strong>\include</strong> vamos a definir el estilo de bibliografía a <strong>flexbib</strong>:</p>
<div class="igBar"><span id="llatex-77"><a href="#" onclick="javascript:showPlainTxt('latex-77'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">LATEX:</span>
<div id="latex-77">
<div class="latex" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800000; font-weight: normal;">\bibliographystyle</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">flexbib</span><span style="color: #E02020; ">}</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Seguidamente, es donde viene lo importante, nuestro \include{fichero} que contiene el cuerpo del primer capítulo, lo vamos a encerrar entre el siguiente código:</p>
<div class="igBar"><span id="llatex-78"><a href="#" onclick="javascript:showPlainTxt('latex-78'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">LATEX:</span>
<div id="latex-78">
<div class="latex" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">btSect</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">bibliodebian</span><span style="color: #E02020; ">}</span> <span style="color: #2C922C; font-style: italic;">% Aquí es donde se le indica el primer fichero .bib</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/index.php?title=%5Cinclude"><span style="color: #800000;">include</span></a><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">debian</span><span style="color: #E02020; ">}</span> <span style="color: #2C922C; font-style: italic;">% Aquí tenemos nuestro primer contenido con \chapter, \section, \subsection y demás</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800000; font-weight: normal;">\btPrintAll</span> <span style="color: #2C922C; font-style: italic;">% Aquí le estamos diciendo que imprima todas las entradas de bibliodebian.bib, aunque no estén citadas</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">btSect</span></span><span style="color: #E02020; ">}</span> <span style="color: #2C922C; font-style: italic;">% Fin del código que engloba la primera bibliografía</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Y análogamente, para el segundo capítulo:</p>
<div class="igBar"><span id="llatex-79"><a href="#" onclick="javascript:showPlainTxt('latex-79'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">LATEX:</span>
<div id="latex-79">
<div class="latex" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">btSect</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">biblioubuntu</span><span style="color: #E02020; ">}</span> <span style="color: #2C922C; font-style: italic;">% Aquí es donde se le indica el segundo fichero .bib</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #E02020; ">\</span><a href="http://www.golatex.de/wiki/index.php?title=%5Cinclude"><span style="color: #800000;">include</span></a><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">ubuntu</span><span style="color: #E02020; ">}</span> <span style="color: #2C922C; font-style: italic;">% Aquí tenemos nuestro segundo contenido con \chapter, \section, \subsection y demás</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800000; font-weight: normal;">\btPrintAll</span> <span style="color: #2C922C; font-style: italic;">% Aquí le estamos diciendo que imprima todas las entradas de biblioubuntu.bib, aunque no estén citadas</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">btSect</span></span><span style="color: #E02020; ">}</span> <span style="color: #2C922C; font-style: italic;">% Fin del código que engloba la segunda bibliografía</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En lugar de que se imprima en cada bibliografía de cada capítulo todas las entradas del .bib asociado, podemos desear que se impriman sólo las que han sido citadas. En este caso en lugar de <strong>\btPrintAll</strong> utilizaremos el comando <strong>\btPrintCited</strong>. </p>
<p>El siguiente paso es compilar con PDFLaTeX el código del documento. Si usamos una GUI como <strong><a href="http://kile.sourceforge.net/">Kile</a></strong>, se nos informará  de lo siguiente:</p>
<p><em>"Package bibtopic Warning: Please (re)run BibTeX on the file(s):</p>
<p>(bibtopic) principal1<br />
(bibtopic) principal2<br />
(bibtopic) and after that rerun LaTeX."</em></p>
<p>Para hacer lo que se nos pide, nos movemos al directorio de trabajo y escribimos en una consola:</p>
<div class="igBar"><span id="lbash-80"><a href="#" onclick="javascript:showPlainTxt('bash-80'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-80">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">bibtex principal1</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">bibtex principal2</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Una vez hecho esto, recompilamos con PDFLaTeX y ahora sí, cada uno de los dos capítulos tendrá al final su bibliografía.</p>
<p>Enlace: <a href="http://bit.ly/9qvwml">Airminded</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=689</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Crea un manual de código en LaTeX de forma automática</title>
		<link>http://www.nacho-alvarez.es/?p=602</link>
		<comments>http://www.nacho-alvarez.es/?p=602#comments</comments>
		<pubDate>Sat, 13 Mar 2010 15:02:05 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=602</guid>
		<description><![CDATA[Para la formalización de ciertos proyectos, se pide "redactar" un manual de código en el que aparezcan todos los ficheros que componen la aplicación. Si utilizáis LaTeX, he creado un script que te permite crear el manual de código de la aplicación con sólo llamarlo con los parámetros adecuados. Deciros que el esqueleto del script, [...]]]></description>
			<content:encoded><![CDATA[<p>Para la formalización de ciertos proyectos, se pide "redactar" un manual de código en el que aparezcan todos los ficheros que componen la aplicación.</p>
<p>Si utilizáis LaTeX, he creado un script que te permite crear el manual de código de la aplicación con sólo llamarlo con los parámetros adecuados.</p>
<p>Deciros que el esqueleto del script, la parte que recorre directorios y ficheros, está basado en el <em>script</em> <strong>Arbol de directorios</strong> de <a href="http://pacodebian.iespana.es/bash.html#SECTION00040000000000000000">Paco Debian</a>.</p>
<p>El código del script es el siguiente:</p>
<div class="igBar"><span id="lbash-82"><a href="#" onclick="javascript:showPlainTxt('bash-82'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-82">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#set -e</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#set -u</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#set -x</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">func_ficheros<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #007800;">listaficheros</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-maxdepth</span> <span style="color: #000000;color:#800000;">1</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">&quot;*.&quot;</span><span style="color: #007800;">$extpar</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #666666; font-style: italic;"># extraer lista ordenada de ficheros del directorio actual</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> item <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$listaficheros</span> <span style="color: #666666; font-style: italic;"># recorrer lista de ficheros</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">do</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">extfich</span>=<span style="color: #800000;">${item##*.}</span> <span style="color: #666666; font-style: italic;"># obtener extension del fichero</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$extfich</span> = <span style="color: #007800;">$extpar</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #666666; font-style: italic;"># si la extension es la misma que especificamos en $2</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">then</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">fichero</span>=<span style="color: #800000;">${item##*&quot;./&quot;}</span> <span style="color: #666666; font-style: italic;"># eliminar todos los &quot;./&quot; que coloca find</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">fichero</span>=<span style="color: #800000;">${fichero//&quot;_&quot;/&quot;\_&quot;}</span> <span style="color: #666666; font-style: italic;"># reemplazar todos los &quot;_&quot; por &quot;\_&quot;, LaTeX trata &quot;_&quot; como error</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;\section{Fichero &quot;</span><span style="color: #007800;">$fichero</span><span style="color: #ff0000;">&quot;}&quot;</span> <span style="color: #666666; font-style: italic;"># creamos la seccion con el nombre del fichero</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;\lstinputlisting{&quot;</span><span style="color: #007800;">$PWD</span><span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #800000;">${item##*&quot;./&quot;}</span><span style="color: #ff0000;">&quot;}<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #666666; font-style: italic;"># incluimos el fichero con ruta completa y con &quot;_&quot; porque es ruta fisica</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">done</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">func_recursiva<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> OBJ <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #666666; font-style: italic;"># recorrer el directorio $1</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">do</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#40;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &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;">${OBJ}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #666666; font-style: italic;"># es un directorio</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">then</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${OBJ}</span>&quot;</span> <span style="color: #666666; font-style: italic;"># cambiar a este directorio</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">var</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-maxdepth</span> <span style="color: #000000;color:#800000;">1</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">&quot;*.&quot;</span><span style="color: #007800;">$extpar</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #666666; font-style: italic;"># ver si hay en el directorio actual ficheros de tipo $2</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$var</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #666666; font-style: italic;"># si hay ficheros de tipo $2</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">then</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">nombrecarpeta</span>=<span style="color: #800000;">${PWD##*$raiz_pwd}</span> <span style="color: #666666; font-style: italic;">#extraer solo el nombre de la carpeta</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">carpeta</span>=<span style="color: #800000;">${nombrecarpeta//&quot;_&quot;/&quot;\_&quot;}</span> <span style="color: #666666; font-style: italic;"># reemplazar todos los &quot;_&quot; por &quot;\_&quot;, LaTeX trata &quot;_&quot; como error</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #666666; font-style: italic;"># retorno de carro</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;\chapter{Carpeta &quot;</span><span style="color: #007800;">$dirpar</span><span style="color: #007800;">$carpeta</span><span style="color: #ff0000;">&quot;}&quot;</span> <span style="color: #666666; font-style: italic;"># crear nueva subseccion con esta subcarpeta</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; func_ficheros <span style="color: #666666; font-style: italic;"># procesar los ficheros de este directorio</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; func_recursiva <span style="color: #666666; font-style: italic;"># seguir mirando subcarpetas</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">fi</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">done</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#################</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;INICIO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#################</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;color:#800000;">3</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #666666; font-style: italic;"># control de errores - utilizar los tres parametros: nombrecarpeta, extensionfichero y ficherolatex</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">then</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;ERROR: Incorrecto numero de argumentos<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Uso del programa: ./myscript nombrecarpeta extensionfichero ficherolatex&quot;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Ejemplo: ./myscript micarpeta php codigo.tex&quot;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">fi</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">dirpar</span>=<span style="color: #007800;">$1</span> <span style="color: #666666; font-style: italic;"># obtener el parametro de carpeta raiz, en func_recursiva se pierde la visibilidad del parametro</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">extpar</span>=<span style="color: #007800;">$2</span> <span style="color: #666666; font-style: italic;"># obtener el parametro de extension a buscar, en func_recursiva se pierde la visibilidad del parametro</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000;color:#800000;">1</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #007800;">$3</span> <span style="color: #666666; font-style: italic;"># enlazar salida de echo a fichero pasado como parametro $3</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$1</span> <span style="color: #666666; font-style: italic;"># entrar al directorio especificado en $1</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">raiz_pwd</span>=<span style="color: #007800;">$PWD</span> <span style="color: #666666; font-style: italic;"># guardar la raiz de este directorio, la perderemos al recorrer el arbol en func_recursiva</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;\chapter{Carpeta &quot;</span><span style="color: #007800;">$1</span><span style="color: #ff0000;">&quot;}&quot;</span> <span style="color: #666666; font-style: italic;"># crear la carpeta raiz como capitulo</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">func_ficheros <span style="color: #666666; font-style: italic;"># procesar directorio raiz</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">func_recursiva <span style="color: #666666; font-style: italic;"># llamar a func_recursiva para exploracion completa del directorio</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Como veis, cada línea está bien comentada para que no haya ningún problema de comprensión.</p>
<p>La ejecución del script se realiza de la siguiente manera:</p>
<pre><code>./myscript nombrecarpeta extensionfichero ficherolatex</code></pre>
<p>Si por ejemplo queremos realizar un manual de código del conocido CMS <a href="http://es.wikipedia.org/wiki/Drupal">Drupal</a>, deberemos llamar al script de la siguiente forma:</p>
<pre><code>neonigma@neonigma-laptop:/opt/lampp/htdocs$ ./myscript drupal php codigo.tex</code></pre>
<p>En líneas generales, el script recorre la carpeta drupal de nuestro servidor Web buscando ficheros con extensión PHP y genera un fichero de LaTeX con la siguiente estructura:</p>
<p>\chapter{Carpeta o subcarpeta}<br />
\section{Sección para fichero .php encontrado}<br />
\lstinputlisting{ruta al fichero php, que provocará el listado de código del mismo}</p>
<ul>
<li>El pdf resultante del proyecto LaTeX puede descargarse <a href='http://www.nacho-alvarez.es/wp-content/uploads/2010/03/ejemplo-manual-codigo-automatico.pdf'>haciendo clic aquí.</a></li>
<li>Podéis descargar el script <a href='http://www.nacho-alvarez.es/wp-content/uploads/2010/03/myscript.zip'>pulsando aquí.</a></li>
<li>El ejemplo de proyecto LaTeX, que incluye el fichero codigo.tex generado automáticamente por el script, puede descargarse <a href='http://www.nacho-alvarez.es/wp-content/uploads/2010/03/manual-drupal.zip'>pulsando aquí.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=602</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Documentar automáticamente las tablas de una base de datos MySQL</title>
		<link>http://www.nacho-alvarez.es/?p=582</link>
		<comments>http://www.nacho-alvarez.es/?p=582#comments</comments>
		<pubDate>Fri, 05 Mar 2010 12:01:21 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=582</guid>
		<description><![CDATA[Seguro que a muchos os ha tocado la tediosa tarea de documentar una aplicación. Para la parte técnica, incluso debemos preparar imágenes de las tablas de la base de datos. Pues bien, no para que la máquina realice el 100% del trabajo, pero sí para ahorrarnos mucho pero que mucho curro, mi buen amigo Joaquín [...]]]></description>
			<content:encoded><![CDATA[<p>Seguro que a muchos os ha tocado la tediosa tarea de documentar una aplicación. Para la parte técnica, incluso debemos preparar imágenes de las tablas de la base de datos. Pues bien, no para que la máquina realice el 100% del trabajo, pero sí para ahorrarnos mucho pero que mucho curro, mi buen amigo <strong>Joaquín Gracia</strong> aka <em>Kubiat</em> se curró este <em>script</em> en PHP que me he encargado de modificar a mi gusto y de complementar con otro <em>script</em> en Bash.</p>
<p>Tenemos, por tanto, el siguiente material:</p>
<p>* <strong>Script en PHP</strong> que muestra en una página Web todas las tablas extraídas de la base de datos y que, además, ha sido modificado para obtener cada tabla en un fichero HTML independiente. Más o menos lo que muestra la siguiente imagen:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/tabla-drupal.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/tabla-drupal-300x175.png" alt="" title="tabla-drupal" width="300" height="175" class="alignnone size-medium wp-image-584" /></a></center></p>
<p>La visita a la página Web crea cada tabla de la base de datos en un fichero HTML, como puede verse en el listado por consola:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/listado-htmls.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/listado-htmls-300x36.png" alt="" title="listado-htmls" width="300" height="36" class="alignnone size-medium wp-image-598" /></a></center></p>
<p>* <strong>Script en Bash</strong> que recoge cada fichero HTML del directorio de trabajo y lo convierte a imagen JPG, como muestra la siguiente imagen:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/ejecucion-script.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/ejecucion-script-300x85.png" alt="" title="ejecucion-script" width="300" height="85" class="alignnone size-medium wp-image-586" /></a></center></p>
<p>Para utilizar el script en PHP, basta con acceder a la dirección Web local donde lo hayamos colocado. Este script sólo necesita modificar las variables de acceso a la base de datos de la función <strong>conecta</strong>.  En el caso de la imagen, la dirección Web a la que se accede es <em>http://localhost/jscript/tablas.php</em></p>
<p>Para utilizar el script en Bash, le damos permisos de ejecución con <em>chmod +x nscript</em> y lo ejecutamos (<strong>importante</strong> que sea dentro de este directorio de trabajo) escribiendo <em>./nscript</em></p>
<p>El código de este <em>script</em> es tan sencillo como esto:</p>
<div class="igBar"><span id="lbash-85"><a href="#" onclick="javascript:showPlainTxt('bash-85'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-85">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># Script para la obtencion de imagenes a partir de HTMLs</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;color:#800000;">777</span> <span style="color: #000000; font-weight: bold;">*</span>.html</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #007800;">archivos</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.html<span style="color: #7a0874; font-weight: bold;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">for</span> lista <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$archivos</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">do</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; convert <span style="color: #660033;">-verbose</span> <span style="color: #660033;">-density</span> 600x600 <span style="color: #660033;">-trim</span> +repage <span style="color: #007800;">$lista</span> <span style="color: #007800;">$lista</span>.jpg</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$lista</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">done</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Lo que significa que el script tomará todos los archivos <strong>html</strong> de la carpeta, y uno a uno los convertirá a <strong>jpg</strong> con una densidad de página de 600x600, recortando los espacios en blanco sobrantes y paginando en varias imágenes si no cupiera en una. Después de esta conversión, se borra el fichero html que ya deja de sernos útil.</p>
<p>En el ejemplo hemos utilizado una instalación de <strong>Drupal</strong> para extraer todas las tablas de la base de datos y convertirlas a imágenes. La muestra de la lista de imágenes resultantes podemos verla en la siguiente imagen:</p>
<p><center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/lista-imagenes.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2010/03/lista-imagenes-300x175.png" alt="" title="lista-imagenes" width="300" height="175" class="alignnone size-medium wp-image-588" /></a></center></p>
<p>Obviamente podemos ver que el texto que acompaña a cada campo es demasiado <strong>genérico</strong>, de ahí a que no todo el trabajo lo realice la máquina. Nosotros podemos, en el paso de la generación de los archivos html, modificar cada campo de cada tabla en los ficheros html para que la descripción se ajuste a lo que queremos. Una vez terminadas las descripciones, lanzaríamos el script en bash y obtendríamos las imágenes automáticamente. </p>
<p><strong>Recordar que este script borra cada fichero HTML, por lo que deberemos guardar en una carpeta los ficheros html por si luego queremos retocar alguna descripción, o eliminar la línea del script en bash que borra cada fichero html</strong>.</p>
<p><a href='http://www.nacho-alvarez.es/wp-content/uploads/2010/03/tablas.php_.zip'>Descarga el <strong>script PHP</strong> aquí.</a><br />
<a href='http://www.nacho-alvarez.es/wp-content/uploads/2010/03/nscript.zip'>Descarga el <strong>script en Bash</strong> aquí.</a></p>
<p>Si la imagen resultante de alguno de los ficheros html nos resulta demasiado grande o demasiado dividida (por ejemplo, la tabla <strong>comments</strong> de Drupal se ha dividido en dos imágenes), podemos utilizar otro script para conversión <em>manual</em> de un único fichero html.</p>
<p>Este script contiene el siguiente código:</p>
<div class="igBar"><span id="lbash-86"><a href="#" onclick="javascript:showPlainTxt('bash-86'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">BASH:</span>
<div id="bash-86">
<div class="bash" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># Script para la obtencion de imagenes a partir de HTMLs</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># Uso: ./xscript 0.55 nombre-de-pagina-html-sin-extension</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">html2ps <span style="color: #660033;">-U</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">$2</span>.ps <span style="color: #007800;">$2</span>.html</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">convert <span style="color: #660033;">-density</span> 600x600 <span style="color: #660033;">-trim</span> +repage <span style="color: #007800;">$2</span>.ps <span style="color: #007800;">$2</span>.jpg</div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>La llamada a este script se realiza de la siguiente forma: <em>./xscript factor-escala nombre-de-pagina-html-sin-extension</em></p>
<p>Por ejemplo: <em>./xscript 0.55 comments</em></p>
<p><a href='http://www.nacho-alvarez.es/wp-content/uploads/2010/03/xscript.zip'>Descarga el <strong>script manual</strong> aquí.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=582</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Manifiesto: En defensa de los derechos fundamentales en Internet</title>
		<link>http://www.nacho-alvarez.es/?p=580</link>
		<comments>http://www.nacho-alvarez.es/?p=580#comments</comments>
		<pubDate>Wed, 02 Dec 2009 12:57:31 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[Informática]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=580</guid>
		<description><![CDATA[Ante la inclusión en el Anteproyecto 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, bloggers, usuarios, profesionales y creadores de internet manifestamos nuestra firme oposición al proyecto, y declaramos que… [...]]]></description>
			<content:encoded><![CDATA[<p>Ante la inclusión en el Anteproyecto 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, bloggers, usuarios, profesionales y creadores de internet manifestamos nuestra firme oposición al proyecto, y declaramos que… </p>
<p>1.- Los derechos de autor no pueden situarse por encima de los derechos fundamentales de los ciudadanos, 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. </p>
<p>2.- La suspensión de derechos fundamentales es y debe seguir siendo competencia exclusiva del poder judicial. 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. </p>
<p>3.- La nueva legislación creará inseguridad jurídica en todo el sector tecnológico español, 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. </p>
<p>4.- La nueva legislación propuesta amenaza a los nuevos creadores y entorpece la creación cultural. 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. </p>
<p>5.- Los autores, como todos los trabajadores, tienen derecho a vivir de su trabajo con nuevas ideas creativas, modelos de negocio y actividades 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. </p>
<p>6.- Consideramos que las industrias culturales necesitan para sobrevivir alternativas modernas, eficaces, creíbles y asequibles y que se adecuen a los nuevos usos sociales, en lugar de limitaciones tan desproporcionadas como ineficaces para el fin que dicen perseguir. </p>
<p>7.- Internet debe funcionar de forma libre y sin interferencias políticas auspiciadas por sectores que pretenden perpetuar obsoletos modelos de negocio e imposibilitar que el saber humano siga siendo libre. </p>
<p>8.- Exigimos que el Gobierno garantice por ley la neutralidad de la Red en España, ante cualquier presión que pueda producirse, como marco para el desarrollo de una economía sostenible y realista de cara al futuro. </p>
<p>9.- Proponemos una verdadera reforma del derecho de propiedad intelectual orientada a su fin: devolver a la sociedad el conocimiento, promover el dominio público y limitar los abusos de las entidades gestoras. </p>
<p>10.- En democracia las leyes y sus modificaciones deben aprobarse tras el oportuno debate público 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. </p>
<p><em>Este manifiesto, elaborado de forma conjunta por varios autores, es de todos y de ninguno. Si quieres sumarte a él, difúndelo por Internet.</em></p>
<div class='wp_likes' id='wp_likes_post-580'><a class='like' style='border:none;cursor:pointer;' href="javascript:wp_likes.like(580);" title='' ><img src="http://www.nacho-alvarez.es/wp-content/plugins/wp-likes/images/like.png" alt='' border='0' style='background:none;border:none;'/>Me gusta</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(580);">Ya no me gusta</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=580</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>La ciencia en España no necesita tijeras</title>
		<link>http://www.nacho-alvarez.es/?p=577</link>
		<comments>http://www.nacho-alvarez.es/?p=577#comments</comments>
		<pubDate>Wed, 07 Oct 2009 21:20:46 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[Ciencia]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=577</guid>
		<description><![CDATA[Desde aquí el pequeño granito de arena a intentar hacer un poco de ruido sobre este tema, que ya de por sí es ruidoso y desagradable. Lo que nos faltaba, vamos. Queremos migrar de la industria del ladrillazo al I+D+i y lo hacemos... ¡recortando presupuestos en I+D+i! Cuanto menos, contraproducente. Un extracto bastante explicativo de [...]]]></description>
			<content:encoded><![CDATA[<p>Desde aquí el pequeño granito de arena a intentar hacer un poco de ruido sobre este tema, que ya de por sí es ruidoso y desagradable. Lo que nos faltaba, vamos. Queremos migrar de la industria del ladrillazo al I+D+i y lo hacemos... ¡recortando presupuestos en I+D+i! Cuanto menos, contraproducente.</p>
<p><center><img src="http://farm3.static.flickr.com/2488/3973473121_e76fde787c_o.jpg" width="50%"/></center></p>
<p>Un extracto bastante explicativo de la iniciativa surgida en <a href="http://aldea-irreductible.blogspot.com">La aldea irreductible</a></p>
<p>"Decir que España es un país de Ciencia es hacer verdaderos contorsionismos con las palabras... Decir que en España hay grandes científicos es obviar su precaria realidad, pero decir que se busca un modelo productivo basado en la Innovación y reducir a la vez el presupuesto del Ministerio de Ciencia en hasta un 37% podría ser tildado perfectamente de tomadura de pelo. Finalmente, el Tijeretazo estará en torno a un 15%... Inquietante, incluso para miembros del propio Gobierno..."</p>
<div class='wp_likes' id='wp_likes_post-577'><a class='like' style='border:none;cursor:pointer;' href="javascript:wp_likes.like(577);" title='' ><img src="http://www.nacho-alvarez.es/wp-content/plugins/wp-likes/images/like.png" alt='' border='0' style='background:none;border:none;'/>Me gusta</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(577);">Ya no me gusta</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=577</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>¿No sabes como escribir un símbolo en LaTeX? ¡Dibújalo!</title>
		<link>http://www.nacho-alvarez.es/?p=569</link>
		<comments>http://www.nacho-alvarez.es/?p=569#comments</comments>
		<pubDate>Thu, 20 Aug 2009 14:58:02 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=569</guid>
		<description><![CDATA[Leo en el blog Manzana Mecánica esta sorprendente noticia que quería compartir con todo el que desarrolla documentos en LaTeX: LaTeX es un lenguaje para creación de documentos tremendamente poderoso y ampliamente usado en la academia para escribir artículos científicos, particularmente por lo fácil que es escribir símbolos matemáticos. Sin embargo, la gran variedad de [...]]]></description>
			<content:encoded><![CDATA[<p>Leo en el blog <a href="http://www.manzanamecanica.org">Manzana Mecánica</a> esta sorprendente noticia que quería compartir con todo el que desarrolla documentos en LaTeX:</p>
<blockquote><p>
LaTeX es un lenguaje para creación de documentos tremendamente poderoso y ampliamente usado en la academia para escribir artículos científicos, particularmente por lo fácil que es escribir símbolos matemáticos. Sin embargo, la gran variedad de comandos también hace que a veces uno no recuerde cómo describir ciertos símbolos. Detexify te permite que dibujes un símbolo y te indica posibles comandos en LaTeX que describen ese símbolo. ¡Muy útil y totalmente recomendado!
</p></blockquote>
<p>Esta es una imagen de como funciona el tinglado:<br />
<center><a href="http://www.nacho-alvarez.es/wp-content/uploads/2009/08/detexify.png"><img src="http://www.nacho-alvarez.es/wp-content/uploads/2009/08/detexify-300x187.png" alt="detexify" title="detexify" width="300" height="187" class="alignnone size-medium wp-image-570" /></a></center></p>
<p>Puedes acceder a Detexify haciendo clic <a href="http://detexify.kirelabs.org/classify.html">aquí</a></p>
<p>Fuente: <a href="http://www.manzanamecanica.org/2009/07/no_sabes_como_escribir_un_simbolo_en_latex_dibujalo.html">Manzana Mecánica</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=569</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Redimensionar iFrame en IE y Firefox con Javascript</title>
		<link>http://www.nacho-alvarez.es/?p=514</link>
		<comments>http://www.nacho-alvarez.es/?p=514#comments</comments>
		<pubDate>Thu, 20 Aug 2009 14:48:46 +0000</pubDate>
		<dc:creator>neonigma</dc:creator>
				<category><![CDATA[PHP / HTML]]></category>

		<guid isPermaLink="false">http://www.nacho-alvarez.es/?p=514</guid>
		<description><![CDATA[Ha sido especialmente tedioso conseguir que para un iframe, se me redimensionara la altura dependiendo del contenido que se cargara dentro de éste. Firefox lo realizaba a la perfección, pero no así Internet Explorer. Tomando un par de referencias me he construido la solución que quiero compartir. En el archivo que declara el iframe: PLAIN [...]]]></description>
			<content:encoded><![CDATA[<p>Ha sido especialmente tedioso conseguir que para un iframe, se me redimensionara la altura dependiendo del contenido que se cargara dentro de éste. Firefox lo realizaba a la perfección, pero no así Internet Explorer. Tomando un par de referencias me he construido la solución que quiero compartir.</p>
<p>En el archivo que declara el iframe:</p>
<div class="igBar"><span id="ljavascript-91"><a href="#" onclick="javascript:showPlainTxt('javascript-91'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-91">
<div class="javascript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">function</span> grand<span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#41;</span> </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; iframe<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mi_iframe&quot;</span><span style="color: #009900;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; iframe.<span style="color: #660066;">height</span><span style="color: #339933;">=</span>h<span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">function</span> reSize<span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#123;</span> &nbsp;</div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">try</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; <span style="color: #009900;">&#123;</span> </div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> oBody &nbsp; <span style="color: #339933;">=</span> &nbsp; mi_iframe.<span style="color: #660066;">document</span>.<span style="color: #660066;">body</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> oFrame&nbsp; <span style="color: #339933;">=</span> &nbsp; document.<span style="color: #660066;">all</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mi_iframe&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; oFrame.<span style="color: #660066;">style</span>.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> oBody.<span style="color: #660066;">scrollHeight</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>oBody.<span style="color: #660066;">offsetHeight</span> <span style="color: #339933;">-</span> oBody.<span style="color: #660066;">clientHeight</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; oFrame.<span style="color: #660066;">style</span>.<span style="color: #660066;">width</span> <span style="color: #339933;">=</span> oBody.<span style="color: #660066;">scrollWidth</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>oBody.<span style="color: #660066;">offsetWidth</span> <span style="color: #339933;">-</span> oBody.<span style="color: #660066;">clientWidth</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//An error is raised if the IFrame domain != its container's domain</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;window.<span style="color: #000066;">status</span> <span style="color: #339933;">=</span>&nbsp; &nbsp; <span style="color: #3366CC;">'Error: '</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">number</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'; '</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">description</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En el mismo fichero, declaramos el iframe y colocamos esto en el body para IE:</p>
<div class="igBar"><span id="lhtml-92"><a href="#" onclick="javascript:showPlainTxt('html-92'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-92">
<div class="html" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3Ebody.html"><span style="color: #000000; font-weight: bold;">&lt;body</span></a> <span style="color: #000066;">onLoad</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;reSize(0)&quot;</span>&gt;&lt;iframe <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mi_iframe&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;iframe.php&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">frameborder</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;100%&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span>iframe&gt;&lt;<span style="color: #66cc66;">/</span>body&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>En el contenido del iframe (iframe.php en el ejemplo):</p>
<div class="igBar"><span id="ljavascript-93"><a href="#" onclick="javascript:showPlainTxt('javascript-93'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-93">
<div class="javascript" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;<span style="color: #003366; font-weight: bold;">function</span> redimensiona<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#123;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> navegador <span style="color: #339933;">=</span> navigator.<span style="color: #660066;">appName</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navegador <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;Microsoft Internet Explorer&quot;</span><span style="color: #009900;">&#41;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; top.<span style="color: #660066;">reSize</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; principal<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div_principal&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; top.<span style="color: #660066;">grand</span><span style="color: #009900;">&#40;</span>principal.<span style="color: #660066;">scrollHeight</span><span style="color: #339933;">+</span><span style="color: #CC0000;color:#800000;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold; vertical-align:top;color:#26536A;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#125;</span></div>
</li>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>El código HTML del contenido de este iframe sería algo así como:</p>
<div class="igBar"><span id="lhtml-94"><a href="#" onclick="javascript:showPlainTxt('html-94'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-94">
<div class="html" style="font-family:monospace;">
<ol>
<li style="font-weight: normal; vertical-align:top;color:#3A6A8B;">
<div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;html&gt;&lt;body <span style="color: #000066;">onLoad</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;redimensiona()&quot;</span>&gt;&lt;table <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;div_principal&quot;</span>&gt;&lt;tr&gt;&lt;td&gt;</span>Incluir contenido de la pagina<span style="color: #009900;"><a href="http://december.com/html/4/element/%26amp%3Blt%3CSEMI%3E.html"><span style="color: #000000; font-weight: bold;">&lt;</span></a><span style="color: #66cc66;">/</span>td&gt;&lt;<span style="color: #66cc66;">/</span>tr&gt;&lt;<span style="color: #66cc66;">/</span>table&gt;&lt;<span style="color: #66cc66;">/</span>body&gt;&lt;<span style="color: #66cc66;">/</span>html&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Referencias:</strong></p>
<ul>
<li><a href="http://clipdepelicula.com/iframe-que-adapta-su-alturaheight-al-contenido/">Clip de pelicula</a></li>
<li><a href="http://support.microsoft.com/kb/278469/es">Microsoft Support</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.nacho-alvarez.es/?feed=rss2&amp;p=514</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
