<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>personal storage for public use :)</title>
	<atom:link href="http://unixgate.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://unixgate.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 12 May 2008 14:39:13 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='unixgate.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1803a2715bbb486941447d8614f1a349?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>personal storage for public use :)</title>
		<link>http://unixgate.wordpress.com</link>
	</image>
			<item>
		<title>perl &#8211; print file names and their sizes</title>
		<link>http://unixgate.wordpress.com/2008/05/12/perl-print-file-names-and-their-sizes/</link>
		<comments>http://unixgate.wordpress.com/2008/05/12/perl-print-file-names-and-their-sizes/#comments</comments>
		<pubDate>Mon, 12 May 2008 14:28:44 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=14</guid>
		<description><![CDATA[This is simple one-liner to print all the files residing in the current folder, as well as their sizes; finally, perl will give you the total in bytes :
perl -e 'foreach() {$t+=-s;print "$_ ",-s,"\n"}print "Total: $t\n"'
hm, the editor keeps on removing the &#60; &#62; signs.
it should look like : open bracket, then the less than [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=14&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is simple one-liner to print all the files residing in the current folder, as well as their sizes; finally, perl will give you the total in bytes :</p>
<p><code>perl -e 'foreach() {$t+=-s;print "$_ ",-s,"\n"}print "Total: $t\n"'</code><br />
hm, the editor keeps on removing the &lt; &gt; signs.<br />
it should look like : open bracket, then the less than sign, asterisk, more than sign, closing bracket, but without the spaces in it.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=14&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/05/12/perl-print-file-names-and-their-sizes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>AIX : Focus on CPU-intensive user</title>
		<link>http://unixgate.wordpress.com/2008/04/30/aix-focus-on-cpu-intensive-user/</link>
		<comments>http://unixgate.wordpress.com/2008/04/30/aix-focus-on-cpu-intensive-user/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 13:21:32 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=12</guid>
		<description><![CDATA[This handy one-liner :
ps -ef &#124; egrep -v "STIME&#124;$LOGNAME" &#124; sort +3 -r &#124; head -n 15 is focusing on the highest recently used CPU-intensive user processes in the system. This may be useful when troubleshooting applications or looking at users&#8217; times.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=12&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This handy one-liner :<br />
<code>ps -ef | egrep -v "STIME|$LOGNAME" | sort +3 -r | head -n 15</code> is focusing on the highest recently used CPU-intensive user processes in the system. This may be useful when troubleshooting applications or looking at users&#8217; times.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=12&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/30/aix-focus-on-cpu-intensive-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>perl and the power of &#8216;pack&#8217;</title>
		<link>http://unixgate.wordpress.com/2008/04/29/perl-and-the-power-of-pack/</link>
		<comments>http://unixgate.wordpress.com/2008/04/29/perl-and-the-power-of-pack/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 12:28:17 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=11</guid>
		<description><![CDATA[One of my favorites is definitely perl, check out the following piece of code :
perl -e 'print pack(c5, (41*2), sqrt(7056), (unpack(c,H)-2), oct(115), 10)'
This cryptic one-liner actually prints : RTFM on your terminal.
The power of perl and the pack function may be discussed for a long time, check the pack for yourself.
     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=11&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One of my favorites is definitely perl, check out the following piece of code :<br />
<code>perl -e 'print pack(c5, (41*2), sqrt(7056), (unpack(c,H)-2), oct(115), 10)'</code><br />
This cryptic one-liner actually prints : RTFM on your terminal.<br />
The power of perl and the pack function may be discussed for a long time, <a href="http://perldoc.perl.org/functions/pack.html">check the pack</a> for yourself.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=11&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/29/perl-and-the-power-of-pack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>Handy mplayer alias</title>
		<link>http://unixgate.wordpress.com/2008/04/25/handy-mplayer-alias/</link>
		<comments>http://unixgate.wordpress.com/2008/04/25/handy-mplayer-alias/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 13:45:24 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=10</guid>
		<description><![CDATA[I found a fancy one-liner in another blog, but I don&#8217;t remember where 
locate -i "whatever band" &#124; grep -i "whatever album/song" &#124; perl -ne 's/^(.*)$/"$1"/ &#38;&#38; print' &#124; xargs mplayer &#8211; This can be easily parametrized with $1, $2 on bash or $band = $ARGV[0];
$song = $ARGV[1]; in perl and can be aliased in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=10&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I found a fancy one-liner in another blog, but I don&#8217;t remember where <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<code>locate -i "whatever band" | grep -i "whatever album/song" | perl -ne 's/^(.*)$/"$1"/ &amp;&amp; print' | xargs mplayer</code> &#8211; This can be easily parametrized with $1, $2 on bash or $band = $ARGV[0];<br />
$song = $ARGV[1]; in perl and can be aliased in .bashrc for example.<br />
I can&#8217;t use it currently because of mplayer issues, but they will be resolved in the near future <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=10&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/25/handy-mplayer-alias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>Find the size of MySQL tables</title>
		<link>http://unixgate.wordpress.com/2008/04/24/find-the-size-of-mysql-tables/</link>
		<comments>http://unixgate.wordpress.com/2008/04/24/find-the-size-of-mysql-tables/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 08:08:42 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=9</guid>
		<description><![CDATA[I&#8217;ve been searching the net for a clue on how to find the size of mysql tables &#8211; here&#8217;s what I found :
mysql test -e 'show table status' &#124;  perl -lane '$size += $F[6]+$F[8];END{print $size}'
mysql will assume that you have an alias in .bashrc for example, as follows :
alias mysql=&#8217;/path/to/mysql/bin/mysql &#8211;defaults-file=/path/to/mysql/conf/mysql.conf -pPassword&#8217;
Then, test is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=9&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been searching the net for a clue on how to find the size of mysql tables &#8211; here&#8217;s what I found :<br />
<code>mysql test -e 'show table status' |  perl -lane '$size += $F[6]+$F[8];END{print $size}'</code><br />
mysql will assume that you have an alias in .bashrc for example, as follows :</p>
<blockquote><p>alias mysql=&#8217;/path/to/mysql/bin/mysql &#8211;defaults-file=/path/to/mysql/conf/mysql.conf -pPassword&#8217;</p></blockquote>
<p>Then, test is the mysql DB, then you execute &#8220;show table status&#8221;, then the perl takes care of the rest, the output will be in bytes, I hope this will help someone, who as me, doesn&#8217;t care about having php installed. </p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=9&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/24/find-the-size-of-mysql-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>Python script to check for opened ports</title>
		<link>http://unixgate.wordpress.com/2008/04/23/python-script-to-check-for-opened-ports/</link>
		<comments>http://unixgate.wordpress.com/2008/04/23/python-script-to-check-for-opened-ports/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 07:31:42 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=8</guid>
		<description><![CDATA[In another article, I&#8217;ve mentioned the use of netcat to check for a listener on remote port at particular machine.
Here&#8217;s another example, yet more enhanced, written in python. The original idea belongs to a member of unix.com forums, nickname [Ghostdog74], I believe, again, I&#8217;ve modified it a little bit to serve my needs.
Most of you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=8&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In another article, I&#8217;ve mentioned the use of netcat to check for a listener on remote port at particular machine.<br />
Here&#8217;s another example, yet more enhanced, written in python. The original idea belongs to a member of <a href="http://unix.com">unix.com forums</a>, nickname [Ghostdog74], I believe, again, I&#8217;ve modified it a little bit to serve my needs.<br />
Most of you probably work in a multi-server environment, where you have all kinds of OSes &#8211; Linux, UNIX, Windows, etc &#8211; so called &#8220;TheServerFarm&#8221; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
As soon as you want to check whether a certain port is opened on a remote machine (iptables may be turned on) you can use the following python script : </p>
<p><code>#!/usr/bin/python</p>
<p>import socket<br />
import sys</p>
<p>if ( len(sys.argv) != 2 ):<br />
    print "Usage: " + sys.argv[0] + " Enter IP or FQDN as argument"<br />
    sys.exit(1)</p>
<p>remote_host = sys.argv[1]</p>
<p>for remote_port in [21,22,23,25,80,139,139,389,443,445,3128,3306,3389]:<br />
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br />
        sock.settimeout(20)<br />
        try:<br />
                sock.connect((remote_host, remote_port))<br />
        except Exception,e:<br />
                print "%d closed " % remote_port<br />
        else:<br />
                print "%d open" % remote_port<br />
        sock.close()</code><br />
The possible ports to be checked are listed in the following line :<br />
<code>for remote_port in [21,22,23,25,80,139,389,443,445,3128,3306,3389]</code><br />
Those are just generic ports, you can change the numbers to suit your needs, if, for example, your applications are running on specific ports. Here&#8217;s a sample report : </p>
<blockquote><p>[unixgate@unix.com ~]$ monports.py 10.10.1.21<br />
21 closed<br />
22 open<br />
23 closed<br />
80 open
</p></blockquote>
<p>Just change the IP address or supply Fully Qualified Domain Name.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=8&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/23/python-script-to-check-for-opened-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>Check to file permissions</title>
		<link>http://unixgate.wordpress.com/2008/04/23/check-to-file-permissions/</link>
		<comments>http://unixgate.wordpress.com/2008/04/23/check-to-file-permissions/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 07:18:02 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=7</guid>
		<description><![CDATA[If, for some reason, you&#8217;re not allowed to see the permissions of a file, or you don&#8217;t understand the rw-rwx-x format, you can use the following script :
#!/bin/bash
echo -n "Enter file name : "
read file
# find out if file has write permission or not
[ -w $file ] &#38;&#38; W="Write = yes" &#124;&#124; W="Write = No"
# [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=7&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If, for some reason, you&#8217;re not allowed to see the permissions of a file, or you don&#8217;t understand the rw-rwx-x format, you can use the following script :</p>
<p><code>#!/bin/bash</p>
<p>echo -n "Enter file name : "<br />
read file</p>
<p># find out if file has write permission or not<br />
[ -w $file ] &amp;&amp; W="Write = yes" || W="Write = No"<br />
# find out if file has excute permission or not<br />
[ -x $file ] &amp;&amp; X="Execute = yes" || X="Execute = No"<br />
# find out if file has read permission or not<br />
[ -r $file ] &amp;&amp; R="Read = yes" || R="Read = No"<br />
echo "$file's permissions, as follows : "<br />
echo "$W"<br />
echo "$R"<br />
echo "$X"</code><br />
The script source is originally taken from <a href="http://bash.cyberciti.biz/file-management/find-file-permission-script/">cybercity</a>, I&#8217;ve changed it a little bit.<br />
Here is a sample report : </p>
<p><code>[unixgate@unix.com ~]$ ./filePerms.sh<br />
Enter file name : template.doc<br />
template.doc's permissions, as follows :<br />
Write = yes<br />
Read = yes<br />
Execute = No</code></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=7&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/23/check-to-file-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>netcat &#8211; using it as port scanner</title>
		<link>http://unixgate.wordpress.com/2008/04/22/netcat-using-it-as-port-scanner/</link>
		<comments>http://unixgate.wordpress.com/2008/04/22/netcat-using-it-as-port-scanner/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 12:51:36 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=6</guid>
		<description><![CDATA[nc stands for NetCat &#8211; arbitrary TCP and UDP connections and listens &#8211; as stated in the manual, I love a lot of things written by BSD community, the *BSD itself as well, so this command too.
You can use it very easily to check for remote port like this :
nc -z serverName.net 22  - where nc is the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=6&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>nc stands for NetCat &#8211; arbitrary TCP and UDP connections and listens &#8211; as stated in the manual, I love a lot of things written by BSD community, the *BSD itself as well, so this command too.</p>
<p>You can use it very easily to check for remote port like this :</p>
<p>nc -z serverName.net 22  - where nc is the executable, assuming it&#8217;s in your $PATH, -z flag stands for : &#8220;just scan for listening daemons, without sending any data to them&#8221;, serverName.net should be replaced with your server FQDN, and 22 in my case is the port number, you can choose whatever port you want. Here, the netcat will return : Connection to serverName.net 22 port [tcp/ssh] succeeded! &#8211; which means that there&#8217;s a listener / daemon on the remote side. Soon I will share another approach, in python, for scanning wider range on ports.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=6&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/22/netcat-using-it-as-port-scanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>Use Time Sync</title>
		<link>http://unixgate.wordpress.com/2008/04/21/use-time-sync/</link>
		<comments>http://unixgate.wordpress.com/2008/04/21/use-time-sync/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 08:56:31 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=5</guid>
		<description><![CDATA[In order to be sync-ed, you can use ntpdate binary under Linux. You can put the following in a cron job : /usr/sbin/ntpdate 10.10.101.1 &#62; /dev/null 2&#62;&#38;1
This will ensure that you&#8217;re up-to-date  , just replace the IP 10.10.101.1 with the IP of the target server.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=5&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In order to be sync-ed, you can use ntpdate binary under Linux. You can put the following in a cron job : <code>/usr/sbin/ntpdate 10.10.101.1 &gt; /dev/null 2&gt;&amp;1</code><br />
This will ensure that you&#8217;re up-to-date <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , just replace the IP 10.10.101.1 with the IP of the target server.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=5&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/21/use-time-sync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
		<item>
		<title>apache benchmarks</title>
		<link>http://unixgate.wordpress.com/2008/04/18/apache-benchmarks/</link>
		<comments>http://unixgate.wordpress.com/2008/04/18/apache-benchmarks/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 13:01:54 +0000</pubDate>
		<dc:creator>unixgate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unixgate.wordpress.com/?p=4</guid>
		<description><![CDATA[There are two good apache benchmarks that I&#8217;m aware of :
ab &#8211; Apache HTTP server benchmarking tool
and siege  &#8211; An HTTP/HTTPS stress tester
In details :
a) ab : written in perl, open source, various options, the one that I&#8217;m using mostly is &#8211; ab -n 1000 -c 5 http://myServerAddress.com/myfiles.cgi &#8211; those are examples , where [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=4&subd=unixgate&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are two good apache benchmarks that I&#8217;m aware of :</p>
<p>ab &#8211; Apache HTTP server benchmarking tool</p>
<p>and siege  &#8211; An HTTP/HTTPS stress tester</p>
<p>In details :</p>
<p>a) ab : written in perl, open source, various options, the one that I&#8217;m using mostly is &#8211; ab -n 1000 -c 5 http://myServerAddress.com/myfiles.cgi &#8211; those are examples , where -n means &#8220;Number  of  requests  to  perform  for the benchmarking session&#8221;, and -c flag means &#8220;Number of multiple requests to perform at a time&#8221;  the sample output is :</p>
<p><code>Benchmarking myServerAddress.com (be patient)</p>
<p>Completed 100 requests<br />
Completed 200 requests<br />
Completed 300 requests<br />
Completed 400 requests<br />
Completed 500 requests<br />
Completed 600 requests<br />
Completed 700 requests<br />
Completed 800 requests<br />
Completed 900 requests<br />
Finished 1000 requests</p>
<p>Server Software:        Apache/2.2.8<br />
Server Hostname:      myServerAddress.com</p>
<p>Document Path:          /myfiles.cgi<br />
Document Length:        526 bytes<br />
Concurrency Level:      5<br />
Time taken for tests:   1.608432 seconds<br />
Complete requests:      1000<br />
Failed requests:        0<br />
Write errors:           0<br />
Total transferred:      796590 bytes<br />
HTML transferred:       527052 bytes<br />
Requests per second:    621.72 [#/sec] (mean)<br />
Time per request:       8.042 [ms] (mean)<br />
Time per request:       1.608 [ms] (mean, across all concurrent requests)<br />
Transfer rate:          483.08 [Kbytes/sec] received</p>
<p>Connection Times (ms)<br />
min  mean[+/-sd] median   max<br />
Connect:        0    2   2.5      2      17<br />
Processing:     2    4   2.7      4      29<br />
Waiting:        0    2   2.6      2      27<br />
Total:          4    7   2.9      6      29</p>
<p>Percentage of the requests served within a certain time (ms)<br />
50%      6<br />
66%      7<br />
75%      7<br />
80%      7<br />
90%      8<br />
95%     17<br />
98%     18<br />
99%     20<br />
100%     29 (longest request)</code></p>
<p>This utility comes pre-installed with most of the Linux distros, so just type in shell session : ab and see if it comes out with something. If not, install it depending on your package management system.</p>
<p>Now, let&#8217;s see how siege is doing, sample line :</p>
<p>siege -c 50 -r 50 http://myServerAddress.com/yetAnotherFile, where -c is concurrent users, and -r is number of iterations, here&#8217;s the sample output :</p>
<p><code>Transactions:                   2500 hits<br />
Availability:                 100.00 %<br />
Elapsed time:                  34.53 secs<br />
Data transferred:             488.39 MB<br />
Response time:                  0.01 secs<br />
Transaction rate:              72.40 trans/sec<br />
Throughput:                    14.14 MB/sec<br />
Concurrency:                    0.95<br />
Successful transactions:        2500<br />
Failed transactions:               0<br />
Longest transaction:            0.16<br />
Shortest transaction:           0.00</code></p>
<p>Both are very good, they have different features that might suit your needs, check them out.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/unixgate.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/unixgate.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/unixgate.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/unixgate.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/unixgate.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/unixgate.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/unixgate.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/unixgate.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/unixgate.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/unixgate.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/unixgate.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/unixgate.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=unixgate.wordpress.com&blog=3515979&post=4&subd=unixgate&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://unixgate.wordpress.com/2008/04/18/apache-benchmarks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24863267cc4a9ef07a578bf85aedf592?s=96&#38;d=identicon" medium="image">
			<media:title type="html">unixgate</media:title>
		</media:content>
	</item>
	</channel>
</rss>