<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Andrés J. Díaz</title>
	<atom:link href="http://ajdiaz.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ajdiaz.wordpress.com</link>
	<description>Tips and tricks for system administration</description>
	<lastBuildDate>Wed, 23 Dec 2009 23:23:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ajdiaz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2e3e45fcc57489501b042e4119949cb4?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Andrés J. Díaz</title>
		<link>http://ajdiaz.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ajdiaz.wordpress.com/osd.xml" title="Andrés J. Díaz" />
		<item>
		<title>python module to handle runit and daemontools supervised services</title>
		<link>http://ajdiaz.wordpress.com/2009/12/23/python-module-to-handle-runit-and-daemontools-supervised-services/</link>
		<comments>http://ajdiaz.wordpress.com/2009/12/23/python-module-to-handle-runit-and-daemontools-supervised-services/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 22:56:04 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[systems]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=80</guid>
		<description><![CDATA[Last month I needed to install runit in some servers to supervise a couple of services. Unfortunately my management interface cannot handle the services anymore, so I decided to write a small module in python to solve this handicap, and that is the result!.
With this module you can handle in python environment a number of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=80&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last month I needed to install <a href="http://smarden.org/runit/">runit</a> in some servers to supervise a couple of services. Unfortunately my management interface cannot handle the services anymore, so I decided to write a small module in python to solve this handicap, and <a href="http://pastebin.com/pastebin.php?dl=f3e7ff3c4">that is the result!</a>.</p>
<p>With this module you can handle in python environment a number of runit scripts. I think that this might be work for daemontools too, but I do not test yet. Let&#8217;s see an example <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><code><br />
&gt;&gt;&gt; import supervise<br />
&gt;&gt;&gt; c = supervise.Service("/var/service/httpd")<br />
&gt;&gt;&gt; print s.status()<br />
{'action': None, 'status': 0, 'uptime': 300L, 'pid': None}<br />
&gt;&gt;&gt; if s.status()['status'] == supervise.STATUS_DOWN: print "service down"<br />
service down<br />
&gt;&gt;&gt; s.start()<br />
&gt;&gt;&gt; if s.status()['status'] == supervise.STATUS_UP: print "service up"<br />
service up<br />
</code></p>
<p>Personally I use this module with <a href="http://rpyc.wikidot.com/">rpyc</a> library to manage remotely the services running in a host, but it too easy making a web interface, for example using <a href="http://bottle.paws.de/">bottle</a>:</p>
<p><code><br />
import supervise<br />
import simplejson<br />
from bottle import route, run</p>
<p>@route('/service/status/:name')<br />
def service_status(name):<br />
   """ Return a json with service status """<br />
   return simplejson.dumps( supervise.Service("/var/service/" +<br />
name).status() )</p>
<p>@route('/service/up/:name')<br />
def service_up(name):<br />
    """ Start the service and return OK """<br />
    c = supervise.Service("/var/service/" + name)<br />
    c.start()<br />
    return "OK UP"</p>
<p>@route('/service/down/:name')<br />
def service_down(name):<br />
    """ Stop the service and return OK """<br />
    c = supervise.Service("/var/service/" + name)<br />
    c.down()<br />
    return "OK DOWN"</p>
<p>from bottle import PasteServer<br />
run(server=PasteServer)<br />
</code></p>
<p>Now you can stop your service just only point your browser <a href="http://localhost/service/down/httpd" rel="nofollow">http://localhost/service/down/httpd</a> (to down http service in this case).</p>
<p>Enjoy!</p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=80&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2009/12/23/python-module-to-handle-runit-and-daemontools-supervised-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>libnsss_map library</title>
		<link>http://ajdiaz.wordpress.com/2009/11/21/the-libnss_map-module-is-a-nss-library-t/</link>
		<comments>http://ajdiaz.wordpress.com/2009/11/21/the-libnss_map-module-is-a-nss-library-t/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 18:41:59 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[distribute]]></category>
		<category><![CDATA[nss]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[systems]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/2009/11/21/the-libnss_map-module-is-a-nss-library-t/</guid>
		<description><![CDATA[Last week I was working on libnss_map, aNSS library module to map user credentials to existent user in the system. This module is intended to be used in high virtualized environment like cloud computing or embedded systems which require a lot of users.
When a new user has been authenticated by PAM or other authentication mechanism, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=73&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last week I was working on <a href="http://connectical.com/projects/libnss-map">libnss_map</a>, aNSS library module to map user credentials to existent user in the system. This module is intended to be used in high virtualized environment like cloud computing or embedded systems which require a lot of users.</p>
<p>When a new user has been authenticated by PAM or other authentication mechanism, then the nss_map module create a virtual user when credentials mapped to an existent user. For example, suppose here are a user virtual, created a la standard way on /etc/passwd:</p>
<pre>
    virtual:x:15000:15000:virtual user for nss_map:/dev/null:/sbin/nologin
</pre>
<p>Then edit the /etc/nssmap.conf<br />
file:</p>
<pre>
    virtual:x:15000:15000:virtual user for nss_map:/home/virtual:/bin/bash
</pre>
<p>Note that the user directory is really a base dir in nssmap, each new user can search their home in <code>/home/virtual/logname</code>, where logname is the name used by user to login, and the /home/virtual is the prefix setted in <code>nssmap.conf</code>.</p>
<p>As usual, you can get the project from <a href="http://connectical.com/projects/libnss-map" rel="nofollow">http://connectical.com/projects/libnss-map</a>.</p>
<p>Enjoy!</p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=73&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2009/11/21/the-libnss_map-module-is-a-nss-library-t/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>/proc and /sys tricks</title>
		<link>http://ajdiaz.wordpress.com/2009/06/20/proc-and-sys-tricks/</link>
		<comments>http://ajdiaz.wordpress.com/2009/06/20/proc-and-sys-tricks/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 19:50:25 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=64</guid>
		<description><![CDATA[Really the sysfs and /proc filesystems are worlds of magic and fantasy. Each day I discover a new trick using this filesystems. So, I decided to post a short summary of my favorites ones. Enjoy and feel free to add your tricks in comments, maybe we can a /proc and /sys knownledge database in a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=64&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Really the sysfs and /proc filesystems are worlds of magic and fantasy. Each day I discover a new trick using this filesystems. So, I decided to post a short summary of my favorites ones. Enjoy and feel free to add your tricks in comments, maybe we can a /proc and /sys knownledge database in a post <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>1. Scanning for LUNs in attached FC<br />
<code>echo "- - -" &gt; /sys/class/scsi_host/hostX/scan</code></p>
<p>2. CPU hotplug<br />
<code>echp 0 &gt; /sys/devices/system/cpu/cpuX/online</code></p>
<p>Obviously when run echo 1, put the CPU online again</p>
<p>3. Enable dmesg timestamp<br />
<code>echo Y &gt; /sys/modules/prinkt/parameters/time</code></p>
<p>4. Restore a removed file when is still in use<br />
<code>cat /proc/<em>pid</em>/fd/<em>descriptor number</em> &gt; /tmp/myfile_restored</code></p>
<p>5. Get the IO operations for a process:<br />
<code>cat /proc/<em>pid</em>/io</code><br />
The <tt>syscr</tt> and the <tt>syscw</tt> are the accumulated read and write IO operations that process do where running.</p>
<p>6. Increase size of IO scheduler queue:<br />
<code> echo 10000 &gt; /sys/block/device/queue/nr_request</code></p>
<p>7. Get the current IO scheduler enabed to a specific device:<br />
<code> cat /sys/block/device/queue/scheduler</code></p>
<p>8. Get the threads of pdflush process which are running:<br />
<code>cat /proc/sys/vm/nr_pdflush_threads</code></p>
<p>9. Set the percentage threshold for memory to start to flushd data to disk:<br />
<code>echo XX &gt; /proc/sys/vm/dirty_background_ratio</code></p>
<p>10. Set the sleep time for pdflush checking (in centisecs):<br />
<code>echo XXX &gt; /proc/sys/vm/dirty_writeback_centisecs</code></p>
<p>11. Set the time to live for a data in buffer, when raises, data will commit to disk (in centisecs):<br />
<code>echo XXX &gt; /proc/sys/vm/dirty_expire_centisecs</code></p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=64&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2009/06/20/proc-and-sys-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Distributed tools</title>
		<link>http://ajdiaz.wordpress.com/2009/04/03/distributed-tools/</link>
		<comments>http://ajdiaz.wordpress.com/2009/04/03/distributed-tools/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 18:29:22 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[gentoo]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/2009/04/03/distributed-tools/</guid>
		<description><![CDATA[For last months I needed to maintain a number of heterogeneous servers for mi work, I need to do some usually actions, like update a config file, restart a service, create local users etc. 
For this purposes there are a lot of applications, like dsh (or full csm), pysh, shmux and many others (only need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=60&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For last months I needed to maintain a number of heterogeneous servers for mi work, I need to do some usually actions, like update a config file, restart a service, create local users etc. </p>
<p>For this purposes there are a lot of applications, like dsh (or full csm), pysh, shmux and many others (only need to perform a search in google using phrase &#8220;distributed shell&#8221;). Unfortunately for me, I want a easy-to-parse solution, because I&#8217;ve a big (really big) number of servers, and I want a single cut-based/awk parsing, and also I need to do some actions as other users (like root, for example) via sudo. Althought many of the existants solutions offers me a subset of this features, I cannot found a complete solution. So I decided to create one <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>You can find the code, and some packages in the <a href="https://connectical.com/projects/dtools">dtools</a> development site. I was use this solution in production environment from months with excelent results, and you can feel free to use.</p>
<p>Of course, its free (of freedom) software, distributed under MIT license.</p>
<p>Enjoy and remember: feedback are welcome <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=60&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2009/04/03/distributed-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>bash4 is out!</title>
		<link>http://ajdiaz.wordpress.com/2009/02/24/bash4-is-out/</link>
		<comments>http://ajdiaz.wordpress.com/2009/02/24/bash4-is-out/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:00:42 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=57</guid>
		<description><![CDATA[Yerterday (monday 23 of Feb) the GNU team released a new version of bash.
This new version contains a lot of interesting features, for example asociative arrays (yep!), autocd &#8230; and more!
The notices was published in the bash mailing list.       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=57&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yerterday (monday 23 of Feb) the GNU team released a new version of <a href="http://en.wikipedia.org/wiki/Bash">bash</a>.</p>
<p>This new version contains a lot of interesting features, for example asociative arrays (yep!), autocd &#8230; and more!</p>
<p>The notices was published in the <a href="http://www.mail-archive.com/cygwin@cygwin.com/msg94439.html">bash mailing list</a>.</p>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=57&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2009/02/24/bash4-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>netstrings implementation</title>
		<link>http://ajdiaz.wordpress.com/2008/08/09/netstrings-implementation/</link>
		<comments>http://ajdiaz.wordpress.com/2008/08/09/netstrings-implementation/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 16:27:39 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=52</guid>
		<description><![CDATA[This week I publish a tiny library to manage netstrings, as described in Bernstein&#8217;s paper. This library is wirten in C and provide a very basic implementation for small applications. I use this library in some projects for months, and now a publish the code over MIT License in launchpad.
You can visit the page of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=52&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This week I publish a tiny library to manage <a href="http://cr.yp.to/proto/netstrings.txt">netstrings</a>, as described in <a href="http://en.wikipedia.org/wiki/Daniel_J._Bernstein">Bernstein</a>&#8217;s paper. This library is wirten in C and provide a very basic implementation for small applications. I use this library in some projects for months, and now a publish the code over <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a> in launchpad.</p>
<p>You can visit the <a href="http://launchpad.net/netstr">page of the project in launchpad</a>, or get the code via bzr:</p>
<pre>
bzr get lp:netstr
</pre><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ajdiaz.wordpress.com/52/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ajdiaz.wordpress.com/52/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=52&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2008/08/09/netstrings-implementation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>pkgcore experience</title>
		<link>http://ajdiaz.wordpress.com/2008/05/10/pkgcore-experience/</link>
		<comments>http://ajdiaz.wordpress.com/2008/05/10/pkgcore-experience/#comments</comments>
		<pubDate>Sat, 10 May 2008 15:57:57 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[gentoo systems pkgcore config]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=46</guid>
		<description><![CDATA[Last days I reinstalled my Gentoo in my desktop computer, a Dell Dimension C521 using the new package handler pkgcore.
The last months I&#8217;ve use official portage, and also new replacement called paludis. The main advantage of this one is being written entirely in C++, so paludis is very fast, but also you can detect some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=46&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last days I reinstalled my <a href="http://gentoo.org">Gentoo</a> in my desktop computer, a <a href="http://en.wikipedia.org/wiki/Dell_Dimension">Dell Dimension C521</a> using the new package handler <a href="http://pkgcore.org"><em>pkgcore</em></a>.</p>
<p>The last months I&#8217;ve use official portage, and also new replacement called <a href="http://paludis.pioto.org/"><em>paludis</em></a>. The main advantage of this one is being written entirely in C++, so paludis is very fast, but also you can detect some problems when you need to compile some &#8220;specials&#8221; packages, such qemu, which requires to be compiled with gcc3. If you compile paludis with another version of gcc, you can find a beauty error related to dynamic linking. Obviously, you can solve this problem by hand or with sonme tricks <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , but I don&#8217;t like tricks in production machines.</p>
<p><span id="more-46"></span></p>
<p>This week I finished to install my desktop computer using pkgcore. Pkgcore is another replacement of portage, written in python, but with some critical pieces in <a href="http://en.wikipedia.org/wiki/C_(programming_language)">C</a> (yes, the old reliable C), and I was surprised with the status of the development. The last time I had seen pkgcore was really unstable and very confusing for me, so I was decided to try paludis, which was more stable and mature. But, in this case, pkgcore exceeded my expectations.</p>
<p>In my opinion the strengths of pkgcore are:</p>
<ul>
<li>fast (similar to paludis, in my experience)</li>
<li>easy to use (portage compatible syntax)</li>
<li>portage compatible configuration</li>
<li>agnostics about compiler (avoid the qemu problem)</li>
<li>well colored <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </li>
</ul>
<p>But nobody is perfect, so pkgcore has some disadvantages also:</p>
<ul>
<li>Arg! configuration file is the hell!</li>
<li>Errors has special syntax, you need some practice to understand</li>
<li>Very strict with no-clean packages in portage (for example when install into /lib instead to use <code>get_lib_dir</code>). I&#8217;m not sure if it&#8217;s a real disadvantage.</li>
</ul>
<p>I put my <tt>pkgcore.conf</tt> file in <a href="http://pastebin.com/f14084a0a">pastebin</a>. I hope to be usefull <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ajdiaz.wordpress.com/46/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ajdiaz.wordpress.com/46/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=46&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2008/05/10/pkgcore-experience/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Physics at MIT</title>
		<link>http://ajdiaz.wordpress.com/2008/03/18/physics-at-mit/</link>
		<comments>http://ajdiaz.wordpress.com/2008/03/18/physics-at-mit/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 21:18:19 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=45</guid>
		<description><![CDATA[I see in the “People of the Web” the last interview to the Professor Walter Lewin, at MIT. I have no comments about him and his classes, only two comments: 1) the great phrase: “Physics work!”, and 2) can other people regarded teacher? I don&#8217;t need to think more about it&#8230;     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=45&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I see in the “<a href="http://potw.news.yahoo.com/">People of the Web</a>” the last interview to the Professor Walter Lewin, at MIT. I have no comments about him and his classes, only two comments: 1) the great phrase: “Physics work!”, and 2) can <a href="http://www.fic.udc.es">other people</a> regarded teacher? I don&#8217;t need to think more about it&#8230;</p><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ajdiaz.wordpress.com/45/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ajdiaz.wordpress.com/45/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=45&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2008/03/18/physics-at-mit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
		<item>
		<title>Entanglement: the greatest mystery in physics</title>
		<link>http://ajdiaz.wordpress.com/2008/03/16/entanglement-the-greatest-mystery-in-physics/</link>
		<comments>http://ajdiaz.wordpress.com/2008/03/16/entanglement-the-greatest-mystery-in-physics/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 00:09:56 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[quantum]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=44</guid>
		<description><![CDATA[
Last days I was read the book titled “Entanglement: The greatest mystery in physics”, which is written by Ph.D. Amir D. Aczel, famous for his books about physics. This one is about quantum physics, particularly the entanglement phenomenon. The entanglement is an effect of quantum objects (if we can call them “objects”) consists in a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=44&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div style="float:left;margin:0.5em;"><a href='http://ajdiaz.files.wordpress.com/2008/03/156858232301lzzzzzzz.jpg' title='Book cover'><img src='http://ajdiaz.files.wordpress.com/2008/03/156858232301lzzzzzzz.thumbnail.jpg' alt='Book cover' /></a></div>
<p>Last days I was read the book titled “Entanglement: The greatest mystery in physics”, which is written by Ph.D. <a href="http://en.wikipedia.org/wiki/Amir_Aczel">Amir D. Aczel</a>, famous for his books about physics. This one is about quantum physics, particularly the <a href="http://en.wikipedia.org/wiki/Quantum_entanglement">entanglement phenomenon</a>. The entanglement is an effect of quantum objects (if we can call them “objects”) consists in a relation between the quantum state of implicated objects, so when we alter one of them, the others “know” <em>automagically</em> the change, even though the objects are spatially separated.</p>
<p>I&#8217;m surprised at how easy is to read, it&#8217;s funny and clearly (as much as quantum theory allows) and I recommended to people who are interesting in quantum theory and it&#8217;s history. </p><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ajdiaz.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ajdiaz.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=44&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2008/03/16/entanglement-the-greatest-mystery-in-physics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>

		<media:content url="http://ajdiaz.files.wordpress.com/2008/03/156858232301lzzzzzzz.thumbnail.jpg" medium="image">
			<media:title type="html">Book cover</media:title>
		</media:content>
	</item>
		<item>
		<title>bash ini parser</title>
		<link>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/</link>
		<comments>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 18:42:07 +0000</pubDate>
		<dc:creator>ajdiaz</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ajdiaz.wordpress.com/?p=40</guid>
		<description><![CDATA[In some situations i like to use INI files as configuration files, as python do. But bash do not provide a parser for these files, obviously you can use a awk code or a couple of sed calls, but if you are bash-priest and do not want to use nothing more, then you can try [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=40&subd=ajdiaz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In some situations i like to use INI files as configuration files, as python do. But bash do not provide a parser for these files, obviously you can use a awk code or a couple of sed calls, but if you are bash-priest and do not want to use nothing more, then you can try the following obscure code:</p>
<pre>
cfg.parser () {
    IFS=$'\n' &amp;&amp; ini=( $(&lt;$1) )              # convert to line-array
    ini=( ${ini[*]//;*/} )                   # remove comments
    ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix
    ini=( ${ini[*]/%]/ \(} )                 # convert text2function (1)
    ini=( ${ini[*]/=/=\( } )                 # convert item to array
    ini=( ${ini[*]/%/ \)} )                  # close array parenthesis
    ini=( ${ini[*]/%\( \)/\(\) \{} )         # convert text2function (2)
    ini=( ${ini[*]/%\} \)/\}} )              # remove extra parenthesis
    ini[0]=''                                # remove first element
    ini[${#ini[*]} + 1]='}'                  # add the last brace
    eval "$(echo "${ini[*]}")"               # eval the result
}
</pre>
<p></p>
<p>And then you can parse your ini files as following:</p>
<pre>
# parse the config file called 'myfile.ini', with the following
# contents::
#   [sec2]
#   var2='something'
cfg.parser 'myfile.ini'

# enable section called 'sec2' (in the file [sec2]) for reading
cfg.section.sec2

# read the content of the variable called 'var2' (in the file
# var2=XXX). If your var2 is an array, then you can use
# ${var[index]}
echo "$var2"
</pre>
<p></p>
<p>Unfortunately, the cfg.parser() function do no support embedded spaces<br />
in section names&#8230; yet</p><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/ajdiaz.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/ajdiaz.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ajdiaz.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ajdiaz.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ajdiaz.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ajdiaz.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ajdiaz.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ajdiaz.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ajdiaz.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ajdiaz.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ajdiaz.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ajdiaz.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ajdiaz.wordpress.com&blog=630003&post=40&subd=ajdiaz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ajdiaz.wordpress.com/2008/02/09/bash-ini-parser/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ffc718cc95b66ed168d0d4b8d88f885c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ajdiaz</media:title>
		</media:content>
	</item>
	</channel>
</rss>