<?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>Linux Blog &#187; Linux</title>
	<atom:link href="http://www.rz0r.net/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rz0r.net</link>
	<description>Otro blog mas de linux</description>
	<lastBuildDate>Tue, 23 Aug 2011 05:26:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Consumir web services SOAP facil con Python Suds</title>
		<link>http://www.rz0r.net/2011/07/consumir-web-services-soap-facil-con-python-suds/</link>
		<comments>http://www.rz0r.net/2011/07/consumir-web-services-soap-facil-con-python-suds/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 05:26:32 +0000</pubDate>
		<dc:creator>rz0r</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[programing]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://www.rz0r.net/?p=186</guid>
		<description><![CDATA[Suds es un tremendo cliente SOAP para consumir web services es basado en Python a diferencia de los clientes en Java no hay generación de clases, y el API es tipo orientado a objetos. Y lo mejor es el poco código que se debe escribir para consumir un servicio web y para muestra un ejemplo [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=90e8a2b5c540d915d4179fab9eeaf31d&amp;default=http://en.gravatar.com/avatar/90e8a2b5c540d915d4179fab9eeaf31d?s=80&r=any' alt='No Gravatar' width=40 height=40/><p>Suds es un tremendo cliente SOAP para consumir web services es basado en Python a diferencia de los clientes en Java no hay generación de clases, y el API es tipo orientado a objetos. Y lo mejor es el poco código que se debe escribir para consumir un servicio web y para muestra un ejemplo sencillo:</p>
<p>Lo primero instalar el cliente ya sea descargándolo del sitio o instalando el paquetes si nuestra distribución de linux lo incluye en sus repositorios.</p>
<pre class="brush: bash; title: ; notranslate">
# fedora 15
yum -y install python-suds
# tarball
wget https://fedorahosted.org/releases/s/u/suds/python-suds-0.4.tar.gz
tar xzvf python-suds-0.4.tar.gz
cd python-suds-0.4
python setup.py install
</pre>
<p>Para el ejemplo utilizaremos uno de los webservices del sitio webservicesx.net</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/env python

from suds.client import Client
url = 'http://www.webservicex.net/globalweather.asmx?WSDL'
client = Client(url)
print client
</pre>
<p>si todo esta correcto la salida del script mostrara esto:</p>
<p>web service output</p>
<pre class="brush: plain; title: ; notranslate">
Suds ( https://fedorahosted.org/suds/ )  version: 0.3.9 GA  build: R659-20100219

Service ( GlobalWeather ) tns=&quot;http://www.webserviceX.NET&quot;
   Prefixes (0)
   Ports (2):
      (GlobalWeatherSoap)
         Methods (2):
            GetCitiesByCountry(xs:string CountryName, )
            GetWeather(xs:string CityName, xs:string CountryName, )
         Types (0):
      (GlobalWeatherSoap12)
         Methods (2):
            GetCitiesByCountry(xs:string CountryName, )
            GetWeather(xs:string CityName, xs:string CountryName, )
         Types (0):
</pre>
<p>El servicio web tiene 2 metodos los cuales podemos invocar de la siguiente manera:</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/env python

from suds.client import Client
url = 'http://www.webservicex.net/globalweather.asmx?WSDL'
client = Client(url)
#print client
weather =  client.service.GetWeather('Managua', 'Nicaragua')
print weather
</pre>
<p>esto generara un string conteniendo el xml para que luego pueda ser procesado según se requiera .</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
&lt;CurrentWeather&gt;
  &lt;Location&gt;Managua A. C. Sandino, Nicaragua (MNMG) 12-09N 086-10W 56M&lt;/Location&gt;
  &lt;Time&gt;Jul 18, 2011 - 12:00 AM EDT / 2011.07.18 0400 UTC&lt;/Time&gt;
  &lt;Wind&gt; from the ESE (110 degrees) at 5 MPH (4 KT):0&lt;/Wind&gt;
  &lt;Visibility&gt; greater than 7 mile(s):0&lt;/Visibility&gt;
  &lt;SkyConditions&gt; partly cloudy&lt;/SkyConditions&gt;
  &lt;Temperature&gt; 77 F (25 C)&lt;/Temperature&gt;
  &lt;DewPoint&gt; 73 F (23 C)&lt;/DewPoint&gt;
  &lt;RelativeHumidity&gt; 88%&lt;/RelativeHumidity&gt;
  &lt;Pressure&gt; 29.88 in. Hg (1011 hPa)&lt;/Pressure&gt;
  &lt;Status&gt;Success&lt;/Status&gt;
&lt;/CurrentWeather&gt;
</pre>
<p>Referencias:</p>
<p>Python Suds</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rz0r.net/2011/07/consumir-web-services-soap-facil-con-python-suds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework Shared Hosting</title>
		<link>http://www.rz0r.net/2011/05/zend-framework-shared-hosting/</link>
		<comments>http://www.rz0r.net/2011/05/zend-framework-shared-hosting/#comments</comments>
		<pubDate>Sat, 07 May 2011 05:08:51 +0000</pubDate>
		<dc:creator>rz0r</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programing]]></category>

		<guid isPermaLink="false">http://www.rz0r.net/?p=174</guid>
		<description><![CDATA[Por lo general cuando desarrollo una aplicación usando Zend Framework esta es desplegada en servidores compartidos donde no es posible realizar una configuración de virtual host en Apache. por lo que utilizo una estructura diferente para la aplicacion de tal modo que las aplicaciones quedan dentro del directorio “zend_apps”, las librerías del framework en “zf” [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=90e8a2b5c540d915d4179fab9eeaf31d&amp;default=http://en.gravatar.com/avatar/90e8a2b5c540d915d4179fab9eeaf31d?s=80&r=any' alt='No Gravatar' width=40 height=40/><p>Por lo general cuando desarrollo una aplicación usando Zend Framework esta es desplegada en servidores compartidos donde no es posible realizar una configuración de virtual host en Apache. por lo que utilizo una estructura diferente para la aplicacion</p>
<pre class="brush: plain; title: ; notranslate">
home
|-- [account]
    |-- zend_apps
    |    |-- mobile
    |        |-- application
    |        |-- docs
    |        |-- library
    |        `-- test
    `-- zf
    |   `-- library
    `-- public_html
        `-- mobile
            |-- css
            |-- img
            |-- js
            |-- index.php
            `-- .htaccess
</pre>
<p>de tal modo que las aplicaciones quedan dentro del directorio “zend_apps”, las librerías del framework en “zf” y los archivos que seran publicos(hojas de estilo, imagenes  y javascript) en un folder dentro del directorio raiz del sitio o si se requiere en el mismo directorio raiz “public_html”  y solo se modifica  el  index.php y el archivos .htaccess para corregir las rutas.</p>
<pre class="brush: php; highlight: [4,5,17]; title: ; notranslate">
&lt;?php
// file: index.php

$apps_path = getenv('ZendApps');  // applications path
$zf_libs = getenv('ZFpath'); // Zend Framework libs path

defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', $apps_path . DIRECTORY_SEPARATOR . 'mobile/application');

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
                                              realpath(APPLICATION_PATH . '/../library'),
                                              realpath($zf_libs . '/library'),
                                              get_include_path(),
                                         )));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
        APPLICATION_PATH . '/configs/application.ini'
);
$application-&gt;bootstrap()
        -&gt;run();
</pre>
<p>Para que los cambios funcionen es necesario agregar variables de entorno en el htaccess utilizando las directivas del modulo de Apache mod_env en el cual debe estar habilitado en el servidor y tendremos un htaccess como este:</p>
<pre class="brush: plain; highlight: [2,3]; title: ; notranslate">
# htaccess
SetEnv ZendApps &quot;/home/username/zend_apps&quot;
SetEnv ZFpath &quot;/home/username/zf&quot;
SetEnv APPLICATION_ENV &quot;production&quot;
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</pre>
<p>con este cambio la aplicacion funcionara correctamente y no es necesario configurar un virtual host.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rz0r.net/2011/05/zend-framework-shared-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android SDK en Fedora 14 x86-64</title>
		<link>http://www.rz0r.net/2011/03/android-sdk-en-fedora-14-x86-64/</link>
		<comments>http://www.rz0r.net/2011/03/android-sdk-en-fedora-14-x86-64/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 05:43:20 +0000</pubDate>
		<dc:creator>rz0r</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[planeta]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[fedora 64 bits]]></category>

		<guid isPermaLink="false">http://www.rz0r.net/?p=160</guid>
		<description><![CDATA[El SDK de Android esta hecho para 32bits para ponerlo a funcionar en Fedora 14 x86-64(64 bits) y correr el emulador usando el JDK de 64 bits requiere instalar librerias de 32 bits; accediendo como usuario root instalamos lo siguiente: Descargamos el SDK del sitio de Android http://developer.android.com/sdk/index.html Linux (i386) &#124;  android-sdk_r10-linux_x86.tgz &#124;  26981997 bytes [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=90e8a2b5c540d915d4179fab9eeaf31d&amp;default=http://en.gravatar.com/avatar/90e8a2b5c540d915d4179fab9eeaf31d?s=80&r=any' alt='No Gravatar' width=40 height=40/><p>El SDK de Android esta hecho para 32bits para ponerlo a funcionar en Fedora 14 x86-64(64 bits) y correr el emulador usando el JDK de 64 bits requiere instalar librerias de 32 bits; accediendo como usuario root instalamos lo siguiente:</p>
<pre class="brush: bash; title: ; notranslate">
su -
yum install ncurses-libs.i686 libstdc++.i686 glibc.i686 libX11-devel.i686  \
glibc.i686 SDL.i686 libX11.i686 libXext.i686 libao.i686  alsa-lib.i686 -y
</pre>
<p>Descargamos el SDK del sitio de Android http://developer.android.com/sdk/index.html</p>
<p>Linux (i386) |  android-sdk_r10-linux_x86.tgz |  26981997 bytes |  c022dda3a56c8a67698e6a39b0b1a4e0</p>
<p>descomprimimos el archivos, desde la terminal ejecutamos</p>
<pre class="brush: bash; title: ; notranslate">
cd android-sdk-linux_x86/tools
./android
</pre>
<p>descargamos el SDK con la version del API que vayamos a utilizar y listo solo queda configurar el dispositivo y probarlo.</p>
<p>El dispositivo puede crearse desde la consola o desde la aplicacion grafica.</p>
<pre class="brush: bash; title: ; notranslate">
# creando el dispositivo desde la consola
cd android-sdk-linux_x86/tools
./android  create avd -c 256M -t 1 -n android_223 -a -s WQVGA400 --force
</pre>
<p>al igual el emulador se puede arrancar desde la consola o la aplicacion.</p>
<pre class="brush: bash; title: ; notranslate">
# ejecutando el emulador
cd android-sdk-linux_x86/tools
./emulator -cpu-delay 0 -no-boot-anim -cache ./cache  -verbose -avd android_223
</pre>
<p>las opciones -cpu-delay 0 -no-boot-anim -cache ./cache, mejora un poco el rendimiento haciendo mas responsivo el emulador.</p>
<div id="attachment_166" class="wp-caption alignnone" style="width: 310px"><a href="http://www.rz0r.net/wp-content/uploads/2011/03/Screenshot.png"><img class="size-medium wp-image-166 " title="android on fedora 14 x86-64" src="http://www.rz0r.net/wp-content/uploads/2011/03/Screenshot-300x187.png" alt="android on fedora 14 x86-64" width="300" height="187" /></a><p class="wp-caption-text">android on fedora 14 x86-64</p></div>
<p>referencia:</p>
<p><a href="http://developer.android.com/index.html">Android Developers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rz0r.net/2011/03/android-sdk-en-fedora-14-x86-64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detección y redirección de móviles con Apache mod_rewrite.</title>
		<link>http://www.rz0r.net/2010/07/deteccion-y-redireccion-de-moviles-con-apache-mod_rewrite/</link>
		<comments>http://www.rz0r.net/2010/07/deteccion-y-redireccion-de-moviles-con-apache-mod_rewrite/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 04:51:56 +0000</pubDate>
		<dc:creator>rz0r</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[mobiles]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.rz0r.net/?p=148</guid>
		<description><![CDATA[Cuando se desarrollan aplicaciones web o versiones móviles de sitios una aspecto fundamental es la detección del móvil y sus capacidades existen 2 opciones para realizar esta tarea ambas utilizan base de datos formatos XML con las características de los móviles una es opensource WURFL y la otra es Device Atlas la cual funciona en [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=90e8a2b5c540d915d4179fab9eeaf31d&amp;default=http://en.gravatar.com/avatar/90e8a2b5c540d915d4179fab9eeaf31d?s=80&r=any' alt='No Gravatar' width=40 height=40/><p>Cuando se desarrollan aplicaciones web o versiones móviles de sitios una aspecto fundamental es la detección del móvil y sus capacidades existen 2 opciones para realizar esta tarea ambas utilizan base de datos formatos XML con las características de los móviles una es opensource   <a href="http://wurfl.sourceforge.net/">WURFL</a>  y la otra es  <a href="http://deviceatlas.com/licences">Device Atlas</a> la cual funciona en base a licencias, gratuita para evaluación con la data de ambas es posible implementar la detección del móvil y sus capacidades. </p>
<p>Ahora bien como dice el titulo de este articulo detección y redirección con Apache mod_rewrite , si no se requiere una solucion compleja lo mas sencillo y rápido si se esta trabajando con Apache es usar su modulo de re-escritura de url ( mod-rewrite )  y eso es mediante unas cuantas reglas en un archivo .htaccess en el directorio como estas:</p>
<pre class="brush: plain; title: ; notranslate">

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} ^(Android|BlackBerry) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(Motorolla|Nokia|Samsung|SonyEricsson) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} iP(hone|od) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} .*Mobile.*Safari

RewriteRule ^$ http://movil.midominio.com  [R=301,L]
</pre>
<p>La deteccion es proporcionada por las expresiones regulares evaluadas de la variable &#8220;HTTP_USER_AGENT&#8221;  y la redireccion por la expresion  &#8220;RewriteRule ^$ http://movil.midominio.com  [R=301,L]&#8221;  en este caso por ejemplo tenemos  un sitio en &#8220;midominio.com&#8221; y una version movil en  &#8220;movil.midominio.com&#8221;  el htaccess redireccionara cada peticion que sea movil al subdominio automaticamente.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rz0r.net/2010/07/deteccion-y-redireccion-de-moviles-con-apache-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agregando color a la terminal en OpenSolaris 2009</title>
		<link>http://www.rz0r.net/2009/08/agregando-color-a-la-terminal-en-opensolaris-2009/</link>
		<comments>http://www.rz0r.net/2009/08/agregando-color-a-la-terminal-en-opensolaris-2009/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 05:42:08 +0000</pubDate>
		<dc:creator>rz0r</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Opensolaris]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[ls]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.rz0r.net/?p=126</guid>
		<description><![CDATA[La terminal en opensolaris 2009 por default no trae activos los colores para el comando ls o el vim, a como viene por defecto en las distribucciones de linux, en lo particular me gusta ver los colores en la terminal para solucionar esto bastara con agregar unas cuantas lineas de codigo bash en los archivos [...]]]></description>
			<content:encoded><![CDATA[<img style='float: left; margin-right: 10px; border: none;' src='http://www.gravatar.com/avatar.php?gravatar_id=90e8a2b5c540d915d4179fab9eeaf31d&amp;default=http://en.gravatar.com/avatar/90e8a2b5c540d915d4179fab9eeaf31d?s=80&r=any' alt='No Gravatar' width=40 height=40/><p>La terminal en opensolaris 2009 por default no trae activos los colores para el comando ls o el vim, a como viene por defecto en las distribucciones de linux, en lo particular me gusta ver los colores en la terminal para solucionar esto bastara con agregar unas cuantas lineas de codigo bash en los archivos .bashrc y .profile para tener funcionando la terminal con los colores.</p>
<p>.bashrc</p>
<pre class="brush: bash; title: ; notranslate">
alias  ls='ls --color=auto'
TERM=xterm-color
export TERM
</pre>
<p>.profile</p>
<pre class="brush: bash; title: ; notranslate">
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
</pre>
<div id="attachment_127" class="wp-caption alignnone" style="width: 310px"><a href="http://www.rz0r.net/wp-content/uploads/2009/08/screen1.png"><img class="size-medium wp-image-127" title="screen1" src="http://www.rz0r.net/wp-content/uploads/2009/08/screen1-300x165.png" alt="ls colors" width="300" height="165" /></a><p class="wp-caption-text">ls colors</p></div>
<div id="attachment_128" class="wp-caption alignnone" style="width: 310px"><a href="http://www.rz0r.net/wp-content/uploads/2009/08/screen2.png"><img class="size-medium wp-image-128" title="screen2" src="http://www.rz0r.net/wp-content/uploads/2009/08/screen2-300x165.png" alt="vim colors" width="300" height="165" /></a><p class="wp-caption-text">vim colors</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.rz0r.net/2009/08/agregando-color-a-la-terminal-en-opensolaris-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

