<?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>RedHatVN Network &#187; shell script</title>
	<atom:link href="http://redhatvn.net/category/linux/shell-script/feed" rel="self" type="application/rss+xml" />
	<link>http://redhatvn.net</link>
	<description>Shared Linux problems</description>
	<lastBuildDate>Tue, 07 Sep 2010 08:08:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Use wget with Squid Proxy Server</title>
		<link>http://redhatvn.net/use-wget-with-squid-proxy-server</link>
		<comments>http://redhatvn.net/use-wget-with-squid-proxy-server#comments</comments>
		<pubDate>Tue, 07 Sep 2010 04:07:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1271</guid>
		<description><![CDATA[How do I make wget work with Squid under UNIX or Linux operating systems? You need to define the shell variables as follows: HTTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here} FTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here} You can put above two directives in a file called ~/.wgetrc: echo 'HTTP_PROXY=192.168.1.254:3128'&#62;&#62; ~/.wgetrc echo 'FTP_PROXY=192.168.1.254:3128'&#62;&#62; ~/.wgetrc Now you can use wget: $ wget http://example.com/file.tar.gz You can also define shell [...]]]></description>
			<content:encoded><![CDATA[<p>How do I make wget work with Squid under UNIX or Linux operating systems?</p>
<p>You need to define the shell variables as follows:</p>
<blockquote><p>HTTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here}<br />
FTP_PROXY={YOUR-PROXY-Server-IP-HERE}:{YOUR-PROXY-SERVER-Port-Here}
</p></blockquote>
<p><span id="more-1271"></span><br />
You can put above two directives in a file called ~/.wgetrc:</p>
<p><code>echo 'HTTP_PROXY=192.168.1.254:3128'&gt;&gt; ~/.wgetrc<br />
echo 'FTP_PROXY=192.168.1.254:3128'&gt;&gt; ~/.wgetrc</code></p>
<p>Now you can use wget:<br />
<code>$ wget http://example.com/file.tar.gz</code><br />
You can also define shell variables as follows:<br />
<code>export http_proxy=http://192.168.1.254:3128/</code><br />
OR you can pass the proxy username and password as follows:<br />
<code>wget --proxy-user=YOUR-USERNAME-HERE --proxy-password=YOUR-PASSWORD-HERE http://nixcraft.com/file.tar.gz</code></p>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/use-wget-with-squid-proxy-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Use Gmail Account To Relay Email From a Shell Prompt</title>
		<link>http://redhatvn.net/how-to-use-gmail-account-to-relay-email-from-a-shell-prompt-2</link>
		<comments>http://redhatvn.net/how-to-use-gmail-account-to-relay-email-from-a-shell-prompt-2#comments</comments>
		<pubDate>Tue, 07 Sep 2010 07:26:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[mail server]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1298</guid>
		<description><![CDATA[Usually, you do not need to setup an email server under Linux desktop operating system. Most GUI email clients (such as Thunderbird) supports Gmail POP3 and IMAP configurations. But, how do you send mail via the standard or /usr/bin/mail user agents or a shell script? Programs such as sendmail / postfix / exim can be [...]]]></description>
			<content:encoded><![CDATA[<p>Usually, you do not need to setup an  email server under Linux desktop operating system. Most GUI email  clients (such as Thunderbird) supports Gmail POP3 and IMAP  configurations. But, how do you send mail via the standard or  /usr/bin/mail user agents or a shell script? Programs such as sendmail /  postfix / exim can be configured as a gmail smarthost but they are  largely overkill for this use.</p>
<p>You can use gmail as a smart host to send all messages from your Linux /  UNIX desktop systems.  You need to use a simple program called ssmtp.  It accepts a mail stream on standard input with recipients specified on  the command line and synchronously forwards the message to the mail   transfer agent of a mailhub for the mailhub MTA to process. Failed  messages are placed in dead.letter in the sender&#8217;s home directory.<br />
<span id="more-1298"></span></p>
<h2>Install ssmtp</h2>
<p>Type the following command under CentOS / RHEL / Red Hat / Fedora Linux:<br />
<code># yum install ssmtp</code><br />
Type the following command under Debian / Ubuntu Linux:<br />
<code># apt-get update &amp;&amp; apt-get install ssmtp</code></p>
<h3>Configure gmail as a smarthost</h3>
<p>Open /etc/ssmtp/ssmtp.conf, enter:<br />
<code># vi /etc/ssmtp/ssmtp.conf</code><br />
Update file with the following settings:</p>
<blockquote><p>
AuthUser=vivek@gmail.com<br />
AuthPass=Your-Gmail-Password<br />
FromLineOverride=YES<br />
mailhub=smtp.gmail.com:587<br />
UseSTARTTLS=YES
</p></blockquote>
<p>Also, make sure you disable Sendmail:<br />
<code># service sendmail stop<br />
# chkconfig sendmail off<br />
# mkdir /root/.bakup<br />
# mv /usr/sbin/sendmail /root/.bakup<br />
#  ln -s /usr/sbin/ssmtp /usr/sbin/sendmail</code><br />
Now, you can use mail / mailx command to send email messages. You can  also write a shell script to backup your files and email to somewhere  else (see below). You can test settings using following syntax:<br />
<code>$ echo "This is a test" | mail -s "Test" vivek@nixcraft.co.in</code></p>
<h3>A note about sSMTP</h3>
<p>sSMTP works well for desktop systems, but it is not a replacement for  Sendmail / Postfix / Exim  / Qmail for email server environment. This  software is perfect for a single user system.</p>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/how-to-use-gmail-account-to-relay-email-from-a-shell-prompt-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Mail Through Gmail with Perl</title>
		<link>http://redhatvn.net/sending-mail-through-gmail-with-perl</link>
		<comments>http://redhatvn.net/sending-mail-through-gmail-with-perl#comments</comments>
		<pubDate>Tue, 07 Sep 2010 07:35:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[mail server]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1301</guid>
		<description><![CDATA[We talked about some of the benefits of setting up an email server in Linux and how you can use python to send email. Now we are going to look at how you can send email from Perl. The Code use Net::SMTP::TLS; my $mailer = new Net::SMTP::TLS( &#8216;smtp.gmail.com&#8217;, Hello => &#8216;smtp.gmail.com&#8217;, Port => 587, User [...]]]></description>
			<content:encoded><![CDATA[<p>We talked about some of the benefits of setting up an email server in Linux and how you can use python to send email. Now we are going to look at how you can send email from Perl.<br />
The Code</p>
<blockquote><p>
use Net::SMTP::TLS;<br />
my $mailer = new Net::SMTP::TLS(<br />
&#8216;smtp.gmail.com&#8217;,<br />
Hello   =>      &#8216;smtp.gmail.com&#8217;,<br />
Port    =>      587,<br />
User    =>      &#8216;username&#8217;,<br />
Password=>      &#8216;password&#8217;);<br />
$mailer->mail(&#8216;from@domain.com&#8217;);<br />
$mailer->to(&#8216;to@domain.com&#8217;);<br />
$mailer->data;<br />
$mailer->datasend(&#8220;Sent from perl!&#8221;);<br />
$mailer->dataend;<br />
$mailer->quit;
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/sending-mail-through-gmail-with-perl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red Hat / CentOS IPv6 Network Configuration</title>
		<link>http://redhatvn.net/red-hat-centos-ipv6-network-configuration</link>
		<comments>http://redhatvn.net/red-hat-centos-ipv6-network-configuration#comments</comments>
		<pubDate>Thu, 26 Aug 2010 04:23:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1248</guid>
		<description><![CDATA[Q. How do I configure static IPv6 networking under RHEL 5.x / Fedora / CentOS Linux? A. Red Hat / CentOS / Fedora RHEL support IPv6 out of box. All you have to do is update two files and turn on networking. You need to update and configure following files for IPv6 configuration: /etc/sysconfig/network : [...]]]></description>
			<content:encoded><![CDATA[<p>Q. How do I configure static IPv6 networking under RHEL 5.x / Fedora / CentOS Linux?<br />
A.  Red Hat / CentOS / Fedora RHEL support IPv6 out of box. All you have to do is update two files and turn on networking.<br />
<span id="more-1248"></span><br />
You need to update and configure following files for IPv6 configuration:</p>
<ol>
<li><strong>/etc/sysconfig/network</strong> : Turn on networking in this file.</li>
<li><strong>/etc/sysconfig/network-scripts/ifcfg-eth0</strong> : Set default IPv6 router IP and server IP address in this file.</li>
</ol>
<p>Open /etc/sysconfig/network file, enter:<br />
<code># vi /etc/sysconfig/network</code><br />
Append following line:</p>
<blockquote><p>NETWORKING_IPV6=yes</p></blockquote>
<p>Open /etc/sysconfig/network-scripts/ifcfg-eth0 (1st network config file)<br />
<code># vi /etc/sysconfig/network-scripts/ifcfg-eth0</code><br />
Append following config directives for IPv6:</p>
<blockquote><p>IPV6INIT=yes<br />
IPV6ADDR=&lt;IPv6-IP-Address&gt;<br />
IPV6_DEFAULTGW=&lt;IPv6-IP-Gateway-Address&gt;</p></blockquote>
<p>Here is my sample file with mix of IPv4 and IPv6 assigned to eth0:</p>
<blockquote><p>DEVICE=eth0<br />
BOOTPROTO=static<br />
ONBOOT=yes<br />
HWADDR=00:30:48:33:bc:33<br />
IPADDR=202.54.1.5<br />
GATEWAY=202.54.1.3<br />
NETMASK=255.255.255.248<br />
IPV6INIT=yes<br />
IPV6ADDR=2607:f0d0:1002:0011:0000:0000:0000:0002<br />
IPV6_DEFAULTGW=2607:f0d0:1002:0011:0000:0000:0000:0001</p></blockquote>
<p>Where,</p>
<ul>
<li><strong>NETWORKING_IPV6=yes|no</strong> &#8211;  Enable or disable global IPv6 initialization.</li>
<li><strong>IPV6INIT=yes</strong> &#8211;  Enable or disable IPv6 configuration for all interfaces.</li>
<li><strong>IPV6ADDR=2607:f0d0:1002:0011:0000:0000:0000:0002</strong> &#8211;   Specify a primary static IPv6 address here.</li>
<li><strong>IPV6_DEFAULTGW=2607:f0d0:1002:0011:0000:0000:0000:0001</strong> &#8211; Add a default route through specified gateway.</li>
</ul>
<p>Save and close the file. Restart networking:<br />
<code># service network restart</code><br />
Verify your configuration by pinging ipv6 enabled site such as ipv6.google.com:<br />
<code>$ ping6 ipv6.google.com</code><br />
Sample output:</p>
<blockquote><p>PING ipv6.google.com(2001:4860:b002::68) 56 data bytes<br />
64 bytes from 2001:4860:b002::68: icmp_seq=1 ttl=59 time=93.2 ms<br />
64 bytes from 2001:4860:b002::68: icmp_seq=2 ttl=59 time=95.0 ms<br />
64 bytes from 2001:4860:b002::68: icmp_seq=3 ttl=59 time=94.2 ms<br />
64 bytes from 2001:4860:b002::68: icmp_seq=4 ttl=59 time=95.2 ms<br />
64 bytes from 2001:4860:b002::68: icmp_seq=5 ttl=59 time=94.8 ms<br />
64 bytes from 2001:4860:b002::68: icmp_seq=6 ttl=59 time=95.1 ms<br />
64 bytes from 2001:4860:b002::68: icmp_seq=7 ttl=59 time=93.3 ms<br />
64 bytes from 2001:4860:b002::68: icmp_seq=8 ttl=59 time=93.8 ms</p>
<p>&#8212; ipv6.google.com ping statistics &#8212;<br />
8 packets transmitted, 8 received, 0% packet loss, time 7010ms<br />
rtt min/avg/max/mdev = 93.268/94.376/95.268/0.799 ms</p></blockquote>
<p>Traces path to a network host, enter:<br />
<code>$ traceroute6 ipv6.google.com</code><br />
Print default IPv6 routing table, enter:<br />
<code>$ route -n -A inet6</code><br />
Sample output:</p>
<blockquote><p>Kernel IPv6 routing table<br />
Destination                                 Next Hop                                Flags Metric Ref    Use Iface<br />
::1/128                                     ::                                      U     0      42531       1 lo<br />
::62.41.14.144/128                          ::                                      U     0      0        1 lo<br />
::127.0.0.1/128                             ::                                      U     0      0        1 lo<br />
::/96                                       ::                                      U     256    0        0 sit0<br />
2001:470:1f04:55a::2/128                    ::                                      U     0      15201       1 lo<br />
2001:470:1f04:55a::/64                      ::                                      U     256    0        0 sit1<br />
fe80::4833:22f4/128                         ::                                      U     0      0        1 lo<br />
fe80::212:3fff:fe75:fa0d/128                ::                                      U     0      0        1 lo<br />
fe80::/64                                   ::                                      U     256    0        0 eth0<br />
fe80::/64                                   ::                                      U     256    0        0 sit1<br />
ff00::/8                                    ::                                      U     256    0        0 eth0<br />
ff00::/8                                    ::                                      U     256    0        0 sit1<br />
::/0                                        ::                                      U     1      0        0 sit1
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/red-hat-centos-ipv6-network-configuration/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RedHat / Centos Disable IPv6 Networking</title>
		<link>http://redhatvn.net/redhat-centos-disable-ipv6-networking</link>
		<comments>http://redhatvn.net/redhat-centos-disable-ipv6-networking#comments</comments>
		<pubDate>Thu, 26 Aug 2010 04:25:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Directadmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://redhatvn.net/?p=1251</guid>
		<description><![CDATA[Our policy and network configuration does not requires IPv6 support in RHEL / CentOS / Fedora Linux. How do I prevent the kernel module from loading at boot time and disable IPv6 networking? You can easily prevent the kernel module from loading by updating the following two files: /etc/modprobe.conf &#8211; Kernel driver configuration file. /etc/sysconfig/network [...]]]></description>
			<content:encoded><![CDATA[<p>Our policy and network configuration  does not requires IPv6 support in RHEL / CentOS / Fedora Linux. How do I  prevent the kernel module from loading at boot time and disable IPv6  networking?<br />
You can easily prevent the kernel module from loading by updating the following two files:</p>
<ol>
<li>/etc/modprobe.conf &#8211; Kernel driver configuration file.</li>
<li>/etc/sysconfig/network &#8211; RHEL / CentOS networking configuration file.</li>
</ol>
<p><span id="more-1251"></span></p>
<h2>/etc/modprobe.conf</h2>
<p>Edit /etc/modprobe.conf, enter:<br />
<code># vi /etc/modprobe.conf</code><br />
Append the following line:</p>
<blockquote><p>install ipv6 /bin/true</p></blockquote>
<p>Save and close the file.</p>
<h2>/etc/sysconfig/network</h2>
<p>Edit /etc/sysconfig/network, enter:<br />
<code># vi /etc/sysconfig/network</code><br />
Update / add as follows:</p>
<blockquote><p> <br />
NETWORKING_IPV6=no<br />
IPV6INIT=no
</p></blockquote>
<p>Save and close the file. Restart networking service<br />
<code># service network restart<br />
# rmmod ipv6</code><br />
Alternatively, simple reboot the box:<br />
<code># reboot</code><br />
Verify IPv6 is disabled, enter:<br />
<code># lsmod | grep ipv6<br />
# /sbin/ifconfig</code></p>
]]></content:encoded>
			<wfw:commentRss>http://redhatvn.net/redhat-centos-disable-ipv6-networking/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->