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

<channel>
	<title>Solusan &#187; Gentoo</title>
	<atom:link href="http://www.solusan.com/blog/gentoo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.solusan.com</link>
	<description>..:: Solusan - Otro blog más ::..</description>
	<lastBuildDate>Thu, 25 Aug 2011 16:39:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=120</generator>
		<item>
		<title>How To: Getting Started with Amazon EC2</title>
		<link>http://www.solusan.com/how-to-getting-started-with-amazon-ec2.html</link>
		<comments>http://www.solusan.com/how-to-getting-started-with-amazon-ec2.html#comments</comments>
		<pubDate>Sun, 13 Feb 2011 16:18:03 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[CentoOS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DragonFlyBSD]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.solusan.com/?p=1395</guid>
		<description><![CDATA[Así.. sin valium y sin nada: Amazon EC2 is among the more potent items in Amazon&#8217;s web services arsenal. You&#8217;ve probably heard of many of the other services such as S3 for storage and FPS for payments. EC2 is all about the &#8220;elastic compute cloud.&#8221; In layman&#8217;s terms, it&#8217;s a server. In slightly less layman&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Así.. sin valium y sin nada:</p>
<p><a href="http://www.amazon.com/gp/browse.html?node=201590011">Amazon EC2</a> is among the more potent items in Amazon&#8217;s web services arsenal. You&#8217;ve  probably heard of many of the other services such as S3 for storage and  FPS for payments. EC2 is all about the &#8220;elastic compute cloud.&#8221; In  layman&#8217;s terms, it&#8217;s a server. In slightly less layman&#8217;s terms, EC2 lets  you easily run and manage many instances (like servers) and  given the proper software and configurations, have a scalable platform  for your web application, outsource resource-intensive tasks to EC2 or  for whatever you would use a server farm.</p>
<p>There are three different <a href="http://www.amazon.com/Instances-EC2-AWS/b/ref=sc_fe_c_0_201590011_2?ie=UTF8&amp;node=370375011&amp;no=201590011&amp;me=A36L942TSJ2AJA">sizes of EC2 instances</a> you can summon and they&#8217;re all probably more powerful than the server  currently running your blog. Unless you&#8217;re offloading video processing  or something intense to EC2, the default small instance with its 1.7GB  of RAM and 160GB disk should be more than fine. It&#8217;s just nice to know  that if for any reason I need a farm of machines each with 15GB of RAM, I  can get that easily.</p>
<p>EC2 has been around for a while but has gained interest in the last  few weeks as Amazon released an elastic IP feature. One of the larger  EC2 issues deals with data persistence on instances. There are many  limitations with EC2 that make it difficult to use unless you carefully  build around the EC2 architecture and don&#8217;t just assume that you can  move your app to EC2 flawlessly. If an instance crashes and you run it  again, you&#8217;ll loose data and when the instance comes back up it will  have a new IP, adding another hurdle with DNS issues. Fortunately, the  elastic IP feature lets you assign a static IP address to your  instances.</p>
<p>As the title of this article implies, this article is meant to be a  beginner&#8217;s look into tinkering with EC2. Just because you will be able  to host a page on EC2 at the end of this article does not mean you  should start using it as your only server. Many considerations need to  be made when using EC2 to get around the data persistence issue. If your  startup is looking to use EC2 as a scalable platform, fortunately there  are many services that have already built stable systems on top of EC2,  ready for your consumption: <a href="http://weoceo.weogeo.com/">WeoCeo</a>, <a href="http://code.google.com/p/scalr/">Scalr</a> and <a href="http://www.rightscale.com/">RightScale</a>. Enough talk, shall we jump right in?</p>
<p><strong>Note:</strong> Most of the information below (and more) is available in the EC2 API doc if you enjoy reading those things.</p>
<h4><span id="more-1395"></span>Getting Started</h4>
<p>In order to interact with any EC2 instances, you&#8217;ll need to install  Amazon&#8217;s command line tools and download your X.509 certificate from  Amazon. Let&#8217;s start with the certificate. Login to your Amazon account  and visit the AWS Access Identifiers page. In the X.509 certificate  section near the bottom, click <strong>Create New</strong>. You&#8217;ll be  greeted with a page allowing you to download both the private key file  and X.509 certificate. Both of these are very important, download them  to your desktop so you don&#8217;t lose them.</p>
<div><a href="http://www.solusan.com/wp-content/2011/02/amazon_aws_create_x509.jpg"><img class="aligncenter size-full wp-image-1400" title="amazon_aws_create_x509" src="http://www.solusan.com/wp-content/2011/02/amazon_aws_create_x509.jpg" alt="" width="500" height="211" /></a></div>
<p>Next up, grab the <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&amp;categoryID=88">EC2 command line tools</a>. Extract them and you should be left with a folder named something like <em>ec2-api-tools-1.3-19403</em>. We&#8217;ll move those to a directory where we will also store the private and public keys.</p>
<p>The commands below assume you are working on an OS X machine in the Terminal.</p>
<pre><code>
mkdir ~/.ec2
cd ~/Desktop
mv *.pem ~/.ec2
cd ~/Desktop/ec2-api-tools-1.3-19403/  #depends on ec2 tools folder name
mv * ~/.ec2
</code></pre>
<p>This is what your .ec2 folder should have now.</p>
<div><a title="Amazon EC2 Folder" href="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_howto_folder_800.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/ec2_howto_folder.jpg"><img class="aligncenter size-full wp-image-1402" style="border: 1px solid black;" title="ec2_howto_folder" src="http://www.solusan.com/wp-content/2011/02/ec2_howto_folder.jpg" alt="" width="500" height="181" /></a></div>
<p>Next up, we&#8217;ll set some paths in your bash profile so the OS knows where the EC2 tools are located.</p>
<p><code>sudo vi ~/.bash_profile</code></p>
<p>Add these lines, replacing &#8220;YOURKEYNAME&#8221; with the actual file name of your private and public keys, then save.</p>
<pre><code>
export EC2_HOME=~/.ec2
export PATH=$PATH:$EC2_HOME/bin
export EC2_PRIVATE_KEY=pk-YOURKEYNAME.pem
export EC2_CERT=cert-YOURKEYNAME.pem
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home/
</code></pre>
<p>To get the changes noticed by the OS immediately, run <em>source</em>.</p>
<p><code>source ~/.bash_profile</code></p>
<p>Now we can actually use those helpful EC2 command line tools.</p>
<h4>AMIs, Keypairs and Instances, Oh My!</h4>
<p>Before proceeding, you&#8217;ll need to grok the concept of AMIs. They are  Amazon Machine Images and whenever you create an EC2 instance, an AMI is  quickly loaded on the machine. They&#8217;re essentially images of the OS. If  you terminate an instance and bring it up again, your machine will only  have the data initially included in the image. That&#8217;s why lots of work  goes into making (&#8220;bundling&#8221;) a good image you will always use that has  the configurations and software you need so you don&#8217;t have to do much  whenever you load the image. This article won&#8217;t delve into creating your  own AMIs but fortunately there are many great, public AMIs available  for use.</p>
<p>To SSH into the instance we&#8217;ll create from an AMI we find, we&#8217;ll need  to create a keypair. This is a different key from the one provided to  us by Amazon. That was for using the EC2 tools and interacting with the  instances in terms of creation and management. To actually SSH into an  instance, a separate keypair is required as there are no passwords by  default.</p>
<pre><code>
cd ~/.ec2 #we pretty much always need to be here
ec2-add-keypair pstam-keypair
</code></pre>
<p>That will print out the private key, which you&#8217;ll need to copy and paste into a file manually.</p>
<div><a title="Amazon EC2 - Adding a keypair" href="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_keypair_529.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/ec2_keypair.jpg"><img class="aligncenter size-full wp-image-1403" title="ec2_keypair" src="http://www.solusan.com/wp-content/2011/02/ec2_keypair.jpg" alt="" width="500" height="189" /></a></div>
<pre><code>
vi ~/.ec2/id_rsa-pstam-keypair
#now paste the private key and save
sudo chmod 600 id_rsa-pstam-keypair
</code></pre>
<p>Now we can find which AMI we want to toss on our yet-to-be-created EC2 instance.</p>
<pre><code>
cd ~/.ec2
ec2-describe-images -a
</code></pre>
<p>Using the <em>-a</em> option will list all of the AMIs you have  access to, and there are a lot. Alternatively you can list just the  images Amazon has:</p>
<pre><code>
ec2-describe-images -o amazon
</code></pre>
<div><a title="Amazon EC2 AMIs" href="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_images_1000.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/ec2_images.jpg"><img class="aligncenter size-full wp-image-1405" title="ec2_images" src="http://www.solusan.com/wp-content/2011/02/ec2_images.jpg" alt="" width="500" height="211" /></a></div>
<p>I found an AMI that I&#8217;ll try out.</p>
<blockquote><p>ami.yyang.info/gentoo-nginx-php-mysql-06feb2008.manifest.xml</p></blockquote>
<p>It&#8217;s a Gentoo Linux install with PHP, MySQL and nginx. When looking at AMIs, you need to find the AMI ID. In this case, it&#8217;s <em>ami-6138dd08</em>.</p>
<p><code> ec2-run-instances ami-6138dd08 -k pstam-keypair </code></p>
<p>The instance is now being loaded with the AMI I selected and booting  up. It should output some text with &#8220;RESERVATION&#8221; and &#8220;INSTANCE&#8221; rows.  On the instance row, it will say something like <em>pending pstam-keypair</em> until it has fully booted up. When an instance is ready to go, its URL  and internal address will be supplied with the ec2din command below.</p>
<p><code> ec2-describe-instances </code></p>
<div><a title="Amazon EC2 Describe Instances" href="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_describe_instances_600.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/ec2_describe_instances.jpg"><img class="aligncenter size-full wp-image-1406" title="ec2_describe_instances" src="http://www.solusan.com/wp-content/2011/02/ec2_describe_instances.jpg" alt="" width="500" height="49" /></a></div>
<p>If you try to access the URL in a browser, nothing will happen just  yet as the firewall blocks all ports by default. You&#8217;ll have to open up  the ones you need. We&#8217;ll do port 80 for HTTP and 22 for SSH. If the AMI  you are running doesn&#8217;t have a web server installed, accessing the EC2  URL in a browser won&#8217;t bring up anything regardless.</p>
<pre><code>
ec2-authorize default -p 22
ec2-authorize default -p 80
</code></pre>
<p>If you want to undo any port authorizations you&#8217;ve made, you can use <em>ec2-revoke</em>.  Now if you access your EC2 URL in a browser you&#8217;ll get something like a  default Apache page, or in the case of the AMI I&#8217;m using, a phpinfo()  page.</p>
<div><a title="EC2 Instance loaded in Firefox" href="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_phpinfo_ffox_850.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/ec2_phpinfo_ffox.jpg"><img class="aligncenter size-full wp-image-1407" title="ec2_phpinfo_ffox" src="http://www.solusan.com/wp-content/2011/02/ec2_phpinfo_ffox.jpg" alt="" width="500" height="161" /></a></div>
<p>The next step to actually using your new EC2 instance is SSHing into  it to get full root access. Run the line below and replace the EC2 URL  with the one provided to you by the <em>ec2-describe-images</em> command earlier.</p>
<pre><code>
ssh -i id_rsa-pstam-keypair root@ec2-XXX-XXX-XXX-XXX.z-2.compute-1.amazonaws.com
</code></pre>
<p>If you run into the problem I did, this won&#8217;t work and you&#8217;ll be  asked for an EC2 instance password that doesn&#8217;t exist. I found out this  was because I initially created the <em>id_rsa-pstam-keypair</em> file  as the root user but ran the ssh command as a regular user which was not  able to access that keypair. That was easily fixed with <em>sudo chown Paul id_rsa-pstam-keypair</em> but you won&#8217;t have this issue if you followed this guide.</p>
<p>Otherwise, you should be logged into your EC2 instance as root over  SSH. Now that we&#8217;re in, we can tinker with the system however we like  and even see what kind of hardware we&#8217;re running on, setup FTP and drop a  web app into <em>/var/www/localhost/htdocs</em> or whatever. Having full root access in any OS you wish is one of the boons of using Amazon EC2.</p>
<div><a title="SSHed into EC2 Instance - cpuinfo" href="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_ssh_catproc_700.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/ec2_ssh_catproc.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/ec2_ssh_catproc.jpg"><img class="aligncenter size-full wp-image-1409" title="ec2_ssh_catproc" src="http://www.solusan.com/wp-content/2011/02/ec2_ssh_catproc.jpg" alt="" width="500" height="257" /></a></div>
<h4>Static IP Time</h4>
<p>If you plan on running your instance for good, you&#8217;ll want a static IP. Let&#8217;s get one for you.</p>
<p><code> ec2-allocate-address </code></p>
<div><a href="http://www.solusan.com/wp-content/2011/02/ec2_allocate_ip.jpg"><img class="aligncenter size-full wp-image-1410" title="ec2_allocate_ip" src="http://www.solusan.com/wp-content/2011/02/ec2_allocate_ip.jpg" alt="" width="500" height="93" /></a></div>
<p>Now we just need to tie that IP address to the instance ID of the  instance you wish to give a static IP. You can grab the instance ID (not  to be confused with the ami-* AMI ID) by running <em>ec2-describe-instances</em>.</p>
<p>In the line below, replace XXX.XXX.XXX.XXX with the IP address you  were given above and replace i-yourinstance with your actual instance  ID.</p>
<p><code> ec2-associate-address -i i-yourinstance XXX.XXX.XXX.XXX </code></p>
<div><a href="http://www.solusan.com/wp-content/2011/02/ec2_terminate_instance.jpg"><img class="aligncenter size-full wp-image-1411" title="ec2_terminate_instance" src="http://www.solusan.com/wp-content/2011/02/ec2_terminate_instance.jpg" alt="" width="500" height="104" /></a></div>
<p>Give it a few minutes and your instance will be accessible through  that new IP in addition to the longer EC2 URL we were previously using.  Please note that if you terminate the instance, the IP does not remain  tied to the instance, to the best of my knowledge. Terminating an  instance seems to be a nuclear option compared to simply rebooting an  instance via regular unix commands over SSH.</p>
<p>Now that the instance has an IP you can setup a domain name with it  if you want. The easiest way I&#8217;ve found of doing this is through a DNS  service like <a href="http://everydns.net/">EveryDNS</a>. Just provide  your domain name registrar with EveryDNS&#8217;s domain name servers, create  an EveryDNS account, add your domain and create an A record with your  newly associated EC2 instance IP address.</p>
<div><a title="EveryDNS - Setup Domain" href="http://turbo.paulstamatiou.com/uploads/2008/04/everydns_setup_domain_1200.jpg"></a><a href="http://www.solusan.com/wp-content/2011/02/everydns_setup_domain.jpg"><img class="aligncenter size-full wp-image-1412" title="everydns_setup_domain" src="http://www.solusan.com/wp-content/2011/02/everydns_setup_domain.jpg" alt="" width="500" height="255" /></a></div>
<p>The TTL on EveryDNS seems to be fixed at 3600 so it might take a  while for propagation, especially if you&#8217;re used to pushing down TTL to  300 when doing DNS work.</p>
<h4>Terminating Your EC2 Instance</h4>
<p>Killing your instance for good can be done, like every other action,  through an EC2 command line tool. This time, it&#8217;s the appropriately  named <em>ec2-terminate-instances</em> (ec2kill). Just provide it with the instance ID of your instance (get it from running ec2din).</p>
<p><code> ec2-terminate-instances i-yourinstance </code></p>
<div><img src="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_terminate_instance.jpg" alt="Terminate EC2 Instance" /></div>
<p>It should return with a &#8220;shutting-down&#8221; status but you&#8217;ll definitely want to check back in a few minutes with <em>ec2-describe-instances</em> to make sure it shutdown successfully and comes up as &#8220;terminated&#8221;.  There are a few cases where instances will hang on shutdown and you will  continue to be charged for instance hours.</p>
<div><a title="EC2 Instances Terminated" href="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_terminated_instances_600.jpg"><img src="http://turbo.paulstamatiou.com/uploads/2008/04/ec2_terminated_instances.jpg" alt="EC2 Instances Terminated" /></a></div>
<h4>The Next Step</h4>
<p>Now that you&#8217;ve successfully launched your first Amazon EC2 instance,  you&#8217;re ready to begin exploring the endless EC2 possibilities. I&#8217;m  still learning about taking the next step but overall, EC2 really isn&#8217;t  something to mess with unless you have quite a bit of sysadmin and  development experience. Actually using EC2 as an elastic compute cloud  usually involves setting up an instance as a load balancer and giving  that instance access to an array of active EC2 instances which it can  hand work to. Other hurdles include providing multiple instances access  to the same database, using Amazon S3 as a persistent filesystem and  employing highly redundant backup systems given the relatively volatile  nature of instances.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/how-to-getting-started-with-amazon-ec2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cómo vaciar la cache dns</title>
		<link>http://www.solusan.com/como-vaciar-la-cache-dns.html</link>
		<comments>http://www.solusan.com/como-vaciar-la-cache-dns.html#comments</comments>
		<pubDate>Thu, 04 Feb 2010 14:44:48 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Hakintosh]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[SuSE]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[dns]]></category>

		<guid isPermaLink="false">http://www.solusan.com/?p=1330</guid>
		<description><![CDATA[En Mac OSX Leopard: dscacheutil -flushcache En Mac OSX Tiger: lookupd -flushcache En Microsoft Windows 2000/XP/Vista: ipconfig /flushdns En Linux: reiniciar el demonio nscd `/etc/rc.d/init.d/nscd restart` Gracias Asier Marqués]]></description>
			<content:encoded><![CDATA[<ul>
<li>En Mac OSX Leopard:</li>
</ul>
<p><code>dscacheutil -flushcache</code></p>
<ul>
<li>En Mac OSX Tiger:</li>
</ul>
<p><code>lookupd -flushcache</code></p>
<ul>
<li>En Microsoft Windows 2000/XP/Vista:</li>
</ul>
<p><code>ipconfig /flushdns</code></p>
<ul>
<li>En Linux:</li>
</ul>
<p>reiniciar el demonio nscd <code>`/etc/rc.d/init.d/nscd restart`</code></p>
<p>Gracias <a title="http://asiermarques.com/2008/04/09/vaciar-cache-dns/" href="http://asiermarques.com/2008/04/09/vaciar-cache-dns/" target="_blank">Asier Marqués</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/como-vaciar-la-cache-dns.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iptables TIP</title>
		<link>http://www.solusan.com/iptables-tip.html</link>
		<comments>http://www.solusan.com/iptables-tip.html#comments</comments>
		<pubDate>Fri, 25 Apr 2008 11:49:06 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[CentoOS]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[SuSE]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://www.solusan.com/?p=1008</guid>
		<description><![CDATA[Necesitamos que un equipo tenga acceso a toda la red corporativa y a si mismo, pero no al &#8216;resto del mundo&#8217;. #!/bin/bash iptables -F iptables -X iptables -Z # abrimos trafico a la red interna iptables -A INPUT -s 127.0.0.0/8 -j ACCEPT iptables -A OUTPUT -s 127.0.0.0/8 -j ACCEPT iptables -A INPUT -s 10.120.0.0/16 -j [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.solusan.com/wp-content/2008/04/iptablespz5.jpg"><img class="alignnone size-thumbnail wp-image-1009 alignright" style="float: right;" title="iptablespz5" src="http://www.solusan.com/wp-content/2008/04/iptablespz5-150x150.jpg" alt="" width="96" height="96" /></a>Necesitamos que un equipo tenga acceso a toda la red corporativa y a si mismo, pero no al &#8216;resto del mundo&#8217;.</p>
<blockquote><p><code>#!/bin/bash<br />
iptables -F<br />
iptables -X<br />
iptables -Z</code></p>
<p><code># abrimos trafico a la red interna</code></p>
<p><code>iptables -A INPUT -s 127.0.0.0/8 -j ACCEPT<br />
iptables -A OUTPUT -s 127.0.0.0/8 -j ACCEPT<br />
iptables -A INPUT -s 10.120.0.0/16 -j ACCEPT<br />
iptables -A INPUT -s 10.120.0.0/16 -j ACCEPT</code></p>
<p><code>iptables -A OUTPUT -d ! 10.120.0.0/16 -j DROP</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/iptables-tip.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>grep</title>
		<link>http://www.solusan.com/grep.html</link>
		<comments>http://www.solusan.com/grep.html#comments</comments>
		<pubDate>Tue, 01 Apr 2008 10:25:01 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DragonFlyBSD]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[SuSE]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[grep]]></category>

		<guid isPermaLink="false">http://www.solusan.com/grep.html</guid>
		<description><![CDATA[What does ‘grep’ mean? &#160; The Wikipedia entry for grep states: grep is a command line utility originally written for use with the Unix operating system. The name comes from a command in the Unix text editor ed that takes the form: g/re/p This means “search globally for matches to the regular expression re, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.solusan.com/wp-content/2008/04/pspipegrep-copia.png" title="pspipegrep-copia.png"><img src="http://www.solusan.com/wp-content/2008/04/pspipegrep-copia.thumbnail.png" alt="pspipegrep-copia.png" align="right" /></a>What does ‘grep’ mean?</p>
<p class="storycontent">&nbsp;</p>
<blockquote><p>The Wikipedia entry for grep states:</p>
<p><strong>grep</strong> is a command line utility originally written for use with the Unix operating system.</p>
<p>The name comes from a command in the Unix text editor ed that takes the form:</p>
<p><strong>g/re/p</strong></p>
<p>This means “<em>s</em>earch <strong>g</strong>lobally for matches to the <strong>r</strong>egular <strong>e</strong>xpression re, and <strong>p</strong>rint lines where they are found”.</p></blockquote>
<p>Simple como deben ser las <em>utilidades</em> …</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/grep.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalación de LVM2 en Gentoo</title>
		<link>http://www.solusan.com/instalacion-de-lvm2-en-gentoo.html</link>
		<comments>http://www.solusan.com/instalacion-de-lvm2-en-gentoo.html#comments</comments>
		<pubDate>Sun, 27 Jan 2008 20:45:11 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Instalación de LVM2 en Gentoo]]></category>

		<guid isPermaLink="false">http://www.solusan.com/instalacion-de-lvm2-en-gentoo.html</guid>
		<description><![CDATA[Contenido: 1. Introducción 2. Instalación 3. Continuar luego de reiniciar 1. Introducción Esta guía está basada en un ejemplo que usa dos discos duros IDE. Significa que probablemente tendrá que cambiar el disco, los nombres y los tamaños de las particiones según su configuración y sus propias necesidades. Aviso: No es la intención que este [...]]]></description>
			<content:encoded><![CDATA[<form name="contents" action="http://www.gentoo.org"> <strong>Contenido</strong>:<br />
<select name="url" size="1" onchange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family: sans-serif,Arial,Helvetica">
<option value="#doc_chap1">1. Introducción</option>
<option value="#doc_chap2">2. Instalación</option>
<option value="#doc_chap3">3. Continuar luego de reiniciar</option>
</select></form>
<p class="chaphead"><a title="doc_chap1" name="doc_chap1"></a><span class="chapnum">1. </span>Introducción</p>
<p> Esta guía está basada en un ejemplo que usa dos discos duros IDE. Significa que probablemente tendrá que cambiar el disco, los nombres y los tamaños de las particiones según su configuración y sus propias necesidades.</p>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#ffbbbb"><strong>Aviso: </strong><br />
No es la intención que este documento sea un tutorial de LVM2. Servirá como información suplementaria al procedimiento de instalación de Gentoo, tal como se describe en la <a href="/doc/es/handbook/handbook-x86.xml?part=1" class="broken_link">Parte 1 del Manual</a>. Asegúrese de <span class="emphasis">leer</span> el Manual de Instalación <span class="emphasis">antes</span> de comenzar el proceso de instalación.</td>
</tr>
</table>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#bbffbb">
<p class="note"><strong>Nota: </strong><br />
Para un HOWTO completo acerca de LVM, navegue a<br />
<a href="http://tldp.org/HOWTO/LVM-HOWTO">http://tldp.org/HOWTO/LVM-HOWTO</a>.</p>
</td>
</tr>
</table>
<p class="secthead"><a title="doc_chap1_sect2" name="doc_chap1_sect2"></a>Requisitos iniciales</p>
<p> Si va a hacer una instalación desde cero, hará falta usar un CD del cual pueda arrancar que soporte LVM2, tal como el CD de Instalación Gentoo. Puede encontrar el CD de Instalación para la plataforma x86 en nuestros <a href="/main/en/mirrors.xml" class="broken_link">servidores espejo</a> bajo <span class="path" dir="ltr">/releases/x86/current/installcd</span>. Tal vez estén soportadas otras plataformas también.</p>
<p>Si instala LVM2 en un sistema existente con espacio de sobra en disco duro, habrá que activar el módulo LVM2 (<span class="path" dir="ltr">dm-mod</span>). Este módulo está disponible en las fuentes <span class="path" dir="ltr">gentoo-sources</span>. La compilación del núcleo y el hacer funcionar a LVM2 serán cubiertos más adelante en esta misma guía.</p>
<p><span id="more-788"></span>¡No todos los núcleos 2.4 de Gentoo soportan LVM2!</p>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#ffbbbb">
<p class="note"><strong>Aviso: </strong><br />
El LVM2 disponible en el CD de instalación 2005.0 está erróneamente enlazado dinámicamente contra la biblioteca (libgpm) ubicada en /usr. Esto significa que no puede tener su /usr en un ambiente LVM. Instale la última versión o la versión 2.0.33 (no la -r1) que están construidas estáticamente.</p>
</td>
</tr>
</table>
<p class="secthead"><a title="doc_chap1_sect3" name="doc_chap1_sect3"></a>Las particiones</p>
<p> Nuestro sistema de ejemplo tiene dos discos duros IDE y serán particionados de la siguiente manera:</p>
<ul>
<li>/dev/hda1  &#8212;  /boot</li>
<li>/dev/hda2  &#8212;  partición de intercambio (swap)</li>
<li>/dev/hda3  &#8212;  /</li>
<li>/dev/hda4  &#8212;  Será usado por LVM2</li>
<li>/dev/hdb1  &#8212;  Será usado por LVM2</li>
</ul>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#ffffbb">
<p class="note"><strong>Importante: </strong><br />
Ponga cuidado a los nombres de las particiones, ya que es fácil confundir las a y las b, y los números de las particiones. Un movimiento en falso y podemos borrar la partición equivocada. ¡Está advertido!</p>
</td>
</tr>
</table>
<p>OK, hora de comenzar &#8230;</p>
<p class="chaphead"><a title="doc_chap2" name="doc_chap2"></a><span class="chapnum">2. </span>Instalación</p>
<p> Siga el manual con los siguientes cambios en el capítulo <span class="emphasis">4.<br />
</span></p>
<p><span class="emphasis"> Preparando los discos</span>:</p>
<p>Use <span class="code" dir="ltr">fdisk</span> como dice el Manual, pero use el esquema de particiones antes mencionado como ejemplo. Acuérdese que este es sólo <span class="emphasis">un ejemplo</span>, adáptelo según sus necesidades.</p>
<p>Cree una pequeña partición física para <span class="path" dir="ltr">/boot</span> (hda1). En este ejemplo, <span class="path" dir="ltr">/boot</span> no será gestionado por LVM2. Esta partición contendrá el gestor de arranque y el/los núcleo(s). 64MB deben ser suficientes para varias generaciones de núcleos.</p>
<p>Cree una partición de intercambio (hda2).</p>
<p>Cree una partición raíz / (hda3). Si le interesa intentar colocar su partición raíz bajo control de LVM (cosa que no recomendamos), vea la sección de recursos al final de esta guía para un enlace a un mini-howto acerca de cómo hacer esto. La partición raíz no requiere ser grande si decide mantener los directorios <span class="path" dir="ltr">/opt /usr /home /var</span> y <span class="path" dir="ltr">/tmp</span> en un grupo de volúmenes (vg) LVM2. En este caso, 1GB debería ser suficient</p>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#bbffbb"><strong>Nota: </strong><br />
<strong>No</strong> recomendamos colocar los siguientes directorios en una<br />
partición LVM2: <span class="path" dir="ltr">/etc</span>, <span class="path" dir="ltr">/lib</span>, <span class="path" dir="ltr">/mnt</span>,<span class="path" dir="ltr"> /proc</span>, <span class="path" dir="ltr">/sbin</span>, <span class="path" dir="ltr">/dev</span> y<span class="path" dir="ltr"> /root</span>. De esta manera podrá ingresar a su sistema (que aunque estuviese incompleto, sería utilizable como root) si ocurriese algún desastre.</td>
</tr>
</table>
<p>Asumiendo que las particiones <span class="path" dir="ltr">/boot</span>, de intercambio y raíz no usan el disco físico completo, cree una cuarta partición y asígnele el tipo 8e (Linux LVM). Si tiene más de un disco físico que quiera usar con LVM, cree una partición en cada uno y asígneles el mismo tipo (8e).</p>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#bbffbb">
<p class="note"><strong>Nota: </strong><br />
Tomando en cuenta el tamaño enorme de los discos duros actuales,<br />
podría considerar dividir el disco en particiones más pequeñas en<br />
vez de crear una sola partición enorme para agregarla a un grupo de<br />
volúmenes LVM2 en un sólo bloque. Después de todo, LVM2 permite<br />
aumentar fácilmente el tamaño de los volúmenes. Esto puede dejarle<br />
particiones no asignadas que pueda usar fuera del control de un grupo<br />
LVM2. Un consejo, no use su espacio de disco hasta que sepa que<br />
lo necesite. Como ejemplo, podemos citar un colaborador que<br />
subdividió su disco duro de 160 Gb en 8 particiones de<br />
20 Gb c/u.</p>
</td>
</tr>
</table>
<p>Cree los sistemas de archivos en <span class="path" dir="ltr">/dev/hda1</span> y<br />
<span class="path" dir="ltr">/dev/hda3</span>, además cree y active la partición de<br />
intercambio en <span class="path" dir="ltr">/dev/hda2</span> tal como se describe en el<br />
manual.</p>
<p>Cargue el módulo LVM2 <span class="path" dir="ltr">dm-mod</span>.</p>
<p><a title="doc_chap2_pre1" name="doc_chap2_pre1"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.1: Cargar el módulo LVM2</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">modprobe dm-mod</span></pre>
</td>
</tr>
</table>
<p>Antes de realizar la exploración y activación del LVM, querrá editar<br />
el archivo <span class="path" dir="ltr">/etc/lvm/lvm.conf</span> para excluir algunos<br />
dispositivos. LVM realizará de forma predeterminada la exploración de<br />
todos los dispositivos, incluso de su lector de CD-ROM, lo cual puede<br />
generar mensajes de error. En el siguiente ejemplo, la línea que<br />
permite la exploración de todos los dispositivos es reemplazada por<br />
una que rechaza todos los dispositivos con excepción de nuestros dos<br />
discos duros IDE.</p>
<p><a title="doc_chap2_pre2" name="doc_chap2_pre2"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.2: Activar LVM</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre><span class="code-comment">(Evitar explorar todos los dispositivos salvo nuestros discos duros)

</span># <span class="code-input">nano -w /etc/lvm/lvm.conf</span>

<span class="code-comment">(Busque la siguiente línea)</span>

filter = [ "a/.*/" ]

<span class="code-comment"></span>

(Reemplácela con la siguiente para explorar /dev/hda y /dev/hdb y

rechazar cualquier otra cosa)

filter = [ "a|/dev/hd[ab]|", "r/.*/" ]

<span class="code-comment">(Guarde el archivo y salga de nano)</span>

# <span class="code-input">vgscan</span>

Reading all physical volumes.  This may take a while...

No volume groups found

<span class="code-comment"></span>

(Haga disponible otros grupos de volúmenes previamente configurados)

# <span class="code-input">vgchange -a y</span></pre>
</td>
</tr>
</table>
<p>Prepare las particiones.</p>
<p><a title="doc_chap2_pre3" name="doc_chap2_pre3"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.3: Preparar las particiones</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">pvcreate /dev/hda4 /dev/hdb1</span>  No physical volume label read from /dev/hda4

Physical volume "/dev/hda4" successfully created

No physical volume label read from /dev/hdb1

Physical volume "/dev/hdb1" successfully created</pre>
</td>
</tr>
</table>
<p>Configure un grupo de volúmenes. Este es el resultado de combinar<br />
varias unidades físicas en un único dispositivo lógico.</p>
<p>En nuestro ejemplo, <span class="path" dir="ltr">/dev/hda1</span>, <span class="path" dir="ltr">/dev/hda2</span> y<br />
<span class="path" dir="ltr">/dev/hda3</span> son las particiones <span class="path" dir="ltr">/boot</span>, de<br />
intercambio y raíz, por lo que necesitamos<br />
combinar <span class="path" dir="ltr">/dev/hda4</span> y <span class="path" dir="ltr">/dev/hdb1</span>. Esto se<br />
puede hacer con un solo comando, pero como es un ejemplo didáctico,<br />
crearemos un grupo de volúmenes y luego lo aumentaremos.</p>
<p><a title="doc_chap2_pre4" name="doc_chap2_pre4"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.4: Crear y aumentar un grupo de volúmenes</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre><span class="code-comment">(Cree un grupo de volúmenes llamado vg)</span># <span class="code-input">vgcreate vg /dev/hda4</span>

/etc/lvm/backup: fsync failed: Invalid argument <span class="code-comment">(Ignore esta advertencia)</span>

Volume group "vg" successfully created<span class="code-comment">(Aumente el tamaño de un grupo de volúmenes existente)</span>

# <span class="code-input">vgextend vg /dev/hdb1</span>

/etc/lvm/backup: fsync failed: Invalid argument

<span class="code-comment">(Ignore esta advertencia nuevamente y más adelante también)</span>

Volume group "vg" successfully extended</pre>
</td>
</tr>
</table>
<p>Cree los volúmenes lógicos. Estos son el equivalente a una partición<br />
creada con fdisk en un ambiente sin LVM2. En nuestro ejemplo,<br />
crearemos las siguientes particiones:</p>
<table class="ntable">
<tr>
<td class="infohead"><strong>Directorio</strong></td>
<td class="infohead"><strong>Tamaño</strong></td>
</tr>
<tr>
<td class="tableinfo">/usr</td>
<td class="tableinfo">10 GB</td>
</tr>
<tr>
<td class="tableinfo">/home</td>
<td class="tableinfo">5 GB</td>
</tr>
<tr>
<td class="tableinfo">/opt</td>
<td class="tableinfo">5 GB</td>
</tr>
<tr>
<td class="tableinfo">/var</td>
<td class="tableinfo">10 GB</td>
</tr>
<tr>
<td class="tableinfo">/tmp</td>
<td class="tableinfo">2 GB</td>
</tr>
</table>
<p>Como usaremos LVM2, no nos preocuparemos mucho acerca de los tamaños<br />
de las particiones, ya que las podemos aumentadar a voluntad.</p>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#bbffbb">
<p class="note"><strong>Nota: </strong><br />
Como comenta Terje Kvernes, es más fácil aumentar el tamaño de una<br />
partición que reducirla, de manera que tal vez quiera empezar con<br />
particiones más pequeñas y aumentarlas según lo requerido.</p>
</td>
</tr>
</table>
<p><a title="doc_chap2_pre5" name="doc_chap2_pre5"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.5: Crear y aumentar los volúmenes lógicos</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">lvcreate -L10G -nusr  vg</span>  Logical volume "usr" created <span class="code-comment">(Los mensajes adicionales  similares no los mostramos)

</span># <span class="code-input">lvcreate -L5G  -nhome vg</span>

# <span class="code-input">lvcreate -L5G  -nopt  vg</span>

# <span class="code-input">lvcreate -L10G -nvar  vg</span>

# <span class="code-input">lvcreate -L2G  -ntmp  vg</span>

<span class="code-comment">(Como ejemplo, aumentemos un volumen lógico en 5 Gbytes)</span>

# <span class="code-input">lvextend -L+5G /dev/vg/home</span></pre>
</td>
</tr>
</table>
<p>Cree los sistemas de archivos en los volúmenes lógicos de la misma<br />
forma que lo haría en una partición regular. Usamos ext3 en los<br />
volúmenes lógicos, pero cualquier sistema de archivos escogido<br />
servirá:</p>
<p><a title="doc_chap2_pre6" name="doc_chap2_pre6"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.6: Crear los sistemas de archivos</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">mke2fs -j /dev/vg/usr</span># <span class="code-input">mke2fs -j /dev/vg/home</span># <span class="code-input">mke2fs -j /dev/vg/opt</span>

# <span class="code-input">mke2fs -j /dev/vg/var</span>

# <span class="code-input">mke2fs -j /dev/vg/tmp</span></pre>
</td>
</tr>
</table>
<p>Monte sus particiones como dice el Manual y monte los volúmenes<br />
lógicos LVM2 como si fuesen particiones. Reemplace el</p>
<p><span class="path" dir="ltr">/dev/hdxx</span> de costumbre con<br />
<span class="path" dir="ltr">/dev/vg/nombre_del_volumen_lógico</span>.</p>
<p><a title="doc_chap2_pre7" name="doc_chap2_pre7"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.7: Montar sus volúmenes lógicos</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre><span class="code-comment">(Asegúrese de montar primero su partición raíz, tal comoaparece en el Manual)

</span># <span class="code-input">mkdir /mnt/gentoo/usr</span>

# <span class="code-input">mount /dev/vg/usr /mnt/gentoo/usr</span># <span class="code-input">mkdir /mnt/gentoo/home</span>

# <span class="code-input">mount /dev/vg/home /mnt/gentoo/home</span>

# <span class="code-input">mkdir /mnt/gentoo/opt</span>

# <span class="code-input">mount /dev/vg/opt /mnt/gentoo/opt</span>

# <span class="code-input">mkdir /mnt/gentoo/var</span>

# <span class="code-input">mount /dev/vg/var /mnt/gentoo/var</span>

# <span class="code-input">mkdir /mnt/gentoo/tmp</span>

# <span class="code-input">mount /dev/vg/tmp /mnt/gentoo/tmp</span></pre>
</td>
</tr>
</table>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#bbffbb">
<p class="note"><strong>Nota: </strong><br />
El resto de la instalación es prácticamente igual, así que no la<br />
repetiremos. Sólo le diremos dónde están las diferencias.</p>
</td>
</tr>
</table>
<p>Al configurar su núcleo, asegúrese que soporte LVM2 (ya que no todos<br />
de la serie 2.4 lo hacen). Seleccione el módulo LVM2 de la siguiente<br />
manera:</p>
<p><a title="doc_chap2_pre8" name="doc_chap2_pre8"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.8: Seleccionar el módulo LVM2 en un núcleo 2.4.x</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre>Multi-device support (RAID and LVM)  ---&gt;  [*] Multiple devices driver support (RAID and LVM)

&lt; &gt;  RAID support

<span class="code-comment">(Note que LVM no está seleccionado a propósito, esto era para LVM1)</span>

&lt; &gt;  Logical volume manager (LVM) support

&lt;M&gt;  Device-mapper support

&lt; &gt;   Mirror (RAID-1) support</pre>
</td>
</tr>
</table>
<p><a title="doc_chap2_pre9" name="doc_chap2_pre9"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.9: Seleccionar el módulo LVM2 en un núcleo 2.6.x</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre>Device Drivers  ---&gt; Multi-device support (RAID and LVM)  ---&gt;

[*] Multiple devices driver support (RAID and LVM)

&lt; &gt;   RAID support

&lt;M&gt;   Device mapper support</pre>
</td>
</tr>
</table>
<p>El módulo compilado se llama <span class="path" dir="ltr">dm-mod.ko</span></p>
<p>Luego de construir su núcleo e instalar sus módulos, agregue la<br />
siguiente línea a su <span class="path" dir="ltr">/etc/modules.autoload.d/kernel-{KV}</span>,<br />
donde {KV} representa la versión del núcleo (bien sea 2.4 ó 2.6) para<br />
que el módulo LVM2 sea cargado al arrancar la máquina:</p>
<p><a title="doc_chap2_pre10" name="doc_chap2_pre10"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.10: Agregar el módulo LVM2 a /etc/modules.autoload.d/kernel-2.6</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">nano -w /etc/modules.autoload.d/kernel-2.6</span><span class="code-comment">(Agregue la siguiente línea)</span>

dm-mod</pre>
</td>
</tr>
</table>
<p>Ahora instale el paquete lvm2.</p>
<table class="ncontent" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#ffffbb">
<p class="note"><strong>Importante: </strong><br />
Verifique que el enlace simbólico <span class="path" dir="ltr">/usr/src/linux</span> apunte a<br />
las fuentes de núcleo que está usando porque el ebuild de lvm2 depende<br />
del ebuild del mapeador de dispositivos que a su vez revisará la<br />
presencia del archivo de fuentes requerido en</p>
<p><span class="path" dir="ltr">/usr/src/linux/include/linux</span>.</p>
</td>
</tr>
</table>
<p><a title="doc_chap2_pre11" name="doc_chap2_pre11"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.11: Instalar vía emerge el paquete LVM2</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">emerge lvm2</span></pre>
</td>
</tr>
</table>
<p>Edite <span class="path" dir="ltr">/etc/lvm/lvm.conf</span> tal como se<br />
describe <a href="#doc_chap2_pre2">previamente</a>. El archivo que<br />
editó antes es parte de su entorno de instalación y desaparecerá luego<br />
del siguiente reinicio del sistema. Esta vez, edite el archivo<br />
verdadero dentro de su nueva instalación de Gentoo.</p>
<p>Al editar su archivo <span class="path" dir="ltr">/etc/fstab</span>, siga el Manual y agregue<br />
sus volúmenes como lo requiera. Una vez más, algunas líneas como<br />
ejemplo:</p>
<p><a title="doc_chap2_pre12" name="doc_chap2_pre12"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.12: Extracto del /etc/fstab</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre>/dev/hda1     /boot   ext3    noauto,noatime 1 2/dev/hda2     none    swap    sw             0 0

/dev/hda3     /       ext3    noatime        0 1

# Volúmenes lógicos

/dev/vg/usr   /usr    ext3    noatime        0 2

/dev/vg/home  /home   ext3    noatime        0 2

/dev/vg/opt   /opt    ext3    noatime        0 2

/dev/vg/var   /var    ext3    noatime        0 2

/dev/vg/tmp   /tmp    ext3    noatime        0 2</pre>
</td>
</tr>
</table>
<p>Al llegar al final de la parte de instalación del Manual, no se olvide<br />
desmontar todos los volúmenes lógicos también y para finalizar, ejecute<br />
el siguiente comando antes de reiniciar:</p>
<p><a title="doc_chap2_pre13" name="doc_chap2_pre13"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 2.13: Cerrar operaciones del LVM2</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">vgchange -a n</span></pre>
</td>
</tr>
</table>
<p>Reinicie su máquina y todas las particiones deberán estar montadas y<br />
visibles.</p>
<p class="chaphead"><a title="doc_chap3" name="doc_chap3"></a><span class="chapnum">3. </span>Continuar luego de reiniciar</p>
<p> Si interrumpió la instalación de Gentoo en cierto punto y quiere<br />
continuar, primero necesita crear los nodos de los dispositivos de<br />
vólumen:</p>
<p><a title="doc_chap3_pre1" name="doc_chap3_pre1"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 3.1: Reactivar los volúmenes</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre># <span class="code-input">vgscan --mknodes</span></pre>
</td>
</tr>
</table>
<p>En cambio en los CDs de Instalación con herramientas no tan actuales<br />
puede que sea necesario reactivar los volúmenes:</p>
<p><a title="doc_chap3_pre2" name="doc_chap3_pre2"></a></p>
<table class="ntable" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#7a5ada">
<p class="codetitle">Listado de Código 3.2: Reactivar los volúmenes</p>
</td>
</tr>
<tr>
<td dir="ltr" align="left" bgcolor="#eeeeff">
<pre><span class="code-comment">(Primero desactive todos los volúmenes)</span># <span class="code-input">vgchange -a n</span>

<span class="code-comment">(Exporte todos los volúmenes)</span>

# <span class="code-input">vgexport -a vg</span>

<span class="code-comment">(Importe todos los volúmenes)</span># <span class="code-input">vgimport -a vg</span>

<span class="code-comment">(Reactive todos los volúmenes)</span>

# <span class="code-input">vgchange -a y</span></pre>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/instalacion-de-lvm2-en-gentoo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>logrotate!!</title>
		<link>http://www.solusan.com/logrotate.html</link>
		<comments>http://www.solusan.com/logrotate.html#comments</comments>
		<pubDate>Tue, 08 Jan 2008 08:34:34 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.solusan.com/logrotate.html</guid>
		<description><![CDATA[Si un día ves que el log de tu máquina se ha comido 10^6 hamburguesas, talvez sería bueno instalar logrotate. Esto suele pasar en sistemas Gentoo, cuando has ido a toda mecha instalando un sistema, por aquello de las prisas y los presupuestos. Pero claro que en el, nunca bien ponderado, handbook lo pone: Si [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.solusan.com/wp-content/2008/01/logrotate.png" title="logrotate.png"><img src="http://www.solusan.com/wp-content/2008/01/logrotate.thumbnail.png" alt="logrotate.png" align="right" /></a>Si un día ves que el log de tu máquina se ha comido 10^6 hamburguesas, talvez sería bueno instalar <em>logrotate</em>.</p>
<p>Esto suele pasar en sistemas <a href="http://es.wikipedia.org/wiki/Gentoo">Gentoo</a>, cuando has ido a toda mecha instalando un sistema, por aquello de las prisas y los presupuestos.</p>
<p>Pero claro que en el, nunca bien ponderado, handbook lo pone:</p>
<p><em> Si está pensando utilizar <span class="code" dir="ltr">sysklogd</span> o <span class="code" dir="ltr">syslog-ng</span> quizá quiera instalar posteriormente <strong><span class="code" dir="ltr">logrotate</span> </strong>ya que esos logeadores no proporcionan ningún mecanismo de rotación para los archivos de log. </em></p>
<p>Así que:</p>
<p><code>#  emerge -av logrotate</code></p>
<p>Un dato anecdótico es que tiene Copyright de Red Hat, Inc.</p>
<p><code>tratatrá ~ # logrotate -v<br />
logrotate 3.7.1 - <strong>Copyright (C) 1995-2001 Red Hat, Inc.</strong><br />
This may be freely redistributed under the terms of the GNU Public License</code></p>
<p>Algunos ficheros de configuración y la ruta del mismo para información:</p>
<p><code># cat /etc/logrotate.d/syslog-ng</code><br />
<code><br />
</code></p>
<pre id="line1">/var/log/messages {
    rotate 7
    weekly
    size 50M
    sharedscripts
    postrotate
        /etc/init.d/syslog-ng reload &amp;<span class="entity">gt;</span> /dev/null 2&amp;<span class="entity">gt;</span>&amp;<span class="entity">amp;</span>1 || true
    endscript
}

/var/log/syslog {
    rotate 7
    weekly
    size 50M
    sharedscripts
    postrotate
        /etc/init.d/syslog-ng reload &amp;<span class="entity">gt;</span> /dev/null 2&amp;<span class="entity">gt;</span>&amp;<span class="entity">amp;</span>1 || true
    endscript
}

/var/log/debug {
    rotate 7
    weekly
    size 50M
    sharedscripts
    postrotate
        /etc/init.d/syslog-ng reload &amp;<span class="entity">gt;</span> /dev/null 2&amp;<span class="entity">gt;</span>&amp;<span class="entity">amp;</span>1 || true
    endscript
}</pre>
<p>Para forzar el rotado de logs ejecuta esta instrucción:</p>
<p><code># logrotate -f /etc/logrotate.conf</code></p>
<p>Más informacion en: <a href="http://gentoo-wiki.com/HOWTO_Setup_Logrotate" title="http://gentoo-wiki.com/HOWTO_Setup_Logrotate " target="_blank" class="broken_link">http://gentoo-wiki.com/HOWTO_Setup_Logrotate</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/logrotate.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Observando si un paquete esta en la rama inestable o no</title>
		<link>http://www.solusan.com/observando-si-un-paquete-esta-en-la-rama-inestable-o-no.html</link>
		<comments>http://www.solusan.com/observando-si-un-paquete-esta-en-la-rama-inestable-o-no.html#comments</comments>
		<pubDate>Mon, 07 Jan 2008 10:37:57 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.solusan.com/observando-si-un-paquete-esta-en-la-rama-inestable-o-no.html</guid>
		<description><![CDATA[Aveces necesitamos saber si un paquete está o no en la rama inestable de gentoo, aunque éste esté enmascarado en /etc/portage/packages.keywords. Para ello disponemos de este pequeño script que nos hará la vida más fácil. #!/bin/bash # vim: set sw=4 sts=4 et tw=80 : # Author: Ciaran McCreesh # Purpose: Display ebuild keywords in a [...]]]></description>
			<content:encoded><![CDATA[<p>Aveces necesitamos saber si un paquete está o no en la rama inestable de gentoo, aunque éste esté enmascarado en /etc/portage/packages.keywords.</p>
<p>Para ello disponemos de este pequeño <a title="http://dev.gentoo.org/%7Edang/eshowkw" href="http://dev.gentoo.org/%7Edang/eshowkw" target="_blank">script</a> que nos hará la vida más fácil.</p>
<pre lang="BASH">#!/bin/bash
# vim: set sw=4 sts=4 et tw=80 :

# Author:        Ciaran McCreesh
# Purpose:       Display ebuild keywords in a graphical form
# Invocation:    eshowkw [ packagename ] (defaults to current directory if no
#                packagename is provided)

shopt -s extglob

PID_TO_KILL=$$

die() {
    echo "$@" 1&gt;&amp;2
    kill $PID_TO_KILL
}

trap 'exit 250' 15

get_portage_dir() {
    local dir
    if <a href="http://es.wikipedia.org/wiki/ -z ${portage_dir_cache} "> -z ${portage_dir_cache} </a> ; then
        for dir in "${HOME}/cvs/gentoo-x86" "/usr/portage" ; do
            <a href="http://es.wikipedia.org/wiki/ -d ${dir}/profiles "> -d ${dir}/profiles </a> &amp;&amp; portage_dir_cache=${dir} &amp;&amp; break
        done
    fi
    <a href="http://es.wikipedia.org/wiki/ -z ${portage_dir_cache} "> -z ${portage_dir_cache} </a> &amp;&amp; portage_dir_cache=$(portageq portdir )
    export portage_dir_cache
    echo ${portage_dir_cache}
}

version_sort() {
    local items= left=0
    items=( $@ )

    while [[ ${left} -lt ${#items[@]} ]] ; do
        local lowest_idx=${left}
        local idx=$(( ${lowest_idx} + 1 ))
        while [[ ${idx} -lt ${#items[@]} ]] ; do
            version_compare "${items[${lowest_idx}]}" "${items[${idx}]}"
            <a href="http://es.wikipedia.org/wiki/ $? -eq 3 "> $? -eq 3 </a> &amp;&amp; lowest_idx=${idx}
            idx=$(( ${idx} + 1 ))
        done
        local tmp=${items[${lowest_idx}]}
        items[${lowest_idx}]=${items[${left}]}
        items[${left}]=${tmp}
        left=$(( ${left} + 1 ))
    done
    echo ${items[@]}
}

version_compare() {
    local ver_a=${1} ver_b=${2} parts_a parts_b cur_idx_a=0 cur_idx_b=0
    parts_a=( $(get_all_version_components "${ver_a}" ) )
    parts_b=( $(get_all_version_components "${ver_b}" ) )

    ### compare number parts.
    local inf_loop=0
    while true ; do
        # grab the current number components
        local cur_tok_a=${parts_a[${cur_idx_a}]}
        local cur_tok_b=${parts_b[${cur_idx_b}]}

        # number?
        if <a href="http://es.wikipedia.org/wiki/ -n ${cur_tok_a} "> -n ${cur_tok_a} </a> &amp;&amp; [[ -z ${cur_tok_a//<a href="http://es.wikipedia.org/wiki/:digit:">:digit:</a>} ]] ; then
            cur_idx_a=$(( ${cur_idx_a} + 1 ))
            [[ ${parts_a[${cur_idx_a}]} == "." ]] \
                &amp;&amp; cur_idx_a=$(( ${cur_idx_a} + 1 ))
        else
            cur_tok_a=""
        fi

        if <a href="http://es.wikipedia.org/wiki/ -n ${cur_tok_b} "> -n ${cur_tok_b} </a> &amp;&amp; [[ -z ${cur_tok_b//<a href="http://es.wikipedia.org/wiki/:digit:">:digit:</a>} ]] ; then
            cur_idx_b=$(( ${cur_idx_b} + 1 ))
            [[ ${parts_b[${cur_idx_b}]} == "." ]] \
                &amp;&amp; cur_idx_b=$(( ${cur_idx_b} + 1 ))
        else
            cur_tok_b=""
        fi

        # done with number components?
        <a href="http://es.wikipedia.org/wiki/ -z ${cur_tok_a} "> -z ${cur_tok_a} </a> &amp;&amp; <a href="http://es.wikipedia.org/wiki/ -z ${cur_tok_b} "> -z ${cur_tok_b} </a> &amp;&amp; break

        # to avoid going into octal mode, strip any leading zeros. otherwise
        # bash will throw a hissy fit on versions like 6.3.068.
        cur_tok_a=${cur_tok_a##+(0)}
        cur_tok_b=${cur_tok_b##+(0)}

        # if a component is blank, make it zero.
        <a href="http://es.wikipedia.org/wiki/ -z ${cur_tok_a} "> -z ${cur_tok_a} </a> &amp;&amp; cur_tok_a=0
        <a href="http://es.wikipedia.org/wiki/ -z ${cur_tok_b} "> -z ${cur_tok_b} </a> &amp;&amp; cur_tok_b=0

        # compare
        <a href="http://es.wikipedia.org/wiki/ ${cur_tok_a} -lt ${cur_tok_b} "> ${cur_tok_a} -lt ${cur_tok_b} </a> &amp;&amp; return 1
        <a href="http://es.wikipedia.org/wiki/ ${cur_tok_a} -gt ${cur_tok_b} "> ${cur_tok_a} -gt ${cur_tok_b} </a> &amp;&amp; return 3
    done

    ### number parts equal. compare letter parts.
    local letter_a=
    letter_a=${parts_a[${cur_idx_a}]}
    if <a href="http://es.wikipedia.org/wiki/ ${#letter_a} -eq 1 "> ${#letter_a} -eq 1 </a> &amp;&amp; [[ -z ${letter_a/[a-z]} ]] ; then
        cur_idx_a=$(( ${cur_idx_a} + 1 ))
    else
        letter_a="@"
    fi

    local letter_b=
    letter_b=${parts_b[${cur_idx_b}]}
    if <a href="http://es.wikipedia.org/wiki/ ${#letter_b} -eq 1 "> ${#letter_b} -eq 1 </a> &amp;&amp; [[ -z ${letter_b/[a-z]} ]] ; then
        cur_idx_b=$(( ${cur_idx_b} + 1 ))
    else
        letter_b="@"
    fi

    # compare
    <a href="http://es.wikipedia.org/wiki/ ${letter_a} &lt; ${letter_b} "> ${letter_a} &lt; ${letter_b} </a> &amp;&amp; return 1
    <a href="http://es.wikipedia.org/wiki/ ${letter_a} &gt; ${letter_b} "> ${letter_a} &gt; ${letter_b} </a> &amp;&amp; return 3

    ### letter parts equal. compare suffixes in order.
    local suffix rule part r_lt r_gt
    for rule in "alpha=1" "beta=1" "pre=1" "rc=1" "p=3" "r=3" ; do
        suffix=${rule%%=*}
        r_lt=${rule##*=}
        <a href="http://es.wikipedia.org/wiki/ ${r_lt} -eq 1 "> ${r_lt} -eq 1 </a> &amp;&amp; r_gt=3 || r_gt=1

        local suffix_a=
        for part in ${parts_a[@]} ; do
            <a href="http://es.wikipedia.org/wiki/ ${part#${suffix}} != ${part} "> ${part#${suffix}} != ${part} </a> &amp;&amp; \
                [[ -z ${part##${suffix}*(<a href="http://es.wikipedia.org/wiki/:digit:">:digit:</a>)} ]] &amp;&amp; \
                suffix_a=${part#${suffix}}0
        done

        local suffix_b=
        for part in ${parts_b[@]} ; do
            <a href="http://es.wikipedia.org/wiki/ ${part#${suffix}} != ${part} "> ${part#${suffix}} != ${part} </a> &amp;&amp; \
                [[ -z ${part##${suffix}*(<a href="http://es.wikipedia.org/wiki/:digit:">:digit:</a>)} ]] &amp;&amp; \
                suffix_b=${part#${suffix}}0
        done

        <a href="http://es.wikipedia.org/wiki/ -z ${suffix_a} "> -z ${suffix_a} </a> &amp;&amp; <a href="http://es.wikipedia.org/wiki/ -z ${suffix_b} "> -z ${suffix_b} </a> &amp;&amp; continue

        <a href="http://es.wikipedia.org/wiki/ -z ${suffix_a} "> -z ${suffix_a} </a> &amp;&amp; return ${r_gt}
        <a href="http://es.wikipedia.org/wiki/ -z ${suffix_b} "> -z ${suffix_b} </a> &amp;&amp; return ${r_lt}

        # avoid octal problems
        suffix_a=${suffix_a##+(0)} ; suffix_a=${suffix_a:-0}
        suffix_b=${suffix_b##+(0)} ; suffix_b=${suffix_b:-0}

        <a href="http://es.wikipedia.org/wiki/ ${suffix_a} -lt ${suffix_b} "> ${suffix_a} -lt ${suffix_b} </a> &amp;&amp; return 1
        <a href="http://es.wikipedia.org/wiki/ ${suffix_a} -gt ${suffix_b} "> ${suffix_a} -gt ${suffix_b} </a> &amp;&amp; return 3
    done

    ### no differences.
    return 2
}

get_all_version_components() {
    local ver_str=${1} result result_idx=0
    result=( )

    while <a href="http://es.wikipedia.org/wiki/ -n "$ver_str" "> -n "$ver_str" </a> ; do
        case "${ver_str:0:1}" in
            # number: parse whilst we have a number
            <a href="http://es.wikipedia.org/wiki/:digit:">:digit:</a>)
                result[$result_idx]="${ver_str%%[^[:digit:]]*}"
                ver_str="${ver_str##+(<a href="http://es.wikipedia.org/wiki/:digit:">:digit:</a>)}"
                result_idx=$(($result_idx + 1))
                ;;

            # separator: single character
            [-_.])
                result[$result_idx]="${ver_str:0:1}"
                ver_str="${ver_str:1}"
                result_idx=$(($result_idx + 1))
                ;;

            # letter: grab the letters plus any following numbers
            <a href="http://es.wikipedia.org/wiki/:alpha:">:alpha:</a>)
                local not_match="${ver_str##+(<a href="http://es.wikipedia.org/wiki/:alpha:">:alpha:</a>)*(<a href="http://es.wikipedia.org/wiki/:digit:">:digit:</a>)}"
                result[$result_idx]=${ver_str:0:$((${#ver_str} - ${#not_match}))}
                ver_str="${not_match}"
                result_idx=$(($result_idx + 1))
                ;;

            # huh?
            *)
                result[$result_idx]="${ver_str:0:1}"
                ver_str="${ver_str:1}"
                result_idx=$(($result_idx + 1))
                ;;
        esac
    done

    echo ${result[@]}
}

get_package_dir() {
    if <a href="http://es.wikipedia.org/wiki/ -z ${1} "> -z ${1} </a> ; then
        pwd
        return 0
    fi

    if <a href="http://es.wikipedia.org/wiki/ -d ${1} "> -d ${1} </a> ; then
        readlink -f ${1}
        return 0
    fi

    get_portage_dir 1&gt;/dev/null
    if <a href="http://es.wikipedia.org/wiki/ ${1/\/} != ${1} "> ${1/\/} != ${1} </a> ; then
        local d=$(get_portage_dir )/${1}
        if <a href="http://es.wikipedia.org/wiki/ -d ${d} "> -d ${d} </a> ; then
            echo ${d}
            return 0
        fi
    else
        local d
        d=( $(echo $(get_portage_dir )/*-*/${1} ) )
        if [[ ${#d[@]} -gt 1 ]] ; then
            die "${1} is ambiguous"
        elif [[ -d ${d[0]} ]] ; then
            echo ${d[0]}
            return 0
        fi
    fi

    return 1
}

repeat() {
    local i
    for (( i=0 ; i &lt; ${1} ; i=$(( ${i} + 1 )) )) ; do
        echo -n "${2}"
    done
}

get_keywords() {
    (
        inherit() { :; }
        source ${1} 2&gt;/dev/null
        echo ${KEYWORDS}
    )
}

colorarch() {
    case "${1}" in
        amd64)
            echo -n -e "\033[0;33m${2}\033[0;0m"
            ;;
        x86)
            echo -n -e "\033[0;31m${2}\033[0;0m"
            ;;
        *)
            echo -n "${2}"
            ;;
    esac
}

colourise() {
    case "${1}" in
        \*)
            echo -n -e "\033[0;31m*\033[0;0m"
            ;;
        +)
            echo -n -e "\033[0;32m+\033[0;0m"
            ;;
        -)
            echo -n -e "\033[0;31m-\033[0;0m"
            ;;
        \~)
            echo -n -e "\033[0;33m~\033[0;0m"
            ;;
        *)
            echo -n "${1}"
            ;;
    esac
}

show_keyword_diagram() {
    echo -n -e "Keywords for \033[1;34m"
    local title=$(readlink -f $(pwd ) )
    title=${title#$(readlink -f ../.. )/*( )}
    echo -n "${title}"
    echo -e "\033[0;0m:"
    echo

    local archs= arch_length=0 arch=
    archs=( $(&lt; $(get_portage_dir )/profiles/arch.list ) )
    for arch in "${archs[@]}" ; do
        <a href="http://es.wikipedia.org/wiki/ ${#arch} -gt ${arch_length} "> ${#arch} -gt ${arch_length} </a> &amp;&amp; arch_length=${#arch}
    done

    local versions= pkgname= version_length=0 version=
    pkgname=$(basename $(readlink -f ./ ) )
    versions=( $(for e in $(echo *.ebuild ) ; do \
            <a href="http://es.wikipedia.org/wiki/ -f ${e} "> -f ${e} </a> &amp;&amp; echo ${e} | sed -e 's/\.ebuild$//g' \
                    -e "s/^${pkgname}-//g" ; \
            done ) )
    versions=( $(version_sort ${versions[@]} ) )
    for version in "${versions[@]}" ; do
        <a href="http://es.wikipedia.org/wiki/ ${#version} -gt ${version_length} "> ${#version} -gt ${version_length} </a> &amp;&amp; version_length=${#version}
    done

    local i=0 archletter=
    for (( i = 0 ; i &lt; ${arch_length} ; i=$(( ${i} + 1 )) )) ; do
        repeat ${version_length} " "
        echo -n " | "
        for arch in "${archs[@]}" ; do
            archletter="${arch:${i}:1}"
            echo -n "$(colorarch "${arch}" "${archletter:- }" ) "
        done
        echo
    done

    repeat ${version_length} "-"
    echo -n "-+"
    repeat ${#archs[@]} "--"
    echo

    for version in "${versions[@]}" ; do
        echo -n "${version}"
        repeat $(( ${version_length} - ${#version} )) " "
        echo -n " | "

        local keyword keywords
        keywords=( $(get_keywords "${pkgname}-${version}.ebuild" ) )
        for arch in "${archs[@]}" ; do
            local display=" "
            [[ ${keywords[@]/-\*} != ${keywords[@]} ]] &amp;&amp; display="*"
            for keyword in "${keywords[@]}" ; do
                [[ ${arch} == "${keyword#[~-]}" ]] &amp;&amp; \
                    display=${keyword:0:1} &amp;&amp; \
                    break;
            done
            [[ -z ${display#[~ *-]} ]] || display="+"
            echo -n "$(colourise "${display}" ) "
        done

        echo
    done
}

main() {
    local dir=$(get_package_dir "${1}" )
    <a href="http://es.wikipedia.org/wiki/ -z ${dir} "> -z ${dir} </a> &amp;&amp; die "Couldn't find '${1}'"
    cd ${dir}
    <a href="http://es.wikipedia.org/wiki/ $(echo *.ebuild ) != "*.ebuild" "> $(echo *.ebuild ) != "*.ebuild" </a> || die "No ebuilds in ${dir}"
    show_keyword_diagram
    true
}

main "$@"
</pre>
<p>En el caso de que no se encuentre en la ubicación original he hecho un micro mirror de la versión de fecha de hoy:</p>
<p><a title="eshowkw" href="http://www.solusan.com/wp-content/2008/01/eshowkw">eshowkw</a></p>
<p align="center"><a title="screenshot-07_01_2008-11_35_19_ver001.png" href="http://www.solusan.com/wp-content/2008/01/screenshot-07_01_2008-11_35_19_ver001.png"><img src="http://www.solusan.com/wp-content/2008/01/screenshot-07_01_2008-11_35_19_ver001.png" alt="screenshot-07_01_2008-11_35_19_ver001.png" /></a></p>
<p align="left">Slàinte!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/observando-si-un-paquete-esta-en-la-rama-inestable-o-no.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitorización de procesos: pgrep, pkill y psg</title>
		<link>http://www.solusan.com/monitorizacion-de-procesos-pgrep-pkill-y-psg.html</link>
		<comments>http://www.solusan.com/monitorizacion-de-procesos-pgrep-pkill-y-psg.html#comments</comments>
		<pubDate>Mon, 07 Jan 2008 07:51:58 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Monitorización de procesos: pgrep]]></category>
		<category><![CDATA[pkill y psg]]></category>

		<guid isPermaLink="false">http://www.solusan.com/monitorizacion-de-procesos-pgrep-pkill-y-psg.html</guid>
		<description><![CDATA[Muchas veces os habréis encontrado con que queréis matar una aplicación que no responde y al hacer un ps veis que hay varios procesos que pertenecen a la misma aplicación, entonces no que más remedio que matar los procesos uno a uno. Bueno, eso era así antes de conocer pgrep y pkill. pgrep es una [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.solusan.com/wp-content/2008/01/penguin-kill.jpg" title="penguin-kill.jpg"><img src="http://www.solusan.com/wp-content/2008/01/penguin-kill.thumbnail.jpg" alt="penguin-kill.jpg" align="right" /></a> Muchas veces os habréis encontrado con que queréis matar una aplicación que no responde y al hacer un ps veis que hay varios procesos que pertenecen a la misma aplicación, entonces no que más remedio que matar los procesos uno a uno. Bueno, eso era así antes de conocer pgrep y pkill. pgrep es una herramienta que dado un nombre de proceso muestra por pantalla los pid&#8217;s de todos los procesos con ese nombre y pkill es su complemento que en lugar de mostrar los procesos los mata directamente.</p>
<p>Ejecutaremos unas cuantas veces yes redirigiendo su salida a /dev/null y poniendo el proceso en background para tener algo con lo que trabajar:</p>
<pre class="programlisting"><span id="more-864"></span>
jgr@seiya ~ $ yes &amp;&gt; /dev/null &amp; yes &amp;&gt; /dev/null &amp; yes &amp;&gt; /dev/null &amp;

[1] 3670

[2] 3671

[3] 3672</pre>
<p>Si hacemos ahora un ps de los de toda la vida veremos esto (la última línea es el propio grep):</p>
<pre class="programlisting">
jgr@seiya ~ $ ps aux | grep yes

jgr       3670 42.8  0.0   4164   584 pts/2    R    20:12   0:19 yes

jgr       3671 41.4  0.0   4164   584 pts/2    R    20:12   0:19 yes

jgr       3672 42.8  0.0   4164   584 pts/2    R    20:12   0:19 yes

jgr       4244  0.0  0.0   6368   808 pts/2    S+   20:13   0:00 grep --colour=auto yes</pre>
<p>Ahora con pgrep veremos sólo los pid&#8217;s de los procesos:</p>
<pre class="programlisting">
jgr@seiya ~ $ pgrep yes

3670

3671

3672</pre>
<p>Y con pkill los matamos y con pgrep comprobaremos que estén realmente muertos:</p>
<pre class="programlisting">
jgr@seiya ~ $ pgrep yes

[1]   Terminado               yes &gt;&amp;/dev/null

[2]-  Terminado               yes &gt;&amp;/dev/null

[3]+  Terminado               yes &gt;&amp;/dev/null</pre>
<p>pgrep y pkill tienen algunas opciones interesantes como por ejemplo -l para mostrar el nombre de los procesos (sólo pgrep) o -u/-U para mostrar o matar sólo los procesos del usuario especificado y alguna más que podéis ver en el man de pgrep.</p>
<p>Bueno y ya que estamos con ps os enseñaré un alias que suelo usar en el .bashrc para hacer más cómodo el uso de ps:</p>
<pre class="programlisting">
export GREP_COLOR="1;32" #verde claro

alias grep='grep --colour=auto'

alias psg="ps aux | grep -v grep | grep"</pre>
<p>Básicamente lo que hacen estos alias es colorear las concordancias del grep y eliminar la última línea de la salida del ps que corresponde al propio grep. Aquí podéis ver un ejemplo otra vez con el proceso yes del ejemplo anterior:</p>
<p align="center"><img src="http://www.solusan.com/wp-content/2008/01/61fin.png" alt="61fin.png" /></p>
<p>Vía: <a href="http://emergeworld.blogspot.com/2007/12/monitorizacin-de-procesos-pgrep-pkill-y.html" title="http://emergeworld.blogspot.com/2007/12/monitorizacin-de-procesos-pgrep-pkill-y.html" target="_blank">http://emergeworld.blogspot.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/monitorizacion-de-procesos-pgrep-pkill-y-psg.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ver páginas de man con vim</title>
		<link>http://www.solusan.com/ver-paginas-de-man-con-vim.html</link>
		<comments>http://www.solusan.com/ver-paginas-de-man-con-vim.html#comments</comments>
		<pubDate>Mon, 07 Jan 2008 07:37:04 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ver páginas de man con vim]]></category>

		<guid isPermaLink="false">http://www.solusan.com/ver-paginas-de-man-con-vim.html</guid>
		<description><![CDATA[Un sencillo truco para usar vim como paginador de man en dos pasos: 1.- Añadid a vuestro .bashrc # export MANPAGER="col -b &#124; view -c 'set ft=man nomod nolist' -" 2.- Recargad las variables de entorno para poder usarlo en la shell actual: # source ~/.bashrc Ya está ya podéis usar vi para ver páginas [...]]]></description>
			<content:encoded><![CDATA[<p> Un sencillo truco para usar vim como paginador de man en dos pasos:</p>
<p>1.- Añadid a vuestro .bashrc</p>
<pre class="programlisting">
# export MANPAGER="col -b | view -c 'set ft=man nomod nolist' -"</pre>
<p>2.- Recargad las variables de entorno para poder usarlo en la shell actual:</p>
<pre class="programlisting">
# source ~/.bashrc</pre>
<p>Ya está ya podéis usar vi para ver páginas de man <img src='http://www.solusan.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Vía: <a href="http://emergeworld.blogspot.com/2007/12/ver-pginas-de-man-con-vim.html" title="http://emergeworld.blogspot.com/2007/12/ver-pginas-de-man-con-vim.html" target="_blank">http://emergeworld.blogspot.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/ver-paginas-de-man-con-vim.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalar livecd-tools en Gentoo (net-setup)</title>
		<link>http://www.solusan.com/instalar-livecd-tools-en-gentoo-net-setup.html</link>
		<comments>http://www.solusan.com/instalar-livecd-tools-en-gentoo-net-setup.html#comments</comments>
		<pubDate>Fri, 21 Dec 2007 09:37:01 +0000</pubDate>
		<dc:creator>Solusan</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.solusan.com/instalar-livecd-tools-en-gentoo-net-setup.html</guid>
		<description><![CDATA[Donde está el configurador de red de Gentoo ? Se trata de una aplicación que se invoca picando, net-setup. Es muy práctica y se encuentra dentro del conjunto de aplicaciones que viven en livecd-tools. Consola: sefirot@sama ~ $ eix livecd-tools * app-misc/livecd-tools Available versions: 1.0.36 ~1.0.37 [M]~1.0.38 ~1.0.39 {X opengl} Homepage: http://www.gentoo.org Description: Gentoo LiveCD [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.solusan.com/wp-content/2007/12/gentoo_chick.jpg" title="gentoo_chick.jpg"><img src="http://www.solusan.com/wp-content/2007/12/gentoo_chick.thumbnail.jpg" alt="gentoo_chick.jpg" align="right" /></a>Donde está el configurador de red de Gentoo ?</p>
<p>Se trata de una aplicación que se invoca picando, net-setup.</p>
<p>Es muy práctica y se encuentra dentro del conjunto de aplicaciones que viven en livecd-tools.</p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Consola:<br />
</strong></span></td>
</tr>
<tr>
<td class="quote">sefirot@sama ~ $ eix livecd-tools<br />
* <span style="font-weight: bold">app-misc/livecd-tools</span><br />
Available versions:  1.0.36 ~1.0.37 [M]~1.0.38 ~1.0.39 {X opengl}<br />
Homepage:            <a href="http://www.gentoo.org/" target="_blank">http://www.gentoo.org</a><br />
Description:         Gentoo LiveCD tools for autoconfiguration of hardware</td>
</tr>
</table>
<p><span class="postbody"></span></p>
<table align="center" border="0" cellpadding="3" cellspacing="1" width="90%">
<tr>
<td><span class="genmed"><strong>Código:</strong></span></td>
</tr>
<tr>
<td class="code">emerge -av app-misc/livecd-tools</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.solusan.com/instalar-livecd-tools-en-gentoo-net-setup.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

