<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4943163881016449055</id><updated>2024-09-19T22:22:53.374+05:30</updated><category term="UUID"/><category term="drop all ping packets"/><title type='text'>Linux</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://linuxshellos.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-1241010258197054300</id><published>2011-05-28T06:49:00.001+05:30</published><updated>2014-03-05T19:26:14.502+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="drop all ping packets"/><title type='text'>Drop all ping packets</title><content type='html'>*************************************************&lt;br /&gt;
To drop all ping packets all together&lt;br /&gt;
*************************************************&lt;br /&gt;
&lt;br /&gt;
You can setup kernel variable to drop all ping packets. &lt;br /&gt;
&lt;br /&gt;
# echo &quot;1&quot; &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
This instructs the kernel to simply ignore all ping requests (ICMP type 0 messages). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To enable ping request type the command:&lt;br /&gt;
&lt;br /&gt;
# echo &quot;0&quot; &amp;gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;
&lt;br /&gt;
[or]&lt;br /&gt;
&lt;br /&gt;
You can drop by adding following line to /etc/sysctl.conf file:&lt;br /&gt;
&lt;br /&gt;
net.ipv4.icmp_echo_ignore_all = 1&lt;br /&gt;
&lt;br /&gt;
Save and close the file.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/1241010258197054300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/1241010258197054300'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/05/drop-all-ping-packets.html' title='Drop all ping packets'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-8397145646960613048</id><published>2011-05-23T23:20:00.000+05:30</published><updated>2014-03-05T19:22:46.805+05:30</updated><title type='text'>To Find The Details Of The CPU</title><content type='html'>To Find The Details Of The CPU , Instead Of Opening The File cat /etc/cpuinfo &lt;br /&gt;
&lt;br /&gt;
# dmidecode -t type         &lt;br /&gt;
&lt;br /&gt;
Type Information&lt;br /&gt;
----------------------------------------&lt;br /&gt;
0 BIOS&lt;br /&gt;
1 System&lt;br /&gt;
2 Base Board&lt;br /&gt;
3 Chassis&lt;br /&gt;
4 Processor&lt;br /&gt;
5 Memory Controller&lt;br /&gt;
6 Memory Module&lt;br /&gt;
7 Cache&lt;br /&gt;
8 Port Connector&lt;br /&gt;
9 System Slots&lt;br /&gt;
10 On Board Devices&lt;br /&gt;
11 OEM Strings&lt;br /&gt;
12 System Configuration Options&lt;br /&gt;
13 BIOS Language&lt;br /&gt;
14 Group Associations&lt;br /&gt;
15 System Event Log&lt;br /&gt;
16 Physical Memory Array&lt;br /&gt;
17 Memory Device&lt;br /&gt;
18 32-bit Memory Error&lt;br /&gt;
19 Memory Array Mapped Address&lt;br /&gt;
20 Memory Device Mapped Address&lt;br /&gt;
21 Built-in Pointing Device&lt;br /&gt;
22 Portable Battery&lt;br /&gt;
23 System Reset&lt;br /&gt;
24 Hardware Security&lt;br /&gt;
25 System Power Controls&lt;br /&gt;
26 Voltage Probe&lt;br /&gt;
27 Cooling Device&lt;br /&gt;
28 Temperature Probe&lt;br /&gt;
29 Electrical Current Probe&lt;br /&gt;
30 Out-of-band Remote Access&lt;br /&gt;
31 Boot Integrity Services&lt;br /&gt;
32 System Boot&lt;br /&gt;
33 64-bit Memory Error&lt;br /&gt;
34 Management Device&lt;br /&gt;
35 Management Device Component&lt;br /&gt;
36 Management Device Threshold Data&lt;br /&gt;
37 Memory Channel&lt;br /&gt;
38 IPMI Device&lt;br /&gt;
39 Power Supply</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/8397145646960613048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/8397145646960613048'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/05/to-find-details-of-cpu.html' title='To Find The Details Of The CPU'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-3008392548924416946</id><published>2011-05-19T16:34:00.000+05:30</published><updated>2014-03-05T19:23:00.570+05:30</updated><title type='text'>Linux Ext2,Ext3,Ext4 File systems</title><content type='html'>A LINUX file system is a collection of files and directories stored. Each  file system is stored in a separate whole disk partition.here we see file system types &lt;br /&gt;
&lt;br /&gt;
The ext2 (second extended file system) is a file system for the Linux kernel. It was initially designed by Remy Card as a replacement for the extended file system (ext).It was introduced with the 1.0 kernel in 1993.Ext2 is flexible,can handle file system up to 4 TB,and supports long file names up to 1012 characters,it has sparse super blocks feature which increase file system performance.In case any user processes fill up a file system,ext2 normally reserves about 5% of disk blocks for exclusive use by root so that root can easily recover from that situation.&lt;br /&gt;
&lt;br /&gt;
The ext3 (third extended file system) is a journal ed file system that is commonly used by the Linux kernel. It is the default file system for many popular Linux distributions,Stephen Tweedie developed ext3.It provides all the features of ext2,and also features journaling and backward compatibility with ext2.The backward compatibility enables you to still run kernels that are only ext2-aware with ext3 partitions.we can also use all of the ext2 file system tuning,repair and recovery tools with ext3 also you can upgrade an ext2 file system to an ext3 file system without losing any of your data.&lt;br /&gt;
Ext3’s journaling feature speeds up the amount of time ,in ext2 when a file system is uncleanly mounted ,the whole file system must be checked.This takes a long time on large file systems.On an ext3 system ,the system keeps a record of uncommitted file transactions and applies only those transactions when the system is brought back up.So a complete system check is not required and the system will come back up much faster.&lt;br /&gt;
&lt;br /&gt;
The ext4 (fourth extended file system) is a journaling file system for Linux,Ext4 is part of the Linux 2.6.28 kernel,Ext4 is the evolution of the most used Linux file system, Ext3. In many ways, Ext4 is a deeper improvement over Ext3 than Ext3 was over Ext2. Ext3 was mostly about adding journaling to Ext2, but Ext4 modifies important data structures of the file system such as the ones destined to store the file data. The result is a filesystem with an improved design, better performance, reliability and features.developed by Mingming Cao,Andreas Dilger,Alex Zhuravlev,Dave Kleikamp,Theodore Ts&#39;o, Eric Sandeen,Sam Naghshineh and others.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/3008392548924416946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/3008392548924416946'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/05/linux-ext2ext3ext4-file-systems.html' title='Linux Ext2,Ext3,Ext4 File systems'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-321919599429184292</id><published>2011-05-17T15:32:00.000+05:30</published><updated>2014-03-05T19:26:00.979+05:30</updated><title type='text'>To Clear Linux Memory Cache</title><content type='html'>To free pagecache:&lt;br /&gt;
&lt;br /&gt;
# sync; echo 1 &amp;gt; /proc/sys/vm/drop_caches&lt;br /&gt;
&lt;br /&gt;
To free dentries and inodes:&lt;br /&gt;
&lt;br /&gt;
# sync; echo 2 &amp;gt; /proc/sys/vm/drop_caches&lt;br /&gt;
&lt;br /&gt;
To free pagecache, dentries and inodes:&lt;br /&gt;
&lt;br /&gt;
# sync; echo 3 &amp;gt; /proc/sys/vm/drop_caches&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; &lt;b&gt;sync - flush file system buffers&lt;/b&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/321919599429184292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/321919599429184292'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/05/to-clear-linux-memory-cache.html' title='To Clear Linux Memory Cache'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-8693130110209758571</id><published>2011-05-16T12:46:00.000+05:30</published><updated>2014-03-05T19:25:29.934+05:30</updated><title type='text'>File Fragmentation checking on Linux</title><content type='html'>To find file fragmentation information for a specific file,we can use filefrag command.&lt;br /&gt;
filefrag reports on how badly fragmented a particular file. It makes allowances for indirect blocks for ext2 and ext3 filesystems, but can be used on files for any filesystem.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;syntax&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;filefrag&lt;/b&gt; -v (filename)&lt;br /&gt;
&lt;br /&gt;
# &lt;b&gt;filefrag&lt;/b&gt; -v /home/example/example.txt&lt;br /&gt;
&lt;br /&gt;
-v&amp;nbsp;&amp;nbsp; =&amp;gt; verbose when checking for file fragmentation&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ouptput&lt;/b&gt;:(for example)&lt;br /&gt;
&lt;br /&gt;
Checking example.txt&lt;br /&gt;
Filesystem type is: ef53&lt;br /&gt;
Filesystem cylinder groups is approximately 606&lt;br /&gt;
Blocksize of file example.txt is 4096&lt;br /&gt;
File size of example.txt is 1194 (1 blocks)&lt;br /&gt;
First block: 7006588&lt;br /&gt;
Last block: 7006588&lt;br /&gt;
example.txt: 1 extent found</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/8693130110209758571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/8693130110209758571'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/05/file-fragmentation-checking-on-linux.html' title='File Fragmentation checking on Linux'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-1765140036707598443</id><published>2011-05-04T17:38:00.000+05:30</published><updated>2014-03-05T19:24:44.848+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="UUID"/><title type='text'>Command to check UUID</title><content type='html'>In your /etc/fstab file, you have have seen an entry that looks UUID=c81355eb-96d2-458a-8ce0-3fa12a04cb8e instead of a more familiar disk drive designation, such as /dev/hda1. Such entries are called universally unique identifiers (UUID). You can use these 128-bit numbers to make hard disk management easier.&lt;br /&gt;
&lt;br /&gt;
This following command is used to print the UUID for a device. This may be used with UUID= in /etc/fstab to name devices that works even if disks are added and removed. redhat uses this in /etc/fstab file.&lt;br /&gt;
&lt;br /&gt;
Print UUID to a selected&amp;nbsp; partition /dev/sda1&lt;br /&gt;
&lt;br /&gt;
#blkid -o value -s UUID /dev/sda1&lt;br /&gt;
&lt;br /&gt;
Print all UUIDs &lt;br /&gt;
&lt;br /&gt;
#blkid -o value -s UUID</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/1765140036707598443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/1765140036707598443'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/05/command-to-check-uuid.html' title='Command to check UUID'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-2313172207556066804</id><published>2011-05-03T11:22:00.000+05:30</published><updated>2014-03-05T19:25:18.291+05:30</updated><title type='text'>Strange Linux Commands Stands For</title><content type='html'>&lt;b&gt;awk&lt;/b&gt; = &quot;Aho Weinberger and Kernighan&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This language was named by its authors, Al Aho, Peter Weinberger and Brian Kernighan. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;cat&lt;/b&gt; = &quot;CATenate&quot;&lt;br /&gt;
The cat command is a standard Unix program used to concatenate and display files. The name is from catenate, a synonym of concatenate.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;grep&lt;/b&gt; = &quot;Global Regular Expression Print&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; grep comes from the ed command to print all lines matching a certain pattern g/re/p where re is a regular expression.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;fgrep&lt;/b&gt; = &quot;Fixed GREP&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fgrep searches for fixed strings only. The &quot;f&quot; does not stand for &quot;fast&quot; - in fact, &quot;fgrep foobar *.c&quot; is usually slower than &quot;egrep foobar *.c&quot; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;egrep&lt;/b&gt; = &quot;Extended GREP&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;b&gt;nroff&lt;/b&gt; = &quot;New ROFF&quot;&lt;br /&gt;
&lt;b&gt;troff&lt;/b&gt; = &quot;Typesetter new ROFF&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; These are descendants of &quot;roff&quot;, which was a re-implementation of the Multics &quot;runoff&quot; program (a program that you&#39;d use to &quot;run off&quot; a good copy of a document)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;tee&lt;/b&gt; = T&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; From plumbing terminology for a T-shaped pipe splitter. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Perl&lt;/b&gt; = &quot;Practical Extraction and Report Language&quot;&lt;br /&gt;
&lt;b&gt;Perl&lt;/b&gt; = &quot;Pathologically Eclectic Rubbish Lister&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; The Perl language is Larry Wall&#39;s highly popular freely-available completely portable text, process, and file manipulation tool that bridges the gap between shell and C programming.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/2313172207556066804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/2313172207556066804'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/05/strange-linux-commands-stands-for.html' title='Strange Linux Commands Stands For'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-4762733674960739681</id><published>2011-04-29T11:26:00.001+05:30</published><updated>2014-03-05T19:24:20.282+05:30</updated><title type='text'>To watch SSH users actions</title><content type='html'>To view your ssh user activities&lt;br /&gt;
&lt;br /&gt;
#cat /dev/vcs1&lt;br /&gt;
&lt;br /&gt;
this will show you what happens in first console. to check other consoles&amp;nbsp; /dev/vcs1 or vcs2 or vcs3.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/4762733674960739681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/4762733674960739681'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/to-watch-ssh-users-actions.html' title='To watch SSH users actions'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-6209210688643384616</id><published>2011-04-29T09:36:00.000+05:30</published><updated>2014-03-05T19:24:10.079+05:30</updated><title type='text'>To find IP address &amp; To watch Linux Memory usage</title><content type='html'>&lt;b&gt;Find out your router’s external IP address using the Linux command line&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
To Find Router external IP.Using the following commands we can see our router external IP address&lt;br /&gt;
&lt;br /&gt;
without curl&lt;br /&gt;
&lt;br /&gt;
#wget -O - -q icanhazip.com&lt;br /&gt;
&lt;br /&gt;
with curl &lt;br /&gt;
&lt;br /&gt;
#curl ifconfig.me&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
#curl icanhazip.com&lt;br /&gt;
&lt;br /&gt;
#curl -s &#39;http://checkip.dyndns.org&#39; | sed &#39;s/.*Current IP Address: \([0-9\.]*\).*/\1/g&#39; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;TO see Linux memory usage in real-time&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you want to display your memory usage in real-time, do a&lt;br /&gt;
&lt;br /&gt;
#watch -d &quot;free -mt&quot;&lt;br /&gt;
&lt;br /&gt;
It will display used and free memory every two seconds.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/6209210688643384616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/6209210688643384616'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/few-useful-linux-commands.html' title='To find IP address &amp; To watch Linux Memory usage'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-329305473528246330</id><published>2011-04-27T10:49:00.000+05:30</published><updated>2014-03-05T19:24:00.803+05:30</updated><title type='text'>Linux Command For Gmail inbox checking</title><content type='html'>To check the gmail,u can access ur&amp;nbsp; gmail inbox from command prompt.&lt;br /&gt;
&lt;br /&gt;
#curl -u username:password --silent &quot;https://mail.google.com/mail/feed/atom&quot; | perl -ne &#39;print &quot;\t&quot; if /&lt;name&gt;/; print &quot;$2\n&quot; if /&amp;lt;(title|name)&amp;gt;(.*)&amp;lt;\/\1&amp;gt;/;&#39;&lt;/name&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/329305473528246330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/329305473528246330'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/linux-command-for-gmail-ibox-checking.html' title='Linux Command For Gmail inbox checking'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-6677246149608730756</id><published>2011-04-20T14:13:00.000+05:30</published><updated>2014-03-05T19:23:44.676+05:30</updated><title type='text'>Few Error Logs and solutions</title><content type='html'>&lt;strong&gt;Template Error: The template file must be given&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Error : Template Error: The template file must be given&lt;br /&gt;
&lt;br /&gt;
Solution : The problem due the cpanel default page missing on the server so you can reset the default page setting by using following steps …&lt;br /&gt;
&lt;br /&gt;
WHM Main &amp;gt;&amp;gt; Account Functions &amp;gt;&amp;gt; Web Template Editor &amp;gt;  Revert to Default&lt;br /&gt;
&lt;br /&gt;
Once done you will again see the cpanel default page.&lt;br /&gt;
&lt;br /&gt;
If you are facing this error on number of domains then you need to add the apache conf entry for that domain  manually into httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Manager of pid-file quit without updating fi&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Error : Manager of pid-file quit without updating fi&lt;br /&gt;
&lt;br /&gt;
Solution : When try to restart the mysql service on the server then above error is generated.&lt;br /&gt;
&lt;br /&gt;
This problem is occurred due the “mysql ” database crashed and should be repaired but the mysql is already stopped on the server  so you need to use the following command to repair and optimize the database when mysql service is down on the server.&lt;br /&gt;
&lt;br /&gt;
For Repair “mysql ” database&lt;br /&gt;
&lt;br /&gt;
# find /var/lib/mysql/mysql  -name &#39;*.MYI&#39; -exec myisamchk -r {} \;&lt;br /&gt;
&lt;br /&gt;
For Optimize the database&lt;br /&gt;
&lt;br /&gt;
# find /var/lib/mysql -name &#39;*.MYI&#39; -exec myisamchk -o {} \;&lt;br /&gt;
&lt;br /&gt;
Then&lt;br /&gt;
&lt;br /&gt;
# ps -ef | grep mysql&lt;br /&gt;
&lt;br /&gt;
# killall -KILL mysql&lt;br /&gt;
&lt;br /&gt;
# /etc/init.d/mysql stop&lt;br /&gt;
&lt;br /&gt;
# /etc/init.d/mysql start&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;DB Error: connect failed in horde&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Error :  When try to access the Horde from cPanel  then it shows following error.&lt;br /&gt;
&lt;br /&gt;
Warning: fopen(/var/cpanel/horde/log/horde_0.log) [function.fopen]: failed to open stream: Permission denied in /usr/local/cpanel/3rdparty/lib/php/Log/file.php on line 216&lt;br /&gt;
A fatal error has occurred&lt;br /&gt;
&lt;br /&gt;
DB Error: connect failed&lt;br /&gt;
&lt;br /&gt;
Details have been logged for the administrator.&lt;br /&gt;
&lt;br /&gt;
Solution: The problem due to the ” Horde Groupware Webmail Edition detected ” means when you have try to update the Horde by using following commands&lt;br /&gt;
&lt;br /&gt;
root@server[~]# /usr/local/cpanel/bin/update-horde --force&lt;br /&gt;
&lt;br /&gt;
Then it shows the following error&lt;br /&gt;
&lt;br /&gt;
!!!     Horde Groupware Webmail Edition detected        !!!&lt;br /&gt;
Install or update of standard Horde Webmail is disabled.&lt;br /&gt;
Horde Groupware Webmail was installed with cPanel 11.25.1.&lt;br /&gt;
Downgrades of Horde are not permitted due to MySQL differences.&lt;br /&gt;
&lt;br /&gt;
Then you need to move the file&lt;br /&gt;
&lt;br /&gt;
root@server[~]# mv /var/cpanel/horde/groupware_version /var/cpanel/horde/groupware_version-bak&lt;br /&gt;
&lt;br /&gt;
After that run following commands&lt;br /&gt;
&lt;br /&gt;
root@server[~]# /usr/local/cpanel/bin/update-horde --force&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Request exceeded the limit of 10 internal redirects&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Error : Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace&lt;br /&gt;
&lt;br /&gt;
Solution : When access the domain and the domain not shows the content and the server logs shows the above error then you need to add the following code in .htaccess file.&lt;br /&gt;
&lt;br /&gt;
RewriteCond %{ENV:REDIRECT_STATUS} 200&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
If you are facing this problem for the addon domain then add the following Rewrite rules in main domain .htaccess file.&lt;br /&gt;
&lt;br /&gt;
RewriteCond %{HTTP_HOST} ^(www\.)?addon_domain\.com&lt;br /&gt;
Rewriterule .* – [L]</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/6677246149608730756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/6677246149608730756'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/few-error-logs-and-solutions.html' title='Few Error Logs and solutions'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-5829518763791760235</id><published>2011-04-20T12:20:00.001+05:30</published><updated>2011-04-20T12:20:52.893+05:30</updated><title type='text'>Crontab - 15 Cron Job Examples</title><content type='html'>An experienced Linux sysadmin knows the importance of running the routine maintenance jobs in the background automatically.&lt;br /&gt;&lt;br /&gt;Linux Cron utility is an effective way to schedule a routine background job at a specific time and/or day on an on-going basis.&lt;br /&gt;&lt;br /&gt;Linux Crontab Format&lt;br /&gt;MIN HOUR DOM MON DOW CMD&lt;br /&gt;Table: Crontab Fields and Allowed Ranges (Linux Crontab Syntax)Field Description Allowed Value&lt;br /&gt;MIN Minute field 0 to 59&lt;br /&gt;HOUR Hour field 0 to 23&lt;br /&gt;DOM Day of Month 1-31&lt;br /&gt;MON Month field 1-12&lt;br /&gt;DOW Day Of Week 0-6&lt;br /&gt;CMD Command Any command to be executed.&lt;br /&gt;&lt;br /&gt;1. Scheduling a Job For a Specific Time Every Day&lt;br /&gt;&lt;br /&gt;The basic usage of cron is to execute a job in a specific time as shown below. This will execute the Full backup shell script (full-backup) on 10th June 08:30 AM.&lt;br /&gt;&lt;br /&gt;Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20.&lt;br /&gt;30 08 10 06 * /home/raj/full-backup&lt;br /&gt;30 – 30th Minute&lt;br /&gt;08 – 08 AM&lt;br /&gt;10 – 10th Day&lt;br /&gt;06 – 6th Month (June)&lt;br /&gt;* – Every day of the week&lt;br /&gt;2. Schedule a Job For More Than One Instance (e.g. Twice a Day)&lt;br /&gt;&lt;br /&gt;The following script take a incremental backup twice a day every day.&lt;br /&gt;&lt;br /&gt;This example executes the specified incremental backup shell script (incremental-backup) at 11:00 and 16:00 on every day. The comma separated value in a field specifies that the command needs to be executed in all the mentioned time.&lt;br /&gt;00 11,16 * * * /home/raj/bin/incremental-backup&lt;br /&gt;00 – 0th Minute (Top of the hour)&lt;br /&gt;11,16 – 11 AM and 4 PM&lt;br /&gt;* – Every day&lt;br /&gt;* – Every month&lt;br /&gt;* – Every day of the week&lt;br /&gt;3. Schedule a Job for Specific Range of Time (e.g. Only on Weekdays)&lt;br /&gt;&lt;br /&gt;If you wanted a job to be scheduled for every hour with in a specific range of time then use the following.&lt;br /&gt;Cron Job everyday during working hours&lt;br /&gt;&lt;br /&gt;This example checks the status of the database everyday (including weekends) during the working hours 9 a.m – 6 p.m&lt;br /&gt;00 09-18 * * * /home/raj/bin/checkdatabase&lt;br /&gt;00 – 0th Minute (Top of the hour)&lt;br /&gt;09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm&lt;br /&gt;* – Every day&lt;br /&gt;* – Every month&lt;br /&gt;* – Every day of the week&lt;br /&gt;Cron Job every weekday during working hours&lt;br /&gt;&lt;br /&gt;This example checks the status of the database every weekday (i.e excluding Sat and Sun) during the working hours 9 a.m – 6 p.m.&lt;br /&gt;&lt;br /&gt;4. How to View Crontab Entries?&lt;br /&gt;View Current Logged-In User’s Crontab entries&lt;br /&gt;&lt;br /&gt;To view your crontab entries type crontab -l from your unix account as shown below.&lt;br /&gt;&lt;br /&gt;raj@mail$ crontab -l&lt;br /&gt;0-55/5 * * * * /usr/sbin/vnstat.cron&lt;br /&gt;&lt;br /&gt;[Note: This displays crontab of the current logged in user]&lt;br /&gt;View Root Crontab entries&lt;br /&gt;&lt;br /&gt;Login as root user (su – root) and do crontab -l as shown below.&lt;br /&gt;root@mail# crontab -l&lt;br /&gt;no crontab for root&lt;br /&gt;Crontab HowTo: View Other Linux User’s Crontabs entries&lt;br /&gt;&lt;br /&gt;To view crontab entries of other Linux users, login to root and use -u {username} -l as shown below.&lt;br /&gt;root@mail# crontab -u raj -l&lt;br /&gt;&lt;br /&gt;00 09-18 * * * /home/raj/checkdatabase&lt;br /&gt;5. How to Edit Crontab Entries?&lt;br /&gt;Edit Current Logged-In User’s Crontab entries&lt;br /&gt;&lt;br /&gt;To edit a crontab entries, use crontab -e as shown below. By default this will edit the current logged-in users crontab.&lt;br /&gt;raj@mail$ crontab -e&lt;br /&gt;&lt;br /&gt;*/10 * * * * /home/raj/debian/bin/check-disk-space&lt;br /&gt;~&lt;br /&gt;&quot;/tmp/crontab.XXXXyjWkHw&quot; 2L, 83C&lt;br /&gt;&lt;br /&gt;[Note: This will open the crontab file in Vim editor for editing.&lt;br /&gt;Please note cron created a temporary /tmp/crontab.XX... ]&lt;br /&gt;&lt;br /&gt;When you save the above temporary file with :wq, it will save the crontab and display the following message indicating the crontab is successfully modified.&lt;br /&gt;~&lt;br /&gt;&quot;crontab.XXXXyjWkHw&quot; 2L, 83C written&lt;br /&gt;crontab: installing new crontab&lt;br /&gt;Edit Root Crontab entries&lt;br /&gt;&lt;br /&gt;Login as root user (su – root) and do crontab -e as shown below.&lt;br /&gt;root@mail# crontab -e&lt;br /&gt;Edit Other Linux User’s Crontab File entries&lt;br /&gt;&lt;br /&gt;To edit crontab entries of other Linux users, login to root and use -u {username} -e as shown below.&lt;br /&gt;root@mail# crontab -u raj -e&lt;br /&gt;&lt;br /&gt;00 09-18 * * * /home/raj/ubuntu/bin/check-db-status&lt;br /&gt;~&lt;br /&gt;~&lt;br /&gt;~&lt;br /&gt;&quot;/tmp/crontab.XXXXyjWkHw&quot; 2L, 83C&lt;br /&gt;6. Schedule a Job for Every Minute Using Cron.&lt;br /&gt;&lt;br /&gt;Ideally you may not have a requirement to schedule a job every minute. But understanding this example will will help you understand the other examples mentioned below in this article.&lt;br /&gt;* * * * * CMD&lt;br /&gt;&lt;br /&gt;The * means all the possible unit — i.e every minute of every hour through out the year. More than using this * directly, you will find it very useful in the following cases.&lt;br /&gt;When you specify */5 in minute field means every 5 minutes.&lt;br /&gt;When you specify 0-10/2 in minute field mean every 2 minutes in the first 10 minute.&lt;br /&gt;Thus the above convention can be used for all the other 4 fields.&lt;br /&gt;7. Schedule a Background Cron Job For Every 10 Minutes.&lt;br /&gt;&lt;br /&gt;Use the following, if you want to check the disk space every 10 minutes.&lt;br /&gt;*/10 * * * * /home/raj/check-disk-space&lt;br /&gt;&lt;br /&gt;It executes the specified command check-disk-space every 10 minutes through out the year. But you may have a requirement of executing the command only during office hours or vice versa. The above examples shows how to do those things.&lt;br /&gt;&lt;br /&gt;Instead of specifying values in the 5 fields, we can specify it using a single keyword as mentioned below.&lt;br /&gt;&lt;br /&gt;There are special cases in which instead of the above 5 fields you can use @ followed by a keyword — such as reboot, midnight, yearly, hourly.&lt;br /&gt;Table: Cron special keywords and its meaningKeyword Equivalent&lt;br /&gt;@yearly 0 0 1 1 *&lt;br /&gt;@daily 0 0 * * *&lt;br /&gt;@hourly 0 * * * *&lt;br /&gt;@reboot Run at startup.&lt;br /&gt;&lt;br /&gt;8. Schedule a Job For First Minute of Every Year using @yearly&lt;br /&gt;&lt;br /&gt;If you want a job to be executed on the first minute of every year, then you can use the @yearly cron keyword as shown below.&lt;br /&gt;&lt;br /&gt;This will execute the system annual maintenance using annual-maintenance shell script at 00:00 on Jan 1st for every year.&lt;br /&gt;@yearly /home/raj/red-hat/bin/annual-maintenance&lt;br /&gt;9. Schedule a Cron Job Beginning of Every Month using @monthly&lt;br /&gt;&lt;br /&gt;It is as similar as the @yearly as above. But executes the command monthly once using @monthly cron keyword.&lt;br /&gt;&lt;br /&gt;This will execute the shell script tape-backup at 00:00 on 1st of every month.&lt;br /&gt;@monthly /home/raj/suse/bin/tape-backup&lt;br /&gt;10. Schedule a Background Job Every Day using @daily&lt;br /&gt;&lt;br /&gt;Using the @daily cron keyword, this will do a daily log file cleanup using cleanup-logs shell scriptat 00:00 on every day.&lt;br /&gt;@daily /home/raj/arch-linux/bin/cleanup-logs &quot;day started&quot;&lt;br /&gt;11. How to Execute a Linux Command After Every Reboot using @reboot?&lt;br /&gt;&lt;br /&gt;Using the @reboot cron keyword, this will execute the specified command once after the machine got booted every time.&lt;br /&gt;@reboot CMD&lt;br /&gt;12. How to Disable/Redirect the Crontab Mail Output using MAIL keyword?&lt;br /&gt;&lt;br /&gt;By default crontab sends the job output to the user who scheduled the job. If you want to redirect the output to a specific user, add or update the MAIL variable in the crontab as shown below.&lt;br /&gt;raj@mail$ crontab -l&lt;br /&gt;MAIL=&quot;raj&quot;&lt;br /&gt;&lt;br /&gt;@yearly /home/raj/annual-maintenance&lt;br /&gt;*/10 * * * * /home/raj/check-disk-space&lt;br /&gt;&lt;br /&gt;[Note: Crontab of the current logged in user with MAIL variable]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you wanted the mail not to be sent to anywhere, i.e to stop the crontab output to be emailed, add or update the MAIL variable in the crontab as shown below.&lt;br /&gt;MAIL=&quot;&quot;&lt;br /&gt;13. How to Execute a Linux Cron Jobs Every Second Using Crontab.&lt;br /&gt;&lt;br /&gt;You cannot schedule a every-second cronjob. Because in cron the minimum unit you can specify is minute. In a typical scenario, there is no reason for most of us to run any job every second in the system.&lt;br /&gt;14. Specify PATH Variable in the Crontab&lt;br /&gt;&lt;br /&gt;All the above examples we specified absolute path of the Linux command or the shell-script that needs to be executed.&lt;br /&gt;&lt;br /&gt;For example, instead of specifying /home/raj/tape-backup, if you want to just specify tape-backup, then add the path /home/raj to the PATH variable in the crontab as shown below.&lt;br /&gt;raj@mail$ crontab -l&lt;br /&gt;&lt;br /&gt;PATH=/bin:/sbin:/usr/bin:/usr/sbin:/home/raj&lt;br /&gt;&lt;br /&gt;@yearly annual-maintenance&lt;br /&gt;*/10 * * * * check-disk-space&lt;br /&gt;&lt;br /&gt;[Note: Crontab of the current logged in user with PATH variable]&lt;br /&gt;15. Installing Crontab From a Cron File&lt;br /&gt;&lt;br /&gt;Instead of directly editing the crontab file, you can also add all the entries to a cron-file first. Once you have all thoese entries in the file, you can upload or install them to the cron as shown below.&lt;br /&gt;raj@mail$ crontab -l&lt;br /&gt;no crontab for ramesh&lt;br /&gt;&lt;br /&gt;$ cat cron-file.txt&lt;br /&gt;@yearly /home/raj/annual-maintenance&lt;br /&gt;*/10 * * * * /home/ramej/check-disk-space&lt;br /&gt;&lt;br /&gt;raj@mail$ crontab cron-file.txt&lt;br /&gt;&lt;br /&gt;raj@mail$ crontab -l&lt;br /&gt;@yearly /home/raj/annual-maintenance&lt;br /&gt;*/10 * * * * /home/raj/check-disk-space&lt;br /&gt;&lt;br /&gt;Note: This will install the cron-file.txt to your crontab, which will also remove your old cron entries. So, please be careful while uploading cron entries from a cron-file.txt.</content><link rel='replies' type='application/atom+xml' href='http://linuxshellos.blogspot.com/feeds/5829518763791760235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/crontab-15-cron-job-examples.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/5829518763791760235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/5829518763791760235'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/crontab-15-cron-job-examples.html' title='Crontab - 15 Cron Job Examples'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-2526724800906664384</id><published>2011-04-16T12:58:00.000+05:30</published><updated>2014-03-05T19:23:37.411+05:30</updated><title type='text'>லினக்ஸ் வரலாறு</title><content type='html'>க்னூ/லினக்ஸ் (GNU/Linux) என்பது கணினிகளில் உள்ள ஓர் இயக்குதளமாகும்..&lt;br /&gt;
&lt;br /&gt;
இவ்வியக்குதளம் பொதுவாக லினக்ஸ் என்ற பெயரால் அறியப்படுகிறது. ஆனாலும், இதன் மிகச்சரியான நிறுவன ஏற்புப் (உத்தியோகபூர்வமான) பெயர் க்னூ/லினக்ஸ் என்பதேயாகும்.&lt;br /&gt;
&lt;br /&gt;
* 1983: ரிச்சர்ட் ஸ்டால்மன் அவர்களால் க்னூ திட்டம் தொடங்கப்படுகிறது. இத்திட்டம் யுனிக்ஸ்&quot;&amp;gt;யுனிக்ஸ் இயக்குதளத்தை ஒத்த திறந்த ஆணைமூல இயக்குதளம் ஒன்றினை உருவாக்குதலை நோக்கமாக கொண்டிருந்தது.&lt;br /&gt;
&lt;br /&gt;
* 1990: க்னூ செயல் திட்டம் ஏறத்தாழ நிறைவடையும் நிலையை அண்மித்தது. ஓர் இயக்குதளத்துக்கு தேவையான செயலிகள் (இன்னமும் எழுதப்படவில்லை)&quot;&amp;gt;செயலிகள், காம்பைலர்கள், உரைத்தொகுப்பிகள், யுனிக்சை ஒத்த ஆணைமுகப்பு (command shell) போன்றவை அனைத்தும் செய்து முடிக்கப்பட்டுவிட்டன. மிக அடிப்படை நிலையில் இருக்கும் கரு (கருனி) ( kernel) ஒன்றை உருவாக்கும் பணி மட்டுமே முற்றுப்பெறவில்லை. அப்போது GNU Hurd என்ற கரு (கருனி) வடிவமைக்கப்பட்ட வண்ணமிருந்தாலும், அது போதாததாகவே உணரப்பட்டது.&lt;br /&gt;
&lt;br /&gt;
* 1991: லினக்ஸ் ஸ்டோவாட்ஸ் என்பவர், அக்காலத்தில் அவருக்கு பல்கலைக்கழகத்தில் கற்பித்த பேராசிரியர், இயங்குதளங்களை பற்றி கற்பிப்பதற்காக வடிவமைத்து வைத்திருந்த மினிக்ஸ் (இன்னமும் எழுதப்படவில்லை)&quot;&amp;gt;மினிக்ஸ் என்ற மென்பொருளை மேம்படுத்த முயன்றுகொண்டிருந்தார். இதற்கான அனுமதி மறுக்கப்படவே, மினிக்சை ஒத்த இயக்குதளம் ஒன்றை வடிவமைக்கத் தொடங்கினார். இதன் படிவளர்ச்சி நாளடைவில் ஒரு முழுமையான இயக்குதள கருவைத் (கருனியைத்) தந்தளித்தது.&lt;br /&gt;
&lt;br /&gt;
* 1991 செப்டெம்பர் 17: லினக்ஸ் தனது இயங்குதளத்தை இணையத்தில் கிடைக்கச்செய்கிறார். இதன் ஆணைமூலத்தை பெற்ற ஏராளமான நிரலாளர்கள் (இன்னமும் எழுதப்படவில்லை)&quot;&amp;gt;நிரலாளர்கள் லினக்சை மேன்மேலும் வளர்த்தெடுக்கிறார்கள்.&lt;br /&gt;
&lt;br /&gt;
அக்காலத்தில் லினக்சை செயற்படுத்த மினிக்ஸ் தொகுதி தேவைப்பட்டது. லினக்ஸ் கருவினை (கருனியை) செயற்படுத்த ஒரு சிறந்த இயக்குதளத்தின் தேவை உணரப்பட்ட நிலையில் லினக்ஸ்ஸும் அவருடன் பணியாற்றிய ஏனைய நிரலாளர்களும் க்னூ செயற்றிட்டத்தின் மென்பொருட்களுடன் லினக்சை ஒருங்கிணைப்பது என்ற முடிவுக்கு வந்தனர்.</content><link rel='replies' type='application/atom+xml' href='http://linuxshellos.blogspot.com/feeds/2526724800906664384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/2526724800906664384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/2526724800906664384'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2011/04/blog-post.html' title='லினக்ஸ் வரலாறு'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4943163881016449055.post-906375130253069065</id><published>2010-04-20T15:16:00.000+05:30</published><updated>2014-03-05T19:23:27.315+05:30</updated><title type='text'>MYSQL</title><content type='html'>&lt;br /&gt;
#mysqladmin -u &lt;root&gt; password &lt;new-password&gt;   &amp;lt;== to set the user password in mysql as root @ user
&lt;br /&gt;eg:-#mysqladmin -u root password 123
&lt;br /&gt;
&lt;br /&gt;#mysqladmin -u &lt;root&gt; -p&lt;oldpwd&gt; password &lt;newpwd&gt;  &amp;lt;== to reset the password in sql
&lt;br /&gt;eg:-#mysqladmin -u root -p123 password 321
&lt;br /&gt;
&lt;br /&gt;#mysql -u &lt;root&gt; -p      &amp;lt;== to login mysql
&lt;br /&gt;eg:-#mysql -u root -p321
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt;create database &lt;db .name=&quot;&quot;&gt;;    &amp;lt;== to create database
&lt;br /&gt;eg:-mysql&amp;gt;create database salesdata;
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt;show databases;
&lt;br /&gt;eg:-
&lt;br /&gt;+--------------------+
&lt;br /&gt;| Database           |
&lt;br /&gt;+--------------------+
&lt;br /&gt;| information_schema | 
&lt;br /&gt;| detail             | 
&lt;br /&gt;| mysql              | 
&lt;br /&gt;| salesdata          | 
&lt;br /&gt;| test               | 
&lt;br /&gt;+--------------------+
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt;grant all privileges on &lt;db .name=&quot;&quot;&gt;.* to &lt;u .name=&quot;&quot;&gt;@&#39;localhost&#39; identified by &#39;&lt;pwd&gt;&#39;;&amp;lt;== to give the full acces to the user
&lt;br /&gt;eg:-mysql&amp;gt;grant all privileges on salesdata.* to raj@&#39;localhost&#39; identified by &#39;1&#39;;&amp;lt;== grant command create new user also*
&lt;br /&gt;
&lt;br /&gt;#mysql -u &lt;mysqluser&gt; -p &lt;db .name=&quot;&quot;&gt;    &amp;lt;== to login as a database user
&lt;br /&gt;eg:-#mysql -u raj -p salesdata
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt;show databases;      &amp;lt;== to list the tables in that particular database
&lt;br /&gt;eg:-
&lt;br /&gt;+-----------+
&lt;br /&gt;| Database  |
&lt;br /&gt;+-----------+
&lt;br /&gt;| salesdata |
&lt;br /&gt;+-----------+
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt;use &lt;db .name=&quot;&quot;&gt;;      &amp;lt;== to select a database
&lt;br /&gt;eg:-mysql&amp;gt;use salesdata;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt;show tables;      &amp;lt;== to list the databases
&lt;br /&gt;eg:-
&lt;br /&gt;+---------------------+
&lt;br /&gt;| Tables_in_salesdata |
&lt;br /&gt;+---------------------+      &amp;lt;== It shows the tables in the salesdata database tables
&lt;br /&gt;| test                |
&lt;br /&gt;+---------------------+      
&lt;br /&gt;1 row in set (0.00 sec)
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt; describe ;     &amp;lt;== It describes the fields in test table
&lt;br /&gt;eg:-
&lt;br /&gt;+---------------+--------------+------+-----+------------+----------------+
&lt;br /&gt;| Field         | Type         | Null | Key | Default    | Extra          |
&lt;br /&gt;+---------------+--------------+------+-----+------------+----------------+
&lt;br /&gt;| num           | int(11)      |      | PRI | NULL       | auto_increment |
&lt;br /&gt;| date_modified | date         |      | MUL | 0000-00-00 |                |
&lt;br /&gt;| name          | varchar(50)  |      | MUL |            |                |
&lt;br /&gt;| description   | varchar(75)  | YES  |     | NULL       |                |
&lt;br /&gt;+---------------+--------------+------+-----+------------+----------------+
&lt;br /&gt;&lt;br /&gt;#mysqldump --database -u &lt;uname&gt; -p&lt;pwd&gt; (db.name) &amp;gt; (db.name.sql) &amp;lt;== to take mysql backup (or) dump
&lt;br /&gt;
&lt;br /&gt;eg:-mysqldump --database -u raj -p1 salesdata &amp;gt; salesdata.sql
&lt;br /&gt;
&lt;br /&gt;#mysql -u raj -p1
&lt;br /&gt;
&lt;br /&gt;mysql&amp;gt; drop database &lt;db name=&quot;&quot;&gt;;     &amp;lt;== to drop a database
&lt;br /&gt;eg:-mysql&amp;gt; drop database salesdata;
&lt;br /&gt;
&lt;br /&gt;#mysql -u raj -p1
&lt;br /&gt;mysql&amp;gt; create database &lt;same db.name=&quot;&quot;&gt;;    &amp;lt;== to create a database again in the (same name)*
&lt;br /&gt;            in other machine or etc..
&lt;br /&gt;
&lt;br /&gt;# mysql --database -u &lt;u .name=&quot;&quot;&gt; -p&lt;pwd&gt; (db.name) &amp;lt; (dbname.sql) &amp;lt;== to extract the database in the same name
&lt;br /&gt;eg:- mysql -u raj -p123 --database salesdata &amp;lt; salesdata.sql &amp;lt;== all the tables in the backup database will extracted 
&lt;br /&gt;            in this databse.
&lt;br /&gt;#mysql -u root -p123
&lt;br /&gt;
&lt;br /&gt;#flush privileges;      &amp;lt;== to change the privileges
&lt;/pwd&gt;&lt;/u&gt;&lt;/same&gt;&lt;/db&gt;&lt;/pwd&gt;&lt;/uname&gt;&lt;table name=&quot;&quot;&gt;
&lt;/table&gt;
&lt;/db&gt;&lt;/db&gt;&lt;/mysqluser&gt;&lt;/pwd&gt;&lt;/u&gt;&lt;/db&gt;&lt;/db&gt;&lt;/root&gt;&lt;/newpwd&gt;&lt;/oldpwd&gt;&lt;/root&gt;&lt;/new-password&gt;&lt;/root&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/906375130253069065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4943163881016449055/posts/default/906375130253069065'/><link rel='alternate' type='text/html' href='http://linuxshellos.blogspot.com/2010/04/mysql.html' title='MYSQL'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>