<?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>[bet0x@barrahome.org ~]$ &#187; /opt/blog/bash</title>
	<atom:link href="http://www.barrahome.org/category/optblogbash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barrahome.org</link>
	<description>Understand something,it is not about money nor personal, I just want to see the world burn!</description>
	<lastBuildDate>Tue, 27 Apr 2010 02:26:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Notificacion de Login/Logout en conexiones SSH.</title>
		<link>http://www.barrahome.org/2010/01/14/notificacion-de-loginlogout-en-conexiones-ssh/</link>
		<comments>http://www.barrahome.org/2010/01/14/notificacion-de-loginlogout-en-conexiones-ssh/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 05:19:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[/opt/blog/bash]]></category>
		<category><![CDATA[/opt/blog/security]]></category>

		<guid isPermaLink="false">http://www.barrahome.org/?p=91</guid>
		<description><![CDATA[Aunque se que no es muy seguro puesto puede ser borrado nos notificara antes que se realice tal evento.
Vamos a editar 2 archivos, el primero sera .bash_profile el cual nos notificara cuando ingresa al sistema la persona:
Debajo del primer comentario agregamos lo siguiente:
echo 'ALERT - Root Shell Access on:' `date` `who` &#124; mail -s &#34;Alert: [...]]]></description>
			<content:encoded><![CDATA[<p>Aunque se que no es muy seguro puesto puede ser borrado nos notificara antes que se realice tal evento.</p>
<p>Vamos a editar 2 archivos, el primero sera .bash_profile el cual nos notificara cuando ingresa al sistema la persona:</p>
<p>Debajo del primer comentario agregamos lo siguiente:</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'ALERT - Root Shell Access on:'</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">who</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Alert: Root Access from <span style="color: #780078;">`who | awk '{print $6}'`</span>&quot;</span> mi<span style="color: #000000; font-weight: bold;">@</span>email.com</div></div>
<p>Reemplazamos mi@email.com con el email el cual recibirá la alerta.</p>
<p>Ahora hacemos lo mismo con .bash_logout y agregamos lo siguiente:</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'ALERT - Root Shell Logout on:'</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">who</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">|</span> mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;Alert: Root Logout from <span style="color: #780078;">`who | awk '{print $6}'`</span>&quot;</span> mi<span style="color: #000000; font-weight: bold;">@</span>email.com</div></div>
<p>Con esto el servidor nos advertirá ante cualquier ingreso o salida del sistema. Prometo que para la próxima entrada sera algo muchísimo mas elaborado que esto.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrahome.org/2010/01/14/notificacion-de-loginlogout-en-conexiones-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple gestor de descargas en bash I</title>
		<link>http://www.barrahome.org/2009/09/09/simple-gestor-de-descargas-en-bash-i/</link>
		<comments>http://www.barrahome.org/2009/09/09/simple-gestor-de-descargas-en-bash-i/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 05:17:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[/opt/blog/bash]]></category>
		<category><![CDATA[/opt/blog/linux]]></category>

		<guid isPermaLink="false">http://www.barrahome.org/?p=21</guid>
		<description><![CDATA[Esto verdaderamente me fue útil, hoy dia lo sigo usando , es un simple script que nos permite bajar con wget las isos de una distro, vamos a dar un ejemplo, Fedora Core 6 contiene 6 CD’s, pero aveces no tenemos acceso a un gestor de descargas que nos permita gestionar lo que bajamos, por [...]]]></description>
			<content:encoded><![CDATA[<p>Esto verdaderamente me fue útil, hoy dia lo sigo usando , es un simple script que nos permite bajar con wget las isos de una distro, vamos a dar un ejemplo, Fedora Core 6 contiene 6 CD’s, pero aveces no tenemos acceso a un gestor de descargas que nos permita gestionar lo que bajamos, por ende vamos a improvisar uno muy muy simple.</p>
<div class="codecolorer-container bash mac-classic" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">seq</span> 1 5<span style="color: #000000; font-weight: bold;">`</span>;<br />
<span style="color: #000000; font-weight: bold;">do</span><br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-c</span> http:<span style="color: #000000; font-weight: bold;">//</span>mirror.linux.duke.edu<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>fedora<span style="color: #000000; font-weight: bold;">/</span>linux<span style="color: #000000; font-weight: bold;">/</span>core<span style="color: #000000; font-weight: bold;">/</span>6<span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>iso<span style="color: #000000; font-weight: bold;">/</span>FC-6-i386-disc<span style="color: #007800;">$i</span>.iso<br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<p>Como ven este simple script nos permite bajar una a una las imágenes de Fedora y le damos la opción -c a wget para continuar parcialmente en el caso de que vallamos a cancelar la descarga para mas adelante.</p>
<p>Ahora una breve explicacion de lo que hacemos con bash.</p>
<p>Como ven en la primera linea hacemos un bucle de $i, contando de 1 a 5, luego ejecutamos wget enviando como parámetro $i que es la cantidad de veces.</p>
<p>También se pueden agregar otro tipo de opciones, por ejemplo si tenemos los MD5 de la iso podemos hacer que cuando baje la iso se compare con un HASH de MD5, de esa forma sabremos que la ISO esta bien original y no corrupta, asi como podemos hacer un ping probe para saber si el host del cual descargamos la iso esta funcionando, y si no pasar al siguiente, pero bueno, esto lo dejamos para la próxima clase</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrahome.org/2009/09/09/simple-gestor-de-descargas-en-bash-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
