<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Shakaran</title> <link>http://shakaran.net/blog</link> <description>Blog de un estudiante de ingeniería informática y sysadmin</description> <lastBuildDate>Wed, 25 Apr 2012 15:02:15 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <image><link>http://shakaran.net/blog</link> <url>http://www.shakaran.net/blog/wp-content/favicon.png</url><title>Shakaran</title> </image> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Shakaran" /><feedburner:info uri="shakaran" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Shakaran</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><title>FreeStation: a little sneak peek</title><link>http://feedproxy.google.com/~r/Shakaran/~3/arkhhHBwNgc/</link> <comments>http://shakaran.net/blog/2012/04/freestation-a-little-sneak-peek/#comments</comments> <pubDate>Mon, 16 Apr 2012 16:12:00 +0000</pubDate> <dc:creator>shakaran</dc:creator> <category><![CDATA[Free Station]]></category> <category><![CDATA[Inclasificado]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[software libre]]></category> <category><![CDATA[Universidad]]></category> <category><![CDATA[adif]]></category> <category><![CDATA[advances]]></category> <category><![CDATA[architecture]]></category> <category><![CDATA[blind]]></category> <category><![CDATA[client]]></category> <category><![CDATA[communication]]></category> <category><![CDATA[dissertation]]></category> <category><![CDATA[dni]]></category> <category><![CDATA[freestation]]></category> <category><![CDATA[ice]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[peek]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[POI]]></category> <category><![CDATA[police]]></category> <category><![CDATA[python]]></category> <category><![CDATA[server]]></category> <category><![CDATA[sescam]]></category> <category><![CDATA[sneak]]></category> <category><![CDATA[software]]></category> <category><![CDATA[SPOF]]></category> <category><![CDATA[stack]]></category> <category><![CDATA[ussability]]></category> <category><![CDATA[zeroc]]></category><guid isPermaLink="false">http://shakaran.net/blog/?p=1202</guid> <description><![CDATA[Several months&#160;have passed&#160;since&#160;I&#160;wrote about Freestation. I would like show some advances and write about my dissertation project that I hope to finish for the 2th June as last day for deadline on this course. An introduction&#160;reminder FreeStation is a program built for help to distribute easy and reliable software and information on point of interest [...]<br /><div><img src="http://shakaran.net/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>10</strong> (0 votes cast)</div><br />]]></description> <content:encoded><![CDATA[<div class="wpbuzzer_button" style="float: right"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-button" data-url="http://shakaran.net/blog/2012/04/freestation-a-little-sneak-peek/" data-imageurl=""></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div><p>Several months&nbsp;have passed&nbsp;since&nbsp;<a title="Free Station: plataforma para el desarrollo de sistemas de distribución de software libre en puntos de información" href="http://shakaran.net/blog/2011/05/free-station-plataforma-para-el-desarrollo-de-sistemas-de-distribucion-de-software-libre-en-puntos-de-informacion/" target="_blank">I&nbsp;wrote about Freestation</a>. I would like <strong>show some advances</strong> and write about my dissertation project that I hope to <strong>finish for the 2th June</strong> as last day for deadline on this course.</p><h3><span style="color: #993300;">An introduction&nbsp;reminder</span></h3><p>FreeStation is a program built for help to distribute easy and reliable software and information on <strong>point of interest</strong> (POI).</p><p>Basically, a POI is huge device that you can find on&nbsp;universities, libraries, hospitals, police stations, train stations, etc.</p><p>For example, this are a couple of images of POIs:</p><div id="attachment_1203" class="wp-caption aligncenter" style="width: 460px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/view-poi-dni-reduced.jpg"><img class="size-full wp-image-1203" title="DNI POI on police station" src="http://shakaran.net/blog/wp-content/uploads/2012/04/view-poi-dni-reduced.jpg" alt="DNI POI on police station" width="450" height="600" /></a><p class="wp-caption-text">DNI POI on police station</p></div><p>This is POI on a police station for perform changes with a DNI (National Idenfication Document on Spain). It shows a keyboard, trackball and DNI card reader for easy operations with <strong>credential authentication</strong> using DNI.</p><p>It has normal power connection but it also&nbsp;has <strong>internet connection</strong> for load data. On the following image:</p><div id="attachment_1205" class="wp-caption aligncenter" style="width: 460px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/front-poi-dni-reduced.jpg"><img class="size-full wp-image-1205" title="Front detail of DNI POI on a police station" src="http://shakaran.net/blog/wp-content/uploads/2012/04/front-poi-dni-reduced.jpg" alt="Front detail of DNI POI on a police station" width="450" height="338" /></a><p class="wp-caption-text">Front detail of DNI POI on a police station</p></div><p>As you can apreciate, it shows with more details a screen showing input boxes for the user and a <strong>simple interface</strong> with buttons. The&nbsp;height POI is adjusted to&nbsp;people&nbsp;in wheelchairs (a laudable&nbsp;feature for accessibility).</p><p>Another example of POI:</p><div id="attachment_1207" class="wp-caption aligncenter" style="width: 460px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/poi-adif-train-station-reduced.jpg"><img class="size-full wp-image-1207" title="Adif POI on a train station" src="http://shakaran.net/blog/wp-content/uploads/2012/04/poi-adif-train-station-reduced.jpg" alt="Adif POI on a train station" width="450" height="600" /></a><p class="wp-caption-text">Adif POI on a train station</p></div><p>This image corresponds to another POI on a Adif&#8217;s train station. It has a <strong>different design</strong>, totally vertical with a big screen rotated. Unfortunaly when I take the photo it was turned off, but I think that it is a tactil screen model with internet connection too.</p><p>It incorporates a audio system maybe <strong>useful for blind people</strong> and as possible confirmation for using audio notification. Sadly, it is enough high for wheelchairs people, so maybe the only functions could be a information panel with low interaction. I can&#8217;t ensure this, because I never can see running this POI when I travel.</p><p>Finally another radical example of POI (three different examples should be enough for ilustrate my point):</p><div id="attachment_1208" class="wp-caption aligncenter" style="width: 460px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/poi-sescam-hospital-reduced.jpg"><img class="size-full wp-image-1208" title="SESCAM POI on a hospital" src="http://shakaran.net/blog/wp-content/uploads/2012/04/poi-sescam-hospital-reduced.jpg" alt="SESCAM POI on a hospital" width="450" height="600" /></a><p class="wp-caption-text">SESCAM POI on a hospital</p></div><p>This is another interesting POI that has a <strong>intercommunication phone</strong> for direct assistance, keyboard, tracball mouse and sanitary card reader. It also has a tray as printer for deliver useful data to the user. Sadly, when I take the photo the POI also is turned off.</p><p>So, this is only a reduced set of examples of a <strong>huge variety</strong> of POIs. Usually you can find the same model for each same hospital, train station, police station, university, etc. Each model runs practically the same model of software and hardware features. But, when the time past, it is highly probably that some POIs have breakdows,&nbsp;energy loss, software bugs, unconsistence of versions, etc.</p><p>So, FreeStation try to <strong>repair and unify</strong> this problems for offer a kindly solution, because it is important deploy same versions between POIs, recieve notifications when a POI it is offline for a breakdown, auto-restart the POI if some hard bug happens, etc.</p><h3><span style="color: #993300;">Architecture</span></h3><p>The Freestation architecture is mainly based on <strong>client-server model</strong>. Each component is easy to tweak or customize and it doesn&#8217;t require technical knowledge for diary use.</p><div id="attachment_1214" class="wp-caption aligncenter" style="width: 458px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/infraestructure.png"><img class=" wp-image-1214  " title="Architecture - Server and clients infrastructure" src="http://shakaran.net/blog/wp-content/uploads/2012/04/infraestructure.png" alt="Architecture - Server and clients infrastructure" width="448" height="336" /></a><p class="wp-caption-text">Architecture - Server and clients infrastructure</p></div><p>Let me introduce you the architecture with real screenshots of the application and some diagrams.</p><h3><span style="color: #993300;">Server architecture</span></h3><p>FreeStation server runs over a <strong>software stack</strong>&nbsp;consisting of several technologies and components. It handles all the communication with every client.</p><p>It has a friendly webserver GUI panel administration based on PHP + Javascript.</p><div id="attachment_1209" class="wp-caption aligncenter" style="width: 446px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-gui.png"><img class=" wp-image-1209   " title="FreeStation Server Webserver GUI" src="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-gui.png" alt="FreeStation Server Webserver GUI" width="436" height="321" /></a><p class="wp-caption-text">FreeStation Server Webserver GUI</p></div><p>As you can see, you can start/stop/restart the server, see real status and different useful output logs for<strong> analyce and diagnose</strong> whatever event.</p><p>It allows easily make the common tasks for <strong>deploy and configure</strong> a high amount of clients with POIs.</p><p>Under the webserver GUI, it runs a daemon process as backend based on python. Each action and task is handled internally and <strong>dispatched on fast way</strong>.</p><p>The backend can make asynchronous&nbsp;communication with clients. For that the <a title="Install ZeroC Ice for Python on Centos" href="http://shakaran.net/blog/2012/02/instalar-zeroc-ice-para-python-en-centos-5-7/" target="_blank">backend uses ICE</a> (Internet Comunication Engine of <a title="Zero C Ice" href="http://zeroc.com" target="_blank">ZeroIce</a>).</p><p>This allows a reliable and robust way to <strong>transfer huge information datasets</strong> between a big amount of clients and the server.</p><p>For example, you also can see a list of current clients handled by the server with stats:</p><div id="attachment_1210" class="wp-caption aligncenter" style="width: 445px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-clients.png"><img class=" wp-image-1210   " title="FreeStation Server GUI - List of clients" src="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-clients.png" alt="FreeStation Server GUI - List of clients" width="435" height="298" /></a><p class="wp-caption-text">FreeStation Server GUI - List of clients</p></div><p>The list shows each client hostname, IP address, last connection, requests, status and some actions for each client. You can add/remove/edit clients and <strong>all the data associated</strong> with a clients would be updated.</p><h3><span style="color: #993300;">Client architecture</span></h3><p>A client run only on a POI and <strong>periodically poll</strong>&nbsp;to the server for updates or information. Clients need a specification for deploy widgets and the data associated for each widget.</p><p>A widget on Freestation terminology is a abstract element that <strong>performs a atomic operation</strong> and provides communication for the data handled inside the widget.</p><p>For complex operations a widget could associate with more widgets for perform a sofisticated task or simply commnicate data with other widgets. The widgets only run on clients, but all them are configured only from a server.</p><p>This describe a&nbsp;<strong>orchestra model</strong> where the server acts like a manager and clients with widgets acts like a&nbsp;choir.</p><p>That means that a client only can communicate with the server and it is not allowed the communication between clients. But this can be easily a <a title="SPOF - Single Point Of Failure" href="http://es.wikipedia.org/wiki/Single_point_of_failure" target="_blank">SPOF</a> (Single Point Of Failure) for server. So, it is planned on a future allow several masters servers as failover and syncronize and replicate data between masters.</p><p>In other hand, an a server, you have a list of widgets available to configure on a client.</p><div id="attachment_1211" class="wp-caption aligncenter" style="width: 468px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-widgets.png"><img class=" wp-image-1211    " title="FreeStation Server GUI - List of total widgets" src="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-widgets.png" alt="FreeStation Server GUI - List of total widgets" width="458" height="334" /></a><p class="wp-caption-text">FreeStation Server GUI - List of total widgets</p></div><p>For example, you can choose deploy and configure a USB Storage widget and a Mount Device widget on a client. That widgets could associate operations for list several files of books about medicine. When the user pick a set and choose save to a usb key, the Mount Device detect the usb key and usb&nbsp;storage widget write the data. The result it is a happy user that obtain the needed information quickly and without problems.</p><div id="attachment_1212" class="wp-caption aligncenter" style="width: 447px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-associate-widget.png"><img class=" wp-image-1212   " title="FreeStation Server - Associate widget to client" src="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-associate-widget.png" alt="FreeStation Server - Associate widget to client" width="437" height="299" /></a><p class="wp-caption-text">FreeStation Server - Associate widget to client</p></div><p>&nbsp;</p><p>You can associate the needed widgets for a client and configure/edit each widget with custom params (for example, only allow 5 items for save on Mount Device):</p><div id="attachment_1213" class="wp-caption aligncenter" style="width: 527px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-configure-widget.png"><img class=" wp-image-1213   " title="FreeStation Server - Configure Widget for a client" src="http://shakaran.net/blog/wp-content/uploads/2012/04/freestation-server-configure-widget.png" alt="FreeStation Server - Configure Widget for a client" width="517" height="354" /></a><p class="wp-caption-text">FreeStation Server - Configure Widget for a client</p></div><p>Another example, you can choose a Video widget and display a video on POI for idle mode. When the user touch or interact with the POI, you can load a Browser Widget with a concrete webpage. Additionally as some institution you can choose a simple logo widget for display your institution logo on screen.</p><p>When a client is totally configured, then can be deployed on POI (normal desktop computer customized). A simple example of client screen deployed:</p><p>&nbsp;</p><div id="attachment_1216" class="wp-caption aligncenter" style="width: 578px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/welcome-client-widgets.png"><img class=" wp-image-1216  " title="FreeStation Client - Welcome wigdets configured" src="http://shakaran.net/blog/wp-content/uploads/2012/04/welcome-client-widgets.png" alt="FreeStation Client - Welcome wigdets configured" width="568" height="389" /></a><p class="wp-caption-text">FreeStation Client - Welcome wigdets configured</p></div><p>There are not limit defining or using new widgets. So in theory, the <strong>widget model scale</strong> for each custom need for a institution.</p><h3><span style="color: #993300;">Free &amp; easy&nbsp;to scale to&nbsp;your&nbsp;needs</span></h3><p>With FreeStation some basic <strong>widgets are offered</strong>, but on the future, it could has <strong>repository widgets</strong> associated, widget patners and offer a rich market for developers that they are interested on develop custom widgets for companies, institutions, hospitals.</p><p>Soon, I plan to release the code as AGPLv3 on Github. Still I need polish some widgets, finish a real demo case for my dissertation and literally write a boring book with approximattelly 200 pages (currently, I have around 80 bad structure pages written).</p><p>So, the project is nearly to finish and with lucky I can finish before to 2th june deadline (and 15 th june official presentation) and finally has a big engineer diploma on my wall, yay!</p><p>Meanwhile, there are&nbsp;nearly two&nbsp;months of hard work, But&nbsp;shhh&nbsp;&#8230;&nbsp;I found a&nbsp;secret weapon <img src='http://shakaran.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p>&nbsp;</p><div id="attachment_1218" class="wp-caption aligncenter" style="width: 410px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/04/secret-hard-work-weapon.jpg"><img class="size-full wp-image-1218" title="Secret hard work weapon" src="http://shakaran.net/blog/wp-content/uploads/2012/04/secret-hard-work-weapon.jpg" alt="Secret hard work weapon" width="400" height="300" /></a><p class="wp-caption-text">Secret hard work weapon</p></div><p>&nbsp;</p><p>&nbsp;</p> <br /><div><img src="http://shakaran.net/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>10</strong> (0 votes cast)</div><br />]]></content:encoded> <wfw:commentRss>http://shakaran.net/blog/2012/04/freestation-a-little-sneak-peek/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://shakaran.net/blog/2012/04/freestation-a-little-sneak-peek/</feedburner:origLink></item> <item><title>Acelerar la carga del terminal borrando logs en Ubuntu</title><link>http://feedproxy.google.com/~r/Shakaran/~3/t0JuD5H0vOI/</link> <comments>http://shakaran.net/blog/2012/02/acelerar-la-carga-del-terminal-borrando-logs-en-ubuntu/#comments</comments> <pubDate>Thu, 09 Feb 2012 11:49:15 +0000</pubDate> <dc:creator>shakaran</dc:creator> <category><![CDATA[Centos]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[software libre]]></category> <category><![CDATA[alias]]></category> <category><![CDATA[borrado]]></category> <category><![CDATA[config]]></category> <category><![CDATA[cron]]></category> <category><![CDATA[logrotate]]></category> <category><![CDATA[logs]]></category> <category><![CDATA[puppet]]></category> <category><![CDATA[repetitivo]]></category> <category><![CDATA[tarea]]></category> <category><![CDATA[terminal]]></category> <category><![CDATA[volumen]]></category> <category><![CDATA[zerolog]]></category> <category><![CDATA[zlog]]></category><guid isPermaLink="false">http://shakaran.net/blog/?p=1189</guid> <description><![CDATA[Por lo general, al iniciar alguna consola o terminal bash, se leen muchos archivos de configuración por defecto y se abren archivos para guardar los eventos de actividad que van ocurriendo. Aunque es útil, puede ralentizar un poco la carga del terminal. Normalmente, cuando un sistema lleva mucho tiempo en ejecución o ha pasado bastante [...]<br /><div><img src="http://shakaran.net/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>10</strong> (0 votes cast)</div><br />]]></description> <content:encoded><![CDATA[<div class="wpbuzzer_button" style="float: right"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-button" data-url="http://shakaran.net/blog/2012/02/acelerar-la-carga-del-terminal-borrando-logs-en-ubuntu/" data-imageurl=""></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div><div class="mceTemp mceIEcenter"><dl id="attachment_1190" class="wp-caption aligncenter" style="margin:auto;width: 310px;"><dt class="wp-caption-dt"><a href="http://shakaran.net/blog/wp-content/uploads/2012/02/terminal.png"><img class="size-medium wp-image-300" title="" src="http://shakaran.net/blog/wp-content/uploads/2012/02/terminal-300x300.png" alt="Terminal" width="300" height="300" /></a></dt></dl></div><p>Por lo general, al iniciar alguna consola o terminal bash, se leen muchos <strong>archivos de configuración</strong> por defecto y se abren archivos para guardar los <strong>eventos de actividad</strong> que van ocurriendo. Aunque es útil, puede <strong>ralentizar</strong> un poco la carga del terminal.</p><p>Normalmente, cuando un sistema lleva <strong>mucho tiempo en ejecución</strong> o ha pasado bastante tiempo desde que fue instalado por primera vez, se acumulan <strong>bastantes logs</strong> de actividad de diferentes procesos.</p><p><a title="Logrotate" href="https://iain.cx/src/logrotate/" target="_blank">Logrotate</a> es una buena utilidad, activada por defecto en la mayoría de distribuciones para los archivos más importantes y que generan <strong>mayor volumen</strong> de información. Es muy útil porque ademas comprime los logs y los borra pasado un tiempo.</p><p>El problema, es que no todas las configuraciones por defecto de logrotate suministradas por la distribución, pueden resultar útiles para todos los usuarios.</p><p>Aunque se puede optar por <strong>personalizar logrotate</strong> para los archivos necesarios,&nbsp;muchas veces se desconocen cuales son todos los archivos de logs o resulta demasiado tedioso ir configurando todos, incluso aunque utilices&nbsp;sistemas automatizados como <a title="Puppet Labs" href="http://puppetlabs.com/" target="_blank">Puppet</a>.</p><p>De ahí la necesidad de crear un pequeño script de bash, más radical (bajo responsabilidad del usuario) que previo respaldo de todos los logs en el home, <strong>borre todos</strong> los archivos de log más antiguos que una determinada fecha dada en días y tambien borre archivos rotados con logrotate.</p><p>Lo he llamado <em>zerolog</em> y este es código que realiza esas tareas:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Descargar <a href="http://shakaran.net/blog/wp-content/plugins/wp-codebox/wp-codebox.php?p=1189&amp;download=zelolog.sh">zelolog.sh</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11898"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
</pre></td><td class="code" id="p1189code8"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/env bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#    zerolog is a bash script for delete common logs on /var/log and</span>
<span style="color: #666666; font-style: italic;">#    avoid fill the disk with rotated files. It backups previously</span>
<span style="color: #666666; font-style: italic;">#    the logs on home folder and it can preserve logs older than</span>
<span style="color: #666666; font-style: italic;">#    a date given on days. This is useful for avoid slow sessions</span>
<span style="color: #666666; font-style: italic;">#    starts on bash terminals.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#    Copyright (C) 2012 by Ángel Guzmán Maeso, shakaran at gmail dot com</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#    This program is free software; you can redistribute it and/or modify</span>
<span style="color: #666666; font-style: italic;">#    it under the terms of the GNU General Public License as published by</span>
<span style="color: #666666; font-style: italic;">#    the Free Software Foundation; either version 3 of the License, or</span>
<span style="color: #666666; font-style: italic;">#    (at your option) any later version.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#    This program is distributed in the hope that it will be useful,</span>
<span style="color: #666666; font-style: italic;">#    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #666666; font-style: italic;">#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span style="color: #666666; font-style: italic;">#    GNU General Public License for more details.</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#    You should have received a copy of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;">#    along with this program; if not, write to the Free Software</span>
<span style="color: #666666; font-style: italic;">#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
&nbsp;
usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Usage: $0 [DAYS]'</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'DAYS: Remove logs older than DAYS. Default: 0 days'</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">id</span> -u<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Please, run this script as root'</span>
    usage
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">MTIME_DAYS</span>=<span style="color: #ff0000;">''</span>
<span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #007800;">MTIME_DAYS</span>=<span style="color: #ff0000;">'-mtime +$1'</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Currently logs <span style="color: #c20cb9; font-weight: bold;">size</span>: <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">du</span> <span style="color: #660033;">-hs</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">'print $1'</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Backup the log folder on home'</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> zcPf ~<span style="color: #000000; font-weight: bold;">/</span>logs-<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">'+%m-%d-%y-%H:%M:%S'</span><span style="color: #000000; font-weight: bold;">`</span>.tar.gz <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Removing rotated log files'</span>
<span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> f <span style="color: #007800;">$MTIME_DAYS</span> <span style="color: #660033;">-name</span> <span style="color: #000000; font-weight: bold;">*</span>.gz <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #ff0000;">'{}'</span> \;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Emptying the logs'</span>
<span style="color: #000000; font-weight: bold;">for</span> logs <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log <span style="color: #007800;">$MTIME_DAYS</span> <span style="color: #660033;">-type</span> f<span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$logs</span>; <span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> Currently logs <span style="color: #c20cb9; font-weight: bold;">size</span>: <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">du</span> <span style="color: #660033;">-hs</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #ff0000;">'print $1'</span><span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">`</span></pre></td></tr></table></div><p>El script esta subido a github en:</p><p><a href="https://github.com/shakaran/scripts/blob/master/zerolog.sh">https://github.com/shakaran/scripts/blob/master/zerolog.sh</a></p><p>Por si alguien quiere hacer fork, modificarlo o en un futuro hago nuevas modificaciones. Esta licenciado bajo <a title="GPLv3" href="http://gplv3.fsf.org/" target="_blank">GPLv3</a>.</p><h3><span style="color: #993300;">Ejemplos de uso</span></h3><p>Para usarlo, requiere ser <strong>administrador</strong>, ya que no todos los logs pueden borrarse como usuario regular.</p><p>Puede usarse como:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1189code9'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p11899"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code9"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>zerolog.sh</pre></td></tr></table></div><p>Que borrará todos los <strong>logs rotados</strong> y vaciara existentes, ademas de crear un backup previo en el home del tipo <tt>logs-&lt;FECHA&gt;.tar.gz</tt> con la fecha actual de la ejecución. Por si quieres <strong>conservar los logs</strong> o decides restaurarlos por algún motivo.</p><p>Si quieres borrar sólo los más <strong>antiguos de X días</strong>, por ejemplo los más antiguos de hace una semana:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1189code10'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p118910"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code10"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>zerolog.sh <span style="color: #000000;">7</span></pre></td></tr></table></div><p>Incluso puedes crearte un <strong>alias</strong>&nbsp;<em>zlog</em>:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1189code11'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p118911"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code11"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">zlog</span>=<span style="color: #ff0000;">&quot;sudo sh /ruta/zerolog.sh&quot;</span></pre></td></tr></table></div><p>También puedes añadir el script como una <strong>tarea cron</strong> y que se ejecute a diario, por ejemplo:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1189code12'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p118912"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code12"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> crontab <span style="color: #660033;">-e</span></pre></td></tr></table></div><p>Y añadir:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1189code13'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p118913"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code13"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #c20cb9; font-weight: bold;">sh</span> <span style="color: #000000; font-weight: bold;">/</span>ruta<span style="color: #000000; font-weight: bold;">/</span>zerolog.sh <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span></pre></td></tr></table></div><p>Por otro lado, si te importan poco tus logs o quieren guardar solo los más recientes, puedes optar por una <strong>opción más drástica</strong> como:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1189code14'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p118914"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code14"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-mtime</span> +<span style="color: #000000;">7</span> <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #ff0000;">'{}'</span> \;<span style="color: #000000; font-weight: bold;">&amp;</span>nbsp;<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span></pre></td></tr></table></div><br /><div><img src="http://shakaran.net/blog/wp-content/plugins/gd-star-rating/gfx.php?value=0.0" /></div><div>Rating: 0.0/<strong>10</strong> (0 votes cast)</div><br />]]></content:encoded> <wfw:commentRss>http://shakaran.net/blog/2012/02/acelerar-la-carga-del-terminal-borrando-logs-en-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <feedburner:origLink>http://shakaran.net/blog/2012/02/acelerar-la-carga-del-terminal-borrando-logs-en-ubuntu/</feedburner:origLink></item> <item><title>Instalar ZeroC Ice para Python en CentOS 5.7</title><link>http://feedproxy.google.com/~r/Shakaran/~3/7iVMsP6uKbA/</link> <comments>http://shakaran.net/blog/2012/02/instalar-zeroc-ice-para-python-en-centos-5-7/#comments</comments> <pubDate>Tue, 07 Feb 2012 11:37:06 +0000</pubDate> <dc:creator>shakaran</dc:creator> <category><![CDATA[CentOS]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Lenguaje C]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[Servidores]]></category> <category><![CDATA[software libre]]></category> <category><![CDATA[api]]></category> <category><![CDATA[aplicaciones]]></category> <category><![CDATA[aprendizaje]]></category> <category><![CDATA[arquitectura]]></category> <category><![CDATA[bindings]]></category> <category><![CDATA[centos]]></category> <category><![CDATA[compilar]]></category> <category><![CDATA[conexión]]></category> <category><![CDATA[distribuiido]]></category> <category><![CDATA[escalable]]></category> <category><![CDATA[free]]></category> <category><![CDATA[gpl]]></category> <category><![CDATA[ice]]></category> <category><![CDATA[nivel]]></category> <category><![CDATA[objetos]]></category> <category><![CDATA[plataforma]]></category> <category><![CDATA[python]]></category> <category><![CDATA[red]]></category> <category><![CDATA[repo]]></category> <category><![CDATA[repositorio]]></category> <category><![CDATA[software]]></category> <category><![CDATA[zeroc]]></category><guid isPermaLink="false">http://shakaran.net/blog/?p=1179</guid> <description><![CDATA[Ice o &#160;Internet Communications Engine&#160; es una plataforma middleware orientada a objetos, que permite escribir aplicaciones distribuidas con muy poco coste. Provee herramientas, APIs, bibliotecas y bindings para la construcciones de aplicaciones cliente-servidor de forma escalable. Es una buena herramienta de trabajo para entornos que sean bastante&#160;heterogéneos, donde el cliente y servidor puede estar escritos [...]<br /><div><img src="http://shakaran.net/blog/wp-content/plugins/gd-star-rating/gfx.php?value=10.0" /></div><div>Rating: 10.0/<strong>10</strong> (1 vote cast)</div><br />]]></description> <content:encoded><![CDATA[<div class="wpbuzzer_button" style="float: right"><a title="Post on Google Buzz" class="google-buzz-button" href="http://www.google.com/buzz/post" data-button-style="normal-button" data-url="http://shakaran.net/blog/2012/02/instalar-zeroc-ice-para-python-en-centos-5-7/" data-imageurl=""></a><script type="text/javascript" src="http://www.google.com/buzz/api/button.js"></script></div><div id="attachment_1180" class="wp-caption aligncenter" style="width: 310px"><a href="http://shakaran.net/blog/wp-content/uploads/2012/02/zeroc-ice-logo.jpg"><img class="size-full wp-image-1180" title="ZeroC Ice " src="http://shakaran.net/blog/wp-content/uploads/2012/02/zeroc-ice-logo.jpg" alt="ZeroC Ice logo" width="300" height="109" /></a><p class="wp-caption-text">ZeroC Ice logo</p></div><p>Ice o &nbsp;<a title="ZeroC Ice" href="http://zeroc.com/ice.html" target="_blank">Internet Communications Engine</a>&nbsp; es una <strong>plataforma middleware orientada a objetos</strong>, que permite escribir aplicaciones distribuidas con muy poco coste. Provee herramientas, APIs, bibliotecas y bindings para la construcciones de aplicaciones cliente-servidor de forma escalable.</p><p>Es una buena herramienta de trabajo para entornos que sean bastante&nbsp;<strong>heterogéneos</strong>, donde el cliente y servidor puede estar escritos en lenguajes de programación muy diferentes y ejecutarse sobre plataformas,&nbsp;sistemas operativos o&nbsp;arquitecturas muy variadas.</p><p>Su fuerte radica en un gran soporte de <strong>tecnologías de red</strong> con interacciones a bajo nivel de red, enfoque en la lógica de las aplicaciones y <strong>portabilidad</strong> de entornos muy diversos.</p><p>Otro punto fuerte a destacar es la&nbsp;<strong>abstracción&nbsp;de red</strong> para detalles como abrir conexiones de red, serializado y des-serializado de datos transmitidos por red, reintentos fallidos de conexión y muchos otros detalles más de bajo nivel que ayudan a simplificar la capa de red.</p><p>Soporta <strong>bindings</strong> con bastantes lenguajes de programación como:&nbsp;<br /> <a title="ZeroC Ice para C++" href="http://zeroc.com/icecpp.html" target="_blank">C++</a>,&nbsp;<a title="ZeroC Ice para .Net" href="http://zeroc.com/icedotnet.html" target="_blank">.NET</a>,&nbsp;<a title="ZeroC Ice para Java" href="http://zeroc.com/icej.html" target="_blank">Java</a>,<a title="ZeroC Ice para Python" href="http://zeroc.com/icepy.html" target="_blank">Python</a>,&nbsp;<a title="ZeroC Ice para Objetive-C" href="http://zeroc.com/iceobjc.html" target="_blank">Objective-C</a>,&nbsp;<a title="ZeroC Ice para Ruby" href="http://zeroc.com/iceruby.html" target="_blank">Ruby</a>,&nbsp;<a title="ZeroC Ice para PHP" href="http://zeroc.com/icephp.html" target="_blank">PHP</a>, y&nbsp;<a title="ZeroC Ice para ActionScript" href="http://zeroc.com/iceas.html" target="_blank">ActionScript</a>.</p><p>Debido a estas características Ice es <a title="Clientes de ZeroC Ice" href="http://www.zeroc.com/customers.html" target="_blank">usado por muchas compañias</a> con misiones críticas en el mundo. La <strong>curva de aprendizaje es sencilla</strong> y existe una gran infraestructura de aplicaciones técnicas que se demandan.</p><p>Ice es software libre bajo licencia&nbsp;<a title="Licencia GPLv2" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" target="_blank">GPLv2</a>&nbsp;y comercializado bajo la marca <a title="ZeroC ICE" href="http://zeroc.com" target="_blank">ZeroC</a>.</p><h3><span style="color: #993300;">Instalación con repositorio</span></h3><p>Esta opción de instalación es sencilla y cómoda, pero no esta aconsejada para desarrolladores que necesiten <strong>actualizaciones</strong> con bastante frecuencia o disponer de una versión determinada.</p><p>Descargar el repo (en estos momentos de escribir el artículo para la versión 3.4) desde la página web oficial:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1179code20'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117920"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1179code20"><pre class="bash" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;"># wget http://download.zeroc.com/Ice/3.4/rhel6/zeroc-ice-rhel6.repo -O /etc/yum.repos.d/zeroc-ice-rhel6.repo</span></pre></td></tr></table></div><p>Activar el repositorio e instalar ZeroC Ice y biblioteca Ice para Python:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1179code21'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117921"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1179code21"><pre class="bash" style="font-family:monospace;"> <span style="color: #666666; font-style: italic;"># yum --enablerepo zeroc-ice install -y ice ice-python</span></pre></td></tr></table></div><h3><span style="color: #993300;">Instalación desde fuentes</span></h3><p>Si tu necesidad esta más orientada al <strong>enfoque desarrollador</strong>, puedes compilar la versión que requieras o en desarrollo. En el momento de escribir este artículo se compila para la versión 3.4.2 de Ice.</p><p>Instalar <a title="mcpp: Portable C preprocessor" href="http://mcpp.sourceforge.net/" target="_blank">portable C preprocessor</a> desde el repo de ZeroC Ice (también puedes optar por <a title="Descargar mccp" href="http://mcpp.sourceforge.net/download.html" target="_blank">bajar y compilar los fuentes de mcpp</a>, pero no es necesario):</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1179code22'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117922"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1179code22"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install -y mcpp-devel</span></pre></td></tr></table></div><p>Después <strong>bajamos los fuentes</strong> de Ice, descomprimimos y compilamos la versión en C++ y su binding para Python (en este caso para la versión 3.4.2 de Ice). Puedes hacerlo todo en una línea con:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1179code23'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117923"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1179code23"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># wget http://zeroc.com/download/Ice/3.4/Ice-3.4.2.tar.gz;&amp;nbsp;tar xvzf Ice-*.tar.gz; cd Ice-*/cpp; make; make install; cd ../py/; make;make install</span></pre></td></tr></table></div><p>La instalación de Ice quedará bajo&nbsp;<tt>/opt/Ice-3.4.2/</tt> y el binding python sobre&nbsp;<tt>/opt/Ice-3.4.2/python</tt>. Es importante recalcar que el binding python se asociara con la versión de defecto de Python en el sistema si dispones de varias.</p><p>Por último, es necesario indicar el el <tt>PATH</tt> y el <tt>PYTHONPATH</tt> del sistema, donde se encuentra la instalación de Ice y su binding de Python:</p><div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1179code24'); return false;">Ver código</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p117924"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1179code24"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># export PATH=/opt/Ice-3.4.2/bin:$PATH</span>
<span style="color: #666666; font-style: italic;"># export PYTHONPATH=/opt/Ice-3.4.2/python:$PYTHONPATH</span></pre></td></tr></table></div><p>&nbsp;</p> <br /><div><img src="http://shakaran.net/blog/wp-content/plugins/gd-star-rating/gfx.php?value=10.0" /></div><div>Rating: 10.0/<strong>10</strong> (1 vote cast)</div><br />]]></content:encoded> <wfw:commentRss>http://shakaran.net/blog/2012/02/instalar-zeroc-ice-para-python-en-centos-5-7/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <feedburner:origLink>http://shakaran.net/blog/2012/02/instalar-zeroc-ice-para-python-en-centos-5-7/</feedburner:origLink></item> </channel> </rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching using memcached
Object Caching 1460/1680 objects using memcached

Served from: shakaran.net @ 2012-05-17 07:18:04 -->

