<?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>Vladzur&#039;s Blog &#187; script</title>
	<atom:link href="http://vladzur.sangrederosas.cl/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://vladzur.sangrederosas.cl</link>
	<description>Sobre PHP, Ubuntu, CakePHP y otras cosas</description>
	<lastBuildDate>Mon, 26 Jul 2010 19:06:54 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Reloj parlante en Ubuntu</title>
		<link>http://vladzur.sangrederosas.cl/2009/11/24/reloj-parlante-en-ubuntu/</link>
		<comments>http://vladzur.sangrederosas.cl/2009/11/24/reloj-parlante-en-ubuntu/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 18:03:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://vladzur.sangrederosas.cl/?p=407</guid>
		<description><![CDATA[Jugando un poco con eSpeak se me ocurrió un pequeño script para que mi máquina me diga la hora cada 30 minutos, algo totalmente trivial pero entretenido. Lo primero es asegurarnos de tener instalado eSpeak, para instalarlo debemos : sudo apt-get install espeak Luego creamos el scrip lahora.sh: #!/bin/bashhora=`date +&#34;%H:%M&#34;`espeak -v es-la -a 190 &#34;Son [...]]]></description>
			<content:encoded><![CDATA[<p>Jugando un poco con eSpeak se me ocurrió un pequeño script para que mi máquina me diga la hora cada 30 minutos, algo totalmente trivial pero entretenido.</p>
<p>Lo primero es asegurarnos de tener instalado eSpeak, para instalarlo debemos :</p>
<p><code>sudo apt-get install espeak</code></p>
<p>Luego creamos el scrip lahora.sh:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow"><ol><li><span style="color: #666666; font-style: italic;">#!/bin/bash</span></li><li><span style="color: #007800;">hora</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%H:%M&quot;</span><span style="color: #000000; font-weight: bold;">`</span></li><li>espeak <span style="color: #660033;">-v</span> es-la <span style="color: #660033;">-a</span> <span style="color: #000000;">190</span> <span style="color: #ff0000;">&quot;Son las <span style="color: #007800;">$hora</span>&quot;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>y luego con Cron programamos la ejecución del script:</p>
<p><code>crontab -e</code></p>
<p>y le decimos que corra el archivo de lunes a viernes a los 0 y 30 minutos:<br />
<code># m h  dom mon dow   command<br />
0,30 * * * 1-5 /home/vladzur/lahora.sh</code></p>
<p>Fácil y divertido (inútil por lo demás).</p>
<p><a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Digg" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Facebook" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Delicious" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Twitter" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><p><a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Digg" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Facebook" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Delicious" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F11%2F24%2Freloj-parlante-en-ubuntu%2F&amp;linkname=Reloj%20parlante%20en%20Ubuntu" title="Twitter" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://vladzur.sangrederosas.cl/2009/11/24/reloj-parlante-en-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sincronizar Laptop y Desktop en Ubuntu</title>
		<link>http://vladzur.sangrederosas.cl/2009/10/02/sincronizar-laptop-y-desktop-en-ubuntu/</link>
		<comments>http://vladzur.sangrederosas.cl/2009/10/02/sincronizar-laptop-y-desktop-en-ubuntu/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 15:42:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://vladzur.sangrederosas.cl/?p=257</guid>
		<description><![CDATA[Cuando trabajamos con un laptop y el equipo de escritorio, muchas veces necesitamos mantener sincronizados nuestros correos y archivos, pues para esto nada mejor que rsync. Podemos crear un directorio en nuestro home/ que contenga enlaces simbólicos a las carpetas que necesitemos sincronizar: mkdir sync cd sync ln -sf /home/usuario/Documentos ./Documentos ln -sf /home/usuario/Imágenes ./Imágenes [...]]]></description>
			<content:encoded><![CDATA[<p>Cuando trabajamos con un laptop y el equipo de escritorio, muchas veces necesitamos mantener sincronizados nuestros correos y archivos, pues para esto nada mejor que <a href="http://es.wikipedia.org/wiki/Rsync" target="_blank">rsync</a>.</p>
<p>Podemos crear un directorio en nuestro home/ que contenga enlaces simbólicos a las carpetas que necesitemos sincronizar:</p>
<p><code>mkdir sync<br />
cd sync<br />
ln -sf /home/usuario/Documentos ./Documentos<br />
ln -sf /home/usuario/Imágenes ./Imágenes<br />
mkdir .gconf<br />
mkdir .gconf/apps<br />
ln -sf /home/usuario/.gconf/apps/evolution ./.gconf/apps/evolution<br />
ln -sf /home/usuario/.evolution ./.evolution</code></p>
<p>Hemos creado una carpeta llamada &#8220;sync&#8221; la que contiene los enlaces a Documentos, Imágenes y nuestro correo de Evolution.</p>
<p>Podemos crear un pequeño script que nos permita sincronizar nuestras carpetas y correos:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow"><ol><li><span style="color: #666666; font-style: italic;">#!/bin/sh</span></li><li><span style="color: #666666; font-style: italic;">#sincronizar con otro equipo</span></li><li><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;sincronizando con $1&quot;</span></li><li>rsync <span style="color: #660033;">-arLuvz</span> <span style="color: #660033;">-e</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario<span style="color: #000000; font-weight: bold;">/</span>sync<span style="color: #000000; font-weight: bold;">/</span> usuario<span style="color: #000000; font-weight: bold;">@</span>$1:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>usuario</li><li><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;sincronización finalizada&quot;</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Podemos llamarlo sincronizar.sh, luego le damos permiso de ejecución:</p>
<p><code>chmod +x sincronizar.sh</code></p>
<p>Y ya podemos mantener sincronizados nuestras máquinas.</p>
<p>Ej:<br />
Si el equipo a sincronizar tiene la ip 192.168.10.100<br />
<code>sh sincronizar.sh 192.168.10.100</code><br />
Asumimos que el nombre de usuario es el mismo en ambos equipos.</p>
<p>(Basado en <a href="http://www.laweba.net/linux/como-sincronizar-dos-ordenadores-en-linux/">http://www.laweba.net/linux/como-sincronizar-dos-ordenadores-en-linux/</a> )</p>
<p><a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Digg" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Facebook" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Delicious" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Twitter" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><p><a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Digg" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Facebook" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Delicious" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F10%2F02%2Fsincronizar-laptop-y-desktop-en-ubuntu%2F&amp;linkname=Sincronizar%20Laptop%20y%20Desktop%20en%20Ubuntu" title="Twitter" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://vladzur.sangrederosas.cl/2009/10/02/sincronizar-laptop-y-desktop-en-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poner tags PHP correctos</title>
		<link>http://vladzur.sangrederosas.cl/2009/09/14/poner-tags-php-correctos/</link>
		<comments>http://vladzur.sangrederosas.cl/2009/09/14/poner-tags-php-correctos/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 13:49:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://vladzur.wordpress.com/2009/09/14/poner-tags-php-correctos/</guid>
		<description><![CDATA[Esta es una traducción de un artículo antiguo escrito originalmente en francés. Si tuviste el mal hábito o tienes algunos scripts php antiguos que usan tas etiquetas PHP cortas (ej. &#60;? ?&#62; en vez de &#60;?php ?&#62;), lo qual está deshabilitado por defecto en la versión actual de PHP, el siguiente script (shorttags.sh) es para [...]]]></description>
			<content:encoded><![CDATA[<p>Esta es una traducción de un artículo antiguo escrito originalmente en francés.<br />
Si tuviste el mal hábito o tienes algunos scripts php antiguos que usan tas etiquetas PHP cortas (ej. &lt;? ?&gt; en vez de &lt;?php ?&gt;), lo qual está deshabilitado por defecto en la versión actual de PHP, el siguiente script (shorttags.sh) es para tí:<br />
<code><br />
#!/bin/sh<br />
find &quot;$@&quot; -name &quot;*.php&quot; -exec perl -i -wpe 's/&lt;?=/&lt;?php echo /g' {} ;<br />
-exec perl -i -wpe 's/&lt;?(?!php)/&lt;?php /g' {} ;<br />
</code></p>
<p>Luego de escribir el script, debes hacerlo ejecutable:<br />
<code><br />
chmod +x shorttags.sh<br />
</code></p>
<p>Luego, puedes usarlo así (no olvides respaldar tus preciosos scripts, nunca se sabe&#8230;):<br />
<code><br />
./shorttags.sh /ruta/tus/archivos/php/<br />
</code></p>
<p>Puedes poner más de una ruta desde esta línea de comandos.</p>
<p>(original <a href="http://planet.ubuntu.com/">http://planet.ubuntu.com/</a>)</p>
<p><a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Digg" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Facebook" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Delicious" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Twitter" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p><p><a href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Digg" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a> <a href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Facebook" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a> <a href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Delicious" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a> <a href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fvladzur.sangrederosas.cl%2F2009%2F09%2F14%2Fponer-tags-php-correctos%2F&amp;linkname=Poner%20tags%20PHP%20correctos" title="Twitter" rel="nofollow" target="_blank"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a> <a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://vladzur.sangrederosas.cl/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://vladzur.sangrederosas.cl/2009/09/14/poner-tags-php-correctos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
