<?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>Vidul Nikolaev Petrov &#187; SA</title>
	<atom:link href="http://www.vidul.com/category/administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vidul.com</link>
	<description>my web space</description>
	<lastBuildDate>Fri, 09 Apr 2010 21:01:09 +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>Delete All Directories Except</title>
		<link>http://www.vidul.com/2010/03/27/delete-all-directories-except/</link>
		<comments>http://www.vidul.com/2010/03/27/delete-all-directories-except/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 00:20:04 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[except]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=647</guid>
		<description><![CDATA[Write a Bash function or an alias.

#######
### alias 
#######
alias _rm_except=&#34;rm -rf $(ls &#124; grep -v ^$1$)&#34;
&#160;
##########
### function
##########
_rm_except &#40;&#41; &#123; rm -rf $&#40;ls &#124; grep -v ^$1$&#41; &#125;
&#160;
# sample usage:
$ cd /tmp &#38;&#38; mkdir 1 2 3 11 22 33
$ _rm_except 1; ls
11  2  22  3  33






		
			Share this on Blinklist
		
		
			Share this on [...]]]></description>
			<content:encoded><![CDATA[<p>Write a <a title="Advanced Bash-Scripting Guide" href="http://tldp.org/LDP/abs/html/" target="_blank">Bash</a> function or an alias.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;"><span style="color: #666666; font-style: italic;">#######</span>
<span style="color: #666666; font-style: italic;">### alias </span>
<span style="color: #666666; font-style: italic;">#######</span>
<span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">_rm_except</span>=<span style="color: #ff0000;">&quot;rm -rf <span style="color: #007800;">$(ls | grep -v ^$1$)</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##########</span>
<span style="color: #666666; font-style: italic;">### function</span>
<span style="color: #666666; font-style: italic;">##########</span>
_rm_except <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> ^$<span style="color: #000000;">1</span>$<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sample usage:</span>
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000;">1</span> <span style="color: #000000;">2</span> <span style="color: #000000;">3</span> <span style="color: #000000;">11</span> <span style="color: #000000;">22</span> <span style="color: #000000;">33</span>
$ _rm_except <span style="color: #000000;">1</span>; <span style="color: #c20cb9; font-weight: bold;">ls</span>
<span style="color: #000000;">11</span>  <span style="color: #000000;">2</span>  <span style="color: #000000;">22</span>  <span style="color: #000000;">3</span>  <span style="color: #000000;">33</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2010/03/27/delete-all-directories-except/&amp;Title=Delete+All+Directories+Except+" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2010/03/27/delete-all-directories-except/&amp;title=Delete+All+Directories+Except+" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2010/03/27/delete-all-directories-except/&amp;title=Delete+All+Directories+Except+" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2010/03/27/delete-all-directories-except/&amp;title=Delete+All+Directories+Except+" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2010/03/27/delete-all-directories-except/&amp;title=Delete+All+Directories+Except+" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2010/03/27/delete-all-directories-except/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Delete+All+Directories+Except++-+http://b2l.me/mbefc+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2010/03/27/delete-all-directories-except/&amp;h=Delete+All+Directories+Except+" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2010/03/27/delete-all-directories-except/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automation of Systems Administration Tasks</title>
		<link>http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/</link>
		<comments>http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 08:25:45 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[automation]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=586</guid>
		<description><![CDATA[No need for complex, unclear, and clumsy programs like Capistrano.
Use Fabric, here is a short exmple, which automates the archive process of users&#8217; directories:

&#160;
# install the Python library
easy_install fabric
&#160;
# create a file called &#34;fabfile&#34;
# it will be used from the &#34;fab&#34; command
# add the following tasks in &#34;fabfile&#34;:


from fabric.api import *
&#160;
env.hosts = &#91;&#34;main&#34;&#93;
env.user  = [...]]]></description>
			<content:encoded><![CDATA[<p>No need for complex, unclear, and clumsy programs like <a title="Capistrano" href="http://www.google.com/search?q=capistrano" target="_blank">Capistrano</a>.</p>
<p>Use <a title="Fabric" href="http://docs.fabfile.org" target="_blank">Fabric</a>, here is a short exmple, which automates the archive process of users&#8217; directories:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;">&nbsp;
<span style="color: #666666; font-style: italic;"># install the Python library</span>
easy_install fabric
&nbsp;
<span style="color: #666666; font-style: italic;"># create a file called &quot;fabfile&quot;</span>
<span style="color: #666666; font-style: italic;"># it will be used from the &quot;fab&quot; command</span>
<span style="color: #666666; font-style: italic;"># add the following tasks in &quot;fabfile&quot;:</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:arial,verdana,monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> fabric.<span style="color: black;">api</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
env.<span style="color: black;">hosts</span> = <span style="color: black;">&#91;</span><span style="color: #483d8b;">&quot;main&quot;</span><span style="color: black;">&#93;</span>
env.<span style="color: #dc143c;">user</span>  = <span style="color: #483d8b;">&quot;root&quot;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> archive_home<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #dc143c;">cd</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;/tmp&quot;</span><span style="color: black;">&#41;</span>:
   run<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;zip -rq home_`date +%Y:%m:%d-%H:%M`.zip /home&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> archive_download<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
  <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;scp %s:/tmp/home_*.zip /home/su/archive&quot;</span> <span style="color: #66cc66;">%</span> env.<span style="color: black;">hosts</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> archive_remove<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
  run<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;rm /tmp/home_*.zip&quot;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>In addition you can use <a href="http://www.google.com/search?q=Python+decorators">decorators</a> to specify different hosts for different tasks.</p>
<p>More about the &#8220;fab&#8221; command:</p>

<div class="wp_syntax"><div class="code"><pre class="default" style="font-family:arial,verdana,monospace;">fab --help
Usage: fab [options] (command) [:arg1,arg2=val2,host=foo,hosts='h1;h2',...] ...
&nbsp;
Options:
  -h, --help       show this help message and exit
  -V, --version  show program's version number and exit
  -l, --list           print list of possible commands and exit
  -d COMMAND, --display=COMMAND
                        print detailed info about a given command and exit
  -r, --reject-unknown-hosts
                        reject unknown hosts
  -D, --disable-known-hosts
                        do not load user known_hosts file
  -u USER, --user=USER  username to use when connecting to remote hosts
  -p PASSWORD, --password=PASSWORD
                        password for use with authentication and/or sudo
  -H HOSTS, --hosts=HOSTS
                        comma-separated list of hosts to operate on
  -R ROLES, --roles=ROLES
                        comma-separated list of roles to operate on
  -i KEY_FILENAME       path to SSH private key file. May be repeated.
  -f FABFILE, --fabfile=FABFILE
                        name of fabfile to load, e.g. 'fabfile.py' or
                        '../other.py'
  -w, --warn-only       warn, instead of abort, when commands fail
  -s SHELL, --shell=SHELL
                        specify a new shell, defaults to '/bin/bash -l -c'
  -c RCFILE, --config=RCFILE
                        specify location of config file to use
  --hide=LEVELS           comma-separated list of output levels to hide
  --show=LEVELS         comma-separated list of output levels to show</pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/&amp;Title=Automation+of+Systems+Administration+Tasks" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/&amp;title=Automation+of+Systems+Administration+Tasks" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/&amp;title=Automation+of+Systems+Administration+Tasks" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/&amp;title=Automation+of+Systems+Administration+Tasks" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/&amp;title=Automation+of+Systems+Administration+Tasks" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Automation+of+Systems+Administration+Tasks+-+http://b2l.me/e65gq+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/&amp;h=Automation+of+Systems+Administration+Tasks" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2010/01/31/automation-of-systems-administration-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ssh fails silently on key authentication</title>
		<link>http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/</link>
		<comments>http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 15:47:04 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=561</guid>
		<description><![CDATA[If it happens that only root (or no one) can use key authentication, most probably the permissions are wrong. Check the following permissions:

ls -ld ~/.ssh &#124; awk '{print $1}'
# should return drwx------
# otherwise: chmod 0700 ~/.ssh






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on [...]]]></description>
			<content:encoded><![CDATA[<p>If it happens that only root (or no one) can use key authentication, most probably the permissions are wrong. Check the following permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-ld</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span>
<span style="color: #666666; font-style: italic;"># should return drwx------</span>
<span style="color: #666666; font-style: italic;"># otherwise: chmod 0700 ~/.ssh</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/&amp;Title=ssh+fails+silently+on+key+authentication" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/&amp;title=ssh+fails+silently+on+key+authentication" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/&amp;title=ssh+fails+silently+on+key+authentication" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/&amp;title=ssh+fails+silently+on+key+authentication" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/&amp;title=ssh+fails+silently+on+key+authentication" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=ssh+fails+silently+on+key+authentication+-+http://b2l.me/d8pdt+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/&amp;h=ssh+fails+silently+on+key+authentication" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2010/01/20/ssh-fails-silently-on-key-authentication-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>socket.error: (99, &#8216;Cannot assign requested address&#8217;)</title>
		<link>http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/</link>
		<comments>http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 20:07:09 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=548</guid>
		<description><![CDATA[Enable the localhost interface:
/sbin/ifconfig lo up





		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Technorati
		
		
			Tweet This!
		
		
			Seed this on Newsvine
		





]]></description>
			<content:encoded><![CDATA[<p>Enable the localhost interface:<br />
<code>/sbin/ifconfig lo up</code></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/&amp;Title=socket.error%3A+%2899%2C+%27Cannot+assign+requested+address%27%29" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/&amp;title=socket.error%3A+%2899%2C+%27Cannot+assign+requested+address%27%29" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/&amp;title=socket.error%3A+%2899%2C+%27Cannot+assign+requested+address%27%29" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/&amp;title=socket.error%3A+%2899%2C+%27Cannot+assign+requested+address%27%29" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/&amp;title=socket.error%3A+%2899%2C+%27Cannot+assign+requested+address%27%29" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=socket.error%3A+%2899%2C+%27Cannot+assign+requested+address%27%29+-+http://b2l.me/cb4bq+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/&amp;h=socket.error%3A+%2899%2C+%27Cannot+assign+requested+address%27%29" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/12/27/socket-error-99-cannot-assign-requested-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>`mkdir` and `cd` at once</title>
		<link>http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/</link>
		<comments>http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 10:50:39 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=525</guid>
		<description><![CDATA[I am sick of mkdir dir_name; cd dir_name;
The solution (put this function in &#8220;.bashrc&#8221; or whatever shell config file you use):

_mkcd &#40;&#41; &#123;
       mkdir -p $1
       cd $1
&#125;
# usage: _mkcd /tmp/dir_1/dir_2
# pwd will show: /tmp/dir_1/dir_2






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this [...]]]></description>
			<content:encoded><![CDATA[<p>I am sick of <em>mkdir dir_name; cd dir_name;</em><br />
The solution (put this function in &#8220;.bashrc&#8221; or whatever shell config file you use):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;">_mkcd <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
       <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> $<span style="color: #000000;">1</span>
       <span style="color: #7a0874; font-weight: bold;">cd</span> $<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;"># usage: _mkcd /tmp/dir_1/dir_2</span>
<span style="color: #666666; font-style: italic;"># pwd will show: /tmp/dir_1/dir_2</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/&amp;Title=%60mkdir%60+and+%60cd%60+at+once" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/&amp;title=%60mkdir%60+and+%60cd%60+at+once" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/&amp;title=%60mkdir%60+and+%60cd%60+at+once" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/&amp;title=%60mkdir%60+and+%60cd%60+at+once" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/&amp;title=%60mkdir%60+and+%60cd%60+at+once" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=%60mkdir%60+and+%60cd%60+at+once+-+http://b2l.me/bndfn+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/&amp;h=%60mkdir%60+and+%60cd%60+at+once" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/12/16/mkdir-and-cd-simultaneously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>unarchive files</title>
		<link>http://www.vidul.com/2009/12/14/unarchive-files/</link>
		<comments>http://www.vidul.com/2009/12/14/unarchive-files/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 19:31:21 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[archive]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=510</guid>
		<description><![CDATA[a sample BASH function (usually resides in $HOMES/.bashrc)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
extract &#40;&#41; &#123;
        if &#91; -f $1 &#93; ; then
                case $1 in
              [...]]]></description>
			<content:encoded><![CDATA[<p><code>a sample <a href="http://en.wikipedia.org/wiki/Bash">BASH</a> function (usually resides in $HOMES/.bashrc)</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="bash" style="font-family:arial,verdana,monospace;">extract <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> $<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #000000; font-weight: bold;">case</span> $<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">in</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.tar.bz2<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xjf $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.tar.gz<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xzf $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.bz2<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">bunzip2</span> $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.rar<span style="color: #7a0874; font-weight: bold;">&#41;</span> rar x $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.gz<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">gunzip</span> $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.tar<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xf $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.tbz2<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xjf $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.tgz<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xzf $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.zip<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #c20cb9; font-weight: bold;">unzip</span> $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span>.Z<span style="color: #7a0874; font-weight: bold;">&#41;</span> uncompress $<span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">;;</span>
                        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;'$1' cannot be extracted via extract()&quot;</span><span style="color: #000000; font-weight: bold;">;;</span>
                <span style="color: #000000; font-weight: bold;">esac</span>
        <span style="color: #000000; font-weight: bold;">else</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;'$1' is not a valid file&quot;</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/12/14/unarchive-files/&amp;Title=unarchive+files" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/12/14/unarchive-files/&amp;title=unarchive+files" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/12/14/unarchive-files/&amp;title=unarchive+files" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/12/14/unarchive-files/&amp;title=unarchive+files" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/12/14/unarchive-files/&amp;title=unarchive+files" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/12/14/unarchive-files/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=unarchive+files+-+http://b2l.me/bj24d+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/12/14/unarchive-files/&amp;h=unarchive+files" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/12/14/unarchive-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iptables &#8211; blocking incoming traffic</title>
		<link>http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/</link>
		<comments>http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 16:28:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[This iptables config will block all incoming traffic, except from machines, identified by thier MAC addresses:
iptables -F INPUT

iptables -A INPUT -m mac—mac-source 00:3f:5f:ab:2c:7d -j ACCEPT

iptables -A INPUT -m mac—mac-source 00:1e:32:36:97:4a -j ACCEPT

iptables -A INPUT -m mac—mac-source 00:44:11:a5:1d:6d -j ACCEPT

# or by ip address:

#iptables -A INPUT -p tcp -s 1.1.1.1 -j ACCEPT

#iptables -A INPUT -p tcp [...]]]></description>
			<content:encoded><![CDATA[<p>This <em>iptables</em> config will block all incoming traffic, except from machines, identified by thier <span class="caps">MAC</span> addresses:</p>
<pre lang="bash" escape="false"><span id="__end"><em>iptables -F <span class="caps">INPUT</span>

iptables -A <span class="caps">INPUT</span> -m mac—mac-source 00:3f:5f:ab:2c:7d -j <span class="caps">ACCEPT</span>

iptables -A <span class="caps">INPUT</span> -m mac—mac-source 00:1e:32:36:97:4a -j <span class="caps">ACCEPT</span>

iptables -A <span class="caps">INPUT</span> -m mac—mac-source 00:44:11:a5:1d:6d -j <span class="caps">ACCEPT</span>

# or by ip address:

#iptables -A <span class="caps">INPUT</span> -p tcp -s 1.1.1.1 -j <span class="caps">ACCEPT</span>

#iptables -A <span class="caps">INPUT</span> -p tcp -s 2.2.2.2 -j <span class="caps">ACCEPT</span>

#iptables -A <span class="caps">INPUT</span> -p tcp -s 3.3.3.3 -j <span class="caps">ACCEPT</span>

iptables -A <span class="caps">INPUT</span> -m state—state <span class="caps">ESTABLISHED</span> -j <span class="caps">ACCEPT</span>

iptables -A <span class="caps">INPUT</span> -s 127.0.0.1 -j <span class="caps">ACCEPT</span>

iptables -A <span class="caps">INPUT</span> -j <span class="caps">REJECT</span>
</em></span></pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/&amp;Title=iptables+-+blocking+incoming+traffic" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/&amp;title=iptables+-+blocking+incoming+traffic" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/&amp;title=iptables+-+blocking+incoming+traffic" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/&amp;title=iptables+-+blocking+incoming+traffic" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/&amp;title=iptables+-+blocking+incoming+traffic" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=iptables+-+blocking+incoming+traffic+-+http://b2l.me/bm7pp+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/&amp;h=iptables+-+blocking+incoming+traffic" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/02/14/iptables-blocking-incoming-traffic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PS1 colors</title>
		<link>http://www.vidul.com/2009/02/14/ps1-colors/</link>
		<comments>http://www.vidul.com/2009/02/14/ps1-colors/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 09:11:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[I like to see green prompt for userid > 0 and red for root, also the hostname and the history number of a command.

PS1=&#34;\[\e[32;1m\]\u\[\e[30;1m\]@\[\e[32;1m\]\H[\!]\W\[\e[30;1m\]\\$\[\e[0m\]&#34;


PS1=&#34;\[\e[32;1m\]\u\[\e[30;1m\]@\[\e[32;1m\]\H[\!]\W\[\e[30;1m\]\\$\[\e[0m\]&#34;






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Technorati
		
		
			Tweet This!
		
		
			Seed this on Newsvine
		





]]></description>
			<content:encoded><![CDATA[<p>I like to see green prompt for userid > 0 and red for root, also the hostname and the history number of a command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;"><span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;\[\e[32;1m\]\u\[\e[30;1m\]@\[\e[32;1m\]\H[\!]\W\[\e[30;1m\]\<span style="color: #000099; font-weight: bold;">\$</span>\[\e[0m\]&quot;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;"><span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;\[\e[32;1m\]\u\[\e[30;1m\]@\[\e[32;1m\]\H[\!]\W\[\e[30;1m\]\<span style="color: #000099; font-weight: bold;">\$</span>\[\e[0m\]&quot;</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/02/14/ps1-colors/&amp;Title=PS1+colors" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/02/14/ps1-colors/&amp;title=PS1+colors" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/02/14/ps1-colors/&amp;title=PS1+colors" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/02/14/ps1-colors/&amp;title=PS1+colors" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/02/14/ps1-colors/&amp;title=PS1+colors" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/02/14/ps1-colors/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=PS1+colors+-+http://b2l.me/bj3t9+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/02/14/ps1-colors/&amp;h=PS1+colors" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/02/14/ps1-colors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to monitor ip addresses from a log file</title>
		<link>http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/</link>
		<comments>http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 00:12:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[address]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[
tail -f production.log  &#124; egrep &#34;([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}&#34;






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Technorati
		
		
			Tweet This!
		
		
			Seed this on Newsvine
		





]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;"><span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> production.log  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #ff0000;">&quot;([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}&quot;</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/&amp;Title=how+to+monitor+ip+addresses+from+a+log+file" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/&amp;title=how+to+monitor+ip+addresses+from+a+log+file" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/&amp;title=how+to+monitor+ip+addresses+from+a+log+file" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/&amp;title=how+to+monitor+ip+addresses+from+a+log+file" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/&amp;title=how+to+monitor+ip+addresses+from+a+log+file" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=how+to+monitor+ip+addresses+from+a+log+file+-+http://b2l.me/bncw2+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/&amp;h=how+to+monitor+ip+addresses+from+a+log+file" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/01/28/how-to-monitor-ip-addresses-from-a-log-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Problems with KDE</title>
		<link>http://www.vidul.com/2009/01/18/security-problems-with-kde/</link>
		<comments>http://www.vidul.com/2009/01/18/security-problems-with-kde/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 09:39:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[SA]]></category>
		<category><![CDATA[firewall]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[From tcpdump it becomes obvious that some kde apps are contacting jamaica.kde.org through http!?
I cannot understand this M$ type of behavior in UNIX env,  neither I want , so here is a quick solution:

iptables -A OUTPUT -d 62.70.27.118 -p tcp -j DROP
iptables -A OUTPUT  -j  ACCEPT






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg [...]]]></description>
			<content:encoded><![CDATA[<p>From tcpdump it becomes obvious that some kde apps are contacting jamaica.kde.org through http!?<br />
I cannot understand this M$ type of behavior in <span class="caps">UNIX</span> env,  neither I want , so here is a quick solution:</p>
<p><b><br />
iptables -A <span class="caps">OUTPUT</span> -d 62.70.27.118 -p tcp -j <span class="caps">DROP</span><br />
iptables -A <span class="caps">OUTPUT</span>  -j  <span class="caps">ACCEPT</span><br />
</b></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/01/18/security-problems-with-kde/&amp;Title=Security+Problems+with+KDE" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/01/18/security-problems-with-kde/&amp;title=Security+Problems+with+KDE" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/01/18/security-problems-with-kde/&amp;title=Security+Problems+with+KDE" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/01/18/security-problems-with-kde/&amp;title=Security+Problems+with+KDE" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/01/18/security-problems-with-kde/&amp;title=Security+Problems+with+KDE" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/01/18/security-problems-with-kde/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Security+Problems+with+KDE+-+http://b2l.me/bkenr+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/01/18/security-problems-with-kde/&amp;h=Security+Problems+with+KDE" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/01/18/security-problems-with-kde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
