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

<channel>
	<title>Blog de Jorge Machín &#187; Linux</title>
	<atom:link href="http://www.machin.com.mx/archives/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.machin.com.mx</link>
	<description>Sólo para recordar</description>
	<lastBuildDate>Mon, 06 Sep 2010 07:34:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Programación Adobe Air 2.0 en Linux</title>
		<link>http://www.machin.com.mx/archives/4795</link>
		<comments>http://www.machin.com.mx/archives/4795#comments</comments>
		<pubDate>Mon, 26 Jul 2010 11:43:13 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/?p=4795</guid>
		<description><![CDATA[<p>Al igual que las aplicaciones Flex, es posible desarrollar en Linux aplicaciones de escritorio en AIR. En este post pongo un ejemplo y una miniguía de instalación.</p>
<h4>Instalación</h4>
<p>Primero se necesita bajar e instalar la versión 4.1 de Flex, la cual se puede obtener de <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex4sdk" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/cfusion/entitlement/index.cfm?e=flex4sdk&amp;referer=');">http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex4sdk</a> en forma de un archivo zip llamado <strong>flex_sdk_4.1.zip</strong></p>
<div class="syntax_hilite">
<div id="text-1">
<div class="text">mkdir flex<br />
cp flex_sdk_4.<span style="">1</span>.zip flex<br />
cd flex<br />
unzip flex_sdk_4.<span style="">1</span>.zip</div>
</div>
</div>
<p></p>
<p>Desafortunadamente la versión multiplataforma de Flex, aunque ya incluye una versión de Air, está rota y aparentemente sólo funciona para Windows y Mac. Pareciera que a los señores de Adobe se les olvidó Linux en el caso de Air; por lo que es necesario descargar el SDK de AIR y desempaquetarlo sobre el directorio donde instalamos Flex. </p>
<p>Entonces, bajamos <strong>Air 2.0</strong> de <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk&amp;referer=');">http://www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk</a> y sobre-escribimos el sdk de AIR que descargamos:</p>
<div class="syntax_hilite">
<div id="text-2">
<div class="text">cp AdobeAIRSDK.tbz2 flex<br />
cd flex<br />
bunzip2 AdobeAIRSDK.tbz2<br />
tar -xvf AdobeAIRSDK.tar</div>
</div>
</div>
<p></p>
<p>Sinceramente no sé si es el método correcto de arreglar los errores de Adobe, pero fue lo primero que se me ocurrió y me funcionó.</p>
<h4>Escribiendo un programa de prueba</h4>
<p>Como ejemplo de una aplicación creamos el programa <strong>mxml</strong> llamado <strong>Test.mxml</strong></p>
<div class="syntax_hilite">
<div id="xml-3">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;s:WindowedApplication</span>&nbsp; <span style="color: #000066;">xmlns:fx</span>=<span style="color: #ff0000;">"http://ns.adobe.com/mxml/2009"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">"library://ns.adobe.com/flex/spark"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">"library://ns.adobe.com/flex/mx"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/s:WindowedApplication<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>El cual compilamos con el comando:</p>
<div class="syntax_hilite">
<div id="text-4">
<div class="text">bin/mxmlc -library-path+=frameworks/libs/air Test.mxml</div>
</div>
</div>
<p></p>
<p>Ahora creamos un archivo que nos describe la aplicación AIR, al cual llamamos <strong>Test-app.xml</strong></p>
<div class="syntax_hilite">
<div id="xml-5">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span> <span style="color: #000066;">standalone</span>=<span style="color: #ff0000;">"no"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;application</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://ns.adobe.com/air/application/2.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Adobe AIR Application Descriptor File Template.</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; Specifies parameters for identifying, installing, and launching AIR applications.</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The last segment of the namespace specifies the version <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; of the AIR runtime required for this application to run.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; minimumPatchLevel - The minimum patch level of the AIR runtime required to run <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the application. Optional.<br />
--&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- A universally unique application identifier. Must be unique across all AIR applications.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Used as the filename for the application. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filename<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filename<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The name that is displayed in the AIR application installer. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;May have multiple values for each language. See samples or xsd schema file. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- An application version designator (such as &quot;v1&quot;, &quot;2.5&quot;, or &quot;Alpha 1&quot;). Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>v1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Description, displayed in the AIR application installer.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;May have multiple values for each language. See samples or xsd schema file. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;description&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Copyright information. Optional --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;copyright&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/copyright<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;publisherID&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/publisherID<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Settings for the application's initial window. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;initialWindow<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The main SWF or HTML file of the application. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Note: In Flash Builder, the SWF reference is set automatically. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test.swf<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The title of the main window. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;title&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/title<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The type of system chrome to use (either &quot;standard&quot; or &quot;none&quot;). Optional. Default standard. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;systemChrome&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/systemChrome<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;transparent&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/transparent<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the window is initially visible. Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;visible&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/visible<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the user can minimize the window. Optional. Default true. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;minimizable&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/minimizable<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the user can maximize the window. Optional. Default true. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;maximizable&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/maximizable<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the user can resize the window. Optional. Default true. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;resizable&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/resizable<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial width in pixels. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;width&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/width<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial height in pixels. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;height&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/height<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial x position. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;x&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/x<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial y position. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;y&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/y<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's minimum size, specified as a width/height pair in pixels, such as &quot;400 200&quot;. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;minSize&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/minSize<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial maximum size, specified as a width/height pair in pixels, such as &quot;1600 1200&quot;. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;maxSize&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/maxSize<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/initialWindow<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- We recommend omitting the supportedProfiles element, --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- which in turn permits your application to be deployed to all --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- devices supported by AIR. If you wish to restrict deployment --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- (i.e., to only mobile devices) then add this element and list --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- only the profiles which your application does support. --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;supportedProfiles&gt;</span></span>desktop extendedDesktop mobileDevice extendedMobileDevice<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/supportedProfiles<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The subpath of the standard default installation location to use. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;installFolder&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/installFolder<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;programMenuFolder&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/programMenuFolder<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The icon the system uses for the application. For at least one resolution,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;specify the path to a PNG file included in the AIR package. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;icon&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/icon<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the application handles the update when a user double-clicks an update version<br />
&nbsp; &nbsp; &nbsp; &nbsp; of the AIR file (true), or the default AIR application installer handles the update (false).<br />
&nbsp; &nbsp; &nbsp; &nbsp; Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;customUpdateUI&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/customUpdateUI<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the application can be launched when the user clicks a link in a web browser.<br />
&nbsp; &nbsp; &nbsp; &nbsp; Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;allowBrowserInvocation&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/allowBrowserInvocation<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Listing of file types for which the application can register. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;fileTypes&gt;</span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Defines one file type. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;fileType&gt;</span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The name that the system displays for the registered file type. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;name&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The extension to register. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;extension&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/extension<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The description of the file type. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;description&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The MIME content type. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;contentType&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/contentType<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The icon to display for the file type. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;icon&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/icon<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;/fileType&gt;</span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;/fileTypes&gt;</span></span> --&gt;</p>
<p><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/application<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>Finalmente ejecutamos la aplicación con:</p>
<div class="syntax_hilite">
<div id="text-6">
<div class="text">adl test.mxml</div>
</div>
</div>
<p></p>
<h4>Algunos detalles...</h4>
<p>Para usar aplicaciones que tengan transparencia es necesario que el escritorio la soporte; por ejemplo usando <strong>compiz</strong>.</p>

]]></description>
			<content:encoded><![CDATA[<p>Al igual que las aplicaciones Flex, es posible desarrollar en Linux aplicaciones de escritorio en AIR. En este post pongo un ejemplo y una miniguía de instalación.</p>
<h4>Instalación</h4>
<p>Primero se necesita bajar e instalar la versión 4.1 de Flex, la cual se puede obtener de <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex4sdk" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/cfusion/entitlement/index.cfm?e=flex4sdk&amp;referer=');">http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex4sdk</a> en forma de un archivo zip llamado <strong>flex_sdk_4.1.zip</strong></p>
<div class="syntax_hilite">
<div id="text-7">
<div class="text">mkdir flex<br />
cp flex_sdk_4.<span style="">1</span>.zip flex<br />
cd flex<br />
unzip flex_sdk_4.<span style="">1</span>.zip</div>
</div>
</div>
<p></p>
<p>Desafortunadamente la versión multiplataforma de Flex, aunque ya incluye una versión de Air, está rota y aparentemente sólo funciona para Windows y Mac. Pareciera que a los señores de Adobe se les olvidó Linux en el caso de Air; por lo que es necesario descargar el SDK de AIR y desempaquetarlo sobre el directorio donde instalamos Flex. </p>
<p>Entonces, bajamos <strong>Air 2.0</strong> de <a href="http://www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk&amp;referer=');">http://www.adobe.com/cfusion/entitlement/index.cfm?e=airsdk</a> y sobre-escribimos el sdk de AIR que descargamos:</p>
<div class="syntax_hilite">
<div id="text-8">
<div class="text">cp AdobeAIRSDK.tbz2 flex<br />
cd flex<br />
bunzip2 AdobeAIRSDK.tbz2<br />
tar -xvf AdobeAIRSDK.tar</div>
</div>
</div>
<p></p>
<p>Sinceramente no sé si es el método correcto de arreglar los errores de Adobe, pero fue lo primero que se me ocurrió y me funcionó.</p>
<h4>Escribiendo un programa de prueba</h4>
<p>Como ejemplo de una aplicación creamos el programa <strong>mxml</strong> llamado <strong>Test.mxml</strong></p>
<div class="syntax_hilite">
<div id="xml-9">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;s:WindowedApplication</span>&nbsp; <span style="color: #000066;">xmlns:fx</span>=<span style="color: #ff0000;">"http://ns.adobe.com/mxml/2009"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">xmlns:s</span>=<span style="color: #ff0000;">"library://ns.adobe.com/flex/spark"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">"library://ns.adobe.com/flex/mx"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/s:WindowedApplication<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>El cual compilamos con el comando:</p>
<div class="syntax_hilite">
<div id="text-10">
<div class="text">bin/mxmlc -library-path+=frameworks/libs/air Test.mxml</div>
</div>
</div>
<p></p>
<p>Ahora creamos un archivo que nos describe la aplicación AIR, al cual llamamos <strong>Test-app.xml</strong></p>
<div class="syntax_hilite">
<div id="xml-11">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span> <span style="color: #000066;">standalone</span>=<span style="color: #ff0000;">"no"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;application</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://ns.adobe.com/air/application/2.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Adobe AIR Application Descriptor File Template.</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; Specifies parameters for identifying, installing, and launching AIR applications.</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/2.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The last segment of the namespace specifies the version <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; of the AIR runtime required for this application to run.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; minimumPatchLevel - The minimum patch level of the AIR runtime required to run <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the application. Optional.<br />
--&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- A universally unique application identifier. Must be unique across all AIR applications.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Used as the filename for the application. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filename<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filename<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The name that is displayed in the AIR application installer. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;May have multiple values for each language. See samples or xsd schema file. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- An application version designator (such as &quot;v1&quot;, &quot;2.5&quot;, or &quot;Alpha 1&quot;). Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>v1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Description, displayed in the AIR application installer.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;May have multiple values for each language. See samples or xsd schema file. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;description&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Copyright information. Optional --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;copyright&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/copyright<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;publisherID&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/publisherID<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Settings for the application's initial window. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;initialWindow<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The main SWF or HTML file of the application. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Note: In Flash Builder, the SWF reference is set automatically. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;content<span style="font-weight: bold; color: black;">&gt;</span></span></span>Test.swf<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/content<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The title of the main window. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;title&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/title<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The type of system chrome to use (either &quot;standard&quot; or &quot;none&quot;). Optional. Default standard. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;systemChrome&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/systemChrome<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;transparent&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/transparent<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the window is initially visible. Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;visible&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/visible<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the user can minimize the window. Optional. Default true. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;minimizable&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/minimizable<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the user can maximize the window. Optional. Default true. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;maximizable&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/maximizable<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the user can resize the window. Optional. Default true. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;resizable&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/resizable<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial width in pixels. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;width&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/width<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial height in pixels. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;height&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/height<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial x position. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;x&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/x<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial y position. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;y&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/y<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's minimum size, specified as a width/height pair in pixels, such as &quot;400 200&quot;. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;minSize&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/minSize<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The window's initial maximum size, specified as a width/height pair in pixels, such as &quot;1600 1200&quot;. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;maxSize&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/maxSize<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/initialWindow<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- We recommend omitting the supportedProfiles element, --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- which in turn permits your application to be deployed to all --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- devices supported by AIR. If you wish to restrict deployment --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- (i.e., to only mobile devices) then add this element and list --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- only the profiles which your application does support. --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;supportedProfiles&gt;</span></span>desktop extendedDesktop mobileDevice extendedMobileDevice<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/supportedProfiles<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The subpath of the standard default installation location to use. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;installFolder&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/installFolder<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;programMenuFolder&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/programMenuFolder<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The icon the system uses for the application. For at least one resolution,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;specify the path to a PNG file included in the AIR package. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;icon&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/icon<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the application handles the update when a user double-clicks an update version<br />
&nbsp; &nbsp; &nbsp; &nbsp; of the AIR file (true), or the default AIR application installer handles the update (false).<br />
&nbsp; &nbsp; &nbsp; &nbsp; Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;customUpdateUI&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/customUpdateUI<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Whether the application can be launched when the user clicks a link in a web browser.<br />
&nbsp; &nbsp; &nbsp; &nbsp; Optional. Default false. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;allowBrowserInvocation&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/allowBrowserInvocation<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Listing of file types for which the application can register. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;fileTypes&gt;</span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Defines one file type. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;fileType&gt;</span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The name that the system displays for the registered file type. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;name&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The extension to register. Required. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;extension&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/extension<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The description of the file type. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;description&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The MIME content type. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;contentType&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/contentType<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- The icon to display for the file type. Optional. --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;icon&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image16x16<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image32x32<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image48x48<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/image128x128<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/icon<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;/fileType&gt;</span></span> --&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;/fileTypes&gt;</span></span> --&gt;</p>
<p><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/application<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>Finalmente ejecutamos la aplicación con:</p>
<div class="syntax_hilite">
<div id="text-12">
<div class="text">adl test.mxml</div>
</div>
</div>
<p></p>
<h4>Algunos detalles...</h4>
<p>Para usar aplicaciones que tengan transparencia es necesario que el escritorio la soporte; por ejemplo usando <strong>compiz</strong>.</p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/4795/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Montar sftp como directorios usando sshfs y fuse</title>
		<link>http://www.machin.com.mx/archives/2188</link>
		<comments>http://www.machin.com.mx/archives/2188#comments</comments>
		<pubDate>Wed, 28 Apr 2010 02:04:53 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/?p=2188</guid>
		<description><![CDATA[<p>Aunque en <strong>KDE</strong> y <strong>Gnome</strong> tenemos formas muy simples de montar directorios externos de varios tipos (SMB, SSH y NFS ) desde el escritorio; es bueno conocer algún método desde la línea de comandos para algún servidor que administremos o para tenerlo a nuestra disposición de forma permanente montado en un directorio. Un método simple y seguro es usar <strong>sshfs</strong> con <strong>fuse</strong>.</p>
<p>Instalamos sshfs y fuse:</p>
<div class="syntax_hilite">
<div id="text-13">
<div class="text">yum install sshfs<br />
yum install fuse</div>
</div>
</div>
<p></p>
<p>Ahora por en la línea de comando podemos hacer:</p>
<div class="syntax_hilite">
<div id="text-14">
<div class="text">sshfs host:/directorio_externo directorio_donde_montar</div>
</div>
</div>
<p></p>
<p>O bien, si queremos que sea permanente, podemos editar el archivo <strong>/etc/fstab</strong> y agregar una línea similar:</p>
<div class="syntax_hilite">
<div id="text-15">
<div class="text">sshfs#user@host:/&nbsp; &nbsp; /home/you/remote&nbsp; &nbsp; fuse&nbsp; &nbsp; defaults&nbsp; &nbsp; <span style="">0</span> <span style="">0</span></div>
</div>
</div>
<p></p>

]]></description>
			<content:encoded><![CDATA[<p>Aunque en <strong>KDE</strong> y <strong>Gnome</strong> tenemos formas muy simples de montar directorios externos de varios tipos (SMB, SSH y NFS ) desde el escritorio; es bueno conocer algún método desde la línea de comandos para algún servidor que administremos o para tenerlo a nuestra disposición de forma permanente montado en un directorio. Un método simple y seguro es usar <strong>sshfs</strong> con <strong>fuse</strong>.</p>
<p>Instalamos sshfs y fuse:</p>
<div class="syntax_hilite">
<div id="text-16">
<div class="text">yum install sshfs<br />
yum install fuse</div>
</div>
</div>
<p></p>
<p>Ahora por en la línea de comando podemos hacer:</p>
<div class="syntax_hilite">
<div id="text-17">
<div class="text">sshfs host:/directorio_externo directorio_donde_montar</div>
</div>
</div>
<p></p>
<p>O bien, si queremos que sea permanente, podemos editar el archivo <strong>/etc/fstab</strong> y agregar una línea similar:</p>
<div class="syntax_hilite">
<div id="text-18">
<div class="text">sshfs#user@host:/&nbsp; &nbsp; /home/you/remote&nbsp; &nbsp; fuse&nbsp; &nbsp; defaults&nbsp; &nbsp; <span style="">0</span> <span style="">0</span></div>
</div>
</div>
<p></p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/2188/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conexión remota a un escritorio Linux desde una máquina XP</title>
		<link>http://www.machin.com.mx/archives/4379</link>
		<comments>http://www.machin.com.mx/archives/4379#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:56:30 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Arqueología Machinesca]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/archives/4379</guid>
		<description><![CDATA[<p>Revisando memory-sticks abandonados encontré un video de noviembre de 2006 donde grababa una prueba de como me conectaba desde mi máquina <strong>XP</strong> a mi servidor <strong>Linux</strong> con <strong>KDE</strong> y <strong>Fedora Core 6</strong>. Se puede ver como corría al mismo tiempo un video, un chat 3D escrito en <strong>Flash</strong> y un programa de demostración 3D de <strong>Irrlicht</strong> (<strong>OpenGL</strong>). Desafortunadamente es una de mis primeras pruebas y no transmitía el audio. Al poco rato de hacer este video configuré lo que me hacía falta.</p>
<p align="center">
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/ZVp2qGofQXk&#038;hl=es_MX&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ZVp2qGofQXk&#038;hl=es_MX&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
</p>
<p>Realmente el desempeño es muy bueno considerando que es una conexión remota. En parte es porque las ordenes <strong>OpenGL</strong> se corren localmente como se puede ver en el acercamiento a la terminal en la parte final del video.</p>

]]></description>
			<content:encoded><![CDATA[<p>Revisando memory-sticks abandonados encontré un video de noviembre de 2006 donde grababa una prueba de como me conectaba desde mi máquina <strong>XP</strong> a mi servidor <strong>Linux</strong> con <strong>KDE</strong> y <strong>Fedora Core 6</strong>. Se puede ver como corría al mismo tiempo un video, un chat 3D escrito en <strong>Flash</strong> y un programa de demostración 3D de <strong>Irrlicht</strong> (<strong>OpenGL</strong>). Desafortunadamente es una de mis primeras pruebas y no transmitía el audio. Al poco rato de hacer este video configuré lo que me hacía falta.</p>
<p align="center">
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/ZVp2qGofQXk&#038;hl=es_MX&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ZVp2qGofQXk&#038;hl=es_MX&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>
</p>
<p>Realmente el desempeño es muy bueno considerando que es una conexión remota. En parte es porque las ordenes <strong>OpenGL</strong> se corren localmente como se puede ver en el acercamiento a la terminal en la parte final del video.</p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/4379/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Circuitos integrados TTL para KTechLab</title>
		<link>http://www.machin.com.mx/archives/3463</link>
		<comments>http://www.machin.com.mx/archives/3463#comments</comments>
		<pubDate>Tue, 20 Oct 2009 05:07:53 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/archives/3463</guid>
		<description><![CDATA[<p>Al analizar el diseño de la ALU para mi microprocesador primero construí un prototipo usando <strong>KTechLab</strong>. Para ello, tuve construir primero los componentes de los circuitos integrados TTL que utilice. En este post pongo mi librería para tenerlos a la mano y por si pueden ser útiles para alguien.
</p>
<table border="1" width="100%">
<tr>
<td><strong>Circuito</strong></td>
<td><strong>Descripción</strong></td>
<td><strong>Archivo KTechLab</strong></td>
</tr>
<tr>
<td>7408</td>
<td>Quadruple 2-Input positive-And Gates</td>
<td><a href="/archivos/7408.circuit">7408.circuit</a></td>
</tr>
<tr>
<td>7432</td>
<td>Quadruple 2-Input positive-Or Gates</td>
<td><a href="/archivos/7432.circuit">7432.circuit</a></td>
</tr>
<tr>
<td>7486</td>
<td>Quadruple 2-Input positive-Exclusive Or Gates</td>
<td><a href="/archivos/7486.circuit">7486.circuit</a></td>
</tr>
<tr>
<td>74138</td>
<td>3-Line to 8-Line Decoders/Demultiplexers</td>
<td><a href="/archivos/74138.circuit">74138.circuit</a></td>
</tr>
<tr>
<td>74151</td>
<td>Data Selector/Multiplexers</td>
<td><a href="/archivos/74151.circuit">74151.circuit</a></td>
</tr>
<tr>
<td>74161</td>
<td>Synchronous 4-Bit Counter</td>
<td><a href="/archivos/74161.circuit">74161.circuit</a></td>
</tr>
<tr>
<td>74163</td>
<td>Synchronous 4-Bit Counter</td>
<td><a href="/archivos/74163.circuit">74163.circuit</a></td>
</tr>
<tr>
<td>74175</td>
<td>Hex/Quadruple D-Type Flip-Flops with Clear</td>
<td><a href="/archivos/74175.circuit">74175.circuit</a></td>
</tr>
<tr>
<td>74283</td>
<td>4-Bit Binary Full Adders with Fast Carry</td>
<td><a href="/archivos/74283.circuit">74283.circuit</a></td>
</tr>
</table>
<p>
<h4>Advertencia:</h4>
</p>
<p>He notado que el programa <strong>KTechlab</strong> tiene problemas en proyectos con muchos circuitos integrados, por lo que se recomienda usar muy pocos al mismo tiempo.</p>

]]></description>
			<content:encoded><![CDATA[<p>Al analizar el diseño de la ALU para mi microprocesador primero construí un prototipo usando <strong>KTechLab</strong>. Para ello, tuve construir primero los componentes de los circuitos integrados TTL que utilice. En este post pongo mi librería para tenerlos a la mano y por si pueden ser útiles para alguien.
</p>
<table border="1" width="100%">
<tr>
<td><strong>Circuito</strong></td>
<td><strong>Descripción</strong></td>
<td><strong>Archivo KTechLab</strong></td>
</tr>
<tr>
<td>7408</td>
<td>Quadruple 2-Input positive-And Gates</td>
<td><a href="/archivos/7408.circuit">7408.circuit</a></td>
</tr>
<tr>
<td>7432</td>
<td>Quadruple 2-Input positive-Or Gates</td>
<td><a href="/archivos/7432.circuit">7432.circuit</a></td>
</tr>
<tr>
<td>7486</td>
<td>Quadruple 2-Input positive-Exclusive Or Gates</td>
<td><a href="/archivos/7486.circuit">7486.circuit</a></td>
</tr>
<tr>
<td>74138</td>
<td>3-Line to 8-Line Decoders/Demultiplexers</td>
<td><a href="/archivos/74138.circuit">74138.circuit</a></td>
</tr>
<tr>
<td>74151</td>
<td>Data Selector/Multiplexers</td>
<td><a href="/archivos/74151.circuit">74151.circuit</a></td>
</tr>
<tr>
<td>74161</td>
<td>Synchronous 4-Bit Counter</td>
<td><a href="/archivos/74161.circuit">74161.circuit</a></td>
</tr>
<tr>
<td>74163</td>
<td>Synchronous 4-Bit Counter</td>
<td><a href="/archivos/74163.circuit">74163.circuit</a></td>
</tr>
<tr>
<td>74175</td>
<td>Hex/Quadruple D-Type Flip-Flops with Clear</td>
<td><a href="/archivos/74175.circuit">74175.circuit</a></td>
</tr>
<tr>
<td>74283</td>
<td>4-Bit Binary Full Adders with Fast Carry</td>
<td><a href="/archivos/74283.circuit">74283.circuit</a></td>
</tr>
</table>
<p>
<h4>Advertencia:</h4>
</p>
<p>He notado que el programa <strong>KTechlab</strong> tiene problemas en proyectos con muchos circuitos integrados, por lo que se recomienda usar muy pocos al mismo tiempo.</p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/3463/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Servicio a la comunidad: Número de conexiones por IP</title>
		<link>http://www.machin.com.mx/archives/2610</link>
		<comments>http://www.machin.com.mx/archives/2610#comments</comments>
		<pubDate>Thu, 10 Sep 2009 18:39:36 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servicio a la comunidad]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/archives/2610</guid>
		<description><![CDATA[<p>Cuando tenemos la sospecha de que estamos sufriendo un ataque de negación de servicio o estamos haciendo pruebas de carga, el siguiente comando puede ser muy útil:</p>
<div class="syntax_hilite">
<div id="text-19">
<div class="text">netstat -anp | grep 'tcp\|udp' | awk '<span style="">&#123;</span>print $<span style="">5</span><span style="">&#125;</span>' | cut -d: -f1 | sort | uniq -c | sort -n</div>
</div>
</div>
<p></p>
<p>El cual nos dice el número de conexiones que tiene cada IP que esta conectada a nuestra máquina. La salida es de la forma:</p>
<div class="syntax_hilite">
<div id="text-20">
<div class="text"><span style="">1</span> <span style="">53</span>.<span style="">147</span>.<span style="">164</span>.<span style="">42</span><br />
<span style="">1</span> <span style="">53</span>.<span style="">14</span>.<span style="">464</span>.<span style="">32</span><br />
<span style="">13</span> <span style="">0</span>.<span style="">0</span>.<span style="">0</span>.<span style="">0</span></div>
</div>
</div>
<p></p>
<p>Se debe ejecutar como root.</p>
<p>Si se desea bloquear una IP, se puede usar el comando de iptables:</p>
<div class="syntax_hilite">
<div id="text-21">
<div class="text">iptables -I INPUT -s XX.XX.XX.XX -j DROP</div>
</div>
</div>
<p></p>
<p>Donde XX.XX.XX.XX.XX es la dirección a bloquear.</p>

]]></description>
			<content:encoded><![CDATA[<p>Cuando tenemos la sospecha de que estamos sufriendo un ataque de negación de servicio o estamos haciendo pruebas de carga, el siguiente comando puede ser muy útil:</p>
<div class="syntax_hilite">
<div id="text-22">
<div class="text">netstat -anp | grep 'tcp\|udp' | awk '<span style="">&#123;</span>print $<span style="">5</span><span style="">&#125;</span>' | cut -d: -f1 | sort | uniq -c | sort -n</div>
</div>
</div>
<p></p>
<p>El cual nos dice el número de conexiones que tiene cada IP que esta conectada a nuestra máquina. La salida es de la forma:</p>
<div class="syntax_hilite">
<div id="text-23">
<div class="text"><span style="">1</span> <span style="">53</span>.<span style="">147</span>.<span style="">164</span>.<span style="">42</span><br />
<span style="">1</span> <span style="">53</span>.<span style="">14</span>.<span style="">464</span>.<span style="">32</span><br />
<span style="">13</span> <span style="">0</span>.<span style="">0</span>.<span style="">0</span>.<span style="">0</span></div>
</div>
</div>
<p></p>
<p>Se debe ejecutar como root.</p>
<p>Si se desea bloquear una IP, se puede usar el comando de iptables:</p>
<div class="syntax_hilite">
<div id="text-24">
<div class="text">iptables -I INPUT -s XX.XX.XX.XX -j DROP</div>
</div>
</div>
<p></p>
<p>Donde XX.XX.XX.XX.XX es la dirección a bloquear.</p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/2610/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Usando a la Color Computer 3 como terminal tonta</title>
		<link>http://www.machin.com.mx/archives/2604</link>
		<comments>http://www.machin.com.mx/archives/2604#comments</comments>
		<pubDate>Wed, 09 Sep 2009 12:00:36 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Color Computer]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/?p=2604</guid>
		<description><![CDATA[<p>Aunque no es un proyecto que tuviera pendiente, al tener una interface en serie en la <strong>Color Computer</strong>; no puede evitar hacer el experimento de convertirla en una terminal tonta y conectarla remotamente a mis computadoras Linux.  </p>
<p align="center">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ueowCfiTZ5s&#038;hl=es&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ueowCfiTZ5s&#038;hl=es&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
</p>
<p>Debo confesar que al capturar la MAC de la máquina Linux en la Color Computer, me sentía un poco como si estuviera metiendo los números de Lost <img src='http://www.machin.com.mx/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

]]></description>
			<content:encoded><![CDATA[<p>Aunque no es un proyecto que tuviera pendiente, al tener una interface en serie en la <strong>Color Computer</strong>; no puede evitar hacer el experimento de convertirla en una terminal tonta y conectarla remotamente a mis computadoras Linux.  </p>
<p align="center">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ueowCfiTZ5s&#038;hl=es&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ueowCfiTZ5s&#038;hl=es&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
</p>
<p>Debo confesar que al capturar la MAC de la máquina Linux en la Color Computer, me sentía un poco como si estuviera metiendo los números de Lost <img src='http://www.machin.com.mx/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/2604/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Herramientas: Electrónica</title>
		<link>http://www.machin.com.mx/archives/2494</link>
		<comments>http://www.machin.com.mx/archives/2494#comments</comments>
		<pubDate>Wed, 02 Sep 2009 18:05:40 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Electrónica]]></category>
		<category><![CDATA[Herramientas]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/?p=2494</guid>
		<description><![CDATA[<p>En este post, voy a mencionar poco a poco a los programas que me han sido útiles para hacer diagramas y simulaciones electrónicas.</p>
<table width="100%">
<tr>
<td valign="top" width="80%">
<h4>KTechLab</h4>
<p>Programa de simulación dinámica de circuitos electrónicos, tanto analógicos como digitales. Incluso puede emular el funcionamiento de micro-controladores para correr/debugear código en ensamblador o en lenguaje de máquina.</p>
<p>Desafortunadamente, no incluye una biblioteca decente de circuitos integrados, pero la lista de compuertas y componentes discretos que proporciona es suficiente para simular bastantes proyectos y es posible crear nuestra propia biblioteca utilizando los componentes existentes. Aunque el rendimiento  va disminuyendo notablemente  conforme se van agregando más de 10 circuitos (en promedio) creados por nosotros. Yo intenté hacer una ALU de 8 bits con 30 subcircuitos mios y los cuelgues y la lentitud eran muchos.</p>
<p><strong>Plataforma:</strong> Linux.</p>
<p><strong>Licencia:</strong> GPL.</p>
<p><strong>Página web:</strong> <a href="http://ktechlab.org/index.php" onclick="pageTracker._trackPageview('/outgoing/ktechlab.org/index.php?referer=');">http://ktechlab.org/index.php</a>
</td>
<td valign="top">
<a href="http://www.machin.com.mx/archives/2494/ktechlab" rel="attachment wp-att-2497"><img src="http://www.machin.com.mx/wp-content/uploads/2009/09/ktechlab.jpg" alt="ktechlab" title="ktechlab" width="400" height="332" class="alignnone size-full wp-image-2497" /></a>
</td>
</tr>
</table>

]]></description>
			<content:encoded><![CDATA[<p>En este post, voy a mencionar poco a poco a los programas que me han sido útiles para hacer diagramas y simulaciones electrónicas.</p>
<table width="100%">
<tr>
<td valign="top" width="80%">
<h4>KTechLab</h4>
<p>Programa de simulación dinámica de circuitos electrónicos, tanto analógicos como digitales. Incluso puede emular el funcionamiento de micro-controladores para correr/debugear código en ensamblador o en lenguaje de máquina.</p>
<p>Desafortunadamente, no incluye una biblioteca decente de circuitos integrados, pero la lista de compuertas y componentes discretos que proporciona es suficiente para simular bastantes proyectos y es posible crear nuestra propia biblioteca utilizando los componentes existentes. Aunque el rendimiento  va disminuyendo notablemente  conforme se van agregando más de 10 circuitos (en promedio) creados por nosotros. Yo intenté hacer una ALU de 8 bits con 30 subcircuitos mios y los cuelgues y la lentitud eran muchos.</p>
<p><strong>Plataforma:</strong> Linux.</p>
<p><strong>Licencia:</strong> GPL.</p>
<p><strong>Página web:</strong> <a href="http://ktechlab.org/index.php" onclick="pageTracker._trackPageview('/outgoing/ktechlab.org/index.php?referer=');">http://ktechlab.org/index.php</a>
</td>
<td valign="top">
<a href="http://www.machin.com.mx/archives/2494/ktechlab" rel="attachment wp-att-2497"><img src="http://www.machin.com.mx/wp-content/uploads/2009/09/ktechlab.jpg" alt="ktechlab" title="ktechlab" width="400" height="332" class="alignnone size-full wp-image-2497" /></a>
</td>
</tr>
</table>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/2494/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip Corto: Cambiar formato a un archivo de texto en Linux</title>
		<link>http://www.machin.com.mx/archives/2141</link>
		<comments>http://www.machin.com.mx/archives/2141#comments</comments>
		<pubDate>Tue, 23 Jun 2009 06:05:08 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tip corto]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/?p=2141</guid>
		<description><![CDATA[<p>Un escenario común para un administrador de servidores es que al subir un archivo se de cuenta que la codificación no es compatible con el programa que esta en el servidor. Una manera rápida y sucia de arreglar el problema es con nuestro viejo amigo vi:</p>
<div class="syntax_hilite">
<div id="text-25">
<div class="text">vi -c &quot;:wq! ++enc=utf8&quot; archivo.txt</div>
</div>
</div>
<p></p>
<p>En el ejemplo anterior, se convierte el archivo de texto a UTF-8, pero también se puede usar latin1 y latin2.</p>

]]></description>
			<content:encoded><![CDATA[<p>Un escenario común para un administrador de servidores es que al subir un archivo se de cuenta que la codificación no es compatible con el programa que esta en el servidor. Una manera rápida y sucia de arreglar el problema es con nuestro viejo amigo vi:</p>
<div class="syntax_hilite">
<div id="text-26">
<div class="text">vi -c &quot;:wq! ++enc=utf8&quot; archivo.txt</div>
</div>
</div>
<p></p>
<p>En el ejemplo anterior, se convierte el archivo de texto a UTF-8, pero también se puede usar latin1 y latin2.</p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/2141/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objetos Remotos Java con BlazeDS y Flex &#8211; Parte 1</title>
		<link>http://www.machin.com.mx/archives/1781</link>
		<comments>http://www.machin.com.mx/archives/1781#comments</comments>
		<pubDate>Sun, 18 Jan 2009 19:01:12 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[mxml]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/?p=1781</guid>
		<description><![CDATA[<p>Esta es una pequeña prueba de concepto de como se pueden llamar objetos remotos java desde <strong>Flex</strong> usando <strong>Linux</strong> y <strong>Tomcat</strong> del lado del servidor.</p>
<h4>Creación de la aplicación web en Tomcat</h4>
<p>1. Dentro del directorio <strong>webapps</strong>, creamos el directorio de nuestro proyecto (p.e. blazeds):</p>
<div class="syntax_hilite">
<div id="text-27">
<div class="text">mkdir webapps/blazeds</div>
</div>
</div>
<p></p>
<p>2. Bajamos la distribución binaria  de <strong>BlazeDS</strong> de su <a href="http://opensource.adobe.com/wiki/display/blazeds/Release+Builds" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/blazeds/Release+Builds?referer=');">página de Internet</a> y la desempaquetamos en un directorio temporal.</p>
<p>3. Copiamos el archivo <strong>blazeds.war</strong> al directorio de nuestro proyecto y lo desempaquetamos. </p>
<p>4. Borramos el archivo .war.</p>
<p>5. Opcionalmente, agregamos la siguiente línea al archivo de configuración <strong>conf/server.xml</strong>  dentro del tag de Host, para que tengamos bien definido el directorio de nuestra aplicación:</p>
<div class="syntax_hilite">
<div id="xml-28">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Context</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">"/blazeds"</span> <span style="color: #000066;">docBase</span>=<span style="color: #ff0000;">"blazeds"</span> <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">reloadable</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</div>
</div>
<p></p>
<p>6. Agregamos el archivo de seguridad <strong>crossdomain.xml</strong> donde este el directorio raíz de nuestro dominio:</p>
<div class="syntax_hilite">
<div id="xml-29">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;cross-domain-policy<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">"*"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/cross-domain-policy<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<h4>Creación del Objeto Remoto en Java</h4>
<p>Para este ejemplo, creamos una pequeña clase en <strong>Java</strong>, en el directorio <strong>WEB-INF/src</strong> que simplemente nos de la hora:</p>
<div class="syntax_hilite">
<div id="java-30">
<div class="java"><span style="color: #a1a100;">import java.util.Date;</span></p>
<p><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Sereno <span style="color: #66cc66;">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?hl=en_amp_q=allinurl_3AString+java.sun.com_amp_bntI=I_27m_20Feeling_20Lucky&amp;referer=');"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getTime<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADate+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?hl=en_amp_q=allinurl_3ADate+java.sun.com_amp_bntI=I_27m_20Feeling_20Lucky&amp;referer=');"><span style="color: #aaaadd; font-weight: bold;">Date</span></a> now = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADate+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?hl=en_amp_q=allinurl_3ADate+java.sun.com_amp_bntI=I_27m_20Feeling_20Lucky&amp;referer=');"><span style="color: #aaaadd; font-weight: bold;">Date</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #ff0000;">"The time is: "</span> + now;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>La compilamos con:</p>
<div class="syntax_hilite">
<div id="text-31">
<div class="text">javac Sereno</div>
</div>
</div>
<p></p>
<p>La copiamos al directorio <strong>classes</strong>.</p>
<p>Ahora que todo esta listo del lado del servidor, declaramos nuestra clase agregando las siguientes lineas al tag <strong>service</strong> del archivo <strong>flex/Remoting-config.xml</strong>:</p>
<div class="syntax_hilite">
<div id="xml-32">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"blazeds"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;properties<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- El nombre de nuestra clase --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;source<span style="font-weight: bold; color: black;">&gt;</span></span></span>Sereno<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/source<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/properties<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/destination<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<h4>Creación de la aplicación Flex</h4>
<p>Del lado del cliente, necesitamos crear un archivo de configuración <strong>services-config.xml</strong> que más adelante se utilizará como un parámetro del comando <strong>mxmlc</strong> que compila nuestro código.</p>
<div class="syntax_hilite">
<div id="xml-33">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"UTF-8"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;services-config<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;services<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"remoting-service"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.services.RemotingService"</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">messageTypes</span>=<span style="color: #ff0000;">"flex.messaging.messages.RemotingMessage"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adapters<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adapter-definition</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"java-object"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.services.remoting.adapters.JavaAdapter"</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/adapters<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Con este id, llamamos al java desde flex --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"blazeds"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">"my-amf"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/destination<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/services<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel-definition</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"my-amf"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"mx.messaging.channels.AMFChannel"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Aqui tengo la ruta de donde se va a jalar las cosas, proviene del war de flex --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;endpoint</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">"http://192.168.1.100:8080/blazeds/messagebroker/amf"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.endpoints.AMFEndpoint"</span><span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channel-definition<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/services-config<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>Aquí tenemos el mxml (blazeds.mxml ) que vamos usar como ejemplo:</p>
<div class="syntax_hilite">
<div id="xml-34">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">"absolute"</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"*"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;![CDATA[</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import mx.controls.Alert;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import mx.rpc.events.FaultEvent;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import mx.rpc.events.ResultEvent;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Esta función se llama cuando se llamo exitosamente a nuestro objeto:</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public function onMethodResult(event:ResultEvent):void {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bo.label = &quot;Result &quot;+event.result</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bo.label += &quot;nDataType &quot;+ typeof(event.result)</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:RemoteObject</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"ro"</span> <span style="color: #000066;">destination</span>=<span style="color: #ff0000;">"blazeds"</span> <span style="color: #000066;">fault</span>=<span style="color: #ff0000;">"Alert.show(event.fault.faultString, 'Error')"</span> <span style="color: #000066;">result</span>=<span style="color: #ff0000;">"{onMethodResult(event)}"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Aquí declaramos todas las funciones que vamos a llamar del objeto Java --&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"getTime"</span> <span style="color: #000066;">result</span>=<span style="color: #ff0000;">"{onMethodResult(event)}"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></p>
<p>&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:RemoteObject<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Label</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"bo"</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">"ro.getTime()"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></p>
<p><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>Lo compilamos con la siguiente línea de comando:</p>
<div class="syntax_hilite">
<div id="text-35">
<div class="text">~/flex/bin/mxmlc blazeds.mxml -services &quot;services-config.xml&quot;</div>
</div>
</div>
<p></p>
<p>Al ejecutar el mxml, veremos una etiqueta vacia que al darle doble click, nos imprimirá la hora del servidor.  </p>
<h4>Conclusiones</h4>
<p>De aquí en adelante, ya todo es creatividad. Por supuesto que  se pueden usar frameworks como <strong>Spring</strong> para acelerar el desarrollo del lado del servidor. Pero lo importante de este post, era comprobar con una prueba de concepto lo bien que se llevan estas tecnologías y hacerlo "a manita" para aprender más. No es muy díficil hacer esto mismo con <strong>Flex Builder</strong> para el cliente y <strong>Eclipse</strong> para el servidor.</p>

]]></description>
			<content:encoded><![CDATA[<p>Esta es una pequeña prueba de concepto de como se pueden llamar objetos remotos java desde <strong>Flex</strong> usando <strong>Linux</strong> y <strong>Tomcat</strong> del lado del servidor.</p>
<h4>Creación de la aplicación web en Tomcat</h4>
<p>1. Dentro del directorio <strong>webapps</strong>, creamos el directorio de nuestro proyecto (p.e. blazeds):</p>
<div class="syntax_hilite">
<div id="text-36">
<div class="text">mkdir webapps/blazeds</div>
</div>
</div>
<p></p>
<p>2. Bajamos la distribución binaria  de <strong>BlazeDS</strong> de su <a href="http://opensource.adobe.com/wiki/display/blazeds/Release+Builds" onclick="pageTracker._trackPageview('/outgoing/opensource.adobe.com/wiki/display/blazeds/Release+Builds?referer=');">página de Internet</a> y la desempaquetamos en un directorio temporal.</p>
<p>3. Copiamos el archivo <strong>blazeds.war</strong> al directorio de nuestro proyecto y lo desempaquetamos. </p>
<p>4. Borramos el archivo .war.</p>
<p>5. Opcionalmente, agregamos la siguiente línea al archivo de configuración <strong>conf/server.xml</strong>  dentro del tag de Host, para que tengamos bien definido el directorio de nuestra aplicación:</p>
<div class="syntax_hilite">
<div id="xml-37">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Context</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">"/blazeds"</span> <span style="color: #000066;">docBase</span>=<span style="color: #ff0000;">"blazeds"</span> <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">"0"</span> <span style="color: #000066;">reloadable</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</div>
</div>
<p></p>
<p>6. Agregamos el archivo de seguridad <strong>crossdomain.xml</strong> donde este el directorio raíz de nuestro dominio:</p>
<div class="syntax_hilite">
<div id="xml-38">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;cross-domain-policy<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;allow-access-from</span> <span style="color: #000066;">domain</span>=<span style="color: #ff0000;">"*"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/cross-domain-policy<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<h4>Creación del Objeto Remoto en Java</h4>
<p>Para este ejemplo, creamos una pequeña clase en <strong>Java</strong>, en el directorio <strong>WEB-INF/src</strong> que simplemente nos de la hora:</p>
<div class="syntax_hilite">
<div id="java-39">
<div class="java"><span style="color: #a1a100;">import java.util.Date;</span></p>
<p><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Sereno <span style="color: #66cc66;">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?hl=en_amp_q=allinurl_3AString+java.sun.com_amp_bntI=I_27m_20Feeling_20Lucky&amp;referer=');"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getTime<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADate+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?hl=en_amp_q=allinurl_3ADate+java.sun.com_amp_bntI=I_27m_20Feeling_20Lucky&amp;referer=');"><span style="color: #aaaadd; font-weight: bold;">Date</span></a> now = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADate+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?hl=en_amp_q=allinurl_3ADate+java.sun.com_amp_bntI=I_27m_20Feeling_20Lucky&amp;referer=');"><span style="color: #aaaadd; font-weight: bold;">Date</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #ff0000;">"The time is: "</span> + now;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></p>
<p><span style="color: #66cc66;">&#125;</span></div>
</div>
</div>
<p></p>
<p>La compilamos con:</p>
<div class="syntax_hilite">
<div id="text-40">
<div class="text">javac Sereno</div>
</div>
</div>
<p></p>
<p>La copiamos al directorio <strong>classes</strong>.</p>
<p>Ahora que todo esta listo del lado del servidor, declaramos nuestra clase agregando las siguientes lineas al tag <strong>service</strong> del archivo <strong>flex/Remoting-config.xml</strong>:</p>
<div class="syntax_hilite">
<div id="xml-41">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"blazeds"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;properties<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- El nombre de nuestra clase --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;source<span style="font-weight: bold; color: black;">&gt;</span></span></span>Sereno<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/source<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/properties<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/destination<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<h4>Creación de la aplicación Flex</h4>
<p>Del lado del cliente, necesitamos crear un archivo de configuración <strong>services-config.xml</strong> que más adelante se utilizará como un parámetro del comando <strong>mxmlc</strong> que compila nuestro código.</p>
<div class="syntax_hilite">
<div id="xml-42">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"UTF-8"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;services-config<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;services<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"remoting-service"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.services.RemotingService"</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">messageTypes</span>=<span style="color: #ff0000;">"flex.messaging.messages.RemotingMessage"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adapters<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adapter-definition</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"java-object"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.services.remoting.adapters.JavaAdapter"</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">"true"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/adapters<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Con este id, llamamos al java desde flex --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"blazeds"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">"my-amf"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/destination<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/services<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel-definition</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"my-amf"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"mx.messaging.channels.AMFChannel"</span><span style="font-weight: bold; color: black;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Aqui tengo la ruta de donde se va a jalar las cosas, proviene del war de flex --&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;endpoint</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">"http://192.168.1.100:8080/blazeds/messagebroker/amf"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.endpoints.AMFEndpoint"</span><span style="font-weight: bold; color: black;">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channel-definition<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channels<span style="font-weight: bold; color: black;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/services-config<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>Aquí tenemos el mxml (blazeds.mxml ) que vamos usar como ejemplo:</p>
<div class="syntax_hilite">
<div id="xml-43">
<div class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span><span style="font-weight: bold; color: black;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">"http://www.adobe.com/2006/mxml"</span> <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">"absolute"</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"*"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;![CDATA[</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import mx.controls.Alert;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import mx.rpc.events.FaultEvent;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; import mx.rpc.events.ResultEvent;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Esta función se llama cuando se llamo exitosamente a nuestro objeto:</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public function onMethodResult(event:ResultEvent):void {</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bo.label = &quot;Result &quot;+event.result</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bo.label += &quot;nDataType &quot;+ typeof(event.result)</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>
&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:RemoteObject</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"ro"</span> <span style="color: #000066;">destination</span>=<span style="color: #ff0000;">"blazeds"</span> <span style="color: #000066;">fault</span>=<span style="color: #ff0000;">"Alert.show(event.fault.faultString, 'Error')"</span> <span style="color: #000066;">result</span>=<span style="color: #ff0000;">"{onMethodResult(event)}"</span><span style="font-weight: bold; color: black;">&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Aquí declaramos todas las funciones que vamos a llamar del objeto Java --&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"getTime"</span> <span style="color: #000066;">result</span>=<span style="color: #ff0000;">"{onMethodResult(event)}"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></p>
<p>&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:RemoteObject<span style="font-weight: bold; color: black;">&gt;</span></span></span></p>
<p>&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Label</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"bo"</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">""</span> <span style="color: #000066;">click</span>=<span style="color: #ff0000;">"ro.getTime()"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></p>
<p><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</div>
</div>
<p></p>
<p>Lo compilamos con la siguiente línea de comando:</p>
<div class="syntax_hilite">
<div id="text-44">
<div class="text">~/flex/bin/mxmlc blazeds.mxml -services &quot;services-config.xml&quot;</div>
</div>
</div>
<p></p>
<p>Al ejecutar el mxml, veremos una etiqueta vacia que al darle doble click, nos imprimirá la hora del servidor.  </p>
<h4>Conclusiones</h4>
<p>De aquí en adelante, ya todo es creatividad. Por supuesto que  se pueden usar frameworks como <strong>Spring</strong> para acelerar el desarrollo del lado del servidor. Pero lo importante de este post, era comprobar con una prueba de concepto lo bien que se llevan estas tecnologías y hacerlo "a manita" para aprender más. No es muy díficil hacer esto mismo con <strong>Flex Builder</strong> para el cliente y <strong>Eclipse</strong> para el servidor.</p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/1781/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>POP before SMTP con Sendmail y Qpopper</title>
		<link>http://www.machin.com.mx/archives/873</link>
		<comments>http://www.machin.com.mx/archives/873#comments</comments>
		<pubDate>Mon, 27 Oct 2008 03:51:20 +0000</pubDate>
		<dc:creator>Jorge Machin</dc:creator>
				<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[poprelay]]></category>
		<category><![CDATA[qpopper]]></category>
		<category><![CDATA[sendmail]]></category>

		<guid isPermaLink="false">http://www.machin.com.mx/?p=873</guid>
		<description><![CDATA[<p>Ls solución de POP before SMTP  que utilizaba en mis años mozos en <strong>Interalia</strong> estaba basada en<strong>poprelay</strong>,  <strong>qpopper</strong> como servidor pop y <strong>sendmail</strong> como mi servidor SMTP. </p>
<p>Aunque es cierto que la utilizaba hace mucho tiempo (2001?) y actualmente hay muchas otras opciones, se puede comprobar que sigue siendo una opción válida y efectiva.</p>
<h4>Instalación de qpopper</h4>
<p>Los fuentes se compilan de la siguiente forma:</p>
<div class="syntax_hilite">
<div id="text-45">
<div class="text">./configure --enable-specialauth<br />
make<br />
cp popper/popper /usr/local/bin</div>
</div>
</div>
<p></p>
<p>Finalmente declaramos el servicio en xinetd, creando el archivo /etc/xinetd.d/qpopper :</p>
<div class="syntax_hilite">
<div id="text-46">
<div class="text">service pop3<br />
<span style="">&#123;</span> <br />
socket_type = stream<br />
protocol = tcp<br />
wait = no<br />
user = root<br />
server = /usr/local/bin/popper<br />
server_args = qpopper –s<br />
port = <span style="">110</span><br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p>Y reiniciamos xinetd:</p>
<div class="syntax_hilite">
<div id="text-47">
<div class="text">/etc/rc.d/init.d/xinetd restart</div>
</div>
</div>
<p></p>
<h4>Poprelay</h4>
<p>El código fuente de <strong>Poprelay</strong> se pueden encontrar en <a href="http://poprelay.sourceforge.net/" onclick="pageTracker._trackPageview('/outgoing/poprelay.sourceforge.net/?referer=');">Sourceforge</a>. </p>
<p>Una vez instalado, para hacerlo funcionar con <strong>sendmail</strong>, se debe integrar el siguiente código al archivo de configuración <strong>/etc/sendmail.mc</strong>:</p>
<div class="syntax_hilite">
<div id="text-48">
<div class="text"># We probably want the access_db feature enabled.</p>
<p>FEATURE<span style="">&#40;</span>access_db<span style="">&#41;</span>dnl</p>
<p># List of IP addresses we allow relaying from.</p>
<p>Klocalip hash -a&lt;MATCH&gt; /etc/mail/localip<br />
Kpopip hash&nbsp; -a&lt;MATCH&gt; /etc/mail/popip</p>
<p>LOCAL_RULESETS</p>
<p>SLocal_check_rcpt</p>
<p># Put the address into cannonical form <span style="">&#40;</span>even if it doesn't resolve to an MX<span style="">&#41;</span>.</p>
<p>R$*&nbsp;&nbsp;&nbsp;$: $&gt;Parse0 $&gt;<span style="">3</span> $<span style="">1</span><br />
R$* &lt;$*&gt; $*&nbsp;&nbsp;$: $<span style="">1</span> &lt;$<span style="">2</span> .&gt; $<span style="">3</span>&nbsp; &nbsp; &nbsp; Pretend it's canonical.<br />
R$* &lt;$* . .&gt; $*&nbsp;&nbsp;$<span style="">1</span> &lt;$<span style="">2</span> .&gt; $<span style="">3</span>&nbsp;&nbsp;&nbsp;Remove extra dots.</p>
<p># Allow relaying if the connected host is a local IP address.</p>
<p>R$*&nbsp;&nbsp;&nbsp;$: &lt;$&amp;<span style="">&#123;</span>client_addr<span style="">&#125;</span>&gt;&nbsp;&nbsp;Get client IP address.<br />
R&lt;&gt;&nbsp;&nbsp;&nbsp;$#OK&nbsp;&nbsp;&nbsp;&nbsp;Local is ok.<br />
R&lt;$* . $-&gt; $*&nbsp; &nbsp;&nbsp; &nbsp;$<span style="">&#40;</span>localip $<span style="">1</span>.$<span style="">2</span> $: &lt;$<span style="">1</span>&gt; . $<span style="">2</span> $<span style="">&#41;</span>&nbsp; &nbsp; Check last three octets.<br />
R$* &lt;MATCH&gt;&nbsp;&nbsp;$#OK<br />
R&lt;$-&gt; $*&nbsp; &nbsp; &nbsp; &nbsp; $: $<span style="">&#40;</span>localip $<span style="">1</span> $: &lt;&gt; $<span style="">1</span> $<span style="">2</span> $<span style="">&#41;</span>&nbsp; &nbsp; Check first octet.<br />
R$* &lt;MATCH&gt;&nbsp;&nbsp;$#OK</p>
<p># Allow relaying if the connected host has recently POP3 authenticated.</p>
<p>R$*&nbsp;&nbsp;&nbsp;$: &lt;$&amp;<span style="">&#123;</span>client_addr<span style="">&#125;</span>&gt;&nbsp;&nbsp;Get client IP address.<br />
R&lt;$*&gt; &nbsp; &nbsp; &nbsp; $<span style="">&#40;</span>popip $<span style="">1</span> $<span style="">&#41;</span>&nbsp;&nbsp;&nbsp;Check full address.<br />
R$* &lt;MATCH&gt;&nbsp;&nbsp;$#OK</p>
<p># IP address didn't match.</p></div>
</div>
</div>
<p></p>
<p>Recreamos el archivo /etc/sendmail.cf con:</p>
<div class="syntax_hilite">
<div id="text-49">
<div class="text">m4 /etc/sendmail.mc&gt; /etc/sendmail.cf</div>
</div>
</div>
<p></p>
<p>Crear el archivo <strong>/etc/mail/localip</strong> el cual contiene una lista de todas las direcciones IP y redes que se les va a permitir hacer relay sin autentificacion. </p>
<div class="syntax_hilite">
<div id="text-50">
<div class="text">touch /etc/mail/localip</div>
</div>
</div>
<p></p>
<p>Crear el archivo /etc/mail/popip:</p>
<div class="syntax_hilite">
<div id="text-51">
<div class="text">makemap hash /etc/mail/popip &lt;/dev/null</div>
</div>
</div>
<p></p>
<p>Modificar la función <strong>scanaddr</strong> del archivo <strong>/sbin/poprelayd</strong> según la versión del servidor de correo POP:</p>
<p><strong>qpoper 2.5X</strong></p>
<div class="syntax_hilite">
<div id="text-52">
<div class="text">sub scanaddr <span style="">&#40;</span>$<span style="">&#41;</span> <span style="">&#123;</span><br />
&nbsp; &nbsp;local $s, $i, @adressen;<br />
&nbsp; &nbsp;$s = $_<span style="">&#91;</span><span style="">0</span><span style="">&#93;</span>;<br />
&nbsp; &nbsp;$i = index <span style="">&#40;</span>$s,'popper'<span style="">&#41;</span>;<br />
&nbsp; &nbsp;undef @adressen;<br />
&nbsp; &nbsp;if <span style="">&#40;</span>$i&gt;=<span style="">0</span><span style="">&#41;</span><span style="">&#123;</span><br />
&nbsp; &nbsp;<span style="">&#40;</span>$s =~&nbsp; /.*?popper.*?POP login.*?<span style="">&#40;</span>d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span><span style="">&#41;</span>/<span style="">&#41;</span> &amp;&amp; <span style="">&#40;</span>push <span style="">&#40;</span>@adressen,$<span style="">1</span><span style="">&#41;</span><span style="">&#41;</span>;&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;<span style="">&#125;</span><br />
&nbsp; &nbsp;return @adressen;<br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p><strong>qpoper 3.X o posterior:</strong></p>
<div class="syntax_hilite">
<div id="text-53">
<div class="text">sub scanaddr <span style="">&#40;</span>$<span style="">&#41;</span> <span style="">&#123;</span><br />
&nbsp; &nbsp;local $s, $i, @adressen;<br />
&nbsp; &nbsp;$s = $_<span style="">&#91;</span><span style="">0</span><span style="">&#93;</span>;<br />
&nbsp; &nbsp;$i = index <span style="">&#40;</span>$s,'popper'<span style="">&#41;</span>;<br />
&nbsp; &nbsp;undef @adressen;<br />
&nbsp; &nbsp;if <span style="">&#40;</span>$i&gt;=<span style="">0</span><span style="">&#41;</span><span style="">&#123;</span><br />
&nbsp; &nbsp;<span style="">&#40;</span>$s =~&nbsp; /.*?popper.*?<span style="">&#40;</span>d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span><span style="">&#41;</span>/<span style="">&#41;</span> &amp;&amp; <span style="">&#40;</span>push <span style="">&#40;</span>@adressen,$<span style="">1</span><span style="">&#41;</span><span style="">&#41;</span>;&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;<span style="">&#125;</span><br />
&nbsp; &nbsp;return @adressen;<br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p>En la versión 4 de qpopper se debe agregar esta función:</p>
<div class="syntax_hilite">
<div id="text-54">
<div class="text">sub log_parse_qpopper_new <span style="">&#40;</span>$<span style="">&#41;</span> <span style="">&#123;</span><br />
&nbsp; &nbsp;local $s,$i,@adressen;<br />
&nbsp; &nbsp;$s = $_<span style="">&#91;</span><span style="">0</span><span style="">&#93;</span>;<br />
&nbsp; &nbsp;$i = index<span style="">&#40;</span>$s,'popper'<span style="">&#41;</span>;<br />
&nbsp; &nbsp;undef @adressen;<br />
&nbsp; &nbsp;if <span style="">&#40;</span>$i&gt;=<span style="">0</span><span style="">&#41;</span><span style="">&#123;</span><br />
&nbsp; &nbsp;<span style="">&#40;</span>$s =~ /.*?popper.*?<span style="">&#40;</span>d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span><span style="">&#41;</span>/<span style="">&#41;</span> &amp;&amp; <span style="">&#40;</span>push <span style="">&#40;</span>@adressen,$<span style="">1</span><span style="">&#41;</span><span style="">&#41;</span>;<br />
&nbsp; &nbsp;<span style="">&#125;</span><br />
&nbsp; &nbsp;return @adressen;<br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p>Levantar el demonio y colocarlo en /etc/rc.d/rc.local:</p>
<div class="syntax_hilite">
<div id="text-55">
<div class="text">poprelay -d</div>
</div>
</div>
<p></p>
<p>o bien hacer un archivo de inicialización:</p>
<div class="syntax_hilite">
<div id="text-56">
<div class="text">#!/bin/bash<br />
#<br />
# Init file for poprelay server daemon<br />
#<br />
# chkconfig: <span style="">2345</span> <span style="">55</span> <span style="">25</span><br />
# description: pop/imap client relay deamon<br />
#<br />
# processname: poprelayd<br />
# pidfile: /var/run/poprelayd.pid</p>
<p># source function library<br />
. /etc/rc.d/init.d/functions</p>
<p># pull in sysconfig settings</p>
<p>RETVAL=<span style="">0</span><br />
POPRD=&quot;/sbin/poprelayd&quot;;<br />
prog=&quot;poprelayd&quot;</p>
<p>start<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Starting $prog:&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; initlog -c &quot;$POPRD -d&quot; &amp;&amp; success || failure<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="">&#91;</span> &quot;$RETVAL&quot; = <span style="">0</span> <span style="">&#93;</span> &amp;&amp; touch /var/lock/subsys/poprelayd<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
<span style="">&#125;</span></p>
<p>stop<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Stopping $prog:&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; killproc $POPRD -TERM<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="">&#91;</span> &quot;$RETVAL&quot; = <span style="">0</span> <span style="">&#93;</span> &amp;&amp; rm -f /var/lock/subsys/poprelayd<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
<span style="">&#125;</span></p>
<p>reload<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Reloading $prog:&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; killproc $POPRD -HUP<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
<span style="">&#125;</span></p>
<p>check<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; PROCS=`ps -ef | grep &quot;poprelayd -d&quot; | grep -v grep | wc -l`<br />
&nbsp; &nbsp; &nbsp; &nbsp; if <span style="">&#91;</span> $PROCS -ne <span style="">1</span> <span style="">&#93;</span>; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Restarting dead poprelayd: $PROCS running&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
<span style="">&#125;</span></p>
<p>
case &quot;$<span style="">1</span>&quot; in<br />
&nbsp; &nbsp; &nbsp; &nbsp; start<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; stop<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; restart<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; reload<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reload<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; check<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; *<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $&quot;Usage: $<span style="">0</span> <span style="">&#123;</span>start|stop|restart|reload|condrestart|status<span style="">&#125;</span>&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RETVAL=<span style="">1</span><br />
esac<br />
exit $RETVAL</div>
</div>
</div>
<p></p>

]]></description>
			<content:encoded><![CDATA[<p>Ls solución de POP before SMTP  que utilizaba en mis años mozos en <strong>Interalia</strong> estaba basada en<strong>poprelay</strong>,  <strong>qpopper</strong> como servidor pop y <strong>sendmail</strong> como mi servidor SMTP. </p>
<p>Aunque es cierto que la utilizaba hace mucho tiempo (2001?) y actualmente hay muchas otras opciones, se puede comprobar que sigue siendo una opción válida y efectiva.</p>
<h4>Instalación de qpopper</h4>
<p>Los fuentes se compilan de la siguiente forma:</p>
<div class="syntax_hilite">
<div id="text-57">
<div class="text">./configure --enable-specialauth<br />
make<br />
cp popper/popper /usr/local/bin</div>
</div>
</div>
<p></p>
<p>Finalmente declaramos el servicio en xinetd, creando el archivo /etc/xinetd.d/qpopper :</p>
<div class="syntax_hilite">
<div id="text-58">
<div class="text">service pop3<br />
<span style="">&#123;</span> <br />
socket_type = stream<br />
protocol = tcp<br />
wait = no<br />
user = root<br />
server = /usr/local/bin/popper<br />
server_args = qpopper –s<br />
port = <span style="">110</span><br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p>Y reiniciamos xinetd:</p>
<div class="syntax_hilite">
<div id="text-59">
<div class="text">/etc/rc.d/init.d/xinetd restart</div>
</div>
</div>
<p></p>
<h4>Poprelay</h4>
<p>El código fuente de <strong>Poprelay</strong> se pueden encontrar en <a href="http://poprelay.sourceforge.net/" onclick="pageTracker._trackPageview('/outgoing/poprelay.sourceforge.net/?referer=');">Sourceforge</a>. </p>
<p>Una vez instalado, para hacerlo funcionar con <strong>sendmail</strong>, se debe integrar el siguiente código al archivo de configuración <strong>/etc/sendmail.mc</strong>:</p>
<div class="syntax_hilite">
<div id="text-60">
<div class="text"># We probably want the access_db feature enabled.</p>
<p>FEATURE<span style="">&#40;</span>access_db<span style="">&#41;</span>dnl</p>
<p># List of IP addresses we allow relaying from.</p>
<p>Klocalip hash -a&lt;MATCH&gt; /etc/mail/localip<br />
Kpopip hash&nbsp; -a&lt;MATCH&gt; /etc/mail/popip</p>
<p>LOCAL_RULESETS</p>
<p>SLocal_check_rcpt</p>
<p># Put the address into cannonical form <span style="">&#40;</span>even if it doesn't resolve to an MX<span style="">&#41;</span>.</p>
<p>R$*&nbsp;&nbsp;&nbsp;$: $&gt;Parse0 $&gt;<span style="">3</span> $<span style="">1</span><br />
R$* &lt;$*&gt; $*&nbsp;&nbsp;$: $<span style="">1</span> &lt;$<span style="">2</span> .&gt; $<span style="">3</span>&nbsp; &nbsp; &nbsp; Pretend it's canonical.<br />
R$* &lt;$* . .&gt; $*&nbsp;&nbsp;$<span style="">1</span> &lt;$<span style="">2</span> .&gt; $<span style="">3</span>&nbsp;&nbsp;&nbsp;Remove extra dots.</p>
<p># Allow relaying if the connected host is a local IP address.</p>
<p>R$*&nbsp;&nbsp;&nbsp;$: &lt;$&amp;<span style="">&#123;</span>client_addr<span style="">&#125;</span>&gt;&nbsp;&nbsp;Get client IP address.<br />
R&lt;&gt;&nbsp;&nbsp;&nbsp;$#OK&nbsp;&nbsp;&nbsp;&nbsp;Local is ok.<br />
R&lt;$* . $-&gt; $*&nbsp; &nbsp;&nbsp; &nbsp;$<span style="">&#40;</span>localip $<span style="">1</span>.$<span style="">2</span> $: &lt;$<span style="">1</span>&gt; . $<span style="">2</span> $<span style="">&#41;</span>&nbsp; &nbsp; Check last three octets.<br />
R$* &lt;MATCH&gt;&nbsp;&nbsp;$#OK<br />
R&lt;$-&gt; $*&nbsp; &nbsp; &nbsp; &nbsp; $: $<span style="">&#40;</span>localip $<span style="">1</span> $: &lt;&gt; $<span style="">1</span> $<span style="">2</span> $<span style="">&#41;</span>&nbsp; &nbsp; Check first octet.<br />
R$* &lt;MATCH&gt;&nbsp;&nbsp;$#OK</p>
<p># Allow relaying if the connected host has recently POP3 authenticated.</p>
<p>R$*&nbsp;&nbsp;&nbsp;$: &lt;$&amp;<span style="">&#123;</span>client_addr<span style="">&#125;</span>&gt;&nbsp;&nbsp;Get client IP address.<br />
R&lt;$*&gt; &nbsp; &nbsp; &nbsp; $<span style="">&#40;</span>popip $<span style="">1</span> $<span style="">&#41;</span>&nbsp;&nbsp;&nbsp;Check full address.<br />
R$* &lt;MATCH&gt;&nbsp;&nbsp;$#OK</p>
<p># IP address didn't match.</p></div>
</div>
</div>
<p></p>
<p>Recreamos el archivo /etc/sendmail.cf con:</p>
<div class="syntax_hilite">
<div id="text-61">
<div class="text">m4 /etc/sendmail.mc&gt; /etc/sendmail.cf</div>
</div>
</div>
<p></p>
<p>Crear el archivo <strong>/etc/mail/localip</strong> el cual contiene una lista de todas las direcciones IP y redes que se les va a permitir hacer relay sin autentificacion. </p>
<div class="syntax_hilite">
<div id="text-62">
<div class="text">touch /etc/mail/localip</div>
</div>
</div>
<p></p>
<p>Crear el archivo /etc/mail/popip:</p>
<div class="syntax_hilite">
<div id="text-63">
<div class="text">makemap hash /etc/mail/popip &lt;/dev/null</div>
</div>
</div>
<p></p>
<p>Modificar la función <strong>scanaddr</strong> del archivo <strong>/sbin/poprelayd</strong> según la versión del servidor de correo POP:</p>
<p><strong>qpoper 2.5X</strong></p>
<div class="syntax_hilite">
<div id="text-64">
<div class="text">sub scanaddr <span style="">&#40;</span>$<span style="">&#41;</span> <span style="">&#123;</span><br />
&nbsp; &nbsp;local $s, $i, @adressen;<br />
&nbsp; &nbsp;$s = $_<span style="">&#91;</span><span style="">0</span><span style="">&#93;</span>;<br />
&nbsp; &nbsp;$i = index <span style="">&#40;</span>$s,'popper'<span style="">&#41;</span>;<br />
&nbsp; &nbsp;undef @adressen;<br />
&nbsp; &nbsp;if <span style="">&#40;</span>$i&gt;=<span style="">0</span><span style="">&#41;</span><span style="">&#123;</span><br />
&nbsp; &nbsp;<span style="">&#40;</span>$s =~&nbsp; /.*?popper.*?POP login.*?<span style="">&#40;</span>d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span><span style="">&#41;</span>/<span style="">&#41;</span> &amp;&amp; <span style="">&#40;</span>push <span style="">&#40;</span>@adressen,$<span style="">1</span><span style="">&#41;</span><span style="">&#41;</span>;&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;<span style="">&#125;</span><br />
&nbsp; &nbsp;return @adressen;<br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p><strong>qpoper 3.X o posterior:</strong></p>
<div class="syntax_hilite">
<div id="text-65">
<div class="text">sub scanaddr <span style="">&#40;</span>$<span style="">&#41;</span> <span style="">&#123;</span><br />
&nbsp; &nbsp;local $s, $i, @adressen;<br />
&nbsp; &nbsp;$s = $_<span style="">&#91;</span><span style="">0</span><span style="">&#93;</span>;<br />
&nbsp; &nbsp;$i = index <span style="">&#40;</span>$s,'popper'<span style="">&#41;</span>;<br />
&nbsp; &nbsp;undef @adressen;<br />
&nbsp; &nbsp;if <span style="">&#40;</span>$i&gt;=<span style="">0</span><span style="">&#41;</span><span style="">&#123;</span><br />
&nbsp; &nbsp;<span style="">&#40;</span>$s =~&nbsp; /.*?popper.*?<span style="">&#40;</span>d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span><span style="">&#41;</span>/<span style="">&#41;</span> &amp;&amp; <span style="">&#40;</span>push <span style="">&#40;</span>@adressen,$<span style="">1</span><span style="">&#41;</span><span style="">&#41;</span>;&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp;<span style="">&#125;</span><br />
&nbsp; &nbsp;return @adressen;<br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p>En la versión 4 de qpopper se debe agregar esta función:</p>
<div class="syntax_hilite">
<div id="text-66">
<div class="text">sub log_parse_qpopper_new <span style="">&#40;</span>$<span style="">&#41;</span> <span style="">&#123;</span><br />
&nbsp; &nbsp;local $s,$i,@adressen;<br />
&nbsp; &nbsp;$s = $_<span style="">&#91;</span><span style="">0</span><span style="">&#93;</span>;<br />
&nbsp; &nbsp;$i = index<span style="">&#40;</span>$s,'popper'<span style="">&#41;</span>;<br />
&nbsp; &nbsp;undef @adressen;<br />
&nbsp; &nbsp;if <span style="">&#40;</span>$i&gt;=<span style="">0</span><span style="">&#41;</span><span style="">&#123;</span><br />
&nbsp; &nbsp;<span style="">&#40;</span>$s =~ /.*?popper.*?<span style="">&#40;</span>d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span>.d<span style="">&#123;</span><span style="">1</span>,<span style="">3</span><span style="">&#125;</span><span style="">&#41;</span>/<span style="">&#41;</span> &amp;&amp; <span style="">&#40;</span>push <span style="">&#40;</span>@adressen,$<span style="">1</span><span style="">&#41;</span><span style="">&#41;</span>;<br />
&nbsp; &nbsp;<span style="">&#125;</span><br />
&nbsp; &nbsp;return @adressen;<br />
<span style="">&#125;</span></div>
</div>
</div>
<p></p>
<p>Levantar el demonio y colocarlo en /etc/rc.d/rc.local:</p>
<div class="syntax_hilite">
<div id="text-67">
<div class="text">poprelay -d</div>
</div>
</div>
<p></p>
<p>o bien hacer un archivo de inicialización:</p>
<div class="syntax_hilite">
<div id="text-68">
<div class="text">#!/bin/bash<br />
#<br />
# Init file for poprelay server daemon<br />
#<br />
# chkconfig: <span style="">2345</span> <span style="">55</span> <span style="">25</span><br />
# description: pop/imap client relay deamon<br />
#<br />
# processname: poprelayd<br />
# pidfile: /var/run/poprelayd.pid</p>
<p># source function library<br />
. /etc/rc.d/init.d/functions</p>
<p># pull in sysconfig settings</p>
<p>RETVAL=<span style="">0</span><br />
POPRD=&quot;/sbin/poprelayd&quot;;<br />
prog=&quot;poprelayd&quot;</p>
<p>start<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Starting $prog:&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; initlog -c &quot;$POPRD -d&quot; &amp;&amp; success || failure<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="">&#91;</span> &quot;$RETVAL&quot; = <span style="">0</span> <span style="">&#93;</span> &amp;&amp; touch /var/lock/subsys/poprelayd<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
<span style="">&#125;</span></p>
<p>stop<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Stopping $prog:&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; killproc $POPRD -TERM<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="">&#91;</span> &quot;$RETVAL&quot; = <span style="">0</span> <span style="">&#93;</span> &amp;&amp; rm -f /var/lock/subsys/poprelayd<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
<span style="">&#125;</span></p>
<p>reload<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; echo -n $&quot;Reloading $prog:&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; killproc $POPRD -HUP<br />
&nbsp; &nbsp; &nbsp; &nbsp; RETVAL=$?<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo<br />
<span style="">&#125;</span></p>
<p>check<span style="">&#40;</span><span style="">&#41;</span><br />
<span style="">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; PROCS=`ps -ef | grep &quot;poprelayd -d&quot; | grep -v grep | wc -l`<br />
&nbsp; &nbsp; &nbsp; &nbsp; if <span style="">&#91;</span> $PROCS -ne <span style="">1</span> <span style="">&#93;</span>; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Restarting dead poprelayd: $PROCS running&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start;<br />
&nbsp; &nbsp; &nbsp; &nbsp; fi<br />
<span style="">&#125;</span></p>
<p>
case &quot;$<span style="">1</span>&quot; in<br />
&nbsp; &nbsp; &nbsp; &nbsp; start<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; stop<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; restart<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; start<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; reload<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reload<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; check<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; *<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $&quot;Usage: $<span style="">0</span> <span style="">&#123;</span>start|stop|restart|reload|condrestart|status<span style="">&#125;</span>&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RETVAL=<span style="">1</span><br />
esac<br />
exit $RETVAL</div>
</div>
</div>
<p></p>

<p></p>]]></content:encoded>
			<wfw:commentRss>http://www.machin.com.mx/archives/873/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
