<?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>Walker News &#187; Linux</title>
	<atom:link href="http://www.walkernews.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.walkernews.net</link>
	<description>A capsule of walker's experience in life...</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:29:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How To Setup VPN Server Using pptpd On RHEL?</title>
		<link>http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/</link>
		<comments>http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 12:42:25 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=8184</guid>
		<description><![CDATA[Install and configure pptpd VPN server on Redhat Enterprise Linux or CentOS 5.]]></description>
			<content:encoded><![CDATA[You might need only 3 minutes to install and configure a Linux VPN server using pptpd and a minute later have Windows 7 VPN client connect pptpd successfully.<br />
<span id="more-8184"></span><br />
On RHEL or CentOS 5 Linux:<br />
<ol>
<li>Download pptpd. The current version used by this guide is <a href="http://poptop.sourceforge.net/yum/stable/packages/" target="_blank" title="Download pptpd RPM from SourceForge">pptpd-1.3.4-2.rhel5.i386.rpm</a>. For experts who want to compile pptpd source code for installation, get it from <a href="http://sourceforge.net/projects/poptop/files/" target="_blank" title="pptpd source code">Poptop official page</a>.<br />
&nbsp;</li>
<li>Confirm the Linux kernel supports MPPE for encrypted tunnel:
<pre>
modprobe ppp-compress-18 &#038;&#038; echo ok
</pre>
<br />If you see &#8220;ok&#8221; printed after execution, meaning that the MPPE is enabled and nothing need to be done. Otherwise, refer to <a href="http://poptop.sourceforge.net/dox/redhat-howto.phtml" target="_blank">this guide</a> for help.<br />
&nbsp;</li>
<li>Install pptpd:
<pre>
rpm -Uvh <em>pptpd-rpm-file</em>
</pre>
</li>
<li>Edit /etc/pptpd.conf file to set the IP of VPN server and clients using private network address space defined by RFC 1918. For example:
<pre>
localip 172.20.20.1
remoteip 172.20.20.2-6
</pre>
<br />Where VPN server IP is 172.20.20.1 and only 5 VPN clients allowed connecting concurrently (because remoteip is limited to allocate IP 172.20.20.2 to 172.20.20.6 for connected client).<br />
&nbsp;</li>
<li>Edit /etc/ppp/chap-secrets file to set VPN login ID and password. E.g.
<pre>
walker   pptpd   vpn123:)   *
</pre>
<br />Where 1st column is VPN login ID, 2nd field is fixed to &#8220;pptpd&#8221;, 3rd field is the VPN login password, and fourth field is an asterisk to indicate any VPN client IP (defined by &#8220;remoteip&#8221; in previous step).<br />
&nbsp;</li>
<li>Configure RHEL/CentOS to auto start pptpd at each reboot:
<pre>
chkconfig --level 345 pptpd on
</pre>
</li>
<li>Start up pptpd immediately (without reboot Linux) and confirm the VPN server is up and listening for client connection:
<pre>
service pptpd start
netstat -tulpan | grep pptpd
</pre>
</li>
<li>Temporarily stop Firewall for first VPN connection attempt (to confirm the pptpd setup is good to go):
<pre>
service iptables stop
</pre>
</li>
</ol>
<br />On Windows 7 (64-bit Ultimate edition), nothing need to be installed as the bundled VPN client is capable to connect with pptpd server:<br />
<ol>
<li>Right click the connection icon at Notification Area (bottom-right corner where the Date/Time is displayed) then choose &#8220;Open Network and Sharing Center&#8221;.<br />
&nbsp;</li>
<li>Click &#8220;Setup a new connection or network&#8221;, &#8220;Connect to a workplace&#8221;, &#8220;Use my Internet connection (VPN)&#8221;.<br />
&nbsp;</li>
<li>For &#8220;Internet address&#8221;, enter the VPN server&#8217;s <a href="http://www.walkernews.net/2008/08/26/private-ip-vs-public-ip-how-to-check-wan-ip-public-ip-or-internet-ip/" title="How to check public or WAN IP?">public/WAN IP</a> (not the 172.20.20.1) which can be &#8220;seen&#8221; and ping-ed by Windows 7. The &#8220;Destination name&#8221; is friendly name defined by user to identify this particular VPN connection.<br />
&nbsp;</li>
<li>Next, enter the VPN login ID and password (as what you&#8217;ve defined in /etc/ppp/chap-secrets) and click Connect.</li>
</ol>
<br />Suppose the login credential is correct, Windows 7 should have no problem connecting with pptpd VPN server.<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/" title="How To Do Interactive Search And Replace Using Vi Editor?">How To Do Interactive Search And Replace Using Vi Editor?</a></li><li><a href="http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/" title="How To Configure VNC Server To Use GNOME Desktop On CentOS?">How To Configure VNC Server To Use GNOME Desktop On CentOS?</a></li><li><a href="http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/" title="How To Load And Remove Linux USB Mass Storage Driver?">How To Load And Remove Linux USB Mass Storage Driver?</a></li><li><a href="http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/" title="How To Disable Linux USB Drive?">How To Disable Linux USB Drive?</a></li><li><a href="http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/" title="How To Create Auto FTP Script On Linux?">How To Create Auto FTP Script On Linux?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-enable-linux-logout-script/" title="How To Enable Linux Logout Script?">How To Enable Linux Logout Script?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-apply-limits-conf-settings-immediately-without-reboot-linux-system/" title="How To Apply limits.conf Settings Immediately Without Reboot Linux System?">How To Apply limits.conf Settings Immediately Without Reboot Linux System?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Do Interactive Search And Replace Using Vi Editor?</title>
		<link>http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/</link>
		<comments>http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 11:39:09 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=8120</guid>
		<description><![CDATA[The Vi command to do interactive search and replace.]]></description>
			<content:encoded><![CDATA[It&#8217;s pretty fast and easy to have Vi automatically search and replace all existence of a target word in text file, if you&#8217;re confident with your regular expression (e.g no error).<br />
<span id="more-8120"></span><br />
For example, this command <code>:1,%s/the/WALKER/g</code> effectively replace any words containing &#8220;the&#8221; to &#8220;WALKER&#8221;, e.g. &#8220;the&#8221;, &#8220;o<span class="rtxt">the</span>r&#8221;,  &#8220;<span class="rtxt">the</span>se&#8221;, etc. <br />
<blockquote>
Obviously, the regular expression is not correct, if your intention is to replace the exact word. In this case, it should be this:<br />
<pre>
:1,%s/\&lt;the\&gt;/WALKER/g
</pre>
<br />where<br />
<ul>
<li><code>1,%</code> means from first to last line, i.e. all lines in the edited file. So, to perform on 3rd to 5th line, write it as <code>3,5</code>.</li>
<li><code>s/\&lt;the\&gt;/WALKER/</code> means search exact word &#8220;the&#8221; and replace it with &#8220;WALKER&#8221;,</li>
<li><code>g</code> means all occurrence of the search text found in each line. Without this &#8220;g&#8221; command, &#8220;s&#8221; only find and replace the first occurrence found in each line.</li>
</ul>
</blockquote>
<br />So, would be great if it&#8217;s possible to get Vi editor confirms text replacement with you for each the target text it found in text file (e.g. source code)?<br />
<br /><span class="subhead2">Using Vi editor to perform search and replace interactively</span><br />
<br />Just use &#8220;c&#8221; command (short for confirmation). For example:<br />
<pre>
:1,%s/\&lt;the\&gt;/WALKER/g<span class="rtxt">c</span>
</pre>
<br />You&#8217;ll see it prompts <code>replace with WALKER (y/n/a/q/l/^E/^Y)?</code>, where<br />
<ul>
<li>y for yes</li>
<li>n for no</li>
<li>a for all (as if &#8220;c&#8221; option is not used)</li>
<li>q for quit</li>
<li>l for last (i.e. quit after replace this)</li>
<li>^E and ^Y indicate CTTL+E and CTRL+Y respectively for scrolling text. Seriously, I don&#8217;t know how to use these two CTRL keys :(</li>
</ul>
<ul class="related_post"><li><a href="http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/" title="How To Setup VPN Server Using pptpd On RHEL?">How To Setup VPN Server Using pptpd On RHEL?</a></li><li><a href="http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/" title="How To Configure VNC Server To Use GNOME Desktop On CentOS?">How To Configure VNC Server To Use GNOME Desktop On CentOS?</a></li><li><a href="http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/" title="How To Load And Remove Linux USB Mass Storage Driver?">How To Load And Remove Linux USB Mass Storage Driver?</a></li><li><a href="http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/" title="How To Disable Linux USB Drive?">How To Disable Linux USB Drive?</a></li><li><a href="http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/" title="How To Create Auto FTP Script On Linux?">How To Create Auto FTP Script On Linux?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-enable-linux-logout-script/" title="How To Enable Linux Logout Script?">How To Enable Linux Logout Script?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-apply-limits-conf-settings-immediately-without-reboot-linux-system/" title="How To Apply limits.conf Settings Immediately Without Reboot Linux System?">How To Apply limits.conf Settings Immediately Without Reboot Linux System?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Configure VNC Server To Use GNOME Desktop On CentOS?</title>
		<link>http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/</link>
		<comments>http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/#comments</comments>
		<pubDate>Wed, 11 May 2011 17:34:49 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=7916</guid>
		<description><![CDATA[There are at least two ways to configure Linux VNC server to access GNOME Desktop on RHEL / CentOS.]]></description>
			<content:encoded><![CDATA[When connecting to Linux VNC server running on RHEL or CentOS, you only see a boring xterm window instead of getting access to normal Linux Desktop (GNOME Desktop, by default).<br />
<span id="more-7916"></span><br />
<img style="float:left;margin:0 9px 0 0" src="http://www.walkernews.net/wp-content/uploads/2011/05/VNC-Gnome-desktop.gif" alt="2 ways to configure Linux VNC server xstartup script to access GNOME Desktop." title="2 ways to configure Linux VNC server xstartup script to access GNOME Desktop." width="312" height="150" />No worry, it can be easily fixed in no time. Let&#8217;s see how to setup Linux VNC server xstartup script to access the graphical GNOME Desktop on RHEL / CentOS:<br />
<br />1. Stop VNC server by execute <code>vncserver -kill :1</code> (if VNC server display number is 1; otherwise replace this number accordingly).<br />
<br />2. Execute <code>cd $HOME/.vnc</code> (this hidden folder and its files are created in user&#8217;s home directory when VNC server started for the first time).<br />
<br />3. Create a backup copy of $HOME/.vnc/xstartup.<br />
<br />4. Now, there are two ways to deal with this $HOME/.vnc/xstartup script file (choose one that works for your case):<br />
<br /><span class="subhead2">Option 1:</span> Open $HOME/.vnc/xstartup and remove comment character &#8220;#&#8221; in front of the blue text, i.e. the file content will looks like this eventually:<br />
<pre>
#!/bin/sh

# Uncomment the following two lines for normal desktop:
<span class="btxt">unset SESSION_MANAGER</span>
<span class="btxt">exec /etc/X11/xinit/xinitrc</span>

[ -x /etc/vnc/xstartup ] &#038;&#038; exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] &#038;&#038; xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &#038;
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &#038;
twm &#038;
</pre>
<br /><span class="subhead2">Option 2:</span> Overwrite $HOME/.vnc/xstartup content with these lines:<br />
<pre>
#!/bin/sh

vncconfig -iconic &#038;

if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
   eval `dbus-launch --sh-syntax --exit-with-session`
fi
exec  gnome-session
</pre>
<br />After saving changes made to xstartup script file, you may start VNC server to test it. Now, the VNC client should be able access to GNOME Desktop of RHEL/CentOS.<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/" title="How To Setup VPN Server Using pptpd On RHEL?">How To Setup VPN Server Using pptpd On RHEL?</a></li><li><a href="http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/" title="How To Do Interactive Search And Replace Using Vi Editor?">How To Do Interactive Search And Replace Using Vi Editor?</a></li><li><a href="http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/" title="How To Load And Remove Linux USB Mass Storage Driver?">How To Load And Remove Linux USB Mass Storage Driver?</a></li><li><a href="http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/" title="How To Disable Linux USB Drive?">How To Disable Linux USB Drive?</a></li><li><a href="http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/" title="How To Create Auto FTP Script On Linux?">How To Create Auto FTP Script On Linux?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-enable-linux-logout-script/" title="How To Enable Linux Logout Script?">How To Enable Linux Logout Script?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-apply-limits-conf-settings-immediately-without-reboot-linux-system/" title="How To Apply limits.conf Settings Immediately Without Reboot Linux System?">How To Apply limits.conf Settings Immediately Without Reboot Linux System?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Load And Remove Linux USB Mass Storage Driver?</title>
		<link>http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/</link>
		<comments>http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/#comments</comments>
		<pubDate>Sun, 08 May 2011 16:53:27 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=7874</guid>
		<description><![CDATA[The command used to load and unload USB mass storage device driver without rebooting the server.]]></description>
			<content:encoded><![CDATA[On Linux, the modprobe command allows user dynamically loads and unloads Linux kernel modules, i.e. one can easily add and remove Linux device driver (e.g. USB mass storage driver) without having to reboot the system.<br />
<span id="more-7874"></span><br />
<blockquote>
What&#8217;s a Linux kernel module? Simply put, it&#8217;s a program (e.g. driver) that can be added to and removed from Linux kernel upon demand to extend the kernel functionality. These programs are usually kept in <code>/lib/modules/$(uname -r)</code> folder and ended with .ko file extension.
</blockquote>
<br />Now, let&#8217;s say you&#8217;ve previously <a href="http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/" rel="bookmark">disabled or turned off Linux mass storage device</a> and now you desperately need to use an USB drive for file transfer. So, how can you load the Linux USB mass storage driver without reboot the server or disrupt connecting users?<br />
<blockquote>
On RHEL 5.2, the Linux kernel automatically detects and mounts an USB drive upon plug in, just like Windows, unless the driver is disabled.
</blockquote>
<br />Here is the trick:<br />
<br />1. Login as root and undo the change made to disable USB mass storage driver, i.e. edit /etc/modprobe.d/no-usb file and use &#8220;#&#8221; to remark (comment out) the &#8220;install usb-storage&#8221; line, e.g.:<br />
<pre>
#install usb-storage /bin/true
</pre>
<br />2. Execute this command to load usb-storage.ko into kernel:<br />
<pre>
modprobe usb-storage
</pre>
<br />To confirm the kernel module has loaded successfully, you can use these commands to check:<br />
<pre>
[walker@test] <span class="btxt">tail /var/log/messages</span>
May 9 00:16:38 test kernel: Initializing USB Mass Storage driver...
May 9 00:16:38 test kernel: usbcore: registered new driver usb-storage
May 9 00:16:38 test kernel: USB Mass Storage support registered.
[walker@test] <span class="btxt">lsmod | grep -i usb</span>
usb_storage            76577  0
scsi_mod              134605  11 usb_storage,megaraid
</pre>
<br />Now, plug in the USB drive to do file transfer. When it&#8217;s done, you can unload / remove USB mass storage driver using this command:<br />
<pre>
modprobe -r usb-storage
</pre>
<br />Next, remove the &#8220;#&#8221; character that&#8217;s used (step-1) to comment out the line in /etc/modprobe.d/no-usb file, if the driver has to be disabled.<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/" title="How To Setup VPN Server Using pptpd On RHEL?">How To Setup VPN Server Using pptpd On RHEL?</a></li><li><a href="http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/" title="How To Do Interactive Search And Replace Using Vi Editor?">How To Do Interactive Search And Replace Using Vi Editor?</a></li><li><a href="http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/" title="How To Configure VNC Server To Use GNOME Desktop On CentOS?">How To Configure VNC Server To Use GNOME Desktop On CentOS?</a></li><li><a href="http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/" title="How To Disable Linux USB Drive?">How To Disable Linux USB Drive?</a></li><li><a href="http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/" title="How To Create Auto FTP Script On Linux?">How To Create Auto FTP Script On Linux?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-enable-linux-logout-script/" title="How To Enable Linux Logout Script?">How To Enable Linux Logout Script?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-apply-limits-conf-settings-immediately-without-reboot-linux-system/" title="How To Apply limits.conf Settings Immediately Without Reboot Linux System?">How To Apply limits.conf Settings Immediately Without Reboot Linux System?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Disable Linux USB Drive?</title>
		<link>http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/</link>
		<comments>http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/#comments</comments>
		<pubDate>Sun, 08 May 2011 15:05:17 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=7866</guid>
		<description><![CDATA[Configure Linux to disable USB mass storage device.]]></description>
			<content:encoded><![CDATA[For security&#8217;s sake, IT auditor and security team normally request system administrator to disable or turn off USB mass storage device to minimize risk of data theft.<br />
<span id="more-7866"></span><br />
Now, let&#8217;s see how to disable USB mass storage device on Redhat Linux (RHEL 5.2 particularly; should be applicable to other Linux distributions too):<br />
<ol>
<li>Login as root,<br />
&nbsp;</li>
<li>Open /etc/modprobe.d/no-usb for edit (create this file if it&#8217;s not exists),<br />
&nbsp;</li>
<li>Append this line to the no-usb file (in step-2) and save it:
<pre>
install usb-storage /bin/true
</pre>
</li>
</ol>
<br />Reboot server to enforce change. To confirm USB mass storage support has disabled, just execute <code>lsmod | grep -i usb</code> or try plug in USB drive to confirm.<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/" title="How To Setup VPN Server Using pptpd On RHEL?">How To Setup VPN Server Using pptpd On RHEL?</a></li><li><a href="http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/" title="How To Do Interactive Search And Replace Using Vi Editor?">How To Do Interactive Search And Replace Using Vi Editor?</a></li><li><a href="http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/" title="How To Configure VNC Server To Use GNOME Desktop On CentOS?">How To Configure VNC Server To Use GNOME Desktop On CentOS?</a></li><li><a href="http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/" title="How To Load And Remove Linux USB Mass Storage Driver?">How To Load And Remove Linux USB Mass Storage Driver?</a></li><li><a href="http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/" title="How To Create Auto FTP Script On Linux?">How To Create Auto FTP Script On Linux?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-enable-linux-logout-script/" title="How To Enable Linux Logout Script?">How To Enable Linux Logout Script?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-apply-limits-conf-settings-immediately-without-reboot-linux-system/" title="How To Apply limits.conf Settings Immediately Without Reboot Linux System?">How To Apply limits.conf Settings Immediately Without Reboot Linux System?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Trick Used To Monitor Website Uptime</title>
		<link>http://www.walkernews.net/2011/05/08/simple-trick-used-to-monitor-website-uptime/</link>
		<comments>http://www.walkernews.net/2011/05/08/simple-trick-used-to-monitor-website-uptime/#comments</comments>
		<pubDate>Sat, 07 May 2011 17:15:46 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=7832</guid>
		<description><![CDATA[A simple Linux shell script used to track website uptime.]]></description>
			<content:encoded><![CDATA[There are many sites offer service to check and track website uptime, but I haven&#8217;t found one that allows user to run check at every minute except the paid premium plan.<br />
<span id="more-7832"></span><br />
So, I make a simple Linux shell script (below) that uses wget to check website uptime (replace blue texts with your own value accordingly):<br />
<pre>
#!/bin/sh

DMSG="Unknown at "`date`
WGETLOG=$HOME/.wget.log

wget -O $WGETLOG <span class="btxt">http://www.walkernews.net</span> 2&gt;&gt;$WGETLOG

[ $? -ne 0 ] &#038;&#038; mail -s "$DMSG" <span class="btxt">email@example.com</span> &lt;$WGETLOG
</pre>
<br />If the Linux web hosting server allows you to schedule cronjob, send email, and run wget at command prompt, then configure crontab to auto execute the shell script every minutes:<br />
<ul>
<li>If the website is down (caused by failure of web server/Apache, PHP, MySQL, etc), it will send an alert to notify you at the given email address.</li>
<li>If the Internet connection to the web hosting server is down, the shell script can&#8217;t detect it and thus can&#8217;t alert you :(</li>
</ul>
<br />Alternatively, power on a Linux machine 24&#215;7 at home or somewhere else to run the shell script. Though this way allows it to detect both Internet connection and website problem (therefore can notify you via email alert), but it can&#8217;t tell which side of the Internet connection is down (unless running another check using ping) and you&#8217;ve to find a Linux machine running 24&#215;7 :(<br />
<br />If that is not your ideal solution, then go subscribe free service to track website uptime (at longer interval) or get a paid premium service with great features (e.g. email + SMS alert, monthly / daily reports, online statistics, multiple checks from different sites, etc).<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2009/05/11/how-to-use-putty-generated-rsa-key-to-login-linux-openssh-server/" title="How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?">How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?</a></li><li><a href="http://www.walkernews.net/2009/05/10/red-hat-linux-5-man-page-displays-weird-characters/" title="Red Hat Linux 5 Man Page Displays Weird Characters">Red Hat Linux 5 Man Page Displays Weird Characters</a></li><li><a href="http://www.walkernews.net/2009/05/03/how-to-create-putty-based-rsa-public-key-for-openssh-server/" title="How To Create Putty-based RSA Public-key For OpenSSH Server?">How To Create Putty-based RSA Public-key For OpenSSH Server?</a></li><li><a href="http://www.walkernews.net/2009/05/02/how-to-regenerate-putty-based-rsa-public-key-from-its-private-key/" title="How To Regenerate Putty-based RSA Public-key From Its Private-key?">How To Regenerate Putty-based RSA Public-key From Its Private-key?</a></li><li><a href="http://www.walkernews.net/2009/04/06/how-to-fix-scp-and-ssh-login-prompt-is-very-slow-in-linux/" title="How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux">How To Fix: SCP And SSH Login Prompt Is Very Slow In Linux</a></li><li><a href="http://www.walkernews.net/2009/04/03/how-to-restart-vnc-server-after-vnc-service-hangs-or-stops-unexpectedly/" title="How To Restart VNC Server After VNC Service Hangs or Stops Unexpectedly?">How To Restart VNC Server After VNC Service Hangs or Stops Unexpectedly?</a></li><li><a href="http://www.walkernews.net/2009/03/22/how-to-fix-server-refused-our-key-error-that-caused-by-putty-generated-rsa-public-key/" title="How To Fix &#8220;Server Refused Our Key&#8221; Error That Caused By Putty Generated RSA Public Key?">How To Fix &#8220;Server Refused Our Key&#8221; Error That Caused By Putty Generated RSA Public Key?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2011/05/08/simple-trick-used-to-monitor-website-uptime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Create Auto FTP Script On Linux?</title>
		<link>http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/</link>
		<comments>http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/#comments</comments>
		<pubDate>Mon, 02 May 2011 16:48:28 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=7803</guid>
		<description><![CDATA[A guide used to create auto FTP script on Redhat Linux.]]></description>
			<content:encoded><![CDATA[FTP is an insecure file transfer protocol and thus prohibited by most system administrators and IT auditors. The best alternate is using SCP or SFTP to transfer files over SSH protocol.<br />
<span id="more-7803"></span><br />
However, security or vulnerability of FTP is only side info, not the concern of this topic. If you would like to create an auto FTP script that can be scheduled as cronjob to automate file transfer, here you go.<br />
<br />First, there must be a .netrc file in home directory. If this file is not exists, just manually create one:<br />
<pre>
vi $HOME/.netrc
</pre>
<br />A sample of .netrc contains 2 sets of auto-FTP information:<br />
<pre>
<span class="rtxt">machine</span> <em>ftp_ip_or_hostname</em>
<span class="rtxt">login</span> <em>ftp_login_id</em>
<span class="rtxt">password</span> <em>ftp_login_password</em>
<span class="rtxt">macdef init</span>
<span class="btxt"><em>prompt
bi
mput fin*.rpt
quit</em></span>

<span class="rtxt">machine</span> <em>192.168.22.45</em>
<span class="rtxt">login</span> <em>walker</em>
<span class="rtxt">password</span> <em>abc123</em>
<span class="rtxt">macdef init</span>
<span class="btxt"><em>prompt
as
mget rpt*.log
quit</em></span>
&nbsp;
</pre>
<br />Where texts in red are mandatory keywords, texts in italic style are user-supplied values for the respective keywords, texts in blue are FTP commands to be executed after login FTP server successfully.<br />
<blockquote>
There must be a blank line immediately after the last FTP command (blue texts). Otherwise, you&#8217;ll get &#8220;Macro definition missing null line terminator.&#8221; rejection.<br />
<br />The password is written as plain text in .netrc &#8211; one of the obvious reasons you shouldn&#8217;t use FTP for file transfer, especially auto-FTP (if can be avoided).
</blockquote>
<br />Next, set .netrc permission to 600:<br />
<pre>
chmod 600 .netrc
</pre>
<br />Now, the auto-FTP setup is done. Using the .netrc sample (above), when I execute <code>ftp 192.168.22.45</code> at Linux command prompt, the FTP client will automatically login, set interactive mode to off, switch to ASCII mode, download rpt*.log and then logout!<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2011/06/19/how-to-setup-vpn-server-using-pptpd-on-rhel/" title="How To Setup VPN Server Using pptpd On RHEL?">How To Setup VPN Server Using pptpd On RHEL?</a></li><li><a href="http://www.walkernews.net/2011/06/05/how-to-do-interactive-search-and-replace-using-vi-editor/" title="How To Do Interactive Search And Replace Using Vi Editor?">How To Do Interactive Search And Replace Using Vi Editor?</a></li><li><a href="http://www.walkernews.net/2011/05/12/how-to-configure-vnc-server-to-use-gnome-desktop-on-centos/" title="How To Configure VNC Server To Use GNOME Desktop On CentOS?">How To Configure VNC Server To Use GNOME Desktop On CentOS?</a></li><li><a href="http://www.walkernews.net/2011/05/09/how-to-load-and-remove-linux-usb-mass-storage-driver/" title="How To Load And Remove Linux USB Mass Storage Driver?">How To Load And Remove Linux USB Mass Storage Driver?</a></li><li><a href="http://www.walkernews.net/2011/05/08/how-to-disable-linux-usb-drive/" title="How To Disable Linux USB Drive?">How To Disable Linux USB Drive?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-enable-linux-logout-script/" title="How To Enable Linux Logout Script?">How To Enable Linux Logout Script?</a></li><li><a href="http://www.walkernews.net/2011/05/02/how-to-apply-limits-conf-settings-immediately-without-reboot-linux-system/" title="How To Apply limits.conf Settings Immediately Without Reboot Linux System?">How To Apply limits.conf Settings Immediately Without Reboot Linux System?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2011/05/03/how-to-create-auto-ftp-script-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

