<?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>LinuxMonk &#187; Shell</title>
	<atom:link href="http://www.linuxmonk.org/tag/shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxmonk.org</link>
	<description>A Journey Towards Infinity...</description>
	<lastBuildDate>Fri, 16 Jul 2010 19:32:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Huawei Modem not detecting in Ubuntu 10.04 Lucid &#8211; Fix</title>
		<link>http://www.linuxmonk.org/2010/07/17/huawei-modem-not-detecting-in-ubuntu-10-04-lucid-fix/</link>
		<comments>http://www.linuxmonk.org/2010/07/17/huawei-modem-not-detecting-in-ubuntu-10-04-lucid-fix/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 19:25:28 +0000</pubDate>
		<dc:creator>Rosario</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Huawei]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.linuxmonk.org/?p=325</guid>
		<description><![CDATA[I always like to do thinks in terminal, let me explain you in my way.  Use lsusb command to find if the modem is detected. If detected use lsusb -v, to find the product id and vendor id of the modem. In my case I am using Huawei EC168C &#8211; the vendor id is &#8220;12d1&#8243; [...]]]></description>
			<content:encoded><![CDATA[<p>I always like to do thinks in terminal, let me explain you in my way.  Use lsusb command to find if the modem is detected.</p>
<p>If detected use lsusb -v, to find the product id and vendor id of the modem.</p>
<p>In my case I am using Huawei EC168C &#8211; the vendor id is &#8220;12d1&#8243; and product id is &#8220;1446&#8243;.</p>
<p>Open the terminal and follow the instructions</p>
<blockquote><p>#sudo gedit /etc/udev/rules.d/15-huawei-115x.rules</p></blockquote>
<p>Now paste the following content as follows and save.</p>
<blockquote><p>SUBSYSTEM==&#8221;usb&#8221;,<br />
SYSFS{idProduct}==&#8221;1446&#8243;,<br />
SYSFS{idVendor}==&#8221;12d1&#8243;,<br />
RUN+=&#8221;/lib/udev/modem-modeswitch &#8211;vendor 0x12d1 &#8211;product 0&#215;1446 &#8211;type option-zerocd&#8221;</p></blockquote>
<p>Save the file. Unplug and plug the modem. Now right click the network icon , goto Mobile Broadband and click Edit. Enter the phone and username.</p>
<p>In my case I am in Zantel network. The phone number is #777 and username is @zantel.com. Click the network icon again and click the detected modem to enjoy surfing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmonk.org/2010/07/17/huawei-modem-not-detecting-in-ubuntu-10-04-lucid-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Shell Script to keep the Datanodes on MySQL NDB Clusters live and stable</title>
		<link>http://www.linuxmonk.org/2010/01/07/a-shell-script-to-keep-the-datanodes-on-mysql-ndb-clusters-live-and-stable/</link>
		<comments>http://www.linuxmonk.org/2010/01/07/a-shell-script-to-keep-the-datanodes-on-mysql-ndb-clusters-live-and-stable/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 13:40:29 +0000</pubDate>
		<dc:creator>Rosario</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySql NDB Clusters]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[NDB Clusters]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.linuxmonk.org/?p=317</guid>
		<description><![CDATA[When i installed an ndb clusters, i found sometimes one of the datanodes, fails for some reason and they never start again untill it is manually done. So i wrote a shell script for the datanodes to check itself. The script checks in the ndbd process is running, if not its starts the process and [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } -->When i installed an ndb clusters, i found sometimes one of the datanodes, fails for some reason and they never start again untill it is manually done. So i wrote a shell script  for the datanodes to check itself. The script checks in the ndbd process is running, if not its starts the process and writes a log. I added this shell script to the cron job to run the script every 10 minutes. Now the ndb clusters is perfectly stable for some months.</p>
<p>You may ask, 10 mins is too long. Does it mean, the database server will be down for 10 mins. Not beacuse there are more than 1 data node in the cluster, during this 10 mins other nodes will serve.</p>
<blockquote><p>#!/bin/sh</p>
<p>logfile=/usr/local/mysql-cluster/restart.log</p>
<p>PID=`ps -eo &#8216;tty pid args&#8217; | grep &#8216;ndbd&#8217; | grep -v grep | tr -s &#8221; | cut -f2 -d &#8221;`</p>
<p>if [ -z "$PID" ]</p>
<p>then</p>
<p>message=`service ndbd start`</p>
<p>echo &#8220;`date` &#8211; NDBD started&#8221;&gt;&gt;$logfile</p>
<p>fi</p></blockquote>
<p>Cron job that I added, (edit the file /etc/crontab and add the following line at the end)</p>
<blockquote><p>*/10 * * * * root /path/to/the/script</p></blockquote>
<p>This would keep the ndbclusters live for ever.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmonk.org/2010/01/07/a-shell-script-to-keep-the-datanodes-on-mysql-ndb-clusters-live-and-stable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with Forkbombs</title>
		<link>http://www.linuxmonk.org/2009/05/25/fun-with-forkbombs/</link>
		<comments>http://www.linuxmonk.org/2009/05/25/fun-with-forkbombs/#comments</comments>
		<pubDate>Mon, 25 May 2009 06:03:05 +0000</pubDate>
		<dc:creator>Rosario</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.linuxmonk.org/?p=274</guid>
		<description><![CDATA[Try this small shell script in your terminal. To have more fun remote login to others desktops and try this command in the terminal. ){ :&#38; };: This is a strange command in linux which crashes the system. Let me explain what exactly happens when this command is executed. ) &#8211; Function header where : [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-bottom: 0in;">Try this small shell script in your terminal. To have more fun remote login to others desktops and try this command in the terminal.</p>
<blockquote>
<p style="margin-bottom: 0in;"><strong> <img src='http://www.linuxmonk.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ){ <img src='http://www.linuxmonk.org/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> :&amp; };:</strong></p>
</blockquote>
<p style="margin-bottom: 0in;">This is a strange command in linux which crashes the system. Let me explain what exactly happens when this command is executed.</p>
<ul>
<li> <img src='http://www.linuxmonk.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ) &#8211; Function header where : is the name of the function(Colon and two parenthesis)</li>
<li>{ Opens the body of the function</li>
<li> A blank space is more important here, to have a good syntax</li>
<li>: recursive call to the same function(Colon)</li>
<li>|- pipes the out put of one function call to another</li>
<li>: which calls the function again (Colon)</li>
<li>&amp; Forks, creates a child process and assigns the function call to it</li>
<li>} Closes the function definition</li>
<li>; delimiter to end the function definition (Semicolon)</li>
<li>: actual call to the function(Colon)</li>
</ul>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">So the above script calls recursively itself twice and forks it to a child process indefinitly. At a point the memory gets full and the system crashes. You can gaurd yourself from forkbombs by restricting the number of process that can be executed at a time. Have fun with fork bombs&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmonk.org/2009/05/25/fun-with-forkbombs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Some Frequently used Linux Commands</title>
		<link>http://www.linuxmonk.org/2009/05/24/some-frequently-used-linux-commands/</link>
		<comments>http://www.linuxmonk.org/2009/05/24/some-frequently-used-linux-commands/#comments</comments>
		<pubDate>Sun, 24 May 2009 14:41:14 +0000</pubDate>
		<dc:creator>Rosario</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.linuxmonk.org/?p=269</guid>
		<description><![CDATA[Here are some of the frequently and very useful linux commands Command Description top A dynamic task list ps -e To view the current snapshot of proccess at a time kill &#60;process-id&#62; Kill a process by specifying its id. Process id can be found from the previous command killall &#60;process-name&#62; Kill a process with its [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some of the frequently and very useful linux commands</p>
<p style="margin-bottom: 0in;">
<table style="height: 431px;" border="1" cellspacing="0" cellpadding="4" width="541" bordercolor="#000000">
<col width="250"></col>
<col width="312"></col>
<tbody>
<tr valign="top">
<td><strong>Command</strong></td>
<td width="312"><strong>Description</strong></td>
</tr>
<tr valign="top">
<td>top</td>
<td width="312">A dynamic task list</td>
</tr>
<tr valign="top">
<td>ps -e</td>
<td width="312">To view the current snapshot of proccess at a time</td>
</tr>
<tr valign="top">
<td>kill &lt;process-id&gt;</td>
<td width="312">Kill a process by specifying its id. Process id can be found 			from the previous command</td>
</tr>
<tr valign="top">
<td>killall &lt;process-name&gt;</td>
<td width="312">Kill a process with its process name. The process name can be 			found using ps -e command</td>
</tr>
<tr valign="top">
<td>fdisk -l</td>
<td width="312">Displays the partion table and list of all the memory devices 			connected to the system</td>
</tr>
<tr valign="top">
<td>mount /dev/&lt;device-name&gt;  /path/to/mountpoint</td>
<td width="312">Used to mount a external or internal memory device to the 			system. The device name can be found from the previous command.</td>
</tr>
<tr valign="top">
<td>mount -t ntfs-3g /dev/&lt;device-name&gt;  /path/to/mountpoint 			-o force</td>
<td width="312">To force mount a memory device which uses ntfs file system</td>
</tr>
<tr valign="top">
<td>sudo nautilus</td>
<td width="312">To open the file browser in root mode. Normally when u open the 			file browser in ubuntu it will not be in root mode. Provided the 			currnet user is a sudoer</td>
</tr>
<tr valign="top">
<td>locate &lt;file-name-pattern&gt;</td>
<td width="312">Used to search or find files by their names. Normally the 			search is done based on a index database. It is good to update the 			database before searching to get recently created files.</td>
</tr>
<tr valign="top">
<td>updatedb</td>
<td width="312">Used to update the file index database</td>
</tr>
<tr valign="top">
<td>cat &lt;filename&gt;</td>
<td width="312">Display the contents of a file</td>
</tr>
<tr valign="top">
<td>cat &lt;filename&gt; | grep &lt;pattern&gt;</td>
<td width="312">The output of the first command is given as input to the next 			command using a pipe. Grep command display the lines that has 			pattern text</td>
</tr>
</tbody>
</table>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">Use,   man&lt;command-name&gt; to get more details about all the above commands</p>
<p style="margin-bottom: 0in;">
<p style="margin-bottom: 0in;">
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmonk.org/2009/05/24/some-frequently-used-linux-commands/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Copying File across Between two systems in a Lan</title>
		<link>http://www.linuxmonk.org/2008/07/09/copying-file-across-between-two-systems-in-a-lan/</link>
		<comments>http://www.linuxmonk.org/2008/07/09/copying-file-across-between-two-systems-in-a-lan/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 16:59:01 +0000</pubDate>
		<dc:creator>Rosario</dc:creator>
				<category><![CDATA[Linux Networking]]></category>
		<category><![CDATA[LAN]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://linuxmonk.wordpress.com/?p=20</guid>
		<description><![CDATA[If in a Lan, Ping between two system to check the availability of the connection. If peer to peer, connect the lan cable. Assign the IP addresses for the two systems (Like 172.16.25.1 and 172.16.25.2 for both the systems, with subnet mask 255.255.255.0). That is the subnet addresses should be same for both the systems. [...]]]></description>
			<content:encoded><![CDATA[<p>If in a Lan, Ping between two system to check the availability of the connection. If peer to peer, connect the lan cable. Assign the IP addresses for the two systems (Like 172.16.25.1 and 172.16.25.2 for both the systems, with subnet mask 255.255.255.0). That is the subnet addresses should be same for both the systems.</p>
<p style="margin-bottom:0;">scp is the command that can be used for transfering files across the systems. Secure Copy(scp) uses Open SSH protocol for the file transfer. ftp can also be used for the file transfer. For using the scp command you must follow a rule. The rule is, the system you invoke this command should have the ssh client and the target system should have the ssh server(sshd). For copying the files from the source to the destination system, this command can be invoked in both source system or the destination system, but should follow the above rule.</p>
<p style="margin-bottom:0;">The usage is the scp command is,</p>
<blockquote><p><strong>#scp username@&lt;source-ip&gt; :/path/to/the/source/file username@&lt;destination-ip&gt; :/path/to/the/destination/file</strong></p></blockquote>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">To copy a folder from the source system to the destination use the recursive the option,</p>
<blockquote><p><strong>#scp -r username@&lt;source-ip&gt; :/path/to/the/source/folder username@&lt;destination-ip&gt; :/path/to/the/destination/folder</strong></p></blockquote>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">The first user name is the user in the source system and the second username is the user in the destination system. The access privileges to the files or folder to copied or to be used as the destination folder depends on the user privileges used in the command.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxmonk.org/2008/07/09/copying-file-across-between-two-systems-in-a-lan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
