<?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; scripts</title>
	<atom:link href="http://www.vidul.com/category/scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vidul.com</link>
	<description>my web space</description>
	<lastBuildDate>Thu, 09 Sep 2010 22:51:55 +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 Trac Tables</title>
		<link>http://www.vidul.com/2009/08/27/delete-trac-tables/</link>
		<comments>http://www.vidul.com/2009/08/27/delete-trac-tables/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 15:55:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Trac]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[
for i in `sqlite3 trac.db '.tables'`; do sqlite3 trac.db &#34;delete from $i&#34;; done






		
			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: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>sqlite3 trac.db <span style="color: #ff0000;">'.tables'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span> sqlite3 trac.db <span style="color: #ff0000;">&quot;delete from <span style="color: #007800;">$i</span>&quot;</span>; <span style="color: #000000; font-weight: bold;">done</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/08/27/delete-trac-tables/&amp;Title=Delete+Trac+Tables" 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/08/27/delete-trac-tables/&amp;title=Delete+Trac+Tables" 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/08/27/delete-trac-tables/&amp;title=Delete+Trac+Tables" 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/08/27/delete-trac-tables/&amp;title=Delete+Trac+Tables" 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/08/27/delete-trac-tables/&amp;title=Delete+Trac+Tables" 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/08/27/delete-trac-tables/" 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+Trac+Tables+-+http://b2l.me/bj3dv+" 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/08/27/delete-trac-tables/&amp;h=Delete+Trac+Tables" 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/08/27/delete-trac-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate HTML with Javascript</title>
		<link>http://www.vidul.com/2009/07/29/generate-html-with-javascript/</link>
		<comments>http://www.vidul.com/2009/07/29/generate-html-with-javascript/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 02:57:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[sample HTML file

&#60; !DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34;
   &#34;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#62;
&#60;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;
      xml:lang=&#34;en&#34;&#62;
  &#60;head&#62;
    &#60;script src=&#34;jquery.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
  &#60;/head&#62;
  &#60;body&#62;
    &#60;div id=&#34;container&#34;&#62;&#60;/div&#62;
    &#60;script src=&#34;gen.html.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
  &#60;/body&#62;
&#60;/html&#62;

sample JavaScript file (should be named gen.html.js)

