<?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>GO IT WORLD &#124; IT TECH &#124; IT NEWS &#187; Shell Script</title>
	<atom:link href="http://www.goitworld.com/category/server-world/shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.goitworld.com</link>
	<description>goitworld.com</description>
	<lastBuildDate>Tue, 10 Jan 2012 10:03:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>postfix queue clean script</title>
		<link>http://www.goitworld.com/postfix-queue-clean-script/</link>
		<comments>http://www.goitworld.com/postfix-queue-clean-script/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 03:45:19 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[clean]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[queue]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/postfix-queue-clean-script/</guid>
		<description><![CDATA[<p style="float: right;margin: 4px;">


</p><p>usage:</p>
<p>&#160;&#160;&#160; 1.Delete all include test.com domain’s mail from queue</p>
<blockquote><p>#perl pfdel.pl @test.com</p>
</blockquote>
<p>&#160;&#160;&#160; 2.Delete all include <a href="mailto:a@test.com">a@test.com</a> mail address’s mail from queue</p>
<blockquote><p>#perl pfdel.pl <a href="mailto:a@test.com">a@test.com</a></p>
</blockquote>
<p>&#160;&#160;&#160; 3.Script content</p>
<pre>#!/usr/bin/perl -w
#
# pfdel - deletes message containing specified address from
# Postfix queue. Matches either sender or recipient address.
#
# Usage: pfdel &#60;email_address&#62;
#

use strict;

# Change these paths if necessary.
my $LISTQ = &#34;/usr/sbin/postqueue -p&#34;;
my $POSTSUPER = &#34;/usr/sbin/postsuper&#34;;

my $email_addr = &#34;&#34;;
my $qid = &#34;&#34;;
my $euid = $&#62;;

if ( @ARGV !=  1 ) {</pre><p>&#8230; <a href="http://www.goitworld.com/postfix-queue-clean-script/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/postfix-queue-clean-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drop probe ip by iptables</title>
		<link>http://www.goitworld.com/drop-probe-ip-by-iptables/</link>
		<comments>http://www.goitworld.com/drop-probe-ip-by-iptables/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 13:12:16 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[probe]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/drop-probe-ip-by-iptables/</guid>
		<description><![CDATA[<p>Modify crontab</p>
<blockquote><p>* * * * * root /home/cnscn/sh/ssh_scan_crontab.sh &#62;/dev/null 2&#62;&#38;1</p>
</blockquote>
<p>ssh_scan_crontab.sh script</p>
<blockquote><li>
<pre>$ cat /home/cnscn/sh/ssh_scan_crontab.sh</pre>
</li>
<li>
<pre>#!/bin/bash</pre>
</li>
<li>
<pre># Author http://jabin.cublog.cn</pre>
</li>
<li>
<pre># Modify cnscn http://cnscn2008.cublog.cn</pre>
</li>
<li>
<pre># Modify xinyv</pre>
</li>
<li>
<pre>&#160;</pre>
</li>
<li>
<pre>#set timezone</pre>
</li>
<li>
<pre>export LC_ALL=UTC</pre>
</li>
<li>
<pre>&#160;</pre>
</li>
<li>
<pre># gather 1 minutes log from secure，count and drop it by iptables</pre>
</li>
<li>
<pre>SCANNER=$(awk 'BEGIN{ tm=strftime(&#34;%b %e %H:%M&#34;,systime()-60);}  $0 ~ tm &#38;&#38; /Failed password/ &#38;&#38; /ssh2/ {print $(NF-3)}' /var/log/secure &#124;sort&#124;uniq -c &#124;awk '{print $1&#34;=&#34;$2;}')</pre>
</li>
<li>
<pre>&#160;</pre>
</li>
<li>
<pre>&#160;</pre>
</li>
<li>
<pre>for i in $SCANNER</pre></li></blockquote><p>&#8230; <a href="http://www.goitworld.com/drop-probe-ip-by-iptables/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/drop-probe-ip-by-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sed  example, Part 3</title>
		<link>http://www.goitworld.com/sed-example-part-3/</link>
		<comments>http://www.goitworld.com/sed-example-part-3/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 10:21:13 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[sed example]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/sed-example-part-3/</guid>
		<description><![CDATA[<p><a name="h0">Muscular sed</a></p>
<p>I offered examples that demonstrated how sed works, but very few of these examples actually did anything particularly <i>useful</i>. In this final sed article, it&#8217;s time to change that pattern and put sed to good use. I&#8217;ll show you several excellent examples that not only demonstrate the power of sed, but also do some really neat (and handy) things. For example, in the second half of the article, I&#8217;ll show you how I designed a sed script that converts a .QIF file from Intuit&#8217;s Quicken financial program into a nicely formatted text file. Before doing that, we&#8217;ll take&#8230; <a href="http://www.goitworld.com/sed-example-part-3/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/sed-example-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sed example, part 2</title>
		<link>http://www.goitworld.com/sed-example-part-2/</link>
		<comments>http://www.goitworld.com/sed-example-part-2/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 08:03:20 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[sed example]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/sed-example-part-2/</guid>
		<description><![CDATA[<p>Sed is a very useful (but often forgotten) UNIX stream editor. It&#8217;s ideal for batch-editing files or for creating shell scripts to modify existing files in powerful ways. This article builds on my previous article introducing sed.</p>
<p><a name="h0">Substitution!</a></p>
<p>Let&#8217;s look at one of sed&#8217;s most useful commands, the substitution command. Using it, we can replace a particular string or matched regular expression with another string. Here&#8217;s an example of the most basic use of this command:</p>
<pre>$ sed -e 's/foo/bar/' myfile.txt</pre>
<p>The above command will output the contents of myfile.txt to stdout, with the first occurrence of &#8216;foo&#8217; (if any)&#8230; <a href="http://www.goitworld.com/sed-example-part-2/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/sed-example-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sed example,part 1</title>
		<link>http://www.goitworld.com/sed-examplepart-1/</link>
		<comments>http://www.goitworld.com/sed-examplepart-1/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 05:48:00 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/sed-examplepart-1/</guid>
		<description><![CDATA[<p><a name="h0">Pick an editor</a></p>
<p>In the UNIX world, we have a lot of options when it comes to editing files. Think of it &#8212; vi, emacs, and jed come to mind, as well as many others. We all have our favorite editor (along with our favorite keybindings) that we have come to know and love. With our trusty editor, we are ready to tackle any number of UNIX-related administration or programming tasks with ease. </p>
<p>While interactive editors are great, they do have limitations. Though their interactive nature can be a strength, it can also be a weakness. Consider a situation&#8230; <a href="http://www.goitworld.com/sed-examplepart-1/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/sed-examplepart-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awk example, Part 3</title>
		<link>http://www.goitworld.com/awk-example-part-3/</link>
		<comments>http://www.goitworld.com/awk-example-part-3/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 10:58:59 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[example]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/awk-example-part-3/</guid>
		<description><![CDATA[<p><a name="h0">Formatting output</a></p>
<p>While awk&#8217;s print statement does do the job most of the time, sometimes more is needed. For those times, awk offers two good old friends called printf() and sprintf(). Yes, these functions, like so many other awk parts, are identical to their C counterparts. printf() will print a formatted string to stdout, while sprintf() returns a formatted string that can be assigned to a variable. If you&#8217;re not familiar with printf() and sprintf(), an introductory C text will quickly get you up to speed on these two essential printing functions. You can view the printf() man page by&#8230; <a href="http://www.goitworld.com/awk-example-part-3/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/awk-example-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awk example, Part 2</title>
		<link>http://www.goitworld.com/awk-example-part-2/</link>
		<comments>http://www.goitworld.com/awk-example-part-2/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 11:45:53 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[example]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/awk-example-part-2/</guid>
		<description><![CDATA[<p><a name="h0">Multi-line records</a></p>
<p>Awk is an excellent tool for reading in and processing structured data, such as the system&#8217;s /etc/passwd file. /etc/passwd is the UNIX user database, and is a colon-delimited text file, containing a lot of important information, including all existing user accounts and user IDs, among other things. In my previous article, I showed you how awk could easily parse this file. All we had to do was to set the FS (field separator) variable to &#34;:&#34;.</p>
<p>By setting the FS variable correctly, awk can be configured to parse almost any kind of structured data, as long as there&#8230; <a href="http://www.goitworld.com/awk-example-part-2/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/awk-example-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awk example, Part 1</title>
		<link>http://www.goitworld.com/awk-example-part-1/</link>
		<comments>http://www.goitworld.com/awk-example-part-1/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 06:30:58 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[example]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/awk-example-part-1/</guid>
		<description><![CDATA[<p><a name="h0">In defense of awk</a></p>
<p>In this series of articles, I&#8217;m going to turn you into a proficient awk coder. I&#8217;ll admit, awk doesn&#8217;t have a very pretty or particularly &#34;hip&#34; name, and the GNU version of awk, called gawk, sounds downright weird. Those unfamiliar with the language may hear &#34;awk&#34; and think of a mess of code so backwards and antiquated that it&#8217;s capable of driving even the most knowledgeable UNIX guru to the brink of insanity (causing him to repeatedly yelp &#34;kill -9!&#34; as he runs for coffee machine). </p>
<p>Sure, awk doesn&#8217;t have a great name. But it&#8230; <a href="http://www.goitworld.com/awk-example-part-1/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/awk-example-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ten great tools for any unix system</title>
		<link>http://www.goitworld.com/ten-great-tools-for-any-unix-system/</link>
		<comments>http://www.goitworld.com/ten-great-tools-for-any-unix-system/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 05:50:04 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[unix system]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/ten-great-tools-for-any-unix-system/</guid>
		<description><![CDATA[<p>Much like a vernacular, the universe of UNIX tools changes almost perpetually. New tools crop up frequently, while others are eternally modernized and adapted to suit emerging best practices. Certain tools are used commonly; others are used more infrequently. Some tools are perennial; occasionally, some are obsoleted outright. To speak UNIX fluently, you have to keep up with the &#34;lingo.&#34; </p>
<p>Table 1 lists 11 of the significant packages previously discussed in the Speaking UNIX series. </p>
<p><a name="table1"><b>Table 1. Prominent UNIX tools</b></a></p>
<table class="data-table-1" cellspacing="0" cellpadding="0" width="80%" summary="Prominent UNIX tools" border="0">
<tbody>
<tr>
<th>Name</th>
<th>Purpose</th>
</tr>
<tr>
<td>Cygwin</td>
<td>A UNIX-like</td></tr></tbody></table><p>&#8230; <a href="http://www.goitworld.com/ten-great-tools-for-any-unix-system/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/ten-great-tools-for-any-unix-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make linux security with a script</title>
		<link>http://www.goitworld.com/make-linux-security-with-a-script/</link>
		<comments>http://www.goitworld.com/make-linux-security-with-a-script/#comments</comments>
		<pubDate>Wed, 20 May 2009 02:04:37 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.goitworld.com/make-linux-security-with-a-script/</guid>
		<description><![CDATA[<p>In order to improve the security of the operating system, while improving the efficiency of the <strong>script</strong> I wrote, I hope you can help.     <br />The primary function of this script to stop unwanted services, including, modification of the core <strong>security</strong>-related parameters, modify the parameters of other applications.</p>
<p>OS:CentOS4/5    <br />Code:</p>
<p>#!/bin/sh </p>
<p>###################################################################################    <br />#&#160;&#160;&#160; Security Script for RedHat Linux     <br />#&#160;&#160;&#160; Author:jason     <br />#&#160;&#160;&#160; Date:2009/05/20     <br />#     <br />################################################################################## </p>
<p>#&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;Define Variable&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-    <br />LANG=EN     <br />DATETIME=`date +%Y%m%d-%M%S`     <br />SERVICES=(autofs firstboot cups gpm nfs nfslock xfs netfs sendmail yum-updatesd restrorecond mcstrans avahi-daemon anacron)     <br />MD5SUM=(ps netstat ls last w&#8230; <a href="http://www.goitworld.com/make-linux-security-with-a-script/" class="read_more">Read the rest</a></p>]]></description>
		<wfw:commentRss>http://www.goitworld.com/make-linux-security-with-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