$&#40;&#34;#container&#34;&#41;.css&#40;&#123;margin:&#34;5% auto 5% auto&#34;,width:&#34;70%&#34;,'max-width':&#34;70%&#34;&#125;&#41;;
$&#40;&#34;#container&#34;&#41;.append&#40;&#34;&#60;div id='header'&#62;this [...]]]></description>
			<content:encoded><![CDATA[<p><strong>sample HTML file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="default" style="font-family:arial,verdana,monospace;">&lt; !DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
   &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      xml:lang=&quot;en&quot;&gt;
  &lt;head&gt;
    &lt;script src=&quot;jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id=&quot;container&quot;&gt;&lt;/div&gt;
    &lt;script src=&quot;gen.html.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p><strong>sample JavaScript file</strong> (should be named gen.html.js)</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:arial,verdana,monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#container&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>margin<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;5% auto 5% auto&quot;</span><span style="color: #339933;">,</span>width<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;70%&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'max-width'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;70%&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#container&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id='header'&gt;this is the header&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#container&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id='body'&gt;this is the body&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#container&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div id='footer'&gt;this is the footer&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#header&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;100%&quot;</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;33px&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'padding-top'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;10px&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'text-align'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;center&quot;</span><span style="color: #339933;">,</span>border<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;1px solid #777&quot;</span><span style="color: #339933;">,</span>background<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#ddd&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#header&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style='clear:both'&gt;&amp;&amp;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;100%&quot;</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;50%&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'madrgin-top'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;2%&quot;</span><span style="color: #339933;">,</span>border<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;1px solid #777&quot;</span><span style="color: #339933;">,</span>background<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#eee&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style='clear:both'&gt;&amp;nbsp;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#footer&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>width<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;100%&quot;</span><span style="color: #339933;">,</span>height<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;33px&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'padding-top'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;10px&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'text-align'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;center&quot;</span><span style="color: #339933;">,</span>border<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;1px solid #777&quot;</span><span style="color: #339933;">,</span>background<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#ddd&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p&gt;1. sub body&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p&gt;2. sub body&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#body p:first&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;text-decoration&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;underline&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#body p:last&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;text-decoration&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;overline&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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/07/29/generate-html-with-javascript/&amp;Title=Generate+HTML+with+Javascript" 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/07/29/generate-html-with-javascript/&amp;title=Generate+HTML+with+Javascript" 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/07/29/generate-html-with-javascript/&amp;title=Generate+HTML+with+Javascript" 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/07/29/generate-html-with-javascript/&amp;title=Generate+HTML+with+Javascript" 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/07/29/generate-html-with-javascript/&amp;title=Generate+HTML+with+Javascript" 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/07/29/generate-html-with-javascript/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Generate+HTML+with+Javascript+-+http://b2l.me/bj3dw+" 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/07/29/generate-html-with-javascript/&amp;h=Generate+HTML+with+Javascript" 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/07/29/generate-html-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to sort a file by its columns</title>
		<link>http://www.vidul.com/2009/06/04/how-to-sort-a-file-by-its-columns/</link>
		<comments>http://www.vidul.com/2009/06/04/how-to-sort-a-file-by-its-columns/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 02:29:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[sorting]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[
# sort by user id
ruby -a -F: -ne 'puts $F.values_at(2, 0).join(&#34;\t&#34;)' '/etc/passwd' &#124; sort -g
&#160;
# sort by user home directory
ruby -a -F: -ne 'puts $F.values_at(5, 0).join(&#34;\t&#34;)' '/etc/passwd' &#124; sort -g
&#160;
# sort by username
ruby -a -F: -ne 'puts $F.values_at(0).join(&#34;\t&#34;)' '/etc/passwd' &#124; sort -g






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;"><span style="color: #666666; font-style: italic;"># sort by user id</span>
ruby <span style="color: #660033;">-a</span> -F: <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">'puts $F.values_at(2, 0).join(&quot;\t&quot;)'</span> <span style="color: #ff0000;">'/etc/passwd'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-g</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sort by user home directory</span>
ruby <span style="color: #660033;">-a</span> -F: <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">'puts $F.values_at(5, 0).join(&quot;\t&quot;)'</span> <span style="color: #ff0000;">'/etc/passwd'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-g</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sort by username</span>
ruby <span style="color: #660033;">-a</span> -F: <span style="color: #660033;">-ne</span> <span style="color: #ff0000;">'puts $F.values_at(0).join(&quot;\t&quot;)'</span> <span style="color: #ff0000;">'/etc/passwd'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sort</span> <span style="color: #660033;">-g</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/06/04/how-to-sort-a-file-by-its-columns/&amp;Title=How+to+sort+a+file+by+its+columns" 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/06/04/how-to-sort-a-file-by-its-columns/&amp;title=How+to+sort+a+file+by+its+columns" 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/06/04/how-to-sort-a-file-by-its-columns/&amp;title=How+to+sort+a+file+by+its+columns" 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/06/04/how-to-sort-a-file-by-its-columns/&amp;title=How+to+sort+a+file+by+its+columns" 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/06/04/how-to-sort-a-file-by-its-columns/&amp;title=How+to+sort+a+file+by+its+columns" 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/06/04/how-to-sort-a-file-by-its-columns/" 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+sort+a+file+by+its+columns+-+http://b2l.me/bj3dx+" 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/06/04/how-to-sort-a-file-by-its-columns/&amp;h=How+to+sort+a+file+by+its+columns" 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/06/04/how-to-sort-a-file-by-its-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a quick remedy for ipod shuffle illnesses</title>
		<link>http://www.vidul.com/2009/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/</link>
		<comments>http://www.vidul.com/2009/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 02:02:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[Symptoms: one green light flash, followed by two green ones.
Conclusion: the player is dead.
Remedy: download ipod reset utility, reset the player and

# change _path_to_the_device_ with the real path (see `dmesg&#124;tail`)
&#160;
mount /dev/_path_to_the_device_  /mnt &#38;&#38; cd /mnt
&#160;
# download rebuild_db.py from http://shuffle-db.sourceforge.net/
# copy 'rebuild_db.py' in /mnt and create the dirs' structure
&#160;
python -c '
import os
os.makedirs(&#34;iPod_Control/iTunes&#34;)
os.makedirs(&#34;Music&#34;)
'
&#160;
cd /mnt &#38;&#38; cp [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Symptoms</strong>: one green light flash, followed by two green ones.</p>
<p><strong>Conclusion</strong>: the player is dead.</p>
<p><strong>Remedy</strong>: download <a href="http://www.apple.com/search/support/?q=iPod+Reset+Utility">ipod reset utility</a>, reset the player and</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:arial,verdana,monospace;"><span style="color: #666666; font-style: italic;"># change _path_to_the_device_ with the real path (see `dmesg|tail`)</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>_path_to_the_device_  <span style="color: #000000; font-weight: bold;">/</span>mnt <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>mnt
&nbsp;
<span style="color: #666666; font-style: italic;"># download rebuild_db.py from http://shuffle-db.sourceforge.net/</span>
<span style="color: #666666; font-style: italic;"># copy 'rebuild_db.py' in /mnt and create the dirs' structure</span>
&nbsp;
python <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'
import os
os.makedirs(&quot;iPod_Control/iTunes&quot;)
os.makedirs(&quot;Music&quot;)
'</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>mnt <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>Music<span style="color: #000000; font-weight: bold;">/*</span>.mp3 Music
python rebuild_db.py
<span style="color: #7a0874; font-weight: bold;">cd</span> .. <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">umount</span></pre></div></div>

<p>That’s it.</p>
<p>P.S. you can format an ipod device as many times as you like,<br />
just follow the above procedure to reset it.</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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/&amp;Title=a+quick+remedy+for+ipod+shuffle+illnesses" 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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/&amp;title=a+quick+remedy+for+ipod+shuffle+illnesses" 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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/&amp;title=a+quick+remedy+for+ipod+shuffle+illnesses" 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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/&amp;title=a+quick+remedy+for+ipod+shuffle+illnesses" 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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/&amp;title=a+quick+remedy+for+ipod+shuffle+illnesses" 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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=a+quick+remedy+for+ipod+shuffle+illnesses+-+http://b2l.me/bj3d2+" 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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/&amp;h=a+quick+remedy+for+ipod+shuffle+illnesses" 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/03/18/an-easy-remedy-for-ipod-shuffle-illnesses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to download an image from flickr</title>
		<link>http://www.vidul.com/2009/03/11/howto-download-an-image-from-flickr/</link>
		<comments>http://www.vidul.com/2009/03/11/howto-download-an-image-from-flickr/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 21:10:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[I wasn’t able to download a photo from flickr. It happened to be 1px transparent image over the other. Here is a simple scaper in cases of such “protection”:

1
2
3
4
5
6
7
8
9
10
11
12
require 'rubygems'
require 'www/mechanize'
&#160;
url = 'http://www.flickr.com/photos/46457493@N00/3162339409/in/set-72157612102050814/'
&#160;
my_id = url.split&#40;&#34;/&#34;&#41;&#91;-3&#93;
agent  = WWW::Mechanize.new
page   = agent.get&#40;url&#41;
&#160;
url   = page.search&#40;&#34;//div[@id='photoImgDiv#{my_id}']/img&#34;&#41;.attr&#40;'src'&#41;
&#160;
agent.get&#40;url&#41;.save_as&#40;&#40;File.basename&#40;url&#41;&#41;.split&#40;&#34;?&#34;&#41;&#91;0&#93;&#41;






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on [...]]]></description>
			<content:encoded><![CDATA[<p>I wasn’t able to download a photo from flickr. It happened to be 1px transparent image over the other. Here is a simple scaper in cases of such <a href="http://en.wikipedia.org/wiki/Security_through_obscurity">“protection”</a>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'www/mechanize'</span>
&nbsp;
url = <span style="color:#996600;">'http://www.flickr.com/photos/46457493@N00/3162339409/in/set-72157612102050814/'</span>
&nbsp;
my_id = url.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>
agent  = <span style="color:#6666ff; font-weight:bold;">WWW::Mechanize</span>.<span style="color:#9900CC;">new</span>
page   = agent.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
url   = page.<span style="color:#9900CC;">search</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;//div[@id='photoImgDiv#{my_id}']/img&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">attr</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'src'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
agent.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">save_as</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;?&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</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/03/11/howto-download-an-image-from-flickr/&amp;Title=How+to+download+an+image+from+flickr" 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/03/11/howto-download-an-image-from-flickr/&amp;title=How+to+download+an+image+from+flickr" 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/03/11/howto-download-an-image-from-flickr/&amp;title=How+to+download+an+image+from+flickr" 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/03/11/howto-download-an-image-from-flickr/&amp;title=How+to+download+an+image+from+flickr" 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/03/11/howto-download-an-image-from-flickr/&amp;title=How+to+download+an+image+from+flickr" 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/03/11/howto-download-an-image-from-flickr/" 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+download+an+image+from+flickr+-+http://b2l.me/bwbpe+" 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/03/11/howto-download-an-image-from-flickr/&amp;h=How+to+download+an+image+from+flickr" 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/03/11/howto-download-an-image-from-flickr/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>Ultra Tiny Address Book</title>
		<link>http://www.vidul.com/2008/10/29/ultra-tiny-address-book/</link>
		<comments>http://www.vidul.com/2008/10/29/ultra-tiny-address-book/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 14:18:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[
#!/usr/bin/perl
&#160;
$s = shift;
$&#34;  = &#34;\n&#34;;
$/  = $\;
$_  = &#60;data&#62;;
@_ = /(.*?$s.*)/gi;
&#160;
print &#34;@_\n&#34;;
&#160;
__DATA__
&#160;
me &#34;some address&#34; my_phone_here
etc...
etc...&#60;/data&#62;






		
			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="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color:#ff6633; font-weight:bold;">$s</span> = shift;
$<span style="color:#996600;">&quot;  = &quot;</span>\n<span style="color:#996600;">&quot;;
$/  = $<span style="color:#000099;">\;</span>
$_  = &lt;data&gt;;
@_ = /(.*?$s.*)/gi;
&nbsp;
print &quot;</span><span style="color:#0066ff; font-weight:bold;">@_</span>\n<span style="color:#996600;">&quot;;
&nbsp;
__DATA__
&nbsp;
me &quot;</span>some address<span style="color:#996600;">&quot; my_phone_here
etc...
etc...&lt;/data&gt;</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/2008/10/29/ultra-tiny-address-book/&amp;Title=Ultra+Tiny+Address+Book" 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/2008/10/29/ultra-tiny-address-book/&amp;title=Ultra+Tiny+Address+Book" 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/2008/10/29/ultra-tiny-address-book/&amp;title=Ultra+Tiny+Address+Book" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2008/10/29/ultra-tiny-address-book/&amp;title=Ultra+Tiny+Address+Book" 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/2008/10/29/ultra-tiny-address-book/&amp;title=Ultra+Tiny+Address+Book" 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/2008/10/29/ultra-tiny-address-book/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Ultra+Tiny+Address+Book+-+http://b2l.me/bmtc2+" 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/2008/10/29/ultra-tiny-address-book/&amp;h=Ultra+Tiny+Address+Book" 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/2008/10/29/ultra-tiny-address-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Scanner (Host/Port)</title>
		<link>http://www.vidul.com/2008/09/28/quick-scanner-host-port/</link>
		<comments>http://www.vidul.com/2008/09/28/quick-scanner-host-port/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 20:09:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[scanner]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[
#!/usr/bin/ruby
&#160;
host_port = ARGV&#91;0&#93;
host = host_port.split&#40;':'&#41;.first
port = host_port.split&#40;':'&#41;.last
&#160;
puts %x&#91;nmap -p #{port} #{host}]

Or just:

#!/usr/bin/ruby
&#160;
puts %x&#91;nmap -p #{ARGV[0].split(':').reverse.join(' ')}]

Usage (cli and given that the script is named scan_proxy):

./scan_proxy 202.105.182.87:808






		
			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="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
&nbsp;
host_port = ARGV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
host = host_port.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">':'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">first</span>
port = host_port.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">':'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">last</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>nmap <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{port} #{host}]</span></pre></div></div>

<p>Or just:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#008000; font-style:italic;">#!/usr/bin/ruby</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#006600; font-weight:bold;">%</span>x<span style="color:#006600; font-weight:bold;">&#91;</span>nmap <span style="color:#006600; font-weight:bold;">-</span><span style="color:#CC0066; font-weight:bold;">p</span> <span style="color:#008000; font-style:italic;">#{ARGV[0].split(':').reverse.join(' ')}]</span></pre></div></div>

<p>Usage (cli and given that the script is named scan_proxy):</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;">.<span style="color:#006600; font-weight:bold;">/</span>scan_proxy 202.105.182.87:<span style="color:#006666;">808</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/2008/09/28/quick-scanner-host-port/&amp;Title=Quick+Scanner+%28Host%2FPort%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/2008/09/28/quick-scanner-host-port/&amp;title=Quick+Scanner+%28Host%2FPort%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/2008/09/28/quick-scanner-host-port/&amp;title=Quick+Scanner+%28Host%2FPort%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/2008/09/28/quick-scanner-host-port/&amp;title=Quick+Scanner+%28Host%2FPort%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/2008/09/28/quick-scanner-host-port/&amp;title=Quick+Scanner+%28Host%2FPort%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/2008/09/28/quick-scanner-host-port/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Quick+Scanner+%28Host%2FPort%29+-+http://b2l.me/bmr93+" 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/2008/09/28/quick-scanner-host-port/&amp;h=Quick+Scanner+%28Host%2FPort%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/2008/09/28/quick-scanner-host-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
