<?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: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-31620939</id><updated>2011-11-27T15:32:12.732-08:00</updated><category term='linux'/><category term='apache'/><category term='virtualization'/><category term='SSH'/><category term='mysql'/><category term='dns'/><category term='import  export'/><category term='kernel'/><category term='script'/><category term='webmin'/><category term='linux trick'/><category term='windows'/><category term='trademark'/><category term='Security'/><category term='Install linux'/><category term='backup'/><title type='text'>Admin Linux  ...  MySQL DBA</title><subtitle type='html'>Open Minds, Open Hearts, Open Doors... Open Source</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>79</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-31620939.post-7432763956368929027</id><published>2010-12-07T02:31:00.000-08:00</published><updated>2010-12-07T02:34:53.877-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL :  Altering Huge Tables</title><content type='html'>You have a huge mysql table - maybe 100 GB. And you need to run alter on it - to either add an index, drop an index, add a column or drop a column. If you run the simple mysql "alter table" command, you will end up spending ages to bring the table back into production.&lt;br /&gt;&lt;br /&gt;Here is a simple hack to get the thing done. The benefit of the hack is that the alter runs quite fast. But since this is a hack, you will need to take care of the backups - in case anything goes wrong. I have seen this hack work effectively with both MyISAM and InnoDB tables.&lt;br /&gt;&lt;br /&gt;Here I have created a simple table to show this hack process. You can assume that this table has billions of rows and is more than 100GB in size.&lt;br /&gt;&lt;br /&gt;CREATE TABLE `testhack` (&lt;br /&gt;`id` int(11) NOT NULL DEFAULT '0',&lt;br /&gt;`unq` varchar(100) DEFAULT NULL,&lt;br /&gt;`keyword` varchar(250) DEFAULT NULL,&lt;br /&gt;PRIMARY KEY (`id`),&lt;br /&gt;UNIQUE KEY `unq` (`unq`)&lt;br /&gt;) ENGINE=MyISAM&lt;br /&gt;&lt;br /&gt;I need to drop the unique key. So, i have create a new table 'testhack_new' with the following schema&lt;br /&gt;&lt;br /&gt;CREATE TABLE `testhack_new` (&lt;br /&gt;`id` int(11) NOT NULL DEFAULT '0',&lt;br /&gt;`unq` varchar(100) DEFAULT NULL,&lt;br /&gt;`keyword` varchar(250) DEFAULT NULL,&lt;br /&gt;PRIMARY KEY (`id`)&lt;br /&gt;) ENGINE=MyISAM&lt;br /&gt;&lt;br /&gt;Flush both tables with read lock&lt;br /&gt;&lt;br /&gt;mysql&gt; Flush tables with read lock;&lt;br /&gt;&lt;br /&gt;Open another terminal. And go to the mysql/data/ directory. Do the following:&lt;br /&gt;&lt;br /&gt;mysql/data/test $ mv testhack.frm testhack_old.frm; mv testhack_new.frm testhack.frm; mv testhack_old.frm testhack_new.frm; mv testhack.MYI testhack_old.MYI; mv testhack_new.MYI testhack.MYI; mv testhack_old.MYI testhack_new.MYI;&lt;br /&gt;&lt;br /&gt;So, what is happening here is that the index, table definitions are being switched. After this process, the table definition of testhack will not contain the unique key. Now unlock the tables in the main window. And run repair tables to remove any issues.&lt;br /&gt;&lt;br /&gt;mysql&gt; unlock tables;&lt;br /&gt;mysql&gt; repair tables testhack;&lt;br /&gt;&lt;br /&gt;+---------------+--------+----------+-------------------------------------------+ &lt;br /&gt;| Table         | Op     | Msg_type | Msg_text                                  | &lt;br /&gt;+---------------+--------+----------+-------------------------------------------+ &lt;br /&gt;| test.testhack | repair | warning  | Number of rows changed from 0 to 20000000 |  &lt;br /&gt;| test.testhack | repair | status   | OK                                        |&lt;br /&gt;+---------------+--------+----------+-------------------------------------------+ &lt;br /&gt;&lt;br /&gt;The repair table rebuilds the indexes. It is faster since it skips the use of key_cache for rebuilding the index (which is used in a normal alter table scenario).&lt;br /&gt;&lt;br /&gt;Source :&lt;br /&gt;&lt;a href="http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/"&gt;http://www.mysqlperformanceblog.com/2007/10/29/hacking-to-make-alter-table-online-for-certain-changes/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-7432763956368929027?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/7432763956368929027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=7432763956368929027' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7432763956368929027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7432763956368929027'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/12/mysql-altering-huge-tables.html' title='MySQL :  Altering Huge Tables'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-672651547748819199</id><published>2010-09-13T02:13:00.000-07:00</published><updated>2010-09-13T02:20:44.506-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install linux'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>mysql-packages</title><content type='html'>&lt;span style="font-weight: bold;"&gt;The RPM packages usages and details:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-server-VERSION.glibc23.i386.rpm&lt;/span&gt; - The MySQL server. You need this unless you only want to connect to a MySQL server running on another machine.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-client-VERSION.glibc23.i386.rpm&lt;/span&gt; - The standard MySQL client programs. You probably always want to install this package.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-devel-VERSION.glibc23.i386.rpm&lt;/span&gt; - The libraries and include files that are needed if you want to compile other MySQL clients, such as the Perl modules.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-debuginfo-VERSION.glibc23.i386.rpm&lt;/span&gt; - This package contains debugging information. debuginfo RPMs are never needed to use MySQL software; this is true both for the server and for client programs. However, they contain additional information that might be needed by a debugger to analyze a crash.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-shared-VERSION.glibc23.i386.rpm&lt;/span&gt; - This package contains the shared libraries (libmysqlclient.so*) that certain languages and applications need to dynamically load and use MySQL. It contains single-threaded and thread-safe libraries. If you install this package, do not install the MySQL-shared-compat package.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-shared-compat-VERSION.glibc23.i386.rpm&lt;/span&gt; - This package includes the shared libraries for MySQL 3.23, 4.0, and so on, up to the current release. It contains single-threaded and thread-safe libraries. Install this package instead of MySQL-shared if you have applications installed that are dynamically linked against older versions of MySQL but you want to upgrade to the current version without breaking the library dependencies.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-shared-compat-advanced-gpl-VERSION.glibc23.i386.rpm, MySQL-shared-compat-advanced-VERSION.glibc23.i386.rpm&lt;/span&gt; - These are like the MySQL-shared-compat package, but are for the “MySQL Enterprise Server – Advanced Edition” products. Install these packages rather than the normal MySQL-shared-compat package if you want to included shared client libraries for older MySQL versions.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-embedded-VERSION.glibc23.i386.rpm&lt;/span&gt; - The embedded MySQL server library.&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-ndb-management-VERSION.glibc23.i386.rpm, MySQL-ndb-storage-VERSION.glibc23.i386.rpm, MySQL-ndb-tools-VERSION.glibc23.i386.rpm, MySQL-ndb-extra-VERSION.glibc23.i386.rpm&lt;/span&gt; - Packages that contain additional files for MySQL Cluster installations.&lt;br /&gt;o Note : The MySQL-ndb-tools RPM requires a working installation of perl. Prior to MySQL 5.1.18, the DBI and HTML::Template packages were also required. See Section 2.15, “Perl Installation Notes”, and Section 17.4.21, “ndb_size.pl — NDBCLUSTER Size Requirement Estimator”, for more information.&lt;br /&gt;&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-test-VERSION.glibc23.i386.rpm&lt;/span&gt; - This package includes the MySQL test suite.&lt;br /&gt;Ø &lt;span style="font-weight: bold;"&gt;MySQL-VERSION.src.rpm&lt;/span&gt; - This contains the source code for all of the previous packages. It can also be used to rebuild the RPMs on other architectures (for example, Alpha or SPARC).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Default Installation Directory :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Directory -&gt; Contents of Directory&lt;/span&gt;&lt;br /&gt;/usr/bin -&gt;  Client programs and scripts&lt;br /&gt;/usr/sbin -&gt;  The mysqld server&lt;br /&gt;/var/lib/mysql -&gt;  Log files, databases&lt;br /&gt;/usr/share/info -&gt;  Manual in Info format&lt;br /&gt;/usr/share/man -&gt;  Unix manual pages&lt;br /&gt;/usr/include/mysql -&gt;  Include (header) files&lt;br /&gt;/usr/lib/mysql -&gt; Libraries&lt;br /&gt;/usr/share/mysql -&gt; Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation&lt;br /&gt;/usr/share/sql-bench -&gt;  Benchmarks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-672651547748819199?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/672651547748819199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=672651547748819199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/672651547748819199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/672651547748819199'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/09/mysql-packages_13.html' title='mysql-packages'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-1257871642175980799</id><published>2010-06-27T05:48:00.000-07:00</published><updated>2010-06-27T05:53:52.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Security Issues with MySQL ROOT Access</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Security Issues with MySQL ROOT Access&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;MySQL offers simple but very effective security mechanisms. Unfortunately, the default installation of MySQL, and in particular the empty root password and the potential vulnerability to buffer overflow attacks, makes the database an easy target for attacks.&lt;br /&gt;In order to achieve the highest possible level of security, the installation and configuration of MySQL should be performed in accordance with the following security requirements:&lt;br /&gt;&lt;br /&gt;  * MySQL processes must run under a unique UID/GID that is not used by any other system process.&lt;br /&gt;  * Only local access to MySQL need to be allowed.(some exceptions for jobs/backups)&lt;br /&gt;  * MySQL root's account must be protected by a complex/hard to guess password.&lt;br /&gt;  * The administrator's account (root) need to be renamed.&lt;br /&gt;  * Anonymous access to the database (by using the nobody account) must be disabled.&lt;br /&gt;&lt;br /&gt;MySQL Security risks can be categorized into the following.&lt;br /&gt;&lt;br /&gt;   *&lt;span style="font-weight: bold;"&gt; Filesystem security risks.&lt;/span&gt; MySQL Installation (basedir) and database information (datadir) and other log (querylog/slowlog) files that contain information about queries that clients execute. These files/directories need to be protected so that other users who have login accounts on the server host cannot access them directly.&lt;br /&gt;   * &lt;span style="font-weight: bold;"&gt;Network security risks. &lt;/span&gt;The MySQL server provides access to databases by allowing clients to connect and make requests. Information about client accounts is stored in the mysql database. Each account should be set up with privileges that provide access only to the data the accounts needs to see or modify.&lt;br /&gt;&lt;br /&gt;MySQL root account has full privileges to perform any database operation, so it's important to assign the account a password that is not easily guessed. Note that usernames and passwords for MySQL accounts are unrelated to those for system login accounts. OS login and MySQL login both should not be the same.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Restrict anonymous remote access&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Grant access to specific users from specific hosts only. Do not grant access from all hosts.&lt;br /&gt;Do not grant the PROCESS or SUPER privilege to non-administrative users. The output of mysqladmin processlist and SHOW PROCESSLIST shows the statements currently being executed, so any user who is allowed to see the server process list might be able to see statements issued by other users such as UPDATE user SET password=PASSWORD(pwd).&lt;br /&gt;&lt;br /&gt;mysqld reserves an extra connection for users who have the SUPER privilege, so that a MySQL root user can log in and check server activity even if all normal connections are in use. This is very useful when MySQL reaches the max_connections threshold. This cannot be beneficial; if users root (which ever has SUPER privilege) is used for all client connections.&lt;br /&gt;Do not grant the FILE privilege to non-administrative users. Any user that has this privilege can write a file anywhere in the file system with the privileges of the mysqld daemon. To make this a bit safer, files generated with SELECT ... INTO OUTFILE do not overwrite existing files and are writable by everyone.&lt;br /&gt;The FILE privilege may also be used to read any file that is accessible to the Unix user that the server runs as. With this privilege, user can read any file into a database table. This could be abused, for example, by using LOAD DATA to load /etc/passwd into a table, which then can be displayed with SELECT.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Improve local security&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use different socket file for both client and server connections. The following parameter should be changed in the [client] section of /etc/my.cnf:&lt;br /&gt;[client] socket = /tmp/mysql.sock&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Change admin password&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of the most important steps in securing MySQL is changing the database administrator's password, which is empty by default. In order to change the administrator's password, follow the steps:&lt;br /&gt;mysql -u root mysql&amp;gt; SET PASSWORD FOR root@localhost=PASSWORD('new_password');&lt;br /&gt;It is good practice not to change passwords from the command line,(instead change at database level). This is especially important when other users working on the server. In that case the password could be easily revealed, e.g. by using the "ps aux" command or reviewing history files, when improper access rights are set to them.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Change admin name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is also recommended to change the default name of administrator's account (root), to a different, harder to guess one. Such a change will make it difficult to perform brute-force and dictionary attacks on the administrator's password.&lt;br /&gt;mysql&amp;gt; update user set user="mysqluser" where user="root"; mysql&amp;gt; flush privileges;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Remove history&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We should also remove the content of the MySQL history file (~/.mysql_history, ~/.history, ~/.bash_history,~/.mysql_history) in which all executed SQL commands are being stored (especially passwords, which are stored as plain text).&lt;br /&gt;User Access Privileges&lt;br /&gt;We can create accounts for specific databases which will be used by specific applications. These accounts should have access rights only to the databases which are used by the specific applications. In particular, they should not have any access rights to the mysql database, nor any system or administrative privileges (FILE, GRANT, ALTER, SHOW DATABASE, RELOAD, SHUTDOWN, PROCESS, SUPER etc.). Application users should not granted all privileges to database with Grant option from any host.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://lh4.googleusercontent.com/lISpcpmuKqb9M_WsjRYJ9ym_Hf5LsFStPjj0vlrk4p1foenw_Or9LTZ-7aUc9LrL-KnF2MgJUC5JBFpJueaSj0T-GgVXiONpCnaHzTWzgp8RC9Px" height="257px;" width="422px;" /&gt;&lt;br /&gt;&lt;span style="font-style: normal; vertical-align: baseline;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size: 85%;"&gt;mysql&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; select user,host,password from user; GRANT USAGE ON *.* TO 'user1'@'%' IDENTIFIED BY PASSWORD 'xxxxxx' | GRANT ALL PRIVILEGES ON `user1`.* TO 'glist'@'%' WITH GRANT OPTION&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-1257871642175980799?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/1257871642175980799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=1257871642175980799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1257871642175980799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1257871642175980799'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/06/security-issues-with-mysql-root-access.html' title='Security Issues with MySQL ROOT Access'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8507341350648091334</id><published>2010-06-25T00:05:00.000-07:00</published><updated>2010-06-25T00:08:13.653-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL Development History</title><content type='html'>&lt;span style="font-weight:bold;"&gt;MySQL Development History&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;- MySQL was first released internally on 23 May 1995&lt;br /&gt;- Windows version was released on January 8, 1998 for Windows 95 and NT&lt;br /&gt;- Version 3.23: beta from June 2000, production release January 2001&lt;br /&gt;- Version 4.0: beta from August 2002, production release March 2003&lt;br /&gt;- Version 4.1: beta from June 2004, production release October 2004&lt;br /&gt;- Version 5.0: beta from March 2005, production release October 2005&lt;br /&gt;- Version 5.1: currently pre-production (since November 2005)&lt;br /&gt;- Sun Microsystems acquires MySQL AB on 26 February 2008&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;MySQL Features History&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;- Version 3.23.23 Full-Text Search&lt;br /&gt;- Version 4.0 Full-Text Search (IN BOOLEAN MODE), UNIONS&lt;br /&gt;- Version 4.1 R-Tree and B-Tree, Sub-Queries, Prepared Statements&lt;br /&gt;- Version 5.0 Cursors, Stored Procedures, Triggers, Views, XA Transactions&lt;br /&gt;- Version 5.1 Event Scheduler, Partitioning, Plugin API, Row-Based Replication, Server Log Tables&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8507341350648091334?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8507341350648091334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8507341350648091334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8507341350648091334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8507341350648091334'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/06/mysql-development-history.html' title='MySQL Development History'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-6186173014919054908</id><published>2010-06-13T11:51:00.000-07:00</published><updated>2010-06-13T12:54:49.208-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>Display Information About File - Stat</title><content type='html'>In Unix/Linux world everything is treated as files. whether it is a devices, directories and sockets — all of these are files.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Stat&lt;/span&gt; command displays file or file system status.&lt;br /&gt;&lt;br /&gt;[Prabhat@Server1 Archive]$ &lt;span style="font-weight: bold;"&gt;stat 1_16470_587807474.arc&lt;/span&gt;&lt;br /&gt;File: `1_16470_587807474.arc'&lt;br /&gt;Size: 208514560       Blocks: 407664     IO Block: 4096   regular file&lt;br /&gt;Device: fd02h/64770d    Inode: 17006596    Links: 1&lt;br /&gt;Access: (0640/-rw-r-----)  Uid: (  500/  oracle)   Gid: (  500/     dba)&lt;br /&gt;Access: 2010-06-12 23:28:58.000000000 -0700&lt;br /&gt;Modify: 2010-06-12 23:31:22.000000000 -0700&lt;br /&gt;Change: 2010-06-12 23:31:22.000000000 -0700&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Details of Linux Stat Command Output&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;File:&lt;/span&gt; `1_16470_587807474.arc’ – Name of the file.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Size:&lt;/span&gt; 208514560 – File size in bytes.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Blocks&lt;/span&gt;: 407664 – Total number of blocks used by this file.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;IO Block&lt;/span&gt;: 4096 – IO block size for this file.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;regular file&lt;/span&gt; – Indicates the file type. This indicates that this is a regular file. Following are available file types.&lt;br /&gt;      &lt;blockquote&gt;o regular file. ( ex: all normal files ).&lt;br /&gt;      o directory. ( ex: directories ).&lt;br /&gt;      o socket. ( ex: sockets ).&lt;br /&gt;      o symbolic link. ( ex: symbolic links. )&lt;br /&gt;      o block special file ( ex: hard disk ).&lt;br /&gt;      o character special file. ( ex: terminal device file ).&lt;/blockquote&gt;&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Device&lt;/span&gt;: fd02h/64770d  – Device number in hex and device number in decimal&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Inode&lt;/span&gt;: 17006596 – Inode number is a unique number for each file which is used for the internal maintenance by the file system.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Links&lt;/span&gt;: 1 – Number of links to the file&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Access&lt;/span&gt;: (0640/-rw-r-----): Access specifier displayed in both octal and character format. Let us see explanation about both the format.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Uid&lt;/span&gt;: ( 500/oracle) – File owner’s user id and user name are displayed.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Gid&lt;/span&gt;: ( 500/dba) – File owner’s group id and group name are displayed.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Access&lt;/span&gt;: 2010-06-12 23:28:58.000000000 -0700 – Last access time of the file.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Modify&lt;/span&gt;: 2010-06-12 23:31:22.000000000 -0700 – Last modification time of the file.&lt;br /&gt;* &lt;span style="font-weight: bold;"&gt;Change&lt;/span&gt;: 2010-06-12 23:31:22.000000000 -0700 – Last change time of the inode data of that file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Stat – Display Information About Directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can use the same command to display the information about a directory as shown below.&lt;br /&gt;&lt;br /&gt;[Prabhat@Server1 oradata]$ &lt;span style="font-weight: bold;"&gt;stat Archive&lt;/span&gt;&lt;br /&gt;File: `Archive'&lt;br /&gt;Size: 12288           Blocks: 24         IO Block: 4096   &lt;span style="font-weight: bold;"&gt;directory&lt;/span&gt;&lt;br /&gt;Device: fd02h/64770d    Inode: 16990209    Links: 2&lt;br /&gt;Access: (0755/drwxr-xr-x)  Uid: (  500/  oracle)   Gid: (  500/     dba)&lt;br /&gt;Access: 2009-11-02 23:43:22.000000000 -0800&lt;br /&gt;Modify: 2010-06-13 05:26:54.000000000 -0700&lt;br /&gt;Change: 2010-06-13 05:26:54.000000000 -0700&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-6186173014919054908?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/6186173014919054908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=6186173014919054908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6186173014919054908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6186173014919054908'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/06/display-information-about-file-file.html' title='Display Information About File - Stat'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8766645405222478992</id><published>2010-06-03T00:28:00.000-07:00</published><updated>2010-06-03T01:05:05.438-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL : About LIMIT 0 , 30</title><content type='html'>Limit is used to limit your MySQL query results to those that fall within a specified range. You can use it to show the first X number of results, or to show a range from X - Y results. It is phrased as Limit X, Y and included at the end of your query.&lt;br /&gt;X is the starting point (remember the first record is 0) and Y is the duration (how many records to display).&lt;br /&gt;&lt;br /&gt;Table 'example' have following data.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;SELECT * FROM `example` ORDER BY `example`.`age` ASC LIMIT 0 , 30&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;id     name     age&lt;/span&gt;&lt;br /&gt;3     Amit     26&lt;br /&gt;5     pani     27&lt;br /&gt;2     Sanjay     28&lt;br /&gt;4     Lucky     29&lt;br /&gt;6     atul     30&lt;br /&gt;1     Kumar     31&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SELECT *  FROM `example` ORDER BY `example`.`age` ASC  LIMIT 3 , 1&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;id  name  age &lt;/span&gt;&lt;br /&gt;4       Lucky   29&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;This will show records 3rd only (&lt;code style="font-style: italic;" class="sql"&gt;&lt;span class="syntax"&gt;&lt;span class="syntax_digit   syntax_digit_integer"&gt;remember the first record is 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8766645405222478992?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8766645405222478992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8766645405222478992' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8766645405222478992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8766645405222478992'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/06/mysql-about-limit-0-30.html' title='MySQL : About LIMIT 0 , 30'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-6667123419487656991</id><published>2010-05-27T22:21:00.001-07:00</published><updated>2010-05-28T11:26:36.875-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL : Allocating memory for caches</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;b&gt;Allocating memory for caches in MySQL&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If the server is dedicated to MySQL, any memory you don’t reserve for the operating system or for query processing is available for caches.&lt;br /&gt;MySQL needs more memory for caches than anything else. It uses caches to avoid disk access, which is orders of magnitude slower than accessing data in memory. The operating system may cache some data on MySQL’s behalf (especially for MyISAM),but MySQL needs lots of memory for itself too.&lt;br /&gt;&lt;br /&gt;The following are the most important caches to consider for the majority of installations:&lt;br /&gt;&lt;b&gt;• The operating system caches for MyISAM data&lt;/b&gt;&lt;br /&gt;&lt;b&gt;• MyISAM key caches&lt;/b&gt;&lt;br /&gt;&lt;b&gt;• The InnoDB buffer pool&lt;/b&gt;&lt;br /&gt;&lt;b&gt;• The query cache&lt;/b&gt;&lt;br /&gt;There are other caches, but they generally don’t use much memory.&lt;br /&gt;&lt;br /&gt;It is much easier to tune a server if you’re using only one storage engine. If you’re using only MyISAM tables, you can disable InnoDB completely, and if you’re using only InnoDB, you need to allocate only minimal resources for MyISAM (MySQL uses MyISAM tables internally for some operations). But if you’re using a mixture of storage engines, it can be very hard to figure out the right balance between them.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;The MyISAM Key Cache&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;The MyISAM key caches are also referred to as key buffers; there is one by default, but you can create more. Unlike InnoDB and some other storage engines, &lt;i&gt;&lt;b&gt;MyISAM itself caches only indexes, not data (it lets the operating system cache the data)&lt;/b&gt;&lt;/i&gt;. If you use mostly MyISAM, you should allocate a lot of memory to the key caches.&lt;br /&gt;&lt;br /&gt;The most important option is the &lt;b&gt;key_buffer_size&lt;/b&gt;, which you should try setting to between 25% and 50% of the amount of memory you reserved for caches. The remainder will be available for the operating system caches, which the operating system will usually fill with data from MyISAM’s .MYD files.&lt;br /&gt;&lt;br /&gt;MySQL 5.0 has a hard upper limit of 4 GB for this variable, no matter what architecture you’re running. (&lt;i&gt;MySQL 5.1 allows larger sizes. Check the current documentation for your version of the server.&lt;/i&gt;)&lt;br /&gt;&lt;br /&gt;By default MyISAM caches all indexes in the default key buffer, but you can create multiple named key buffers. This lets you keep more than 4 GB of indexes in memory at once. To create key buffers named key_buffer_1 and key_buffer_2, each sized at 1 GB, place the following in the configuration file:&lt;br /&gt;&lt;b&gt;key_buffer_1.key_buffer_size = 1G&lt;/b&gt;&lt;br /&gt;&lt;b&gt;key_buffer_2.key_buffer_size = 1G&lt;/b&gt;&lt;br /&gt;Now there are three key buffers: the two explicitly created by those lines and the default buffer. You can use the CACHE INDEX command to map tables to caches. You can also tell MySQL to use key_buffer_1 for the indexes from tables t1 and t2 with the following SQL statement:&lt;br /&gt;&lt;b&gt;mysql&amp;gt; CACHE INDEX t1, t2 IN key_buffer_1;&lt;/b&gt;&lt;br /&gt;Now when MySQL reads blocks from the indexes on these tables, it will cache the blocks in the specified buffer. You can also preload the tables’ indexes into the cache with the LOAD INDEX command:&lt;br /&gt;&lt;b&gt;mysql&amp;gt; LOAD INDEX INTO CACHE t1, t2;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can place this SQL into a file that’s executed when MySQL starts up. The filename must be specified in the init_file option, and the file can include multiple SQL commands, each on a single line (no comments are allowed). Any indexes you don’t explicitly map to a key buffer will be assigned to the default buffer the first time MySQL needs to access the .MYI file.&lt;br /&gt;&lt;br /&gt;You can monitor the performance and usage of the key buffers with information from SHOW STATUS and SHOW VARIABLES. You can calculate the hit ratio and the percentage of the buffer in use with these equations:&lt;br /&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;Cache hit ratio&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;100 - ( (Key_reads * 100) / Key_read_requests )&lt;/b&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;Percentage of buffer in use&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;100 - ( (Key_blocks_unused * key_cache_block_size) * 100 / key_buffer_size )&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;It’s good to know the cache hit rate, but this number can be misleading. For example,the difference between 99% and 99.9% looks small, but it really represents a tenfold increase. The cache hit rate is also application-dependent: some applications might work fine at 95%, whereas others might be I/O-bound at 99.9%. You might even be able to get a 99.99% hit rate with properly sized caches.&lt;br /&gt;&lt;br /&gt;The number of cache misses per second is generally much more empirically useful. Suppose you have a single hard drive that can do 100 random reads per second. Five misses per second will not cause your workload to be I/O-bound, but 80 per second&lt;br /&gt;will likely cause problems.&lt;br /&gt;You can use the following equation to calculate this value &lt;b&gt;cache misses&lt;/b&gt;:&lt;br /&gt;&lt;b&gt;Key_reads / Uptime&lt;/b&gt;&lt;br /&gt;Calculate the number of misses incrementally over intervals of 10 to 100 seconds, so you can get an idea of the current performance. The following command will show the incremental values every 10 seconds:&lt;br /&gt;&lt;b&gt;$ mysqladmin extended-status -r -i 10 | grep Key_reads&lt;/b&gt;&lt;br /&gt;When you’re deciding how much memory to allocate to the key caches, it might help to know how much space your MyISAM indexes are actually using on disk. You don’t need to make the key buffers larger than the data they will cache.&lt;br /&gt;Space your MyISAM indexes are actually using on disk&lt;br /&gt;&lt;b&gt;$ du -sch `find /path/to/mysql/data/directory/ -name "*.MYI"`&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Remember that MyISAM uses the operating system cache for the data files, which are often larger than the indexes. Therefore, it often makes sense to leave more memory for the operating system cache than for the key caches. Finally, even if you don’t have any MyISAM tables, bear in mind that you still need to set key_buffer_size to a small amount of memory, such as 32M. The MySQL server sometimes uses MyISAM tables for internal purposes, such as temporary tables for GROUP BY queries.&lt;br /&gt;&lt;br /&gt;The MyISAM key block size The key block size is important (especially for write-intensive workloads) because of the way it causes MyISAM, the operating system cache, and the filesystem to interact. If the key block size is too small, you may encounter read-around writes, which&lt;br /&gt;are writes that the operating system cannot perform without first reading some data  from the disk. Here’s how a read-around write happens, assuming the operating system’s page size is 4 KB (typically true on the x86 architecture) and the key block size is 1 KB:&lt;br /&gt;1. MyISAM requests a 1 KB key block from disk.&lt;br /&gt;2. The operating system reads 4 KB of data from the disk and caches it, then passes the desired 1 KB of data to MyISAM.&lt;br /&gt;3. The operating system discards the cached data in favor of some other data.&lt;br /&gt;4. MyISAM modifies the 1 KB key block and asks the operating system to write it back to disk.&lt;br /&gt;5. The operating system reads the same 4 KB of data from the disk into the operating system cache, modifies the 1 KB that MyISAM changed, and writes the entire&lt;br /&gt;4 KB back to disk.&lt;br /&gt;&lt;br /&gt;The read-around write happened in step 5, when MyISAM asked the operating system to write only part of a 4 KB page. If MyISAM’s block size had matched the operating system’s, the disk read in step 5 could have been avoided.*Unfortunately, in MySQL 5.0 and earlier, there’s no way to configure the key block size. However, in MySQL 5.1 and later, you can avoid read-around writes by making MyISAM’s key block size the same as the operating system’s. The &lt;b&gt;myisam_block_size&lt;/b&gt; variable controls the key block size. You can also specify the size for each key with the &lt;b&gt;KEY_BLOCK_SIZE&lt;/b&gt; option in a CREATE TABLE or CREATE INDEX statement, but because all keys are stored in the same file, you really need all of them to have blocks as large as or larger than the operating system’s to avoid alignment issues that could still cause read-around writes. (For example, if one key has 1 KB blocks and another has 4 KB blocks, the 4 KB block boundaries might not match the operating system’s page boundaries.)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;The InnoDB Buffer Pool&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;If you use mostly InnoDB tables, the InnoDB buffer pool probably needs more memory than anything else. Unlike the MyISAM key cache, &lt;i&gt;&lt;b&gt;the InnoDB buffer pool doesn’t just cache indexes: it also holds row data&lt;/b&gt;&lt;/i&gt;, the adaptive hash index, the insert buffer, locks, and other internal structures. InnoDB also uses the buffer pool to help it delay writes, so it can merge many writes together and perform them sequentially. In short, InnoDB relies heavily on the buffer pool, and you should be sure to allocate enough memory to it.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;The MySQL manual suggests using up to 80% of the machine’s physical memory for the buffer pool on a dedicated server; in reality, you can use more than that if the machine has a lot of memory.&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;As with the MyISAM key buffers, you can use variables from SHOW commands or tools such as innotop to monitor your InnoDB buffer pool’s memory usage and performance. There’s no equivalent of LOAD INDEX INTO CACHE for InnoDB tables. However, if you’re trying to warm up a server and get it ready to handle a heavy load, you can issue queries that perform full table scans or full index scans.&lt;br /&gt;&lt;br /&gt;In most cases, you should make the InnoDB buffer pool as large as your available memory allows. However, in rare circumstances, very large buffer pools (say, 50 GB) can cause long stalls. For example, a large buffer pool may become slow during checkpoints or insert buffer merge operations, and concurrency can drop as a result of locking. If you experience these problems, you may have to reduce the buffer pool size.&lt;br /&gt;&lt;br /&gt;You can change the &lt;i&gt;&lt;b&gt;innodb_max_dirty_pages_pct&lt;/b&gt;&lt;/i&gt; variable to instruct InnoDB to keep more or fewer dirty (modified) pages in the buffer pool. If you allow a lot of dirty pages, InnoDB can take a long time to shut down, because it writes the dirty pages to the data files upon shutdown.&lt;br /&gt;You can monitor the number of dirty pages by watching the &lt;i&gt;&lt;b&gt;Innodb_buffer_pool_pages_dirty&lt;/b&gt;&lt;/i&gt; server status variable or using innotop to monitor SHOW INNODB STATUS.&lt;br /&gt;Lowering the value of the innodb_max_dirty_pages_pct variable doesn’t actually guarantee that InnoDB will keep fewer dirty pages in the buffer pool. Instead, it controls the threshold at which InnoDB stops being “lazy.” InnoDB’s default behavior is to flush dirty pages with a background thread, merging writes together and performing them sequentially for efficiency. This behavior is called “lazy” because it lets InnoDB delay flushing dirty pages in the buffer pool, unless it needs to use the space for some other data. When the percentage of dirty pages exceeds the threshold, InnoDB will flush pages as quickly as it can to try to keep the dirty page count lower. The variable’s default value is 90, so by default InnoDB will flush lazily until the buffer pool is 90% full of dirty pages. You can tweak the threshold for your workload if you wish to spread out the writes a bit more. For example, lowering it to 50 will generally cause InnoDB to do more write operations, because it will flush pages sooner and therefore be unable to batch the writes as well. However, if your workload has a lot of write spikes, using a lower value may help InnoDB absorb the spikes better: it will have more “spare” memory to hold dirty pages, so it won’t have to wait for other dirty pages to be flushed to disk.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;The Thread Cache&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;The thread cache holds threads that aren’t currently associated with a connection but are ready to serve new connections. When there’s a thread in the cache and a new connection is created, MySQL removes the thread from the cache and gives it to the new connection. When the connection is closed, MySQL places the thread back into the cache, if there’s room. If isn’t room, MySQL destroys the thread. As long as MySQL has a free thread in the cache, it can respond very rapidly to connect requests, because it doesn’t have to create a new thread for each connection.&lt;br /&gt;The &lt;b&gt;thread_cache_size&lt;/b&gt; variable specifies the number of threads MySQL can keep in the cache. You probably won’t need to tune this value, unless your server gets many connection requests. To check whether the thread cache is large enough, watch the &lt;i&gt;&lt;b&gt;Threads_created&lt;/b&gt;&lt;/i&gt; status variable. We generally try to keep the thread cache large enough that we see fewer than 10 new threads created each second, but it’s often pretty easy to get this number lower than 1 per second.&lt;br /&gt;&lt;br /&gt;A good approach is to watch the Threads_connected variable and try to set &lt;b&gt;thread_cache_size &lt;/b&gt;large enough to handle the typical fluctuation in your workload. For example, if Threads_connected usually stays between 100 and 200, you can set the cache size to 100. If it stays between 500 and 700, a thread cache of 200 should be large enough. Think of it this way: at 700 connections, there are probably no threads in the cache; at 500 connections, there are 200 cached threads ready to be used if the load increases to 700 again. Making the thread cache very large is probably not necessary for most uses, but keeping it small doesn’t save much memory, so there’s little benefit in doing so. Each thread that’s in the thread cache or sleeping typically uses around 256 KB of memory. This is very little compared to the amount of memory a thread can use when a connection is actively processing a query. In general, you should keep your thread cache large enough that &lt;i&gt;&lt;b&gt;Threads_created&lt;/b&gt;&lt;/i&gt; doesn’t increase very often. If this is a very large number, however (e.g., many thousand threads), you might want to set it lower because some operating systems don’t handle very large numbers of threads well, even when most of them are sleeping.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;The Table Cache&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;The table cache is similar in concept to the thread cache, but it stores objects that represent tables. Each object in the cache contains the associated table’s parsed .frm file, plus other data. Exactly what else is in the object depends on the table’s storage engine. For example, for MyISAM, it holds the table data and/or index file descriptors.   For merge tables it may hold many file descriptors, because merge tables can have many underlying tables. The table cache can help you reuse resources. For instance, when a query requests access to a MyISAM table, MySQL might be able to give it a file descriptor from the cached object instead of opening the file. The table cache can also help avoid some of the I/O required for marking a MyISAM table as “in use” in the index headers.*The table cache’s design is a little MyISAM-centric—this is one of the areas where the separation between the server and the storage engines is not completely clean, for historical reasons. The table cache is a little less important for InnoDB, because InnoDB doesn’t rely on it for as many purposes (such as holding file descriptors; it has its own version of a table cache for this purpose). However, even InnoDB benefits from caching the parsed .frm files.&lt;br /&gt;&lt;br /&gt;In MySQL 5.1, the table cache is separated into two parts: a cache of open tables and a table definition cache (configured via the &lt;b&gt;table_open_cache&lt;/b&gt; and &lt;b&gt;table_definition_cache&lt;/b&gt; variables). Thus, the table definitions (the parsed .frm files) are separated from&lt;br /&gt;the other resources, such as file descriptors. Opened tables are still per-thread, pertable-used, but the table definitions are global and can be shared among all connections efficiently. You can generally set table_definition_cache high enough to cache all your table definitions. Unless you have tens of thousands of tables, this is likely to be the easiest approach. If the Opened_tables status variable is large or increasing, the table cache isn’t large enough, and you should increase the table_cache system variable (or table_open_cache, in MySQL 5.1). The only real downside to making the table cache very large is that it might cause longer shutdown times when your server has a lot of MyISAM tables, because the key blocks have to be flushed and the tables have to be marked as no longer open. It can also make FLUSH TABLES WITH READ LOCK take a long time &lt;span style="font-family:arial;"&gt;&lt;/span&gt;complete, for the same reason.&lt;br /&gt;If you get errors indicating that MySQL can’t open any more files (use the perror utility to check what the error number means), you might also need to increase the number of files MySQL is allowed to keep open. You can do this with the open_files_limit server variable in your my.cnf file.&lt;br /&gt;The thread and table caches don’t really use much memory, and they are beneficial&lt;br /&gt;because they conserve resources. Although creating a new thread and opening a new&lt;br /&gt;file aren’t really expensive compared to other things MySQL might do, the overhead&lt;br /&gt;can add up quickly under a high-concurrency workload. Caching threads and tables&lt;br /&gt;can improve efficiency.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-6667123419487656991?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/6667123419487656991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=6667123419487656991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6667123419487656991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6667123419487656991'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/05/mysql-allocating-memory-for-caches.html' title='MySQL : Allocating memory for caches'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-7960071667771106133</id><published>2010-05-25T09:05:00.001-07:00</published><updated>2010-05-25T09:10:05.703-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MYSQL : Checking and Reparing tables</title><content type='html'>If your database is MySQL, though, there's still hope. Over the course  of this article, I will show you how to use MySQL's built-in crash  recovery tools to check your database, and hopefully recover all the  data you just lost.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;&lt;span class="subhead1"&gt;Built-in tools&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;When  it comes to repairing and checking tables, MySQL offers two options:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;myisamchk&lt;/b&gt;  designed specifically to check and repair MyISAM tables (the default  table type used by MySQL). This tool can scan your databases, identify  problems, optimize tables for faster lookup, and optionally repair  corrupted tables. The myisamchk tool is invoked from the command line.&lt;/li&gt;&lt;li&gt;MySQL  also allows you check and repair tables using SQL commands. The &lt;b&gt;CHECK  TABLE&lt;/b&gt;, &lt;b&gt;REPAIR TABLE&lt;/b&gt;, and &lt;b&gt;OPTIMIZE TABLE&lt;/b&gt; commands can  be used on a running MySQL server and need to be entered through a MySQL  client.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Most of the time, it's preferable to use myisamchk  because it is significantly faster than using SQL commands.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="subhead1"&gt;Checking tables&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;If you're having trouble  accessing a table, first try checking it for errors. To check a table,  shut down the server and type &lt;i&gt;myisamchk&lt;/i&gt; at the command prompt,  followed by the table's file name, as shown below:&lt;br /&gt;&lt;b&gt;&lt;span class="code"&gt;$ myisamchk /usr/local/mysql/data/phpbb/user.myi&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="code"&gt;Checking MyISAM file: /usr/local/mysql/data//user.MYI&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;Data records:     1153   Deleted blocks:       0&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;- check file-size&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;- check key  delete-chain&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;- check record delete-chain&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;- check index reference&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;-  check data record references index: 1&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;-  check record links&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use the complete path to the table file  instead of just the table name. Remember to include the file extension  as well.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;myisamchk options :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;myisamchk &lt;/span&gt;-- fast    Perform a quick check, only verifying if the table handler closed successfully&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;myisamchk&lt;/span&gt; -- medium-check    Perform a faster check, by calculating a checksum for the indexes in each record and verifying that checksum against the index tree&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;myisamchk&lt;/span&gt; -- extend-check    Perform a thorough check of the table, verifying the data in each record&lt;br /&gt;&lt;span class="caption"&gt;Command line arguments for myisamchk&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;" class="subhead1"&gt;Repairing tables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next,  shut down the MySQL server. This is because myisamchk makes changes to  the table file itself, so you don't want other users accessing or  otherwise manipulating the file during the repair operation.  Also  advisable table physical backup of database.&lt;br /&gt;&lt;br /&gt;Once the table file  is backed up and the server down, you can run myisamchk with the &lt;i&gt;--recover&lt;/i&gt;  option, as shown below:&lt;br /&gt;&lt;b&gt;&lt;span class="code"&gt;$ myisamchk --recover  /usr/local/mysql/data/phpbb/user.myi&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="code"&gt;-  recovering (with sort) MyISAM-table  '/usr/local/mysql/data/phpbb/user.MYI'Data records: 1153&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;- Fixing index 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;i&gt;--recover&lt;/i&gt; option  reconstructs the MySQL table index file after weeding the corrupted  table of invalid or previously deleted records that could be causing a  problem.&lt;br /&gt;&lt;br /&gt;In the unlikely event that the &lt;i&gt;--recover&lt;/i&gt; option  fails, revert to the original table file and try the &lt;i&gt;--safe-recover&lt;/i&gt;  option. This is slower, because MySQL needs to scan through the records  in the data file one by one and them restore the index, but it can  sometimes work better than a regular repair operation.&lt;br /&gt;&lt;span style="font-weight: bold;" class="code"&gt;$ myisamchk --safe-recover  /usr/local/mysql/data/phpbb/user.myi&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;-  recovering (with keycache) MyISAM-table  '/usr/local/mysql/data/phpbb/user.MYI'&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;Data  records: 4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;&lt;span class="subhead1"&gt;Using CHECK TABLE  and REPAIR TABLE&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;check and repair operations are  run  from a MySQL prompt, via the &lt;span style="font-weight: bold;"&gt;CHECK  TABLE&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;REPAIR TABLE&lt;/span&gt;  commands.&lt;br /&gt;&lt;br /&gt;Consider the following example of running a CHECK TABLE  command:&lt;br /&gt;&lt;span class="code"&gt;mysql&gt; &lt;b&gt;CHECK TABLE user;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+-------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;| Table        | Op    | Msg_type | Msg_text |&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+-------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;| phpbb.user | check | status   | OK       |&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+-------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;1 row in set (0.02 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can add the  FAST, MEDIUM, and EXTENDED keywords to the command to obtain behavior  similar to that available in myisamchk. For example:&lt;br /&gt;&lt;span class="code"&gt;mysql&gt; &lt;b&gt;CHECK TABLE user EXTENDED;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+-------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;| Table        | Op    | Msg_type | Msg_text |&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+-------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;| phpbb.user| check | status   | OK       |&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+-------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;1 row in set (0.02 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When it comes to  repairing tables, too, MySQL offers the REPAIR TABLE option, as below:&lt;br /&gt;&lt;span class="code"&gt;mysql&amp;gt; &lt;b&gt;REPAIR TABLE user;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+--------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;| Table        | Op     | Msg_type | Msg_text |&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+--------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;| phpbb.user | repair | status   | OK       |&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;+--------------+--------+----------+----------+&lt;/span&gt;&lt;br /&gt;&lt;span class="code"&gt;1 row in set (0.01 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As with the  myisamchk tool, the REPAIR TABLE command can take one of two additional  options: QUICK, which tries a quick repair, and EXTENDED, which rebuilds  the index after reading each record in the table.&lt;br /&gt;&lt;br /&gt;An option here  is to use the mysqlcheck utility, which provides a command line front  end to the CHECK TABLE and REPAIR TABLE commands, allowing you to check  and repair tables without first taking the server down. Everything that  you can do with CHECK TABLE and REPAIR TABLE can be done with  mysqlcheck, by passing appropriate command line options to the program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-7960071667771106133?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/7960071667771106133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=7960071667771106133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7960071667771106133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7960071667771106133'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/05/mysql-checking-and-reparing-tables.html' title='MYSQL : Checking and Reparing tables'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-5359929357377342452</id><published>2010-05-08T07:39:00.000-07:00</published><updated>2010-05-08T07:45:47.153-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL : Calculate Query Executed per second</title><content type='html'>Here is a way to calculate Query Executed per second :&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;time=10&lt;br /&gt;begin=`mysql -e "show status" | awk '{if ($1 == "Questions") print $2}'`&lt;br /&gt;sleep $time&lt;br /&gt;end=`mysql -e "show status" | awk '{if ($1 == "Questions") print $2}'`&lt;br /&gt;diff=`expr $end - $begin`&lt;br /&gt;avg=`expr $diff / $time`&lt;br /&gt;echo "$avg"&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-5359929357377342452?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/5359929357377342452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=5359929357377342452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5359929357377342452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5359929357377342452'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/05/mysql-calculate-query-executed-per.html' title='MySQL : Calculate Query Executed per second'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-3478675973899324024</id><published>2010-04-07T00:30:00.000-07:00</published><updated>2010-04-07T00:32:35.579-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>Problem : CTRL+S in Putty</title><content type='html'>Over the years, we all have habit of using CTRL+S every few minutes during working on a document,  because we all had too much work lost from stupid errors; In the Windows world, CTRL+S is used as the Save you work. &lt;br /&gt;But, this habit will be a problem on working in the Linux world. &lt;br /&gt;&lt;br /&gt;By accident while inside a terminal window (in PUTTY) we press CTRL+S, this accidental keystroke meant we had reconnect to my Linux server, kill whatever program we were running, and then start it again. &lt;br /&gt;&lt;br /&gt;But here is solution : &lt;br /&gt;&lt;br /&gt;CTRL+S actually does XOFF, which means the terminal will accept key strokes but won’t show the output of anything. It will appear as if your terminal is dead when it’s really just waiting to be turned back on. The fix? &lt;span style="font-weight:bold;"&gt;Simply press CTRL+Q to turn flow-control on (XON)&lt;/span&gt;. If you pressed a whole bunch of keys before pressing CTRL+Q, you’ll see the output from those keystrokes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-3478675973899324024?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/3478675973899324024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=3478675973899324024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3478675973899324024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3478675973899324024'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/04/problem-ctrls-in-putty.html' title='Problem : CTRL+S in Putty'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-2729656597386392541</id><published>2010-03-21T22:21:00.000-07:00</published><updated>2010-03-21T22:51:20.731-07:00</updated><title type='text'>memory-usage-free</title><content type='html'>There is simple command to check for the overall usage of memory including physical memory and swap memory.&lt;br /&gt;&lt;br /&gt;What you is just type free and it will shows you the information of the memory usage. for example:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;             total       used       free     shared    buffers     cached&lt;br /&gt;Mem:      16442272   16355460      86812          0     129600   10120444&lt;br /&gt;-/+ buffers/cache:    6105416   10336856&lt;br /&gt;Swap:     10223608     263608    9960000&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;The value shows at the first line of total column, is the total physical memory I have in kilobytes. I have 16GB ram, the results (16442272kb) shown above is approximate in kb. So the system have already used almost all the physically memory, which just left about 84M as free memory.&lt;br /&gt;&lt;br /&gt;Out of 15.6G from 5.8G that stored in the system, is actually used. And it still left 9.8G in cache. I have total 10G of swap , and it uses 9.4GM and remain 9.4G unused.&lt;br /&gt;&lt;br /&gt;The memory usage seems high but still consider healthy. I have loaded a lots of applications and uses some minor disc space for swap, but everything still running smooth without any lags.&lt;br /&gt;&lt;br /&gt;Free have few options, if you feel that memory result shows in kb is not detail enough, you can have more accurate measurement in bytes. You can passes -b for bytes, or less details -m for Megabytes, -g for gigabytes.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;free -b&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;You can ask free to display results in every 5 seconds, in order to track the increases/decreases on memory usage.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;free -s 5&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-2729656597386392541?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/2729656597386392541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=2729656597386392541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2729656597386392541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2729656597386392541'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/03/memory-usage-free.html' title='memory-usage-free'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-9016653374216967561</id><published>2010-02-19T06:27:00.000-08:00</published><updated>2010-02-19T07:53:47.475-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Kontrollbase-MySQL monitoring tool</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Kontrollbase - MySQL monitoring tool.&lt;/span&gt;&lt;br /&gt;Past few days I am looking for a centralized MySQL database monitoring tool, Which will give complete details of MySQL database.&lt;br /&gt;I have looked various tools but, &lt;a href="http://kontrollsoft.com/"&gt;Kontrollbase&lt;/a&gt; is given me the complete solution.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://kontrollsoft.com/"&gt;Kontrollbase&lt;/a&gt; is a monitoring, analytics, reporting, and historical analysis webapp for MySQL database administrators and advanced users of MySQL databases.&lt;br /&gt;&lt;br /&gt;Important links:&lt;br /&gt; &lt;a href="http://kontrollsoft.com/software-kontrollbase"&gt;software-kontrollbase&lt;/a&gt;&lt;br /&gt; &lt;a href="http://kontrollsoft.com/screenshots"&gt;screenshots&lt;/a&gt;&lt;br /&gt; &lt;a href="http://demo01.kontrollbase.com/"&gt;demo&lt;/a&gt; U&lt;span style="font-style:italic;"&gt;sername: demo , Password: password&lt;br /&gt;note: do not use IE, use Firefox or other browser.&lt;/span&gt;&lt;br /&gt; &lt;a href="http://kontrollsoft.com/software-downloads"&gt;downloads&lt;/a&gt;&lt;br /&gt; &lt;a href="http://kontrollsoft.com/kontrollbase/userguide/toc.php"&gt;Documentation&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-9016653374216967561?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/9016653374216967561/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=9016653374216967561' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/9016653374216967561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/9016653374216967561'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/02/kontrollbase-mysql-monitoring-tool.html' title='Kontrollbase-MySQL monitoring tool'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-7147181923628502622</id><published>2010-02-15T00:34:00.000-08:00</published><updated>2010-02-15T00:38:54.401-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>System details of  Windows</title><content type='html'>Various time we required system (on Windows 2000, XP, 2003/8, Vista and Windows 7) details like hardware (motherboard, CPU , RAM , etc), installed software operating system’s security hotfixes and lots and lots of more.&lt;br /&gt;&lt;br /&gt;One such solution is &lt;a href="http://www.lookinmypc.com/"&gt;LookInMyPC&lt;/a&gt; – a free program that automatically generates a detailed audit report of the hardware and software on your computer. It records essential information such as, operating system and processor details, the amount of RAM installed, drive specifications, and much, much, more.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.lookinmypc.com/ReportPage1.htm"&gt;sample report&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-7147181923628502622?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/7147181923628502622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=7147181923628502622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7147181923628502622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7147181923628502622'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2010/02/system-details-of-windows.html' title='System details of  Windows'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-5723872545934727204</id><published>2009-12-31T16:31:00.000-08:00</published><updated>2009-12-31T16:37:47.809-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL Tips : Verify database Objects</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Verify database Objects:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. Verify table.&lt;/span&gt;&lt;br /&gt;    a. SHOW TABLE STATUS LIKE '%user%'\G&lt;br /&gt;    b. SHOW TABLE STATUS from forum LIKE '%user%' \G&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. It will show you all tables have MyISAM engine.   &lt;/span&gt;&lt;br /&gt;    a. SELECT TABLE_SCHEMA, table_name, table_type, engine From information_schema.tables where engine='MyISAM';&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. To know rows per table, you can use a query like this: &lt;/span&gt;&lt;br /&gt;    a. SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'forum';&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4.  Verify you procedure / function.&lt;/span&gt;&lt;br /&gt;    a. SHOW  procedure/FUNCTION STATUS LIKE ´hello´G&lt;br /&gt;    b. show create procedure/function hello\G&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5.  Routines &lt;/span&gt;&lt;br /&gt;   a. select routine_name from information_schema.routines; // list of all the routines in the system &lt;br /&gt;   b. select routine_name, routine_schema, routine_type from information_schema.routines; // This lists all of the routines in the system. With additional Information like the database the routines belongs too and also distinct between the different routines. &lt;br /&gt;    c. select routine_name, routine_schema, routine_type from information_schema.routines where routine_schema = database() // This time we can see just the routines for the currently selected database. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;6. Triggers&lt;/span&gt;&lt;br /&gt;    a. select TRIGGER_SCHEMA,TRIGGER_NAME from INFORMATION_SCHEMA.TRIGGERS;&lt;br /&gt;    b. select TRIGGER_NAME from INFORMATION_SCHEMA.TRIGGERS where TRIGGER_SCHEMA = database();&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-5723872545934727204?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/5723872545934727204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=5723872545934727204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5723872545934727204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5723872545934727204'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/12/mysql-tips-verify-database-objects.html' title='MySQL Tips : Verify database Objects'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4924901095624550174</id><published>2009-12-28T16:35:00.000-08:00</published><updated>2010-12-07T03:55:46.083-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL Tips : Calculate database and table size</title><content type='html'>Few MySQL Tips:&lt;br /&gt;&lt;br /&gt;a. calculate databases size  :&lt;br /&gt;-&gt; It will show database size&lt;br /&gt;&lt;blockquote&gt; SELECT s.schema_name, CONCAT(IFNULL(ROUND(SUM(t.data_length)/1024/1024,2),0.00),"Mb") as Data_size, CONCAT(IFNULL(ROUND(SUM(t.index_length)/1024/1024,2),0.00),"Mb") as Index_size,COUNT(table_name) total_tables  FROM INFORMATION_SCHEMA.SCHEMATA s  LEFT JOIN INFORMATION_SCHEMA.TABLES t ON s.schema_name = t.table_schema WHERE s.schema_name not in("mysql","information_schema","test") GROUP BY s.schema_name order by Data_size DESC;&lt;/blockquote&gt;&lt;br /&gt;-&gt; It will show database size along with table size.&lt;br /&gt;&lt;blockquote&gt; SELECT s.schema_name,t.table_name, CONCAT(IFNULL(ROUND(SUM(t.data_length)/1024/1024,2),0.00),"Mb") data_size,CONCAT(IFNULL(ROUND(SUM(t.index_length)/1024/1024,2),0.00),"Mb") index_size, t.ENGINE ENGINE, t.table_rows TABLE_ROWS,t.row_format TABLE_ROW_FORMAT,date(t.update_time) FROM INFORMATION_SCHEMA.SCHEMATA s LEFT JOIN INFORMATION_SCHEMA.TABLES t ON s.schema_name = t.table_schema WHERE s.schema_name not in ("mysql","information_schema") GROUP BY s.schema_name,t.table_name,TABLE_ROW_FORMAT,ENGINE ORDER BY TABLE_ROWS DESC,data_size DESC,index_size DESC;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;-&gt; It will show table size of engine 'MEMORY'.&lt;br /&gt;&lt;blockquote&gt; SELECT concat(table_schema,'.',table_name) as Database_Tablename, table_rows as  Rows, concat(round(data_length/(1024*1024),2),'M') DATA,  concat(round(index_length/(1024*1024),2),'M') idx,  concat(round((data_length+index_length)/(1024*1024),2),'M') total_size,  round(index_length/data_length,2) idxfrac   FROM information_schema.TABLES where ENGINE='MEMORY';&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;-&gt; It will show 5 top tables using space.&lt;br /&gt;&lt;blockquote&gt; SELECT concat(table_schema,'.',table_name) as Database_Tablename,  &lt;br /&gt;table_rows as  Rows, concat(round(data_length/(1024*1024),2),'M') DATA,  &lt;br /&gt;concat(round(index_length/(1024*1024),2),'M') idx, concat(round((data_length+index_length)/(1024*1024),2),'M') total_size,  &lt;br /&gt;round(index_length/data_length,2) idxfrac FROM information_schema.TABLES where ORDER BY data_length+index_length DESC limit 5; &lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4924901095624550174?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4924901095624550174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4924901095624550174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4924901095624550174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4924901095624550174'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/12/mysql-tips-calculate-database-and-table.html' title='MySQL Tips : Calculate database and table size'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-2539101420217465717</id><published>2009-12-23T02:05:00.000-08:00</published><updated>2009-12-23T02:17:52.383-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>Temporarily stop/start a process in linux</title><content type='html'>Some time we have requirement that, particular job should stop for certain period of time and start again.&lt;br /&gt;&lt;br /&gt;Most of us familiar with KILL command, but here is  another feature of KILL command , which saves your life   :-&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;#kill -STOP 10067 (&lt;span style="font-style:italic;"&gt;where 10067 is process id&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;#kill -CONT 10067 (&lt;span style="font-style:italic;"&gt;where 10067 is process id&lt;/span&gt;)&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;have a fun :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-2539101420217465717?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/2539101420217465717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=2539101420217465717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2539101420217465717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2539101420217465717'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/12/temporarily-stopstart-process-in-linux.html' title='Temporarily stop/start a process in linux'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-6695579042474400816</id><published>2009-11-04T00:25:00.000-08:00</published><updated>2009-11-04T00:38:37.909-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Extract single db/table  from dump file</title><content type='html'>&lt;span style="font-weight:bold;"&gt;using sed to extract single database from the dumpfile:&lt;/span&gt;&lt;br /&gt;=========================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;sed -n '/^-- Current Database: `dbname`/,/^-- Current Database: `/p' dumpfile &gt; dbname.sql 2&gt;error&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;eg:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;sed -n '/^-- Current Database: `blogs`/,/^-- Current Database: `/p' dump.sql &gt; blogs.sql 2&gt;error&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;we can also use "awk" for the same.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.tsheets.com/2008/tips-tricks/extract-a-single-table-from-a-mysqldump-file.html"&gt;&lt;span style="font-weight:bold;"&gt;extract single table from the dumpfile:-&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-6695579042474400816?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/6695579042474400816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=6695579042474400816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6695579042474400816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6695579042474400816'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/11/extract-single-dbtable-from-dump-file.html' title='Extract single db/table  from dump file'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-6343389594314945066</id><published>2009-10-27T16:42:00.000-07:00</published><updated>2009-10-27T17:06:03.329-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>nohup : commands keep executing even you exit from a shell prompt</title><content type='html'>nohup command if added in front of any command will continue running the command or process even if you shut down your terminal or close your session to machine&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;nohup command-name &amp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Where,&lt;br /&gt;&lt;br /&gt;    * command-name : is name of shell script or command name. You can pass argument to command or a shell script.&lt;br /&gt;    * &amp; : nohup does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an &amp; symbol.&lt;br /&gt;&lt;br /&gt;examples:&lt;br /&gt;&lt;br /&gt;# nohup mysql -q -uUSER1 -pPASS1 &lt; dump.sql &gt; dump.log 2&gt; error.log &amp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;source:&lt;br /&gt;&lt;a href="http://www.idevelopment.info/data/Unix/General_UNIX/GENERAL_RunningUNIXCommandsImmunetoHangups_nohup.shtml"&gt;http://www.idevelopment.info/data/Unix/General_UNIX/GENERAL_RunningUNIXCommandsImmunetoHangups_nohup.shtml&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cyberciti.biz/tips/nohup-execute-commands-after-you-exit-from-a-shell-prompt.html"&gt;http://www.cyberciti.biz/tips/nohup-execute-commands-after-you-exit-from-a-shell-prompt.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-6343389594314945066?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/6343389594314945066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=6343389594314945066' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6343389594314945066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6343389594314945066'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/10/nohup-commands-keep-executing-even-you.html' title='nohup : commands keep executing even you exit from a shell prompt'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-6705512147750804582</id><published>2009-10-07T20:33:00.000-07:00</published><updated>2009-10-07T20:40:24.053-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Reset your MySQL Table Auto Increment Value</title><content type='html'>Recently,I created tables using &lt;span style="font-style:italic;"&gt;auto increment&lt;/span&gt; number as the Primary Key. As name say, the number will increase every time I insert new record into the table. At some point I wanted to delete the whole dummy data I inserted.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;ALTER TABLE tablename AUTO_INCREMENT = value;&lt;/blockquote&gt;  &lt;br /&gt;&lt;br /&gt;eg. &lt;br /&gt;If I had a items table and I created a few new items and then deleted them, to set the auto increment value back to ‘100′ i would simply:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;ALTER TABLE items AUTO_INCREMENT = 100; &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-6705512147750804582?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/6705512147750804582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=6705512147750804582' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6705512147750804582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6705512147750804582'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/10/reset-your-mysql-table-auto-increment.html' title='Reset your MySQL Table Auto Increment Value'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8237676064761424277</id><published>2009-09-13T02:27:00.000-07:00</published><updated>2009-09-13T02:52:59.955-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>MySQL log file rotation</title><content type='html'>Rotating MySQL Log Files on Linux.&lt;br /&gt;A. Check logrotate must on daily cron&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;#less /etc/cron.daily/logrotate&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B. Check on logrotate.d there must be mysql&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;#less /etc/logrotate.d/mysql&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Its default Content is:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;# by setting the variable "err-log"&lt;br /&gt;# in the [safe_mysqld] section as follows:&lt;br /&gt;#&lt;br /&gt;# [safe_mysqld]&lt;br /&gt;# err-log=/var/lib/mysql/mysqld.log&lt;br /&gt;#&lt;br /&gt;# If the root user has a password you have to create a&lt;br /&gt;# /root/.my.cnf configuration file with the following&lt;br /&gt;# content:&lt;br /&gt;#&lt;br /&gt;# [mysqladmin]&lt;br /&gt;# password = &lt;secret&gt;&lt;br /&gt;# user= root&lt;br /&gt;#&lt;br /&gt;# where "&lt;secret&gt;" is the password.&lt;br /&gt;#&lt;br /&gt;# ATTENTION: This /root/.my.cnf should be readable ONLY&lt;br /&gt;# for root !&lt;br /&gt;&lt;br /&gt;/var/lib/mysql/mysqld.log {&lt;br /&gt;        # create 600 mysql mysql&lt;br /&gt;        notifempty&lt;br /&gt;        daily&lt;br /&gt;        rotate 3&lt;br /&gt;        missingok&lt;br /&gt;        compress&lt;br /&gt;    postrotate&lt;br /&gt;        # just if mysqld is really running&lt;br /&gt;        if test -x /usr/bin/mysqladmin &amp;&amp; \&lt;br /&gt;           /usr/bin/mysqladmin ping &amp;&gt;/dev/null&lt;br /&gt;        then&lt;br /&gt;           /usr/bin/mysqladmin flush-logs&lt;br /&gt;        fi&lt;br /&gt;    endscript&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;a href="http://linux.die.net/man/8/logrotate"&gt;Read uses of variable&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;My file :&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;# This logname can be set in /etc/my.cnf&lt;br /&gt;# by setting the variable "err-log"&lt;br /&gt;# in the [safe_mysqld] section as follows:&lt;br /&gt;#&lt;br /&gt;# [safe_mysqld]&lt;br /&gt;# err-log=/var/lib/mysql/mysqld.log&lt;br /&gt;#&lt;br /&gt;# If the root user has a password you have to create a&lt;br /&gt;# /root/.my.cnf configuration file with the following&lt;br /&gt;# content:&lt;br /&gt;#&lt;br /&gt;# [mysqladmin]&lt;br /&gt;# password = &lt;secret&gt;&lt;br /&gt;# user= root&lt;br /&gt;# &lt;br /&gt;# where "&lt;secret&gt;" is the password.&lt;br /&gt;#&lt;br /&gt;# ATTENTION: This /root/.my.cnf should be readable ONLY&lt;br /&gt;# for root !&lt;br /&gt;&lt;br /&gt;# - I put everything in one block and added sharedscripts, so that mysql gets &lt;br /&gt;#   flush-logs'd only once.&lt;br /&gt;#   Else the binary logs would automatically increase by n times every day.&lt;br /&gt;# - The error log is obsolete, messages go to syslog now.&lt;br /&gt;/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log {&lt;br /&gt; daily&lt;br /&gt; rotate 7&lt;br /&gt; missingok&lt;br /&gt; create 640 mysql adm&lt;br /&gt; compress&lt;br /&gt; sharedscripts&lt;br /&gt; postrotate&lt;br /&gt;  test -x /usr/bin/mysqladmin || exit 0&lt;br /&gt;&lt;br /&gt;  # If this fails, check debian.conf! &lt;br /&gt;  export HOME=/etc/mysql/my.cnf&lt;br /&gt;  MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"&lt;br /&gt;  if [ -z "`$MYADMIN ping 2&gt;/dev/null`" ]; then&lt;br /&gt;    # Really no mysqld or rather a missing debian-sys-maint user?&lt;br /&gt;    # If this occurs and is not a error please report a bug.&lt;br /&gt;    if ps cax | grep -q mysqld; then&lt;br /&gt;       exit 1&lt;br /&gt;    fi &lt;br /&gt;  else&lt;br /&gt;    $MYADMIN flush-logs&lt;br /&gt;  fi&lt;br /&gt; endscript&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;C. Create a file /root/.my.cnf.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;#vi /root/.my.cnf&lt;/span&gt; &lt;span style="font-style:italic;"&gt; (# ATTENTION: This /root/.my.cnf should be readable ONLY)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold:-"&gt;&lt;span style="font-weight:bold;"&gt;Its contain ;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;[mysqladmin]&lt;br /&gt;password = xxxx&lt;br /&gt;user= root&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Run manually ;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;#logrotate -f /path/to/some/logrotate.conf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;if you want to force a rotatation which is uncalled for in the config files, you need to give it a "-f":&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8237676064761424277?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8237676064761424277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8237676064761424277' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8237676064761424277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8237676064761424277'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/09/mysql-log-file-rotation.html' title='MySQL log file rotation'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-7142863915716986094</id><published>2009-09-09T06:56:00.000-07:00</published><updated>2010-05-23T21:53:24.606-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>MySQL: Analyze slow query log using mysqldumpslow</title><content type='html'>&lt;span style="font-style:italic;"&gt;First enable slow query logging, then generate a slow query and finally look at the slow query log.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;mysqldumpslow&lt;/span&gt;&lt;br /&gt;       This program parses and summarizes a 'slow query log'.&lt;br /&gt;       -v     verbose&lt;br /&gt;       -d     debug&lt;br /&gt;       -s=WORD&lt;br /&gt;              what to sort by (t, at, l, al, r, ar etc)&lt;br /&gt;       -r     reverse the sort order (largest last instead of first)&lt;br /&gt;       -t=NUMBER&lt;br /&gt;              just show the top n queries&lt;br /&gt;       -a     don't abstract all numbers to N and strings to 'S'&lt;br /&gt;       -n=NUMBER&lt;br /&gt;              abstract numbers with at least n digits within names&lt;br /&gt;       -g=WORD&lt;br /&gt;              grep: only consider stmts that include this string&lt;br /&gt;       -h=WORD&lt;br /&gt;              hostname of db server for *-slow.log filename (can be wildcard)&lt;br /&gt;       -i=WORD&lt;br /&gt;              name of server instance (if using mysql.server startup script)&lt;br /&gt;       -l     don't subtract lock time from total time&lt;br /&gt;eg.&lt;br /&gt;&lt;br /&gt;1. mysqldumpslow -t 10 /var/lib/mysql/mysql-slow.log.1 &gt; /tmp/top_ten_slow_query.txt&lt;br /&gt;    It will put top ten slow query in file /tmp/top_ten_slow_query.txt&lt;br /&gt;2. mysqldumpslow -a -s c -t  10 /var/lib/mysql/mysql-slow.log.1 &gt; /tmp/top_ten_repeat_slow_query.txt&lt;br /&gt;    It will put top ten repeat slow query in file top_ten_repeat_slow_query.txt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-7142863915716986094?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/7142863915716986094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=7142863915716986094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7142863915716986094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7142863915716986094'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/09/mysql-analyze-slow-query-log-using.html' title='MySQL: Analyze slow query log using mysqldumpslow'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-3264322537097348904</id><published>2009-07-30T12:55:00.000-07:00</published><updated>2009-07-30T13:42:09.740-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>AWK: Pattern Matching and Processing</title><content type='html'>awk 'pattern {action}' filename &lt;br /&gt;&lt;br /&gt;Reads one line at a time from file, checks for pattern match, performs action if pattern matched pattern.&lt;br /&gt; &lt;br /&gt;NR is a special awk variable meaning the line number of the current record&lt;br /&gt;&lt;br /&gt;can use a line number, to select a specific line, by comparing it to NR (for example: NR == 2)&lt;br /&gt;can specify a range of line numbers (for example: NR == 2, NR == 4)&lt;br /&gt;&lt;br /&gt;can specify a regular expression, to select all lines that match&lt;br /&gt; &lt;br /&gt;$n are special awk variables, meaning the value of the nth field (field delimiter is space or tab)&lt;br /&gt; &lt;br /&gt;$0 is the entire record&lt;br /&gt;can use field values, by comparing to $n (for example: $3 == 65)&lt;br /&gt;&lt;br /&gt;every line is selected if no pattern is specified&lt;br /&gt; &lt;br /&gt;Instructions&lt;br /&gt; &lt;br /&gt;print - print line(s) that match the pattern, or print fields within matching lines&lt;br /&gt;print is default if no action is specified&lt;br /&gt;there are many, many instruction, including just about all C statements with similar syntax&lt;br /&gt;other instructions will be covered in future courses&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;examples, using the file testfile.&lt;br /&gt; &lt;br /&gt;awk 'NR == 2, NR == 4' testfile - print the 2nd through 4th lines (default action is to print entire line)&lt;br /&gt;&lt;br /&gt;awk '/chevy/' testfile - print only lines matching regular expression, same as grep 'chevy' testfile&lt;br /&gt;awk '{print $3, $1}' testfile - print third and first field of all lines (default pattern matches all lines)&lt;br /&gt;&lt;br /&gt;awk '/chevy/ {print $3, $1}' testfile - print third and first fiield of lines matching regular expression&lt;br /&gt;awk '$3 == 65' testfile - print only lines with a third field value of 65&lt;br /&gt;awk '$5 &lt; = 3000' testfile - print only lines with a fifth field value that is less than or equal to 3000&lt;br /&gt;&lt;br /&gt;awk '{print $1}' testfile - print first field of every record&lt;br /&gt;awk '{print $3 $1}' testfile&lt;br /&gt;awk '{print $3, $1}' testfile - inserts output field separator (variable OFS, default is space)&lt;br /&gt;&lt;br /&gt;awk -F, '{print $2}' testfile - specifies that , is input field separator, default is space or tab&lt;br /&gt;awk '$2 ~ /[0-9]/ {print $3, $1}' testfile - searches for reg-exp (a digit) only in the second field&lt;br /&gt;&lt;br /&gt;awk '{printf "%-30s%20s\n", $3, $2}' testfile - print 3rd field left-justified in a 30 character field, 2nd field right-justified in a 20 character field, then skip to a new line (required with printf)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;awk '$3 &lt;= 23' testfile - prints lines where 3rd field has a value &lt;= 23&lt;br /&gt;awk '$3 &lt;='$var1' {print $3}' testfile - $var1 is a shell variable, not an awk variable, e.g. first execute: var1=23&lt;br /&gt;&lt;br /&gt;awk '$3&lt;='$2' {$3++} {print $0}' testfile - if field 3 &lt;= argument 2 then increment field 3, e.g. first execute: set xxx 23&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;awk '$3&gt; 1 &amp;&amp; $3 &lt; 23' testfile - prints lines where 3rd field is in range 1 to 23&lt;br /&gt;&lt;br /&gt;awk '$3 &lt; 2 || $3 &gt; 4' testfile - prints lines where 3rd field is outside of range 2 to 4&lt;br /&gt;awk '$3 &lt; "4"' testfile - double quotes force string comparison&lt;br /&gt;NF is an awk variable meaning # of fields in current record&lt;br /&gt;&lt;br /&gt;awk '! (NF == 4)' testfile - lines without 4 fields&lt;br /&gt;NR is an awk variable meaning # of current record&lt;br /&gt;awk 'NR == 2,NR==7' testfile - range of records from record number 2 to 7&lt;br /&gt;&lt;br /&gt;BEGIN is an awk pattern meaning "before first record processed"&lt;br /&gt;awk 'BEGIN {OFS="~"} {print $1, $2}' testfile - print 1st and 2nd field of each record, separated by ~&lt;br /&gt;END is an awk pattern meaning "after last record processed"&lt;br /&gt;&lt;br /&gt;awk '{var+=$3} END {print var}' testfile - sum of 3rd fields in all records&lt;br /&gt;awk '{var+=$3} END {print var/NR}' testfile - average of 3rd fields in all records - note that awk handles decimal arithmetic&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;awk '$5 &gt; var {var=$5} END {print var}' testfile - maximum of 5th fields in all records&lt;br /&gt;awk '$5 &gt; var {var=$5} END {print var}' testfile - maximum of 5th fields in all records&lt;br /&gt;&lt;br /&gt;sort -rk5 testfile | awk 'NR==1 {var=$5} var==$5 {print $0}' - print all records with maximum 5th field&lt;br /&gt; &lt;br /&gt;Simple awk operations involving functions within the command line:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;awk '/chevy/' testfile&lt;br /&gt; &lt;br /&gt;# Match lines (records) that contain the keyword chevy note that chevy is a regular expression...&lt;br /&gt; &lt;br /&gt;awk '{print $3, $1}' testfile&lt;br /&gt; &lt;br /&gt;# Pattern not specified - therefore, all lines (records) for fields 3 and 1 are displayed&lt;br /&gt;&lt;br /&gt;# Note that comma (,) between fields represents delimiter (ie. space)&lt;br /&gt; &lt;br /&gt;awk '/chevy/ {print $3, $1}' testfile&lt;br /&gt; &lt;br /&gt;# Similar to above, but for chevy&lt;br /&gt; &lt;br /&gt;awk '/^h/' testfile&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# Match testfile that begin with h&lt;br /&gt; &lt;br /&gt;awk '$1 ~ /^h/' testfile                       ### useful ###&lt;br /&gt; &lt;br /&gt;# Match with field #1 that begins with h&lt;br /&gt; &lt;br /&gt;awk '$1 ~ /h/' testfile&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# Match with field #1 any epression containing the letter h&lt;br /&gt; &lt;br /&gt;awk '$2 ~ /^[tm]/ {print $3, $2, "$" $5}' testfile&lt;br /&gt; &lt;br /&gt;# Match testfile that begin with t or m and display field 3 (year), field 2 (model name) and then $ followed by field 4 (price)&lt;br /&gt; &lt;br /&gt;--------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Complex awk operations involving functions within the command line:&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;awk ?/chevy/ {print $3, $1}? testfile&lt;br /&gt;&lt;br /&gt;# prints 3rd &amp; 1st fields of record containing chevy&lt;br /&gt; &lt;br /&gt;awk ?$1 ~ /^c/ {print $2, $3}? testfile&lt;br /&gt;&lt;br /&gt;# print 2nd &amp; 3rd fields of record with 1st field beginning with c&lt;br /&gt; &lt;br /&gt;awk ?NR==2 {print $1, $4}? testfile&lt;br /&gt;&lt;br /&gt;# prints 1st &amp; 4th fields of record for record #2&lt;br /&gt; &lt;br /&gt;awk ?NR==2, NR==8 {print $2, $3}? testfile&lt;br /&gt;&lt;br /&gt;# prints 2nd &amp; 3rd fields of record for records 2 through 8&lt;br /&gt; &lt;br /&gt;awk ?$3 &gt;= 65 {print $3, $1}? testfile&lt;br /&gt;&lt;br /&gt;# prints 3rd &amp; 1st fields of record with 3rd field &gt;= 65&lt;br /&gt; &lt;br /&gt;awk ?$5 &gt;= ?2000? &amp;&amp; $5 &lt; ?9000? {print $2, $3}? testfile&lt;br /&gt;&lt;br /&gt;# prints 2nd &amp; 3rd fields of record within range of 2000 to under 9000&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-3264322537097348904?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/3264322537097348904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=3264322537097348904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3264322537097348904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3264322537097348904'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/07/awk-pattern-matching-and-processing.html' title='AWK: Pattern Matching and Processing'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-9104652984640064151</id><published>2009-07-28T17:57:00.000-07:00</published><updated>2009-07-28T18:11:52.001-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL Replication : Purged binary logs</title><content type='html'>Yesterday I have found that there is no space left on server of MySQL master and on Slave. Once I debugged I have come to know that there is GB's of bin-log files on Master and relay-log on Slave. &lt;br /&gt;&lt;br /&gt;Its due to I have forget to add a expire_logs_days Variable in my.cnf during the configuration of replication server.&lt;br /&gt;&lt;br /&gt;# expire_logs_days    = 7&lt;br /&gt;&lt;br /&gt;It will purged binary logs older than 7 days.The old logs will be purged during the next bin-log switch.&lt;br /&gt;&lt;br /&gt;Or, You can also delete bin-log manually using command : &lt;br /&gt;&lt;br /&gt;PURGE BINARY LOGS TO 'mysql-bin.010';&lt;br /&gt;PURGE BINARY LOGS BEFORE '2008-04-02 22:46:26';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-9104652984640064151?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/9104652984640064151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=9104652984640064151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/9104652984640064151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/9104652984640064151'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/07/mysql-replication-purged-binary-logs.html' title='MySQL Replication : Purged binary logs'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-5067492306504863607</id><published>2009-07-02T09:36:00.000-07:00</published><updated>2009-07-02T09:40:17.101-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>MYSQL: slow queries log</title><content type='html'>MySQL has built-in functionality that allows you to log SQL queries to a file , You can enable the full SQL queries logs to a file or only slow running queries log.  It is easy for us to troubleshoot/ debug the sql statement if SQL queries log enable , The slow query log  is  used to find queries that take a long time to execute and are therefore candidates for optimization.&lt;br /&gt;&lt;br /&gt;To enable you just need to add some lines to your my.cnf file, and restart. Add the following:&lt;br /&gt;&lt;br /&gt;    * To enable slow Query Log only&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;log-slow-queries = /var/log/mysql/mysql-slow.log&lt;br /&gt;long_query_time = 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After enabling slow query, mysqld writes a statement to the slow query log file and it consists of all SQL statements that took more than long_query_time seconds to execute. The time to acquire the initial table locks is not counted as execution time. mysqld only log after SQL statements has been executed and after all locks have been released, so log order might be different from execution order. The minimum and default values of long_query_time are 1 and 10, respectively.&lt;br /&gt;&lt;br /&gt;    * To enable full Log Query&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;log=/var/log/mysqldquery.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above will log all queries to the log file.&lt;br /&gt;&lt;br /&gt;Selecting Queries to Optmize&lt;br /&gt;• The slow query log&lt;br /&gt;– Logs all queries that take longer than long_query_time&lt;br /&gt;– Can also log all querie s that don’t use indexes with&lt;br /&gt;  --&lt;span style="font-weight:bold;"&gt;log-queries-not-using-indexes&lt;/span&gt;&lt;br /&gt;– To log slow administatve commands use&lt;br /&gt;  --&lt;span style="font-weight:bold;"&gt;log-slow-admin-statements&lt;/span&gt;&lt;br /&gt;– To analyze the contents of the slow log use&lt;br /&gt;  mysqldumpslow&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-5067492306504863607?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/5067492306504863607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=5067492306504863607' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5067492306504863607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5067492306504863607'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/07/mysql-slow-queries-log.html' title='MYSQL: slow queries log'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-3929417292929539040</id><published>2009-06-30T11:26:00.000-07:00</published><updated>2009-06-30T11:27:32.054-07:00</updated><title type='text'>MYSQL: Query Execution Basics</title><content type='html'>1. &lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The client sends the SQL statement to the server.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; -&gt; The protocol is halfduplex, which means that at any given time the MySQL server can be either sending or receiving messages, but not both. It also means there is no way to cut a message short.&lt;br /&gt;The client sends a query to the server as a single packet of data. This is why the max_packet_size configuration variable is important if you have large queries. Once the client sends the query, it doesn’t have the ball anymore; it can only wait for results. The response from the server usually consists of many packets of data.When the server responds, the client has to receive the entire result set. It cannot simply fetch a few rows and then ask the server not to bother sending the rest. If the client needs only the first few rows that are returned, it either has to wait for all of the server’s packets to arrive and then discard the ones it doesn’t need, or disconnect ungracefully. Neither is a good idea, which is why appropriate LIMIT clauses are so important.Here’s another way to think about this: when a client fetches rows from the server, it thinks it’s pulling them. But the truth is, the MySQL server is pushing the rows as it generates them. The client is only receiving the pushed rows; there is no way for it to tell the server to stop sending rows. The client is “drinking from the fire hose,” so to speak. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NLkmGwwWuto/SkpWv-UYJZI/AAAAAAAABGU/-AIlLWeNb4s/s1600-h/mysql-arc.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 354px;" src="http://4.bp.blogspot.com/_NLkmGwwWuto/SkpWv-UYJZI/AAAAAAAABGU/-AIlLWeNb4s/s400/mysql-arc.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5353186489265563026" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The server checks the query cache. If there’s a hit, it returns the stored result from the cache; otherwise, it passes the SQL statement to the next step.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; -&gt; Before even parsing a query, MySQL checks for it in the query cache, if the cache is enabled. This operation is a case sensitive hash lookup. If the query differs from a similar query in the cache by even a single byte, it won’t match, and the query processing will go to the next stage.&lt;br /&gt;If MySQL does find a match in the query cache, it must check privileges before&lt;br /&gt;returning the cached query. This is possible without parsing the query, because&lt;br /&gt;MySQL stores table information with the cached query. If the privileges are OK,&lt;br /&gt;MySQL retrieves the stored result from the query cache and sends it to the client,&lt;br /&gt;bypassing every other stage in query execution. The query is never parsed, optimized,&lt;br /&gt;or executed.&lt;br /&gt;&lt;br /&gt;3. &lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The server parses, preprocesses, and optimizes the SQL into a query execution&lt;br /&gt;plan.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  -&gt; MySQL’s parser breaks the query into tokens and builds a “parse tree”&lt;br /&gt;from them. The parser uses MySQL’s SQL grammar to interpret and validate the&lt;br /&gt;query. For instance, it ensures that the tokens in the query are valid and in the proper order, and it checks for mistakes such as quoted strings that aren’t terminated. The preprocessor then checks the resulting parse tree for additional semantics that the parser can’t resolve. For example, it checks that tables and columns exist, and it resolves names and aliases to ensure that column references aren’t ambiguous.Next, the preprocessor checks privileges. This is normally very fast unless your server has large numbers of privileges.&lt;br /&gt;  -&gt; The parse tree is now valid and ready for the optimizer to turn it into a query execution plan. A query can often be executed many different ways and produce the same result. The optimizer’s job is to find the best option. MySQL uses a cost-based optimizer, which means it tries to predict the cost of various execution plans and choose the least expensive. The unit of cost is a single random four-kilobyte data page read.&lt;br /&gt;&lt;br /&gt;4. &lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The query execution engine executes the plan by making calls to the storage engine API.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  -&gt; The parsing and optimizing stage outputs a query execution plan, which MySQL’s&lt;br /&gt;query execution engine uses to process the query. The plan is a data structure; it is&lt;br /&gt;not executable byte-code, which is how many other databases execute queries. In contrast to the optimization stage, the execution stage is usually not all that complex: MySQL simply follows the instructions given in the query execution plan.&lt;br /&gt;Many of the operations in the plan invoke methods implemented by the storage&lt;br /&gt;engine interface, also known as the handler API. Each table in the query is represented by an instance of a handler. If a table appears three times in the query, for example, the server creates three handler instances. Though we glossed over this before, MySQL actually creates the handler instances early in the optimization stage. The optimizer uses them to get information about the tables, such as their column names and index statistics.&lt;br /&gt;&lt;br /&gt;5. &lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The server sends the result to the client.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; -&gt; The final step in executing a query is to reply to the client. Even queries that don’t return a result set still reply to the client connection with information about the query, such as how many rows it affected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-3929417292929539040?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/3929417292929539040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=3929417292929539040' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3929417292929539040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3929417292929539040'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/06/mysql-query-execution-basics.html' title='MYSQL: Query Execution Basics'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NLkmGwwWuto/SkpWv-UYJZI/AAAAAAAABGU/-AIlLWeNb4s/s72-c/mysql-arc.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4695394540292539560</id><published>2009-06-14T03:21:00.000-07:00</published><updated>2009-06-30T10:06:48.503-07:00</updated><title type='text'>How do I Use the Linux Top Command?</title><content type='html'>The Unix top command is designed to help users determine which processes are running and which applications are using more memory or processing power than they should be.&lt;br /&gt;&lt;br /&gt;The top command is very easy to use but you should know the things in details. The output of to is :&lt;br /&gt;&lt;br /&gt;top output:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;top - 22:09:08 up 14 min,  1 user,  load average: 0.21, 0.23, 0.30&lt;br /&gt;Tasks:  81 total,   1 running,  80 sleeping,   0 stopped,   0 zombie&lt;br /&gt;Cpu(s):  9.5%us, 31.2%sy,  0.0%ni, 27.0%id,  7.6%wa,  1.0%hi, 23.7%si,  0.0%st&lt;br /&gt;Mem:    255592k total,   167568k used,    88024k free,    25068k buffers&lt;br /&gt;Swap:   524280k total,        0k used,   524280k free,    85724k cached&lt;br /&gt;&lt;br /&gt;  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND&lt;br /&gt; 3166 apache    15   0 29444 6112 1524 S  6.6  2.4   0:00.79 httpd&lt;br /&gt; 3161 apache    15   0 29444 6112 1524 S  5.9  2.4   0:00.79 httpd&lt;br /&gt; 3164 apache    15   0 29444 6112 1524 S  5.9  2.4   0:00.75 httpd&lt;br /&gt; 3169 apache    15   0 29444 6112 1524 S  5.9  2.4   0:00.74 httpd&lt;br /&gt; 3163 apache    15   0 29444 6112 1524 S  5.6  2.4   0:00.76 httpd&lt;br /&gt; 3165 apache    15   0 29444 6112 1524 S  5.6  2.4   0:00.77 httpd&lt;br /&gt; 3167 apache    15   0 29444 6112 1524 S  5.3  2.4   0:00.73 httpd&lt;br /&gt; 3162 apache    15   0 29444 6112 1524 S  5.0  2.4   0:00.77 httpd&lt;br /&gt; 3407 root      16   0  2188 1012  816 R  1.7  0.4   0:00.51 top&lt;br /&gt;  240 root      15   0     0    0    0 S  0.3  0.0   0:00.08 pdflush&lt;br /&gt;  501 root      10  -5     0    0    0 S  0.3  0.0   0:01.20 kjournald&lt;br /&gt; 2794 root      18   0 12720 1268  560 S  0.3  0.5   0:00.73 pcscd&lt;br /&gt;    1 root      15   0  2060  636  544 S  0.0  0.2   0:03.81 init&lt;br /&gt;    2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0&lt;br /&gt;    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0&lt;br /&gt;    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0&lt;br /&gt;    5 root      10  -5     0    0    0 S  0.0  0.0   0:00.07 events/0&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;The first line in top:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;top - 22:09:08 up 14 min,  1 user,  load average: 0.21, 0.23, 0.30&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;“22:09:08″ is the current time; “up 14 min” shows how long the system has been up for; “1 user” how many users are logged in; “load average: 0.21, 0.23, 0.30″ the load average of the system (1minute, 5 minutes, 15 minutes).&lt;br /&gt;&lt;br /&gt;Load average is an extensive topic and to understand its inner workings can be daunting. The simplest of definitions states that load average is the cpu utilization over a period of time. A load average of 1 means your cpu is being fully utilized and processes are not having to wait to use a CPU. A load average above 1 indicates that processes need to wait and your system will be less responsive. If your load average is consistently above 3 and your system is running slow you may want to upgrade to more CPU’s or a faster CPU.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The second line in top:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Tasks:  82 total,   1 running,  81 sleeping,   0 stopped,   0 zombie&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Shows the number of processes and their current state.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The third lin in top:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Cpu(s):  9.5%us, 31.2%sy,  0.0%ni, 27.0%id,  7.6%wa,  1.0%hi, 23.7%si,  0.0%st&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Shows CPU utilization details. “9.5%us” user processes are using 9.5%; “31.2%sy” system processes are using 31.2%; “27.0%id” percentage of available cpu; “7.6%wa” time CPU is waiting for IO.&lt;br /&gt;&lt;br /&gt;When first analyzing the Cpu(s) line in top look at the %id to see how much cpu is available. If %id is low then focus on %us, %sy, and %wa to determine what is using the CPU.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The fourth and fifth lines in top:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Mem:    255592k total,   167568k used,    88024k free,    25068k buffers&lt;br /&gt;Swap:   524280k total,        0k used,   524280k free,    85724k cached&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Describes the memory usage. These numbers can be misleading. “255592k total” is total memory in the system; “167568K used” is the part of the RAM that currently contains information; “88024k free” is the part of RAM that contains no information; “25068K buffers and 85724k cached” is the buffered and cached data for IO.&lt;br /&gt;&lt;br /&gt;So what is the actual amount of free RAM available for programs to use ?&lt;br /&gt;&lt;br /&gt;The answer is: free + (buffers + cached)&lt;br /&gt;&lt;br /&gt;88024k + (25068k + 85724k) = 198816k&lt;br /&gt;&lt;br /&gt;How much RAM is being used by progams ?&lt;br /&gt;&lt;br /&gt;The answer is: used - (buffers + cached)&lt;br /&gt;&lt;br /&gt;167568k - (25068k + 85724k) = 56776k&lt;br /&gt;&lt;br /&gt;The processes information:&lt;br /&gt;&lt;br /&gt;Top will display the process using the most CPU usage in descending order. Lets describe each column that represents a process.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt; PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND&lt;br /&gt;3166 apache    15   0 29444 6112 1524 S  6.6  2.4   0:00.79 httpd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PID - process ID of the process&lt;br /&gt;&lt;br /&gt;USER - User who is running the process&lt;br /&gt;&lt;br /&gt;PR - The priority of the process&lt;br /&gt;&lt;br /&gt;NI - Nice value of the process (higher value indicates lower priority)&lt;br /&gt;&lt;br /&gt;VIRT - The total amount of virtual memory used&lt;br /&gt;&lt;br /&gt;RES - Resident task size&lt;br /&gt;&lt;br /&gt;SHR - Amount of shared memory used&lt;br /&gt;&lt;br /&gt;S - State of the task. Values are S (sleeping), D (uninterruptible sleep), R (running), Z (zombies), or T (stopped or traced)&lt;br /&gt;&lt;br /&gt;%CPU - Percentage of CPU used&lt;br /&gt;&lt;br /&gt;%MEM - Percentage of Memory used&lt;br /&gt;&lt;br /&gt;TIME+ - Total CPU time used&lt;br /&gt;&lt;br /&gt;COMMAND - Command issued&lt;br /&gt;Interacting with TOP&lt;br /&gt;&lt;br /&gt;Now that we are able to understand the output from TOP lets learn how to change the way the output is displayed.&lt;br /&gt;&lt;br /&gt;Just press the following key while running top and the output will be sorted in real time.&lt;br /&gt;&lt;br /&gt;M - Sort by memory usage&lt;br /&gt;&lt;br /&gt;P - Sort by CPU usage&lt;br /&gt;&lt;br /&gt;T - Sort by cumulative time&lt;br /&gt;&lt;br /&gt;z - Color display&lt;br /&gt;&lt;br /&gt;k - Kill a process&lt;br /&gt;&lt;br /&gt;q - quit&lt;br /&gt;&lt;br /&gt;If we want to kill the process with PID 3161, then press “k” and a prompt will ask you for the PID number, and enter 3161.&lt;br /&gt;Command Line Parameters with TOP&lt;br /&gt;&lt;br /&gt;You can control what top displays by issuing parameters when you run top.&lt;br /&gt;&lt;br /&gt;- d - Controls the delay between refreshes&lt;br /&gt;&lt;br /&gt;- p - Specify the process by PID that you want to monitor&lt;br /&gt;&lt;br /&gt;-n - Update the display this number of times and then exit&lt;br /&gt;&lt;br /&gt;If we want to only monitor the http process with a PID of 3166&lt;br /&gt;&lt;br /&gt;$ top -p 3166&lt;br /&gt;&lt;br /&gt;If we want to change the delay between refreshes to 5 seconds&lt;br /&gt;&lt;br /&gt;$ top -d 5&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4695394540292539560?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4695394540292539560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4695394540292539560' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4695394540292539560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4695394540292539560'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/06/how-do-i-use-linux-top-command.html' title='How do I Use the Linux Top Command?'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-2670672935310033599</id><published>2009-04-17T23:00:00.000-07:00</published><updated>2009-04-17T23:15:32.285-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>Block IP addresses using IPtables</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Block a particular&lt;/span&gt;&lt;br /&gt;#service iptables start&lt;br /&gt;#iptables -I INPUT -s 10.1.24.4 -j DROP&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;This command will simply drop any packet coming from the address 10.1.24.4 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To list the chains:&lt;/span&gt;&lt;br /&gt;#iptables -L -n&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To make persist :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#service iptables status&lt;br /&gt;#iptables-save (copy output)&lt;br /&gt;#emacs /etc/sysconfig/iptables (paste output)&lt;br /&gt;#service iptables restart&lt;br /&gt;&lt;br /&gt;make sure iptables service start on default.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-2670672935310033599?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/2670672935310033599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=2670672935310033599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2670672935310033599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2670672935310033599'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/04/block-ip-addresses-using-iptables.html' title='Block IP addresses using IPtables'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-5656295927112698636</id><published>2009-03-30T06:16:00.000-07:00</published><updated>2009-03-31T02:25:38.457-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install linux'/><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>creating bulk users in linux</title><content type='html'>Today I have configured NX server.&lt;br /&gt;Now, Next task is to create users and really its very time consuming and boring task.&lt;br /&gt;&lt;br /&gt;Usually you use &lt;span style="font-weight:bold;"&gt;useradd&lt;/span&gt; command to create a new user or update default new user information from command line.&lt;br /&gt;&lt;br /&gt;So i have explore Linux and searched on Google , I have found few scripts to do this. But later I have found one good and easy solution.&lt;br /&gt;&lt;br /&gt;Here is that, &lt;br /&gt;&lt;br /&gt;Update and create new users in bulk.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;newusers&lt;/span&gt;&lt;/span&gt; command reads a file of user name and clear-text password pairs and uses this information to update a group of existing users or to create new users. Each line is in the same format as the standard password file.&lt;br /&gt;&lt;br /&gt;This command is intended to be used in a large system environment where many accounts are updated at a single time (batch mode). Since username and passwords are stored in clear text format make sure only root can read/write the file. Use chmod command:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;# touch /root/bulk-user-add.txt&lt;br /&gt;# chmod 0600 /root/bulk-user-add.txt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create a user list as follows. Open file:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;# emacs /root/bulk-user-add.txt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Append username and password:&lt;br /&gt;sanjay:mypass99:555:555:Sanjay Singh:/home/Sanjay:/bin/bash&lt;br /&gt;frampton:mypass99n:556:556:Frampton Martin:/home/Frampton:/bin/bash&lt;br /&gt;----&lt;br /&gt;--&lt;br /&gt;---&lt;br /&gt;barun:mypass99:560:560:Barun Ghosh:/home/Barun:/bin/bash&lt;br /&gt;&lt;br /&gt;Now create users in batch:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;# newusers /root/bulk-user-add.txt&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Read man page of newusers for more information.&lt;br /&gt;May be I will automate entire procedure using a php&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-5656295927112698636?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/5656295927112698636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=5656295927112698636' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5656295927112698636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5656295927112698636'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/03/creating-bulk-users-in-linux.html' title='creating bulk users in linux'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-2324870283566077215</id><published>2009-03-24T11:04:00.000-07:00</published><updated>2009-03-24T11:18:39.694-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kernel'/><title type='text'>Boot time parameters of Linux kernel</title><content type='html'>&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Boot time parameters you should know about the Linux kernel.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Linux kernel accepts boot time parameters as it starts to boot system. This is used to inform kernel about various hardware parameter.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The kernel command line syntax&lt;/span&gt;&lt;br /&gt;name=value1,value2,value3…&lt;br /&gt;Where,&lt;br /&gt;    * name : Keyword name, for example, init, ro, boot etc&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Common Boot time parameters&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;init&lt;/span&gt;&lt;br /&gt;This sets the initial command to be executed by the kernel. Default is to use /sbin/init, which is the parent of all processes.&lt;br /&gt;To boot system without password pass /bin/bash or /bin/sh as argument to init&lt;br /&gt;init=/bin/bash&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;single&lt;/span&gt;&lt;br /&gt;The most common argument that is passed to the init process is the word 'single' which instructs init to boot the computer in single user mode, and not launch all the usual daemons&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;root=/dev/device&lt;/span&gt;&lt;br /&gt;This argument tells the kernel what device (hard disk, floppy disk) to be used as the root filesystem while booting. For example following boot parameter use /dev/sda1 as the root file system:&lt;br /&gt;root=/dev/sda1&lt;br /&gt;If you copy entire partition from /dev/sda1 to /dev/sdb1 then use&lt;br /&gt;root=/dev/sdb1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ro&lt;/span&gt;&lt;br /&gt;This argument tells the kernel to mount root file system as read-only. This is done so that fsck program can check and repair a Linux file system. Please note that you should never ever run fsck on read/write file system.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;rw&lt;/span&gt;&lt;br /&gt;This argument tells the kernel to mount root file system as read and write mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;panic=SECOND&lt;/span&gt;&lt;br /&gt;Specify kernel behavior on panic. By default, the kernel will not reboot after a panic, but this option will cause a kernel reboot after N seconds. For example following boot parameter will force to reboot Linux after 10 seconds&lt;br /&gt;panic=10&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;maxcpus=NUMBER&lt;/span&gt;&lt;br /&gt;Specify maximum number of processors that an SMP kernel should make use of. For example if you have four cpus and would like to use 2 CPU then pass 2 as a number to maxcpus (useful to test different software performances and configurations).&lt;br /&gt;&lt;span style="font-style:italic;"&gt;maxcpus=2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-weight:bold;"&gt;debug&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Enable kernel debugging. This option is useful for kernel hackers and developers who wish to troubleshoot problem&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;selinux [0|1]&lt;/span&gt;&lt;br /&gt;Disable or enable SELinux at boot time.&lt;br /&gt;• Value 0 : Disable selinux&lt;br /&gt;• Value 1 : Enable selinux&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;raid=/dev/mdN&lt;/span&gt;&lt;br /&gt;This argument tells kernel howto assembly of RAID arrays at boot time. Please note that When md is compiled into the kernel (not as module), partitions of type 0xfd are scanned and automatically assembled into RAID arrays. This autodetection may be suppressed with the kernel parameter "raid=noautodetect". As of kernel 2.6.9, only drives with a type 0 superblock can be autodetected and run at boot time.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;mem=MEMEORY_SIZE&lt;/span&gt;&lt;br /&gt;This is a classic parameter. Force usage of a specific amount of memory to be used when the kernel is not able to see the whole system memory or for test. For example:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;mem=1024M&lt;/span&gt;&lt;br /&gt;The kernel command line is a null-terminated string currently up to 255 characters long, plus the final null. A string that is too long will be automatically truncated by the kernel, a boot loader may allow a longer command line to be passed to permit future kernels to extend this limit (H. Peter Anvin ).&lt;br /&gt;Other parameters&lt;br /&gt;initrd /boot/initrd.img&lt;br /&gt;An initrd should be loaded. the boot process will load the kernel and an initial ramdisk; then the kernel converts initrd into a "normal" ramdisk, which is mounted read-write as root device; then /linuxrc is executed; afterwards the "real" root file system is mounted, and the initrd file system is moved over to /initrd; finally the usual boot sequence (e.g. invocation of /sbin/init) is performed. initrd is used to provide/load additional modules (device driver). For example, SCSI or RAID device driver loaded using initrd.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;hdX =noprobe&lt;/span&gt;&lt;br /&gt;Do not probe for hdX drive. For example, disable hdb hard disk:&lt;br /&gt;hdb=noprobe&lt;br /&gt;If you disable hdb in BIOS, Linux will still detect it. This is the only way to disable hdb.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ether=irq,iobase,[ARG1,ARG2],name&lt;/span&gt;&lt;br /&gt;Where,&lt;br /&gt;• ether: ETHERNET DEVICES&lt;br /&gt;For example, following boot argument force probing for a second Ethernet card (NIC), as the default is to only probe for one (irq=0,iobase=0 means automatically detect them).&lt;br /&gt;ether=0,0,eth1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;How to begin the enter parameters mode?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;You need to enter all this parameter at Grub or Lilo boot prompt. For example if you are using Grub as a boot loader, at Grub prompt press 'e' to edit command before booting.&lt;br /&gt;1) Select second line&lt;br /&gt;2) Again, press 'e' to edit selected command&lt;br /&gt;3) Type any of above parameters.&lt;br /&gt;See an example of "recovering grub boot loader password", for more information. Another option is to type above parameters in grub.conf or lilo.conf file itself.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cyberciti.biz/howto/question/static/linux-kernel-parameters.php"&gt;More detail&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-2324870283566077215?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/2324870283566077215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=2324870283566077215' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2324870283566077215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2324870283566077215'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/03/boot-time-parameters-of-linux-kernel.html' title='Boot time parameters of Linux kernel'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8784311374131490137</id><published>2009-03-22T00:18:00.000-07:00</published><updated>2009-03-22T00:57:17.375-07:00</updated><title type='text'>MYSQL REPLICATION &amp; DISASTER RECOVERY</title><content type='html'>MySQL’s built-in replication capability is the foundation for building large, high performance applications on top of MySQL. Replication lets you configure one or more servers as slaves, or replicas, of another server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. Setting up Replication:&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_NLkmGwwWuto/ScXvTIsI7QI/AAAAAAAABEM/qooPJfKksXw/s1600-h/MYSQL.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 203px;" src="http://4.bp.blogspot.com/_NLkmGwwWuto/ScXvTIsI7QI/AAAAAAAABEM/qooPJfKksXw/s400/MYSQL.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5315918047209909506" /&gt;&lt;/a&gt;&lt;br /&gt;Three threads are involved in Replication: One on the master and two on the slave.&lt;br /&gt;• The I/O thread on the slave connects to the master and requests the binary update log. The Binary log dump thread on the master sends the binary update log to the slave on request.&lt;br /&gt;• Once on the slave, the I/O thread reads the data sent by the master and copies it to the relay log in the data directory.&lt;br /&gt;• The third thread, also on the slave, is the SQL Thread, which read and executes the queries from the relay log to bring the slave in alignment with the master.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Replication with example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Version: Both master and slave should be the same version. Otherwise replication will be improper.&lt;br /&gt;Network Configuration Settings&lt;br /&gt;Master Server IP Address: 10.5.1.10&lt;br /&gt;Slave Server Primary IP Address (Ethernet eth0): 10.5.1.11&lt;br /&gt;Slave Server Secondary IP Address (Ethernet eth1): 10.5.1.10 (By default it is disabled)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. MySQL Replication Installation:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step1:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Install MySQL on master 1 and slave 1. Configure network services on both systems, like&lt;br /&gt;Master 1/Slave 2 IP: 10.5.1.10&lt;br /&gt;Master 2/Slave 1 IP: 10.5.1.11&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step2:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On Master 1, make changes in my.cnf:&lt;br /&gt;[mysqld]&lt;br /&gt;logbin= mysqlbin&lt;br /&gt;binlogdodb=&lt;database name&gt;  # input the database which should be replicated or ignore this command to replicate all the databases.&lt;br /&gt;binlogignoredb= mysql # input the database that should be ignored for replication&lt;br /&gt;serverid=1&lt;br /&gt;auto_increment_increment=2&lt;br /&gt;auto_increment_offset=1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 3:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On master 1, create a replication slave account in mysql.&lt;br /&gt;mysql&gt; grant replication slave on *.* to 'replication'@10.5.1.11 identified by 'slave';&lt;br /&gt;Restart the mysql master1.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 4:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now edit my.cnf on Slave1 or Master2:&lt;br /&gt;[mysqld]&lt;br /&gt;serverid =2&lt;br /&gt;masterhost= 10.5.1.10&lt;br /&gt;masteruser= replication&lt;br /&gt;masterpassword= slave&lt;br /&gt;masterport= 3306&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 5:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Restart th MySQL Slave 1.&lt;br /&gt;Login to the MySQL command prompt and start the slave replication.&lt;br /&gt;[root@Slavetest ~]# mysql -u root -p&lt;br /&gt;Enter password: xxxxx (Please consult MySQL Administrator/IT Manager)&lt;br /&gt;Welcome to the MySQL monitor. Commands end with; or \g.&lt;br /&gt;Your MySQL connection id is 250&lt;br /&gt;Server version: 5.0.54a-enterprise-gpl-log MySQL Enterprise Server (GPL)&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;mysql&gt;&lt;br /&gt;mysql&gt; start slave;&lt;br /&gt;mysql&gt; show slave status\G;&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Slave_IO_State: Waiting for master to send event&lt;br /&gt;Master_Host: 10.5.1.10&lt;br /&gt;Master_User: replication&lt;br /&gt;Master_Port: 3306&lt;br /&gt;Connect_Retry: 60&lt;br /&gt;Master_Log_File: mysql-bin.000018&lt;br /&gt;Read_Master_Log_Pos: 2953&lt;br /&gt;Relay_Log_File: slavetest-relay-bin.000065&lt;br /&gt;Relay_Log_Pos: 235&lt;br /&gt;Relay_Master_Log_File: mysql-bin.000018&lt;br /&gt;Slave_IO_Running: Yes&lt;br /&gt;Slave_SQL_Running: Yes&lt;br /&gt;Replicate_Do_DB:&lt;br /&gt;Replicate_Ignore_DB:&lt;br /&gt;Replicate_Do_Table:&lt;br /&gt;Replicate_Ignore_Table:&lt;br /&gt;Replicate_Wild_Do_Table:&lt;br /&gt;Replicate_Wild_Ignore_Table:&lt;br /&gt;Last_Errno: 0&lt;br /&gt;Last_Error:&lt;br /&gt;Skip_Counter: 0&lt;br /&gt;Exec_Master_Log_Pos: 2953&lt;br /&gt;Relay_Log_Space: 235&lt;br /&gt;Until_Condition: None&lt;br /&gt;Until_Log_File:&lt;br /&gt;Until_Log_Pos: 0&lt;br /&gt;Master_SSL_Allowed: No&lt;br /&gt;Master_SSL_CA_File:&lt;br /&gt;Master_SSL_CA_Path:&lt;br /&gt;Master_SSL_Cert:&lt;br /&gt;Master_SSL_Cipher:&lt;br /&gt;Master_SSL_Key:&lt;br /&gt;Seconds_Behind_Master: 0&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;mysql&gt;&lt;br /&gt;Above highlighted rows must be indicate related log files and Slave_IO_Running and&lt;br /&gt;Slave_SQL_Running: must be to YES.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 6:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On Master 1:&lt;br /&gt;[root@TESTDB~]# mysql -u root -p&lt;br /&gt;Enter password: xxxxx (Please consult MySQL Administrator/IT Manager)&lt;br /&gt;Welcome to the MySQL monitor. Commands end with; or \g.&lt;br /&gt;Your MySQL connection id is 250&lt;br /&gt;Server version: 5.0.54a-enterprise-gpl-log MySQL Enterprise Server (GPL)&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;mysql&gt;&lt;br /&gt;mysql&gt; show master status;&lt;br /&gt;+------------------------------------+-----------+--------------------+------------------------+&lt;br /&gt;| File | Position | Binlog_Do_DB | Binlog_Ignore_DB|&lt;br /&gt;+------------------------------------+-----------+--------------------+------------------------+&lt;br /&gt;|MysqlMYSQL01-bin.000008| 410 | | mysql |&lt;br /&gt;+------------------------------------+-----------+--------------------+------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;The above scenario is for master-slave, now we will create a slave master scenario for the same systems and it will work as master master.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 7:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Edit on Master 2/ Slave 1, edit my.cnf and master entries into it:&lt;br /&gt;[mysqld]&lt;br /&gt;logbin=mysqlbin   #information for becoming master added&lt;br /&gt;binlogignoredb=mysql&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 8:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Create a replication slave account on master2 for master1:&lt;br /&gt;mysql&gt; grant replication slave on *.* to 'slavereplication'@10.5.1.10 identified by 'slave';&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 9:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Edit my.cnf on master1 for information of its master.&lt;br /&gt;[mysqld]&lt;br /&gt;auto_increment_increment=2&lt;br /&gt;auto_increment_offset=1  #information for becoming slave.&lt;br /&gt;masterhost= 10.5.1.11&lt;br /&gt;masteruser= slavereplication&lt;br /&gt;masterpassword= slave&lt;br /&gt;masterport= 3306&lt;br /&gt;master_connect_retry=60&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 10:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Restart both mysql master1 and master2.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step 11:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Monitor Mysql Replication using :&lt;br /&gt;• show slave status\G&lt;br /&gt;• show processlist\G&lt;br /&gt;• show master status;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4. Fail over Configuration Procedure :&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step1: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Login to Slave Server Using Secure Shell in Linux or Putty tool&lt;br /&gt;[root@TESTDB ~]# ssh 10.5.1.11&lt;br /&gt;root@10.5.1.11 password: xxxxx&lt;br /&gt;Last login: Tue Oct 7 15:30:41 2008 from 10.5.1.10&lt;br /&gt;[root@slavetest ~]#&lt;br /&gt;or Use Putty Tool in Windows&lt;br /&gt;Enter the slave IP address and user name and password&lt;br /&gt;After login into slave machine proceed the below steps.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step2:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Connect the Ethernet Interface cable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step3:&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;Enable the secondary Ethernet interface&lt;br /&gt;[root@slavetest ~]# ifup eth1&lt;br /&gt;Step4: Login into Mysql&lt;br /&gt;[root@slavetest ~]# mysql -u root -p&lt;br /&gt;Enter password: xxxxx (Please consult MySQL Administrator/IT Manager)&lt;br /&gt;Welcome to the MySQL monitor. Commands end with ; or \g.&lt;br /&gt;Your MySQL connection id is 250&lt;br /&gt;Server version: 5.0.54a-enterprise-gpl-log MySQL Enterprise Server (GPL)&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;mysql&gt;&lt;br /&gt;You Will get Welcome message and mysql prompt as show above.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step5:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check the Slave Status&lt;br /&gt;mysql&gt; show slave status\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Slave_IO_State: Waiting for master to send event&lt;br /&gt;Master_Host: 10.5.1.10&lt;br /&gt;Master_User: replication&lt;br /&gt;Master_Port: 3306&lt;br /&gt;Connect_Retry: 60&lt;br /&gt;Master_Log_File: mysql-bin.000018&lt;br /&gt;Read_Master_Log_Pos: 2953&lt;br /&gt;Relay_Log_File: slavetest-relay-bin.000065&lt;br /&gt;Relay_Log_Pos: 235&lt;br /&gt;Relay_Master_Log_File: mysql-bin.000018&lt;br /&gt;Slave_IO_Running: Yes&lt;br /&gt;Slave_SQL_Running: Yes&lt;br /&gt;Replicate_Do_DB:&lt;br /&gt;Replicate_Ignore_DB:&lt;br /&gt;Replicate_Do_Table:&lt;br /&gt;Replicate_Ignore_Table:&lt;br /&gt;Replicate_Wild_Do_Table:&lt;br /&gt;Replicate_Wild_Ignore_Table:&lt;br /&gt;Last_Errno: 0&lt;br /&gt;Last_Error:&lt;br /&gt;Skip_Counter: 0&lt;br /&gt;Exec_Master_Log_Pos: 2953&lt;br /&gt;Relay_Log_Space: 235&lt;br /&gt;Until_Condition: None&lt;br /&gt;Until_Log_File:&lt;br /&gt;Until_Log_Pos: 0&lt;br /&gt;Master_SSL_Allowed: No&lt;br /&gt;Master_SSL_CA_File:&lt;br /&gt;Master_SSL_CA_Path:&lt;br /&gt;Master_SSL_Cert:&lt;br /&gt;Master_SSL_Cipher:&lt;br /&gt;Master_SSL_Key:&lt;br /&gt;Seconds_Behind_Master: 0&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;mysql&gt;&lt;br /&gt;Above Result will display Slave Replication status.&lt;br /&gt;Make sure that the slave has processed any statements in their relay log. On slave, issue STOP SLAVE  IO_THREAD, then check the output of SHOW PROCESSLIST until you see Has read all relay log; waiting for the slave I/O thread to update it. When this is true for all slaves, they can be reconfigured to the new setup.&lt;br /&gt;mysql&gt; Stop Slave io_thread;&lt;br /&gt;mysql&gt; show processlist\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Id : 203&lt;br /&gt;User: slavereplication&lt;br /&gt;Host: 10.5.1.10:59795&lt;br /&gt;db : NULL&lt;br /&gt;Command: Binlog Dump&lt;br /&gt;Time: 158086&lt;br /&gt;State: Has sent all binlog to slave; waiting for binlog to be updated&lt;br /&gt;Info: NULL&lt;br /&gt;*************************** 2. row ***************************&lt;br /&gt;Id: 230&lt;br /&gt;User: system user&lt;br /&gt;Host:&lt;br /&gt;db: NULL&lt;br /&gt;Command: Connect&lt;br /&gt;Time: 152220&lt;br /&gt;State: Has read all relay log; waiting for the slave I/O thread to update it&lt;br /&gt;Info: NULL&lt;br /&gt;*************************** 3. row ***************************&lt;br /&gt;Id: 251&lt;br /&gt;User: root&lt;br /&gt;Host: localhost&lt;br /&gt;db: NULL&lt;br /&gt;Command: Query&lt;br /&gt;Time: 0&lt;br /&gt;State: NULL&lt;br /&gt;Info: show processlist&lt;br /&gt;3 rows in set (0.00 sec)&lt;br /&gt;mysql&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step6:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Making Slave as Master server&lt;br /&gt;mysql&gt; show master status;&lt;br /&gt;+----------------------+----------+-------------------+-----------------------------+&lt;br /&gt;| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;br /&gt;+----------------------+----------+-------------------+-----------------------------+&lt;br /&gt;| mysql-bin.000006 | 783 | | mysql,mysql |&lt;br /&gt;+----------------------+----------+-------------------+-----------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;mysql&gt;&lt;br /&gt;(Note : This is very important make a note down of mysql log file and position when the slave becomes master).&lt;br /&gt;mysql&gt; stop slave;&lt;br /&gt;This command will stop the slave replication. Now it is ready to serve as a master, start the application in the server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5. Restoration Procedure:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: Bring down the secondary Ethernet interface eth1 down in slave server before your plan to restore. Now once the original master server problem has been fixed and making it as live server. When Master is up again, you must issue the CHANGE MASTER, so that Master becomes a slave of S1 and picks up each Web Client writes that it missed while it was down.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step1:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Connect to the Current Master server&lt;br /&gt;[root@TESTDB ~]# ssh 10.5.1.11&lt;br /&gt;root@10.5.1.11's password: xxxxxxx&lt;br /&gt;Last login: Tue Oct 7 15:30:41 2008 from 10.5.1.10&lt;br /&gt;[root@mastertest ~]#&lt;br /&gt;or&lt;br /&gt;Use Putty Tool in Windows&lt;br /&gt;Enter the slave IP address and user name and password&lt;br /&gt;After login into machine proceed the below steps.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Step 2:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Unplug the secondary Ethernet Interface in current Master.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step3: &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Disable the secondary Ethernet Interface in current Master.&lt;br /&gt;[root@mastertest ~]# ifdown eth1&lt;br /&gt;Now Boot the Original Master Server and if the Ethernet cable is UN-plugged. Plug the Ethernet Interface in the Original Master server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step4:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Login To Original_Mater Server Using Secure Shell in Linux or Putty tool&lt;br /&gt;[root@TESTDB ~]# ssh 10.5.1.10&lt;br /&gt;root@10.5.1.10's password: xxxxxxx&lt;br /&gt;Last login: Tue Oct 7 15:30:41 2008 from 10.5.1.10&lt;br /&gt;[root@mastertest ~]#&lt;br /&gt;Or Use Putty Tool in Windows&lt;br /&gt;Enter the slave IP address and user name and password&lt;br /&gt;After login into machine proceed the below steps.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step5:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Login into Mysql&lt;br /&gt;[root@slavetest ~]# mysql -u root -p&lt;br /&gt;Enter password: xxxxx (Please consult MySQL Administrator/IT Manager)&lt;br /&gt;Welcome to the MySQL monitor. Commands end with ; or \g.&lt;br /&gt;Your MySQL connection id is 250&lt;br /&gt;Server version: 5.0.54a-enterprise-gpl-log MySQL Enterprise Server (GPL)&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;mysql&gt;&lt;br /&gt;You Will get Welcome message and mysql prompt as show above.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step6:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Configure Old_master as a Slave Server of Current_Master Server&lt;br /&gt;mysql&gt;change master to &lt;br /&gt;&gt;master_host=10.5.1.11', (slave server ip address)&lt;br /&gt;&gt;master_user='slavereplication', (slavereplication-mysql replication user created in the&lt;br /&gt;slave server)&lt;br /&gt;&gt;master_password='slave', (slave- mysql replication user password created in the&lt;br /&gt;slave server)&lt;br /&gt;&gt;master_log_file='mysql-bin.0000xx', (xx: position of current_master server log file name as shown in show master status, at the time of&lt;br /&gt;making slave as master)&lt;br /&gt;&gt; master_log_pos=xx; (xx:position of current_master log position as shown&lt;br /&gt;in show master status, at the time of making slave as master)&lt;br /&gt;mysql&gt;&lt;br /&gt;mysql&gt;start slave;&lt;br /&gt;Now it will get updates, which are missed during the failure. Once all update has been finished make master a master again.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Step7:&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To make Master a master again (because it is the most powerful machine, for example), use the preceding procedure as if Slave 1 was unavailable and Master was to be the new master.&lt;br /&gt;[root@mastertest ~]# service mysql stop&lt;br /&gt;[root@mastertest ~]# cd /var/lib/mysql&lt;br /&gt;[root@mastertest ~]# mv master.info relay-log.info servername-relay.bin* /root&lt;br /&gt;[root@mastertest ~]# service mysql start&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Step8: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Making original Slave as a slave replication server&lt;br /&gt;&lt;br /&gt;[root@slavetest ~]# mysql -u root -p&lt;br /&gt;Enter password: xxxxx (Please consult MySQL Administrator/IT Manager)&lt;br /&gt;Welcome to the MySQL monitor. Commands end with ; or \g.&lt;br /&gt;Your MySQL connection id is 250&lt;br /&gt;Server version: 5.0.54a-enterprise-gpl-log MySQL Enterprise Server (GPL)&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;mysql&gt; start slave;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;6. Replication Files:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let’s take a look at some of the files replication uses. You already know about the binary log and the relay log, but there are several other files too. Where MySQL places them depends mostly on your configuration settings. Different MySQL versions place them in different directories by default. You can probably find them either in the data directory or in the directory that contains the server’s .pid file (possibly /var/run/mysqld/ on Unix-like systems). &lt;br /&gt;Here they are:&lt;br /&gt;• mysql-bin.index : A server that has binary logging enabled will also have a file named the same as the binary logs, but with a .index suffix. This file keeps track of the binary log files that exist on disk. It is not an index in the sense of a table’s index; rather, each line in the file contains the filename of a binary log file. You might be tempted to think that this file is redundant and can be deleted (after all, MySQL could just look at the disk to find its files), but don’t. MySQL relies on this index file, and it will not recognize a binary log file unless it’s mentioned here.&lt;br /&gt;&lt;br /&gt;• mysql-relay-bin.index : This file serves the same purpose for the relay logs as the binary log index file does for the binary logs.&lt;br /&gt;&lt;br /&gt;• master.info : This file contains the information a slave server needs to connect to its master. Don’t delete it, or your slave will not know how to connect to its master after it restarts. This file contains the replication user’s password, in plain text, so you may want to restrict its permissions.&lt;br /&gt;&lt;br /&gt;• relay-log.info:  This file contains the slave’s current binary log and relay log coordinates (i.e., the slave’s position on the master). Don’t delete this either, or the slave will forget where it was replicating from after a restart and might try to replay statements it has already executed. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;These files are a rather crude way of recording MySQL’s replication and logging state. Unfortunately, they are not written synchronously, so if your server loses power and the files haven’t yet been flushed to disk, they can be inaccurate when the server restarts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8784311374131490137?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8784311374131490137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8784311374131490137' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8784311374131490137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8784311374131490137'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2009/03/mysql-replication-disaster-recovery.html' title='MYSQL REPLICATION &amp; DISASTER RECOVERY'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NLkmGwwWuto/ScXvTIsI7QI/AAAAAAAABEM/qooPJfKksXw/s72-c/MYSQL.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4276492545064389347</id><published>2008-11-20T01:57:00.001-08:00</published><updated>2008-11-20T02:33:43.275-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='import  export'/><title type='text'>move you bookmarks between computers</title><content type='html'>Most of time I face problem when I lose my bookmarks. Its important to take backup of bookmarks which easily transfer between systems. After doning 10min of search I comeup with 3 method.&lt;br /&gt;a. Export &amp;amp; Import Method.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;From the Firefox browser, click on on the "Bookmarks" menu located at the top of the window. Next, click on the "Organize Bookmarks"&lt;/li&gt;&lt;li&gt;This brings you to a separate window which lists all existing bookmarks (favorite websites). From the File menu at the top, you have the option to Import and Export.&lt;/li&gt;&lt;li&gt;If you need to import external bookmarks and merge them into Firefox, do so by clicking "Import" from the File menu. This allows you to import your favorites from Internet Explorer, or just an existing file you had saved in the past. Choose the desired option, and hit "Next" to search for your bookmarks. When done, click "Finish." &lt;/li&gt;&lt;li&gt;If you need to externally save existing Firefox bookmarks, click on the "Export" option from the File menu. Once you choose a save destination, you're all set.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;b. Keep your bookmark online, few sites gives service to keep the bookmarks online and it will sync data between your firefok and there server. Just you need to create account there one of such site is &lt;a href="http://www.mybookmarks.com/"&gt;http://www.mybookmarks.com/&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;c. This will take backup of all your Firefox Extentions along with bookmarks. What you need to do install FEBE (&lt;a href="http://www.blogger.com/www.customsoftwareconsult.com/extensions/febe/febe.html"&gt;Firefox Environment Backup Extension&lt;/a&gt;). There is another extension CLEO(&lt;a href="http://www.blogger.com/www.customsoftwareconsult.com/extensions/cleo/cleo.html"&gt;Compact Library Extension Organizer&lt;/a&gt;) that can be used to combine all the extension and make it as a single extension file. it can also be very help full if you have your own custom made extension.&lt;/p&gt;&lt;p&gt;source :&lt;/p&gt;&lt;p&gt;&lt;a href="http://mozilla.gunnars.net/firefox_bookmarks_tutorial.html"&gt;http://mozilla.gunnars.net/firefox_bookmarks_tutorial.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://prabhanjan-panigrahi.blogspot.com/2008/11/backup-your-firefox-extentions-and.html"&gt;http://prabhanjan-panigrahi.blogspot.com/2008/11/backup-your-firefox-extentions-and.html&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4276492545064389347?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4276492545064389347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4276492545064389347' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4276492545064389347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4276492545064389347'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/11/move-you-bookmarks-between-computers_20.html' title='move you bookmarks between computers'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-6630777613268635676</id><published>2008-09-25T05:32:00.000-07:00</published><updated>2008-09-25T05:48:20.723-07:00</updated><title type='text'>Performance : Alternative PHP Cache (APC)</title><content type='html'>1. yum install php-pecl-apc&lt;br /&gt;&lt;br /&gt;If for some reason centosplus repo is not enabled then:&lt;br /&gt;1. cd /usr/src/&lt;br /&gt;2. wget http://pecl.php.net/get/APC-3.0.19.tgz&lt;br /&gt;3. tar xvzf APC-3.0.19.tgz&lt;br /&gt;4. cd APC-3.0.19&lt;br /&gt;5. yum install php-devel&lt;br /&gt;6. yum install automake&lt;br /&gt;7. yum install libtool httpd-devel*&lt;br /&gt;8. /usr/bin/phpize&lt;br /&gt;9. ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config&lt;br /&gt;10. make&lt;br /&gt;11. make install&lt;br /&gt;12. ls /usr/lib64/php4/ or /usr/lib64/php/modules/&lt;br /&gt;13 #emacs /etc/php.ini&lt;br /&gt;  extension=apc.so&lt;br /&gt;  apc.enabled=1&lt;br /&gt;  apc.shm_segments=1&lt;br /&gt;  apc.shm_size=128&lt;br /&gt;  apc.ttl=7200&lt;br /&gt;  apc.user_ttl=7200&lt;br /&gt;  apc.num_files_hint=1024&lt;br /&gt;  apc.mmap_file_mask=/tmp/apc.XXXXXX&lt;br /&gt;  apc.enable_cli=1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-6630777613268635676?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/6630777613268635676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=6630777613268635676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6630777613268635676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6630777613268635676'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/09/performance-alternative-php-cache-apc.html' title='Performance : Alternative PHP Cache (APC)'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4256057307094429416</id><published>2008-09-15T06:25:00.000-07:00</published><updated>2008-09-15T06:45:07.812-07:00</updated><title type='text'>Understanding LVM</title><content type='html'>&lt;span style="font-weight: bold;"&gt;LVM terminology:&lt;/span&gt;&lt;br /&gt;a. &lt;span style="font-weight: bold; font-style: italic;"&gt;Physical Volume (PV)&lt;/span&gt; : A PV is nothing more than a physical medium with some administrative data added to it - once you have added this, LVM will recognise it .&lt;br /&gt;b. &lt;span style="font-weight: bold;"&gt;Physical Extents (PE)&lt;/span&gt; :- Physical Extents are like really big blocks, often with a size of megabytes.&lt;br /&gt;c. &lt;span style="font-weight: bold; font-style: italic;"&gt;Volume Group (VG) &lt;/span&gt;- A VG is made up of a number of Physical Extents (which may have come from multiple Physical Volumes or hard drives). While it may be tempting to think of a VG as being made up of several hard drives (/dev/hda and /dev/sda for example), it's more accurate to say that it contains PEs which are provided by these hard drives.&lt;br /&gt;d. &lt;span style="font-weight: bold; font-style: italic;"&gt;Logical Volumes (LV)&lt;/span&gt; - A logical volume functions like a normal partition -- it have a filesystem such as Ext3, and a mount point. From , Volume Group, PEs can be assigned to a logical Volume (LV).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Creating Physical volumes:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#pvcreate /dev/sda3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Multiple physical volumes&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#pvcreate /dev/sda9 /dev/sda10&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Creating a volume group:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#vgcreate home2 /dev/sda3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Multiple physical volumes to make up a volume group&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#vgcreate home3 /dev/sda9 /dev/sda10&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Creating logical volume:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#lvcreate --size 1G -n downloads home2&lt;/span&gt;&lt;br /&gt;now,&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#mkfs.ext3 /dev/home2/downloads&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#mkdir /home/downloads&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#mount -t ext3 /dev/home2/downloads /home/downloads&lt;/span&gt;&lt;br /&gt;Add a line to the /etc/fstab file&lt;br /&gt;&lt;span style="font-style: italic;"&gt;/dev/home2/downloads     /home/downloads     ext3     defaults     1 2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Resizing logical volumes:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#umount /home/downloads&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#lvextend -L +1G /dev/home2/downloads&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#resize2fs /dev/home2/downloads&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Similar to the lvextend there is the lvreduce command:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#lvreduce -L -500M /dev/home2/downloads&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#resize2fs /dev/home2/downloads&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Modifying volume groups:&lt;/span&gt;&lt;br /&gt;a. unmount the logical volumes within your volume group.&lt;br /&gt;b. &lt;span style="font-style: italic;"&gt;#vgextend home2 /dev/sda5 /dev/sda7&lt;/span&gt;&lt;br /&gt;(The volume group home2 is now made up of sda3, sda5, and sda7)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Remove a volume group&lt;/span&gt;&lt;br /&gt;a. Unmount your logical volume&lt;br /&gt;b. &lt;span style="font-style: italic;"&gt;#vgremove home2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;A Physical Volume, containing Physical Extents:&lt;br /&gt;&lt;br /&gt;+-----[ Physical Volume ]------+&lt;br /&gt;| PE | PE | PE | PE | PE | PE  |&lt;br /&gt;+------------------------------+&lt;br /&gt;&lt;br /&gt;A Volume Group, containing 2 Physical Volumes (PVs) with 6 Physical Extents:&lt;br /&gt;&lt;br /&gt;+------[ Volume Group ]-----------------+&lt;br /&gt;|  +--[PV]--------+  +--[PV]---------+  |&lt;br /&gt;|  | PE | PE | PE |  | PE | PE | PE  |  |&lt;br /&gt;|  +--------------+  +---------------+  |&lt;br /&gt;+---------------------------------------+&lt;br /&gt;&lt;br /&gt;We now further expand this:&lt;br /&gt;&lt;br /&gt;+------[ Volume Group ]-----------------+&lt;br /&gt;|  +--[PV]--------+  +--[PV]---------+  |&lt;br /&gt;|  | PE | PE | PE |  | PE | PE | PE  |  |&lt;br /&gt;|  +--+---+---+---+  +-+----+----+---+  |&lt;br /&gt;|     |   |   | +-----/     |    |      |&lt;br /&gt;|     |   |   | |           |    |      |&lt;br /&gt;|   +-+---+---+-+      +----+----+--+   |&lt;br /&gt;|   |  Logical  |      |  Logical   |   |&lt;br /&gt;|   |  Volume   |      |   Volume   |   |&lt;br /&gt;|   |           |      |            |   |&lt;br /&gt;|   |  /home    |      |    /var    |   |&lt;br /&gt;|   +-----------+      +------------+   |&lt;br /&gt;+---------------------------------------+&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can use the lvdisplay command see logical vloume's status.&lt;br /&gt;&lt;a href="http://www.ibm.com/developerworks/library/l-lvm2/index.html"&gt;&lt;br /&gt;http://www.ibm.com/developerworks/library/l-lvm2/index.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.linux.com/feature/118645"&gt;http://www.linux.com/feature/11864&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4256057307094429416?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4256057307094429416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4256057307094429416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4256057307094429416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4256057307094429416'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/09/understanding-lvm.html' title='Understanding LVM'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-45120938420689798</id><published>2008-09-15T05:16:00.000-07:00</published><updated>2008-09-15T05:24:03.561-07:00</updated><title type='text'>Roaming Profile on samba with PDC controller, windows as client</title><content type='html'>1. Make these change in samba configuration file :  emacs /etc/samba/smb.conf&lt;br /&gt;Important terms to understand&lt;br /&gt;    a. wins support = yes&lt;br /&gt;    b. domain master = yes&lt;br /&gt;    c. netbios name = samba&lt;br /&gt;    d. workgroup = OFFICE&lt;br /&gt;    e. domain logons = yes&lt;br /&gt;&lt;br /&gt;2. Samba root access&lt;br /&gt;#smbpasswd -a&lt;br /&gt;&lt;br /&gt;3. Add new user :&lt;br /&gt;#useradd prabhat  (adding linux user)&lt;br /&gt;#passwd prabhat&lt;br /&gt;#smbpasswd -a prabhat  (converting linux user into samba user)&lt;br /&gt;&lt;br /&gt;4. On the windows machine,Aadd window machine in 'OFFICE' domain of samba.&lt;br /&gt;On desktop, Right click on "My Computer" -&gt; "properties" -&gt; "Network identificatation" tab -&gt; "change"&lt;br /&gt;while joing it will ask for username password "root" &amp;amp; "OFFICE" (see serial no 2.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Important Points:&lt;br /&gt;1. There will be one and only one PDC over network.&lt;br /&gt;2. The machine name must be unique over network.&lt;br /&gt;3. While login from client domain name must be 'OFFICE'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#emacs /etc/samba/smb.conf&lt;br /&gt;&lt;blockquote style="font-style: italic;"&gt;[global]&lt;br /&gt;      log file = /var/log/samba/%m.log&lt;br /&gt;      log level = 2&lt;br /&gt;      load printers = yes&lt;br /&gt;      idmap gid = 16777216-33554431&lt;br /&gt;      socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192&lt;br /&gt;      winbind use default domain = no&lt;br /&gt;      template shell = /bin/false&lt;br /&gt;      wins support = yes&lt;br /&gt;      dns proxy = no&lt;br /&gt;      netbios name = samba&lt;br /&gt;      domain master = yes&lt;br /&gt;      preferred master = yes&lt;br /&gt;      cups options = raw&lt;br /&gt;      server string = Samba PDC&lt;br /&gt;      idmap uid = 16777216-33554431&lt;br /&gt;      workgroup = OFFICE&lt;br /&gt;      os level = 64&lt;br /&gt;      domain logons = yes&lt;br /&gt;      add user script = /usr/sbin/useradd -m '%u'&lt;br /&gt;      delete user script = /usr/sbin/userdel -r '%u'&lt;br /&gt;      add group script = /usr/sbin/groupadd '%g'&lt;br /&gt;      delete group script = /usr/sbin/groupdel '%g'&lt;br /&gt;      add user to group script = /usr/sbin/usermod -G '%g' '%u'&lt;br /&gt;      set primary group script = /usr/sbin/usermod -g '%g' '%u'&lt;br /&gt;      add machine script = /usr/sbin/useradd -s /bin/false -d /dev/null '%u'&lt;br /&gt;      logon script = scripts\logon.bat&lt;br /&gt;      passdb backend = tdbsam&lt;br /&gt;      printcap name = /etc/printcap&lt;br /&gt;      security = user&lt;br /&gt;      max log size = 50&lt;br /&gt;      hosts allow = 10.1.&lt;br /&gt;&lt;br /&gt;[homes]&lt;br /&gt; comment = Home Directories&lt;br /&gt; valid users = %S&lt;br /&gt; browseable = No&lt;br /&gt; writable = Yes&lt;br /&gt;&lt;br /&gt;# Un-comment the following and create the netlogon directory for Domain Logons&lt;br /&gt;[netlogon]&lt;br /&gt;      comment = Network Logon Service&lt;br /&gt;      logon path = \\%L\profiles\%U&lt;br /&gt;      logon home = \\%L\%U\.9xprofile&lt;br /&gt;      logon drive = p:&lt;br /&gt;      browseable = no&lt;br /&gt;      writable = no&lt;br /&gt;;   share modes = no&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Concept:&lt;br /&gt;&lt;a href="http://searchenterpriselinux.techtarget.com/tip/0,289483,sid39_gci1151921,00.html"&gt;http://searchenterpriselinux.techtarget.com/tip/0,289483,sid39_gci1151921,00.html&lt;/a&gt;&lt;br /&gt;Practial Implement:&lt;br /&gt;&lt;a href="http://searchenterpriselinux.techtarget.com/tip/0,289483,sid39_gci1151926,00.html"&gt;http://searchenterpriselinux.techtarget.com/tip/0,289483,sid39_gci1151926,00.html&lt;/a&gt;&lt;br /&gt;Read section : "Joining" a Samba Domain&lt;br /&gt;&lt;a href="http://www.rmschneider.com/writing/xp_and_samba.html"&gt;http://www.rmschneider.com/writing/xp_and_samba.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-45120938420689798?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/45120938420689798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=45120938420689798' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/45120938420689798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/45120938420689798'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/09/roaming-profile-on-samba-with-pdc.html' title='Roaming Profile on samba with PDC controller, windows as client'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8137623487767585839</id><published>2008-07-23T05:24:00.000-07:00</published><updated>2008-07-23T05:49:29.086-07:00</updated><title type='text'>NFS server Redhat 5</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Making NFS server Live:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Server side  (Server IP 10.1.31.1):&lt;/span&gt;&lt;br /&gt;1. Check nfs-utils is installed or not using&lt;br /&gt;  &lt;span style="font-weight: bold; font-style: italic;"&gt;#yum list nfs-utils&lt;/span&gt;&lt;br /&gt;2. Edit /etc/exports , add dir you want share with netrwork information and permision&lt;br /&gt;  &lt;span style="font-style: italic; font-weight: bold;"&gt;# vi /etc/exports&lt;/span&gt;&lt;br /&gt;       &lt;span style="font-weight: bold; font-style: italic;"&gt;/var/ftp/pub    10.1.0.0/16(rw,sync,no_root_squash)&lt;/span&gt;&lt;br /&gt;3. Restart nfs service&lt;br /&gt;  &lt;span style="font-weight: bold; font-style: italic;"&gt;# service nfs retstart&lt;/span&gt;&lt;br /&gt;or&lt;br /&gt;  &lt;span style="font-weight: bold; font-style: italic;"&gt;# service nfs reload&lt;/span&gt;&lt;br /&gt;4. Check port &amp;amp; shared dir using&lt;br /&gt;  &lt;span style="font-weight: bold; font-style: italic;"&gt;# rcpinfo -p&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;   # export -v&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;   # service portmap status&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Client Side (Client IP : 10.1.0.0/16, eg 10.1.31.67):&lt;/span&gt;&lt;br /&gt;1. mount shared nfs folder&lt;br /&gt;  &lt;span style="font-style: italic; font-weight: bold;"&gt;# mount 10.1.31.3:/var/ftp/pub /mnt&lt;/span&gt;&lt;br /&gt;2. Do static mount using /etc/fstab&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;   # vi /etc/fstab&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;   10.1.31.1:/var/ftp/pub                    /mnt                 nfs defaults        0 0&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8137623487767585839?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8137623487767585839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8137623487767585839' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8137623487767585839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8137623487767585839'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/07/nfs-server-redhat-5.html' title='NFS server Redhat 5'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8647749969656575967</id><published>2008-07-16T04:17:00.000-07:00</published><updated>2008-07-16T05:14:49.604-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install linux'/><title type='text'>Creating RAID Partition</title><content type='html'>&lt;span style="font-size:100%;"&gt;Creating RAID-5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;    &lt;p class="MsoNormal"  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;For this you need 3 Partition, 2 partitions with same size and 3rd partition &lt;/span&gt;&lt;span style="font-size:100%;"&gt;is 10% &lt;/span&gt;&lt;span style="font-size:100%;"&gt;greater than 1st or 2nd( &lt;span style="font-style: italic;"&gt;since 1 &amp;amp; 2nd partition of same size.&lt;/span&gt;).   You can use fdisk command to create partition and  make sure &lt;/span&gt;&lt;span style="font-size:100%;"&gt;partition &lt;/span&gt;&lt;span style="font-size:100%;"&gt; type must be FD. In fdisk command use option &lt;span style="font-weight: bold; font-style: italic;"&gt;t&lt;/span&gt; to change partition type.&lt;/span&gt;&lt;/p&gt;eg.  I have created &lt;span style="font-size:100%;"&gt;/dev/sda1, &lt;/span&gt;&lt;span style="font-size:100%;"&gt;/dev/sdb1 and &lt;/span&gt;&lt;span style="font-size:100%;"&gt;/dev/sdc1.&lt;/span&gt;        &lt;p class="MsoNormal"  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;Once you created 3 partitions use this to make RAID 5:&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;#mdadm --create /dev/md0 --level=5 --raid-device=3 /dev/sd{a1,b1,c1}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;Check the RAID partition using:&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;#less /proc/mdstat&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;Or you can see detail information's using:&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;#mdadm --detail /dev/md0&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;To rebuild corrupted partation use:&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;#mdadm /dev/md0 -r /dev/sdb0&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-family: arial;" class="MsoNormal"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8647749969656575967?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8647749969656575967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8647749969656575967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8647749969656575967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8647749969656575967'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/07/creating-raid-partition.html' title='Creating RAID Partition'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-1141879095354450618</id><published>2008-07-10T04:39:00.000-07:00</published><updated>2008-07-11T07:49:34.328-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Swap Filesystem Creation</title><content type='html'>Partition Creation for Swap filesystem&lt;br /&gt;1.    fdisk  -l&lt;br /&gt;2.    fdisk /dev/sda&lt;br /&gt;3.    Type p &amp;amp; Press Enter&lt;br /&gt;4.    Type n &amp;amp; Press Enter&lt;br /&gt;5.    Just Press Enter for 1st Cylinder size&lt;br /&gt;6.    Type +sizeM for last Cylinder size&lt;br /&gt;7.    Type p &amp;amp; Press Enter&lt;br /&gt;8.    Type t &amp;amp; Press Enter&lt;br /&gt;9.    t2  /dev/sda12&lt;br /&gt;10.     Type 82 &amp;amp; Press Enter&lt;br /&gt;11.     Type p &amp;amp; Press Enter&lt;br /&gt;12.     Type w &amp;amp; Press Enter&lt;br /&gt;13.     partprobe&lt;br /&gt;14.     swapon  -s&lt;br /&gt;15.     swapoff  /dev/sda7            =&gt; Swapoff the another                                       swap partition&lt;br /&gt;16.     swapon  -s&lt;br /&gt;&lt;br /&gt;Creation of a new Swap Filesystem&lt;br /&gt;1.    mkswap  -v1  /dev/sda12&lt;br /&gt;2.    swapon  /dev/sda12&lt;br /&gt;3.    swapon  /dev/sda7&lt;br /&gt;Here /dev/sda7 &amp;amp; /dev/sda12 are swap partition.&lt;br /&gt;&lt;br /&gt;For automounting the either or swap partition do the following :&lt;br /&gt;&lt;br /&gt;1.    vi  /etc/fstab&lt;br /&gt;2.    Add the following line :-&lt;br /&gt;&lt;br /&gt;/dev/sda12        swap    swap    defaults        0    0&lt;br /&gt;&lt;br /&gt;Note :- Partition Id identifies what type of filesystem will have to create. Id is Hexacode number. Maximum 4 partition can  be create 3 primary &amp;amp; 1 Extended.&lt;br /&gt;&lt;br /&gt;Filesystem    ID&lt;br /&gt;Ext2 / Ext3 ( Linux)    83&lt;br /&gt;Swap    82&lt;br /&gt;Fat32    C&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-1141879095354450618?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/1141879095354450618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=1141879095354450618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1141879095354450618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1141879095354450618'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/07/swap-filesystem-creation.html' title='Swap Filesystem Creation'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-6252716857694393029</id><published>2008-07-10T03:48:00.000-07:00</published><updated>2008-07-11T01:54:34.729-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Linux partition using fdisk</title><content type='html'>&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;Linux partition using fdisk&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;1.    fdisk  -l                        =&gt; To check what type of Hard Disk i.e. Sata ( /dev/sda ) or Pata ( /dev/hda )                                                                &lt;br /&gt;2.    fdisk  /dev/sda&lt;br /&gt;3.    Type n then Enter                =&gt; For new Partition&lt;br /&gt;4.    Just press Enter                 =&gt; For 1st Cylinder&lt;br /&gt;5.    Type +size and press Enter        =&gt; For Last Cylinder for  Example +1000M. Size  can be in terms of M or K&lt;br /&gt;6.    Type p                        =&gt; To print the partition&lt;br /&gt;7.    Type w                        =&gt; To save the new partition. It's save in the hard disk but kernel  partition table not updated. (/dev/sda11 is created in my system , might be different in your system)&lt;br /&gt;8.    Type partprobe &amp;amp; Press Enter    =&gt; To update the kernel.&lt;br /&gt;9.    mkfs.ext3  -b  2048  /dev/sda11      =&gt; Here b is the block &amp;amp; is \block size in bytes &amp;amp; /dev/sda11 is new partition   has created&lt;br /&gt;11.     e2label  /dev/sda11  data=&gt; data is Label name&lt;br /&gt;12.     e2label  /dev/sda11&lt;br /&gt;13.    mkdir  /data =&gt; To mount the partition /dev/sda11 /data is a directory&lt;br /&gt;14.     mount  /dev/sda11  /data&lt;br /&gt;15.     ls  /data&lt;br /&gt;To make this above mount point for /dev/sda11 permanent write entry in the /etc/fstab file by the following way :-&lt;br /&gt;&lt;br /&gt;1.vi  /etc/fstab&lt;br /&gt;2. LABEL=data    /data ext3        defaults        0    0&lt;br /&gt;&lt;br /&gt;=&gt; defaults means how   will it be mount by which criteria  rw,exec,acl etc.  First 0 is for dump value i.e. Whether there will be automatic dumping or not means or off. Next 0 is fsck sequence value i.e. If there is any improperly  shutdown occurs then the system again then which file it will check for  consistency.0 means it doesn't check.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-6252716857694393029?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/6252716857694393029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=6252716857694393029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6252716857694393029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/6252716857694393029'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/07/linux-partition-using-fdisk.html' title='Linux partition using fdisk'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4768515068079824466</id><published>2008-05-02T18:47:00.000-07:00</published><updated>2008-05-02T18:54:18.055-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install linux'/><title type='text'>instant Messenger: Openfire, Spark &amp; web chat (Fastpath)</title><content type='html'>-&gt; Openfire&lt;br /&gt;1 .  lynx http://www.igniterealtime.org/downloads/download-landing.jsp?file=openfire/openfire-3.4.5-1.i386.rpm&lt;br /&gt;2 .  rpm -ivh openfire-3.4.5-1.i386.rpm&lt;br /&gt;3 .  /etc/rc.d/init.d/openfire status&lt;br /&gt;4 .  /etc/rc.d/init.d/openfire start&lt;br /&gt;5.  Make sure that the firewall is stopped.&lt;br /&gt;6 .  http://www.grmtech.com:9090/&lt;br /&gt;7 . From the plugin tab in the web based admin control panel: installed Asterisk-IM Openfire&lt;br /&gt;&lt;br /&gt;-&gt; Spark&lt;br /&gt;Download and install on client system.&lt;br /&gt;&lt;a href="http://www.igniterealtime.org/downloadServlet?filename=spark/spark_2_5_8.exe"&gt;http://www.igniterealtime.org/downloadServlet?filename=spark/spark_2_5_8.exe&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;-&gt; web chat&lt;br /&gt;Go to plugin tab in the web based admin control panel:&lt;br /&gt;1.Click on 'Available Plugins'&lt;br /&gt;2. Install the following plugin&lt;br /&gt; a.  Spark Fastpath Webchat&lt;br /&gt; b. Fastpath Service&lt;br /&gt; c. Monitoring Service (its is a optional)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4768515068079824466?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4768515068079824466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4768515068079824466' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4768515068079824466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4768515068079824466'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/05/instant-messenger-openfire-spark-web.html' title='instant Messenger: Openfire, Spark &amp; web chat (Fastpath)'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4497872893374239493</id><published>2008-05-02T18:44:00.000-07:00</published><updated>2008-05-02T18:45:50.103-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install linux'/><title type='text'>How to make a linux server act as a gateway</title><content type='html'>1. turned on IP forwarding in sysctl.conf by setting the value to 1&lt;br /&gt;2. gave the ip tables command for nat masquerade.&lt;br /&gt;iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&lt;br /&gt;iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE&lt;br /&gt;Checked that the commands took effect by:&lt;br /&gt;iptables-save&lt;br /&gt;and then made the entries from iptables-save inside the file /etc/sysconfig/iptables&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4497872893374239493?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4497872893374239493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4497872893374239493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4497872893374239493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4497872893374239493'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/05/how-to-make-linux-server-act-as-gateway.html' title='How to make a linux server act as a gateway'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-2250815727991743572</id><published>2008-05-02T18:42:00.000-07:00</published><updated>2008-05-02T18:44:32.187-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>Check and Rebuilding failed Linux software RAID</title><content type='html'># cat /proc/mdstat&lt;br /&gt;# mdadm -D /dev/md0&lt;br /&gt;Detail : http://sitearticles.com/cms/show/43.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-2250815727991743572?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/2250815727991743572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=2250815727991743572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2250815727991743572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2250815727991743572'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/05/check-and-rebuilding-failed-linux.html' title='Check and Rebuilding failed Linux software RAID'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-1601552919847306862</id><published>2008-05-02T18:35:00.000-07:00</published><updated>2008-05-02T18:41:08.208-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>ssh commands to log in without the password</title><content type='html'>&lt;span style="font-weight: bold; font-style: italic;"&gt;ssh commands to log in without the password&lt;/span&gt;&lt;br /&gt;# ssh-keygen -t rsa&lt;br /&gt;* This will generate your id_rsa and id_rsa.pub in the .ssh directory in your home directory&lt;br /&gt;* copy the id_rsa.pub to the .ssh directory of the remote host you want to logon to as authorized_keys2&lt;br /&gt;* If you have more than one host from which you want to connect to the remote host, you need to add the local host's id_rsa.pub as one line in the authorized_keys2 file of the remote host command for the 1and1 servers is:&lt;br /&gt;# scp .ssh/id_rsa.pub u35894953@217.160.226.69:./.ssh/authorized_keys2&lt;br /&gt;&lt;br /&gt;:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-1601552919847306862?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/1601552919847306862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=1601552919847306862' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1601552919847306862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1601552919847306862'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/05/ssh-commands-to-log-in-without-password.html' title='ssh commands to log in without the password'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-2507651545034547139</id><published>2008-04-13T23:30:00.000-07:00</published><updated>2008-04-14T02:12:40.693-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Apache: Proxy and ReverseProxy Server</title><content type='html'>Redirect your all traffic:&lt;br /&gt;Case:&lt;br /&gt;example.com A record is point to  server with IP10.1.31.7 (mean its resolves to IP 10.1.31.7 ), but you are running your web server from example.com on server with IP 10.1.31.8.&lt;br /&gt;So, you want all traffic coming to 10.1.31.7 will redirect to 10.1.31.8.&lt;br /&gt;&lt;br /&gt;Do the following changes on server have IP 10.1.31.7 :&lt;br /&gt;1. Run&lt;span style="font-weight: bold;"&gt; apache&lt;/span&gt;.&lt;br /&gt;2. Do the following entry in apache.&lt;br /&gt;a. &lt;span style="font-weight: bold;"&gt;NameVirtualHost 10.1.31.7&lt;/span&gt;&lt;br /&gt;b&lt;span style="font-weight: bold; font-style: italic;"&gt; &amp;lt;VirtualHost 10.1.31.7:80 &amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;ServerName example.com&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;ServerAlias www.example.com&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;DocumentRoot /home/test&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;ProxyRequests off&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;ProxyPass / http://www.example.com/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;ProxyPassReverse / http://www.example.com/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&amp;lt;Location /&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;ProxyPassReverse / &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&amp;lt;/Location&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&amp;lt;/VirtualHost&amp;gt; &lt;/span&gt;&lt;br /&gt;3.  Do the following entry in /etc/hosts.&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;  10.1.31.8     example.com&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;  10.1.31.8     www.example.com&lt;/span&gt;&lt;br /&gt;(&lt;span style="font-style: italic;"&gt;make sure once you #ping example.com from 10.1.31.7 it resolver's to 10.1.31.8&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note: its redirect only http request not https.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;more you can see on &lt;a href="http://www.akadia.com/services/apache_redirect.html"&gt;this link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-2507651545034547139?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/2507651545034547139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=2507651545034547139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2507651545034547139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/2507651545034547139'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/04/apache-proxy-and-reverseproxy-server.html' title='Apache: Proxy and ReverseProxy Server'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-1645154904284080439</id><published>2008-04-12T06:55:00.000-07:00</published><updated>2008-04-12T07:03:51.273-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='script'/><title type='text'>Removing all blank lines, leading and trailing blank spaces</title><content type='html'>Removing all blank lines, leading and trailing blank spaces :&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g' prabhat.txt &gt; kumar.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;This command will create new file (kumar.txt) on which it removes blank lines, leading and trailing blank spaces.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-1645154904284080439?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/1645154904284080439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=1645154904284080439' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1645154904284080439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/1645154904284080439'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/04/removing-all-blank-lines-leading-and.html' title='Removing all blank lines, leading and trailing blank spaces'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-3512309618477276050</id><published>2008-04-11T00:29:00.000-07:00</published><updated>2008-04-11T01:47:39.457-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>Changing Run Levels</title><content type='html'>On production environment normal run level 3 is used and it get rarely changed.&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Runlevel"&gt;Runlevel and usage&lt;/a&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;0 — Halt&lt;/li&gt;&lt;li&gt;1 — Single-user mode&lt;/li&gt;&lt;li&gt;2 — Not used (user-definable)&lt;/li&gt;&lt;li&gt;3 — Full multi-user mode&lt;/li&gt;&lt;li&gt;4 — Not used (user-definable)&lt;/li&gt;&lt;li&gt;5 — Full multi-user mode (with an X-based login screen)&lt;/li&gt;&lt;li&gt;6 — Reboot&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold; font-style: italic;"&gt;Check run level using :-&lt;/span&gt;&lt;br /&gt;#&lt;span style="font-weight: bold;"&gt;who -r&lt;/span&gt;&lt;span style="font-family:monospace;"&gt; or&lt;/span&gt; #&lt;span style="font-weight: bold;"&gt;runlevel&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Change run level using:-&lt;/span&gt;&lt;br /&gt;#&lt;span style="font-weight: bold;"&gt;telinit 5&lt;/span&gt;  or&lt;br /&gt;open file&lt;br /&gt;#&lt;span style="font-weight: bold;"&gt;emacs  /etc/inittab&lt;/span&gt;&lt;br /&gt;Look for the default runlevel called initdefault which look like as follows:&lt;br /&gt;id:&lt;span style="font-weight: bold;"&gt;3&lt;/span&gt;:initdefault:&lt;br /&gt;Replace run level x with  y (&lt;span style="font-style: italic;"&gt;where x is current run level and y you want to set&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Set services in run level using :&lt;/span&gt;&lt;br /&gt;#&lt;b class="APPLICATION"&gt;ntsysv &lt;/b&gt;&lt;span class="APPLICATION"&gt;or&lt;br /&gt;#&lt;/span&gt;&lt;tt style="font-weight: bold;" class="COMMAND"&gt;chkconfig &lt;/tt&gt;&lt;tt class="COMMAND"&gt;or&lt;/tt&gt;&lt;tt style="font-weight: bold;" class="COMMAND"&gt;&lt;br /&gt;&lt;/tt&gt;&lt;tt class="COMMAND"&gt;#&lt;/tt&gt;&lt;span class="APPLICATION"&gt;&lt;/span&gt;&lt;b class="APPLICATION"&gt;serviceconf&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-3512309618477276050?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/3512309618477276050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=3512309618477276050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3512309618477276050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3512309618477276050'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/04/changing-run-levels.html' title='Changing Run Levels'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-3929143047104311200</id><published>2008-04-01T04:42:00.000-07:00</published><updated>2008-04-01T04:48:47.272-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux trick'/><title type='text'>How To: Transfer your PuTTY settings between computers</title><content type='html'>Putty stores its settings in the Windows registry. To save a backup of your Putty settings, you'll need to export this registry key to a file. &lt;br /&gt;&lt;br /&gt;HKEY_CURRENT_USER\Software\SimonTatham&lt;br /&gt;&lt;br /&gt;Steps :&lt;br /&gt;1. Click Start-&gt;Run and type "RegEdt32" in the "Open" dialog. Click "Ok"&lt;br /&gt;2. One RegEdt32 starts, you'll be presented with an application.&lt;br /&gt;3. Press "Ctrl+F" to bring up the Find dialog. Enter the name of the key, "SimonTratham" in the "Find What" field, and make sure only "Keys" is checked in the "Look At" section of the dialog. Finally, click "Find Next"&lt;br /&gt;4. The search may take a while, reminding us that the Windows Registry is a large and mysterious place where dragons be. Let's use these few seconds to reflect on the fact that you should never, ever, never change things in the registry unless you are absolutely, positively, totally, completely, 100% dead sure that you know exactly what you're doing. When the search completes we'll see the key name for which we're looking.&lt;br /&gt;5. Click File-&gt;Export. Give your file an appropriate name like, "putty.reg" and click "Save"&lt;br /&gt;6. We're done! Save the putty.reg file somewhere safe. The file doesn't contain any passwords or actual SSH key values so, it's relatively safe from prying eyes. Still, it does contain your configuration and that kind of data is a private matter.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Importing Your PuTTy Configuration:&lt;br /&gt;Windows will ask you for confirmation that you want to import this set of registry values. We know this file is safe, because we created it but, you should never import registry information from an unknown source&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-3929143047104311200?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/3929143047104311200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=3929143047104311200' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3929143047104311200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3929143047104311200'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/04/how-to-transfer-your-putty-settings.html' title='How To: Transfer your PuTTY settings between computers'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-5014868418878739910</id><published>2008-03-19T06:32:00.000-07:00</published><updated>2008-03-19T06:38:45.593-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='script'/><title type='text'>Remove all empty directories</title><content type='html'>$ cleanlinks&lt;br /&gt; &lt;br /&gt;this is supported on few flavor of Linux (XFree86), you can use this script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;#/bin/bash&lt;br /&gt;DIR="$1"&lt;br /&gt; [ -d $DIR ] &amp;&amp; [ $(ls -l $DIR | wc -l) -eq 1  ] &amp;&amp; rmdir $DIR ||  :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;$ script.sh dir1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-5014868418878739910?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/5014868418878739910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=5014868418878739910' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5014868418878739910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5014868418878739910'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/03/remove-all-empty-directories.html' title='Remove all empty directories'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-7100923284886004882</id><published>2008-03-19T06:20:00.000-07:00</published><updated>2008-03-19T06:52:33.885-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='script'/><title type='text'>Removing blank line from file</title><content type='html'>Using sed.&lt;br /&gt;$ sed '/^$/d' withblankline.txt &gt; withoutblankline.txt&lt;br /&gt;Using grep.&lt;br /&gt;$ grep -v '^$' withblankline.txt &gt; withoutblankline.txt&lt;br /&gt;&lt;br /&gt;Use following for loop (shell script) to remove all blank lines from all files stored in /home/prabhat/data directory:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;files="/home/prabhat/data/*.txt"&lt;br /&gt;for f in $files&lt;br /&gt;do&lt;br /&gt;sed '/^$/d' $i &gt; $i.out&lt;br /&gt;mv $i.out $i&lt;br /&gt;done&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-7100923284886004882?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/7100923284886004882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=7100923284886004882' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7100923284886004882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7100923284886004882'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/03/removing-blank-line-from-file.html' title='Removing blank line from file'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-7012327841056794759</id><published>2008-03-19T05:49:00.000-07:00</published><updated>2008-03-19T06:15:53.106-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dns'/><title type='text'>How to check reverse DNS</title><content type='html'>The DNS is used to determine what IP address is associated with a given host name, so to reverse resolve a known IP address is to lookup what the associated host name for it. A reverse lookup is often referred to simply as reverse resolving, or more specifically reverse DNS lookups.&lt;br /&gt;&lt;br /&gt;Use of reverse DNS.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;blockquote&gt;Anti-spam&lt;br /&gt;Network troubleshooting&lt;br /&gt;Avoid spammers and phishers using a forward confirmed reverse DNS etc&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Check reverse DNS for given IP address under Linux or Windows XP/Server 2003.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;You can use standard UNIX / Linux utilities such as nslookup, dig or hosts to find out reverse DNS of a given IP address.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;eg; under Linux/UNIX/&lt;br /&gt;$ host 66.65.123.34 &lt;br /&gt;or&lt;br /&gt;dig -x IP (66.65.123.34)&lt;br /&gt;and under Linux/UNIX/Windows&lt;br /&gt;nslookup 66.65.123.34&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-7012327841056794759?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/7012327841056794759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=7012327841056794759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7012327841056794759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/7012327841056794759'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/03/how-to-check-reverse-dns.html' title='How to check reverse DNS'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-5773804709088130996</id><published>2008-01-07T01:36:00.000-08:00</published><updated>2008-01-13T21:42:10.011-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><title type='text'>ssh warning</title><content type='html'>This is not a big thing, but sometime this small things matter a lot.&lt;br /&gt;&lt;br /&gt;You can put a message on remote ssh login for user or it will just act as a warning for a defaulters.&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;1. Open a file using : emacs /etc/motd and write a messge you want&lt;br /&gt;e.g.&lt;br /&gt;********************************************************************&lt;br /&gt;* *&lt;br /&gt;* This system is for the use of authorized users only. Usage of *&lt;br /&gt;* this system may be monitored and recorded by system personnel. *&lt;br /&gt;* *&lt;br /&gt;* Anyone using this system expressly consents to such monitoring *&lt;br /&gt;* and is advised that if such monitoring reveals possible *&lt;br /&gt;* evidence of criminal activity, system personnel may provide the *&lt;br /&gt;* evidence from such monitoring to law enforcement officials. *&lt;br /&gt;* *&lt;br /&gt;********************************************************************&lt;br /&gt;==========================================================&lt;br /&gt;Unauthorized access to this machine is prohibited&lt;br /&gt;Press &lt;ctrl-d&gt;if you are not an authorized user&lt;br /&gt;&lt;br /&gt;2. Save the file and exist.&lt;br /&gt;3. Restart the ssh service using. #service sshd restart&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-5773804709088130996?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/5773804709088130996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=5773804709088130996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5773804709088130996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5773804709088130996'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2008/01/ssh-warning.html' title='ssh warning'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4369937553238100081</id><published>2007-10-24T23:56:00.000-07:00</published><updated>2007-12-04T22:59:35.982-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Install linux'/><title type='text'>Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media</title><content type='html'>Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media&lt;br /&gt;&lt;br /&gt;I have a server running CentOS 4 with internet on it. This server is without any CD Drive, floppy Drive, USB-key, nor any other removable media and its Remote server.&lt;br /&gt;&lt;br /&gt;How do i install CentOS 5 on it? I have searched in various forums, posted in various forums.&lt;br /&gt;After a long hour I have came to solution.&lt;br /&gt;&lt;br /&gt;I am writting here what excataly I have done.&lt;br /&gt;&lt;br /&gt;Since, I have net connection on current system,&lt;br /&gt;&lt;br /&gt;1. I have downloaded ISO image of &lt;a href="http://ftp.osuosl.org/pub/centos/5.0/isos/x86_64/CentOS-5.0-x86_64-bin-1of7.iso"&gt;centos 5 (1 CD only)&lt;/a&gt;&lt;br /&gt;2. mkdir /mnt/tmp&lt;br /&gt;3. mount -o loop CentOS-5.0-x86_64-bin-1of7.iso /mnt/tmp&lt;br /&gt;4. cp -a /mnt/tmp/isolinux/vmlinuz /boot/vmlinuzMy&lt;br /&gt;5. cp -a /mnt/tmp/isolinux/initrd.img /boot/initrdMy.img&lt;br /&gt;6. umount /mnt/tmp&lt;br /&gt;7. Add entry to your /etc/grub.conf&lt;br /&gt;title Fedora Core 2 Installation&lt;br /&gt;root (hd0,0) kernel /boot/vmlinuzMy&lt;br /&gt;initrd /boot/initrdMy.img&lt;br /&gt;8. Reboot system&lt;br /&gt;9. Now your is booted and ready for new installation.&lt;br /&gt;10. Select installation method you want (FTP, HTTP or NFS probably). I have selected http&lt;br /&gt;11. Give your Name server and ipdetails.&lt;br /&gt;12. Give site &amp;amp; Dir (I have given)&lt;br /&gt;mirror.stanford.edu&lt;br /&gt;/yum/pub/centos/5/os/x86_64/&lt;br /&gt;&lt;br /&gt;I think its ok to install now :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4369937553238100081?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4369937553238100081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4369937553238100081' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4369937553238100081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4369937553238100081'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/10/install-gnulinux-without-any-cd-floppy.html' title='Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-201121863816288733</id><published>2007-10-18T02:38:00.000-07:00</published><updated>2007-10-18T03:29:18.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><title type='text'>System Security Monitor root access</title><content type='html'>Security of the server always come first , especially web server which access by the worldwide and hackers always keep eyes on those server's.&lt;br /&gt;So, its good if you have system which automatically send a email notification via email whenever someone logs in as root on your system.&lt;br /&gt;To configure the automatic email alert notification to a email address on each incident of root log on on the server, use the following guide.&lt;br /&gt;Login to the server via SSH using as root ID.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Ensure that you’re at home directory of root. The open up the .bash_profile for editing using pico or vi by typing one of the following commands at linux command shell:&lt;br /&gt;pico .bash_profilevi .bash_profile&lt;/li&gt;&lt;li&gt;Scroll down to the end of the file and add the following line:&lt;br /&gt;echo 'ALERT - Root Shell Access on:' `date` `who` mail -s "Alert: Root Access from `who cut -d"(" -f2 cut -d")" -f1`" user@example.com&lt;br /&gt;Replace user@email.com with the actual email account address that you want to the root access alert notification been sent to. Note that you can change the text contains in the email alert too. The text starting with first ALERT is written as email body, and you can add in other info such as host name or change the wordings. The second Alert is the email title which you can change to your own too. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Note that you can change the text contains in the email alert too. The text starting with first ALERT is written as email body, and you can add in other info such as host name or change the wordings. The second Alert is the email title which you can change to your own too. &lt;/p&gt;&lt;p&gt;Now logout and login again as root, you should receive an email alert at your inbox. The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-201121863816288733?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/201121863816288733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=201121863816288733' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/201121863816288733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/201121863816288733'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/10/system-security-monitor-root-access.html' title='System Security Monitor root access'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4667475485898287742</id><published>2007-09-15T01:53:00.000-07:00</published><updated>2007-09-15T02:09:34.651-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='trademark'/><title type='text'>Trademark Problem</title><content type='html'>I am Technical guy I am totally unaware of trademark related things.&lt;br /&gt;&lt;br /&gt;But you must be thinking in admin Linux blog I am talking about trademark what happen to this guy. Believe me I am not crazy.&lt;br /&gt;&lt;br /&gt;One day I got this comment:&lt;br /&gt;&lt;br /&gt;"&lt;br /&gt;Dear Mr. Kumar,Your "Open Hearts" header presents a bit of a problem for us as we hold the international trademark for "Open hearts. Open minds. Open doors." We ask you, kindly, to please remove this statement from your blog. If you have any questions, please contact us at &lt;a href="mailto:im@umcom.org"&gt;im@umcom.org&lt;/a&gt;. --The United Methodist Church.&lt;br /&gt;"&lt;br /&gt;&lt;br /&gt;"Open Hearts, Open Minds, Open Doors... Open Source" yes this Title Description is trademark to someone.&lt;br /&gt;&lt;br /&gt;Now just I reshuffled this and made it to “Open Minds, Open Hearts, Open Doors... Open Source"&lt;br /&gt;&lt;br /&gt;Hope this will not create any problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4667475485898287742?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4667475485898287742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4667475485898287742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4667475485898287742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4667475485898287742'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/09/trademark-problem.html' title='Trademark Problem'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8166613946180034149</id><published>2007-09-13T04:26:00.000-07:00</published><updated>2007-09-13T04:32:52.210-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><title type='text'>Backup strategy</title><content type='html'>Backup strategy:&lt;br /&gt;In computer world most important thing is DATA. No system can 100% secure or fault tolerance, so we always worry &amp; care about data.&lt;br /&gt;Various organization follows different back strategy. Like daily, weekly, monthly or yearly and at different levels.&lt;br /&gt;Once my CEO asked me to design the backup system, and then I study various backup system, algorithms and architectures.&lt;br /&gt;&lt;br /&gt;Then I come up with this backup architecture&lt;br /&gt;&lt;br /&gt;Level 0 - Hard disk backup using RAID -1 mirroring, its purpose is to use in the case of hardware failure.&lt;br /&gt;&lt;br /&gt;Level 1 – OS backup using rsnapshot. It is a file system backup utility based on rsyn, using rsnapshot; it is possible to take snapshots of your file systems at different points in time. Its purpose is to use in the case of OS failure.&lt;br /&gt;&lt;br /&gt;Level 2 – Application data backup on same data center using Rsync. Its purpose is to use in the case of application failure.&lt;br /&gt;&lt;br /&gt;Level 3 – Application data backup at remote location. Its purpose is to use in the case of data center failure.&lt;br /&gt;&lt;br /&gt;As you move from level – 0 to level -3, you have to take more revisions like hours 1, day 1, week 1, and year.&lt;br /&gt;&lt;br /&gt;I think this is quit good backup strategy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8166613946180034149?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8166613946180034149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8166613946180034149' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8166613946180034149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8166613946180034149'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/09/backup-strategy.html' title='Backup strategy'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-5101333158862793106</id><published>2007-06-25T02:57:00.000-07:00</published><updated>2007-06-25T03:10:08.645-07:00</updated><title type='text'>Xen : virtualization software</title><content type='html'>In my previous blog post I was talked about Virtualization.&lt;br /&gt;&lt;br /&gt;Now I am writting about &lt;a href="http://en.wikipedia.org/wiki/Xen"&gt;XEN&lt;/a&gt; , It is software that runs on a host operating system and allows one to run several guest operating systems on top of the host on the same computer hardware at the same time. Xen Software which enabling every server to support multiple virtual servers. It is the fastest and most secure virtualization software.&lt;br /&gt;&lt;br /&gt;In Xen virtualization, a thin software layer known as the Xen hypervisor ( &lt;em&gt;open source technology, developed collaboratively by the world’s best engineers at over 20 of the most innovative data center solution vendors, including Intel, AMD, Cisco, Dell, Egenera, HP, IBM, Mellanox, Network Appliance, Novell, Red Hat, SGI, Sun, Unisys, Veritas, Voltaire, and of course, XenSource &lt;/em&gt;) is inserted between the server’s hardware and the operating system.&lt;br /&gt;&lt;br /&gt;This provides an abstraction layer that allows each physical server to run one or more “virtual servers,” effectively decoupling the operating system and its applications from the underlying physical server.&lt;br /&gt;&lt;br /&gt;In CentOS-5 Its In build&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.centos.org/"&gt;http://www.centos.org/&lt;/a&gt;&lt;br /&gt;Some useful Link here&lt;br /&gt;&lt;a href="http://www.xensource.com/download/"&gt;http://www.xensource.com/download/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.xensource.com/media/xen/player.html"&gt;http://www.xensource.com/media/xen/player.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://bits.xensource.com/Xen/docs/user.pdf"&gt;http://bits.xensource.com/Xen/docs/user.pdf&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.linuxjournal.com/article/8540"&gt;http://www.linuxjournal.com/article/8540&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.xensource.com/xenwiki/XenIntro"&gt;http://wiki.xensource.com/xenwiki/XenIntro&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-5101333158862793106?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/5101333158862793106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=5101333158862793106' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5101333158862793106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/5101333158862793106'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/06/xen-virtualization-software.html' title='Xen : virtualization software'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-4641255173504113760</id><published>2007-04-27T22:41:00.000-07:00</published><updated>2007-04-27T23:06:56.983-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='virtualization'/><title type='text'>Virtualization : Basic Concepts</title><content type='html'>&lt;o:p&gt;&lt;/o:p&gt;&lt;a href="http://en.wikipedia.org/wiki/Virtualization"&gt;Virtualization&lt;/a&gt; is the creation of a virtual (rather than actual) version of something, such as an operating system, a server, a storage device or network resources.&lt;o:p&gt;&lt;/o:p&gt; e.g. hard drive into different partitions, a partition is the logical division of a hard disk drive to create, in effect, two separate hard drives.&lt;br /&gt;Similarly, Operating system virtualization is the use of software to allow a piece of hardware to run multiple operating system images at the same time.&lt;o:p&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;There are three areas of IT where virtualization is making head roads&lt;br /&gt;a) Network virtualization&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;b) Storage virtualization &lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;c) Server virtualization&lt;o:p&gt; &lt;/o:p&gt;    &lt;p class="MsoNormal"&gt;Today, virtualization is in the forefront - helping businesses with scalability, security and management of their global IT infrastructure.&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/p&gt;      &lt;p class="MsoNormal"&gt;Virtualization can host multiple guest operating systems. Each guest operating system runs in its own domain, Virtualization schedules virtual CPUs within the virtual machines to make the best use of the available physical CPUs. Each guest operating systems handles its own applications. These guest operating systems schedule each application accordingly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;You can deploy Virtualization in one of two choices: full virtualization or &lt;st1:place&gt;Para&lt;/st1:place&gt; virtualization.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;        &lt;p class="MsoNormal"&gt;Full virtualization provides total abstraction of the underlying physical system and creates a new virtual system in which the guest operating systems can run. No modifications are needed in the guest OS or application (the guest OS or application is not aware of the virtualized environment and runs normally). &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;st1:place&gt;Para&lt;/st1:place&gt; virtualization requires user modification of the guest operating systems that run on the virtual machines (these guest operating systems are aware that they are running on a virtual machine) and provide near-native performance.&lt;/p&gt;  &lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;To know  more on Virtualization:&lt;br /&gt;&lt;a href="http://searchservervirtualization.techtarget.com/sDefinition/0,,sid94_gci499539,00.html"&gt;&lt;span style="font-size:85%;"&gt;Intro to Virtualization,&lt;/span&gt;&lt;br /&gt;SearchServerVirtualization.com&lt;/a&gt;, &lt;a href="http://www.redhat.com/rhel/virtualization/"&gt;&lt;br /&gt;Red Hat Enterprise Linux Virtualization&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-4641255173504113760?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/4641255173504113760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=4641255173504113760' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4641255173504113760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/4641255173504113760'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/04/virtualization-basic-concepts.html' title='Virtualization : Basic Concepts'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8371277749663443308</id><published>2007-04-23T22:34:00.000-07:00</published><updated>2007-04-23T22:47:01.427-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><title type='text'>Change the default port for SSh user</title><content type='html'>Default port for SSH user is 22.  But we can change the default port to some another port.&lt;br /&gt;eg. I want to run ssh service on port 99 instead of 22.&lt;br /&gt;&lt;br /&gt;Make the following change.&lt;br /&gt;&lt;br /&gt;open files&lt;br /&gt;#emacs /etc/ssh/ssh_config&lt;br /&gt;#emacs /etc/ssh/sshd_config&lt;br /&gt;&lt;br /&gt;search for port ie is default  port = 22&lt;br /&gt;&lt;br /&gt;make port = 99&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;You can run on any port, But make sure other service not running on that port.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8371277749663443308?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8371277749663443308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8371277749663443308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8371277749663443308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8371277749663443308'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/04/change-default-port-for-ssh-user.html' title='Change the default port for SSh user'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-3574233885841423638</id><published>2007-04-19T02:17:00.000-07:00</published><updated>2007-04-19T02:42:50.587-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webmin'/><title type='text'>web Based administration solution for Linux : webmin</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Webmin"&gt;Webmin&lt;/a&gt; is an open source web Based administration solution for Linux. The purpose of webmin is to gather the administration of many different tasks and services under a common web interface. The software is perl based and module based which make it adaptable. Most common tasks have a module to administer.&lt;br /&gt;&lt;br /&gt;how To Install Webmin:&lt;br /&gt;# cd /usr/src&lt;br /&gt;# wget &lt;a href="http://prdownloads.sourceforge.net/webadmin/webmin-1.340-1.noarch.rpm" _base_href="https://i.grmtech.com/plugins/phpwiki/index.php/"&gt;http://prdownloads.sourceforge.net/webadmin/webmin-1.340-1.noarch.rpm&lt;/a&gt;&lt;br /&gt;# rpm -ivh webmin-1.340-1.noarch.rpm&lt;br /&gt;&lt;br /&gt;steps to install virtualmin &amp;amp; configure it:&lt;br /&gt;login to webmin: ipaddress:100000&lt;br /&gt;1) webmin -&gt; webmin configuration -&gt; webmin modulesInstall module -&gt; from ftp or http url -&gt;virtual min url is: &lt;a href="http://download.webmin.com/download/virtualmin/virtual-server-3.201.gpl.wbm.gz" _base_href="https://i.grmtech.com/plugins/phpwiki/index.php/"&gt;http://download.webmin.com/download/virtualmin/virtual-server-3.201.gpl.wbm.gz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) Enable https:yum install mod_sslin virtualmin config enable ssl for websites.&lt;br /&gt;Configuring virtualmin:Enabled the subverion and mysql moduledisabled webalizerPostgreSQL setup and configuration enabled? yes.&lt;br /&gt;&lt;br /&gt;3) If this server is going to use PGsqlPostfix configuration from webmin:servers-&gt;postfix-&gt;virtual domain-&gt;domain mapping lookup table: hash:/etc/postfix/virtual General options: Network interface for receiving mail: all [make sure that the hostname is something like sys.abc.comg is you are going to run the acb system here.]&lt;br /&gt;&lt;br /&gt;4) dovecot configuration from webmin:webmin -&gt; servers -&gt; dovecot -&gt; user login options -&gt; Password authentication source -&gt; unix shadow filestart at boot: yes&lt;br /&gt;&lt;br /&gt;5) Webmin -&gt; webmin configuration -&gt; Ports and addressesaccess the webmin system: and then configure the port (eg 100000) for webmin listen and udp packets.&lt;br /&gt;&lt;br /&gt;6) Webmin -&gt; webmin configuration -&gt; ssl encryptionAlso make webmin run on ssh.Enable SSL if available? yesRedirect non-SSL requests to SSL mode? yes&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-3574233885841423638?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/3574233885841423638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=3574233885841423638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3574233885841423638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3574233885841423638'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/04/webmin-is-open-source-web-based.html' title='web Based administration solution for Linux : webmin'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-8872527455766987458</id><published>2007-04-02T05:31:00.000-07:00</published><updated>2007-04-02T05:47:25.198-07:00</updated><title type='text'>Check your memory !</title><content type='html'>We all are always worry about memory weather it is main memory, secondary, or other swap&lt;br /&gt;These are few command which help u to debug your memory.&lt;br /&gt;&lt;br /&gt;Simple stat.&lt;br /&gt;#free&lt;br /&gt;#du -h&lt;br /&gt;#df -h&lt;br /&gt;&lt;br /&gt;Some complex stat.&lt;br /&gt;&lt;br /&gt;#cat /proc/meminfo&lt;br /&gt;#dmesg | grep -n kernel&lt;br /&gt;&lt;br /&gt;This command give you files have more than 100M usages.&lt;br /&gt;&lt;br /&gt;#find /     -size +100M -fprintf /root/big.txt  '%-10s %p\n'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-8872527455766987458?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/8872527455766987458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=8872527455766987458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8872527455766987458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/8872527455766987458'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/04/check-your-linux-memory.html' title='Check your memory !'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-3407717933835601410</id><published>2007-02-13T23:22:00.000-08:00</published><updated>2007-02-13T23:24:22.356-08:00</updated><title type='text'>find out all failed login attempts via ssh/telnet</title><content type='html'>how do I find out all failed login attempts via ssh/telnet?&lt;br /&gt;&lt;br /&gt;# grep "authentication failure" /var/log/messages|awk '{ print $13 }' | cut -b7- | sort | uniq -c&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-3407717933835601410?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/3407717933835601410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=3407717933835601410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3407717933835601410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/3407717933835601410'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/02/find-out-all-failed-login-attempts-via.html' title='find out all failed login attempts via ssh/telnet'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-117094007684516327</id><published>2007-02-08T05:07:00.000-08:00</published><updated>2007-02-08T05:07:58.083-08:00</updated><title type='text'>find command with examples</title><content type='html'>find command all we know but here u find some example,&lt;br /&gt;&lt;br /&gt;find . -name "rc.conf" -print  &lt;br /&gt;      This command will search in the current directory and all sub directories for a file named rc.conf.&lt;br /&gt;&lt;br /&gt;find /usr/src -not \( -name "*,v" -o -name ".*,v" \) '{}' \; -print &lt;br /&gt;      This command will search in the /usr/src directory and all sub directories. All files that are of the form '*,v' and '.*,v' are excluded. Important arguments to note are:&lt;br /&gt;&lt;br /&gt;    * -not means the negation of the expression that follows&lt;br /&gt;    * \( means the start of a complex expression.&lt;br /&gt;    * \) means the end of a complex expression.&lt;br /&gt;    * -o means a logical or of a complex expression.&lt;br /&gt;      In this case the complex expression is all files like '*,v' or '.*,v' &lt;br /&gt;&lt;br /&gt;The above example is shows how to select all file that are not part of the RCS system. This is important when you want go through a source tree and modify all the source files... but ... you don't want to affect the RCS version control files. &lt;br /&gt;&lt;br /&gt;find . -exec grep "www.athabasca" '{}' \; -print &lt;br /&gt;     This command will search in the current directory and all sub directories.&lt;br /&gt;&lt;br /&gt;find . -exec grep -q "www.athabasca" '{}' \; -print &lt;br /&gt;&lt;br /&gt;This command is very important for process a series of files that contain a specific string. You can then process each file appropriately. An example is find all html files with the string "www.athabascau.ca". You can then process the files with a sed script to change those occurrances of "www.athabascau.ca" with "intra.athabascau.ca"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-117094007684516327?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/117094007684516327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=117094007684516327' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/117094007684516327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/117094007684516327'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/02/find-command-with-examples.html' title='find command with examples'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116834329079222729</id><published>2007-01-09T03:38:00.000-08:00</published><updated>2007-01-09T03:48:13.640-08:00</updated><title type='text'>Recover Root Password of MYSQL</title><content type='html'>Step # 1 : Stop mysql service&lt;br /&gt;# /etc/init.d/mysql stop&lt;br /&gt;&lt;br /&gt;Step # 2: Start to MySQL server w/o password:&lt;br /&gt;# mysqld_safe --skip-grant-tables &amp;&lt;br /&gt;&lt;br /&gt;Step # 3: Connect to mysql server using mysql client:&lt;br /&gt;# mysql -u root&lt;br /&gt;&lt;br /&gt;Step # 4: Setup new MySQL root user password&lt;br /&gt;mysql&gt; use mysql;&lt;br /&gt;mysql&gt; update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';&lt;br /&gt;mysql&gt; flush privileges;&lt;br /&gt;mysql&gt; quit&lt;br /&gt;&lt;br /&gt;Step # 5: Stop MySQL Server:&lt;br /&gt;# /etc/init.d/mysql stop&lt;br /&gt;&lt;br /&gt;Step # 6: Start MySQL server and test it&lt;br /&gt;# /etc/init.d/mysql start&lt;br /&gt;# mysql -u root -p &lt;br /&gt;&lt;br /&gt;Enjoy ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116834329079222729?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116834329079222729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116834329079222729' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116834329079222729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116834329079222729'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/01/recover-root-password-of-mysql.html' title='Recover Root Password of MYSQL'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116832353396782334</id><published>2007-01-08T22:10:00.000-08:00</published><updated>2007-01-09T03:49:30.756-08:00</updated><title type='text'>Recover Root Password In Liunx Machine</title><content type='html'>Recover Root Password&lt;br /&gt;&lt;br /&gt;Probably the simplest way to solve a forgotten root password problem is to boot your system in the single-user mode.&lt;br /&gt;If you are using LILO, at the LILO boot prompt (graphical LILO users can press Ctrl-x to exit the graphical screen and go to the boot: prompt), and then enter:&lt;br /&gt;Code:&lt;br /&gt; linux single&lt;br /&gt;This will make you the "root" user without asking for a password. Once the system has booted, you can change the root password using the password command:&lt;br /&gt;Code:&lt;br /&gt;passwd&lt;br /&gt;GRUB users will follow basically the same steps, except that the GRUB boot loader doesn't have a default boot prompt, but you can choose "e'' when the menu displays to edit the boot parameters. Just select the kernel line for the kernel you want to boot. Go to the end of that line and type "single" as a separate word, then press ENTER to exit the edit mode. Once back at the GRUB screen, press "b" to boot into single user mode.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116832353396782334?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116832353396782334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116832353396782334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116832353396782334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116832353396782334'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/01/recover-root-password-in-liunx-machine.html' title='Recover Root Password In Liunx Machine'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116798827169365677</id><published>2007-01-05T00:58:00.000-08:00</published><updated>2007-01-16T18:54:33.216-08:00</updated><title type='text'>Backup of DataBase from MYSQL</title><content type='html'>Every database admin job is to take DB backup time to time.&lt;br /&gt;there is two method's i am using..&lt;br /&gt;Method 1st :&lt;br /&gt;mysqldump client is a backup program used to dump a database or a collection of databases for backup or transfer to another SQL server. The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump  can also be used to generate files in CSV, other delimited text, or XML format.&lt;br /&gt;&lt;br /&gt;The most common use of mysqldump is probably for making a backup of an entire database:&lt;br /&gt;shell&gt; mysqldump db_name &gt; backup-file.sql&lt;br /&gt;You can read the dump file back into the server like this:&lt;br /&gt;shell&gt; mysql db_name &lt; backup-file.sql&lt;br /&gt;&lt;br /&gt;Or like this:&lt;br /&gt;shell&gt; mysql -e "source /path-to-backup/backup-file.sql" db_name&lt;br /&gt;&lt;br /&gt;mysqldump is also very useful for populating databases by copying data from one MySQL server to another:&lt;br /&gt;shell&gt; mysqldump --opt db_name | mysql --host=remote_host -C db_name&lt;br /&gt;&lt;br /&gt;It is possible to dump several databases with one command:&lt;br /&gt;shell&gt; mysqldump --databases db_name1 [db_name2 ...] &gt; my_databases.sql&lt;br /&gt;&lt;br /&gt;To dump all databases, use the --all-databases option:&lt;br /&gt;shell&gt; mysqldump --all-databases &gt; all_databases.sql&lt;br /&gt;&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html"&gt;more u can read&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Method 2nd:&lt;br /&gt;find out where ur mysql sotre's the database generally default path will be:&lt;br /&gt;:var/lib/mysql this is datadir=var/lib/mysql which is mention in mysql configuration file.&lt;br /&gt;&lt;br /&gt;All the DB's u willfind on mysql dir, so u can copy the mysql dir.&lt;br /&gt;this kind of backup used when u want to uninstall and then again install with different version.&lt;br /&gt;simply move to other location mysql dir, and then copy that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116798827169365677?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116798827169365677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116798827169365677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116798827169365677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116798827169365677'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2007/01/backup-of-database-from-mysql.html' title='Backup of DataBase from MYSQL'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116719150218050379</id><published>2006-12-26T19:33:00.000-08:00</published><updated>2006-12-26T19:51:42.356-08:00</updated><title type='text'>rm and the 'Argument list too long'</title><content type='html'>you wanted to delete all the files in a directory that begins with the word 'temp' bala bala&lt;br /&gt;&lt;br /&gt;[prabhat@my-site]# rm temp*&lt;br /&gt;bash: /bin/rm: Argument list too long&lt;br /&gt;&lt;br /&gt;ERROR!&lt;br /&gt;This happens when you are trying to delete too many files in a directory at the same time - it seems rm has limits ....&lt;br /&gt;&lt;br /&gt;To solve the problem:&lt;br /&gt;&lt;br /&gt;Use 'find' to pipe all the matching files to 'rm', one at a time.&lt;br /&gt;[prabhat@my-site]# find . -name 'temp*' | xargs rm&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;[prabhat@my-site]# find . -name 'temp*' - print0 | xargs -0 rm -f&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116719150218050379?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116719150218050379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116719150218050379' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116719150218050379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116719150218050379'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/12/rm-and-argument-list-too-long.html' title='rm and the &apos;Argument list too long&apos;'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116644412407999947</id><published>2006-12-18T04:03:00.000-08:00</published><updated>2006-12-18T04:15:24.336-08:00</updated><title type='text'>Sort folders by size with one command</title><content type='html'>Entire user’s data is under /home, I need to have a list of all the sub folders sorted by the size of the sub folders.&lt;br /&gt;simple command to get the list of sub folders sorted by their size:&lt;br /&gt;du --max-depth=1 /home/ | sort -n -r&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116644412407999947?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116644412407999947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116644412407999947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116644412407999947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116644412407999947'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/12/sort-folders-by-size-with-one-command.html' title='Sort folders by size with one command'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116496303213413499</id><published>2006-12-01T00:47:00.000-08:00</published><updated>2006-12-01T00:50:32.593-08:00</updated><title type='text'>Zombie Process</title><content type='html'>A process can be sleeping in kernel code. Usually that's because of faulty hardware or a badly written driver- or maybe a little of both. A device that isn't set to the interrupt the driver thinks it is can cause this, for example- the driver is waiting for something its never going to get. The process doesn't ignore your signal- it just never gets it.&lt;br /&gt;A zombie process doesn't react to signals because it's not really a process at all- it's just what's left over after it died. What's supposed to happen is that its parent process was to issue a "wait()" to collect the information about its exit. If the parent doesn't (programming error or just bad programming), you get a zombie. The zombie will go away if its parent dies- it will be "adopted" by init which will do the wait()- so if you see one hanging about, check its parent; if it is init, it will be gone soon, if not the only recourse is to kill the parent..which you may or may not want to do.&lt;br /&gt;    * Finally, a process that is being traced (by a debugger, for example) won't react to the KILL either.&lt;br /&gt;&lt;br /&gt;We can find out zombie process by :-&lt;br /&gt;Use top or ps command:&lt;br /&gt;# top&lt;br /&gt;OR&lt;br /&gt;# ps aux | awk '{ print $8 " " $2 }' | grep -w Z&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How do I kill zombie process?&lt;br /&gt;You cannot kill zombies, as they are already dead. But if you have too many zombies then kill parent process or restart service.&lt;br /&gt;&lt;br /&gt;You can kill zombie process using PID obtained from any one of the above command. For example kill zombie proces having PID 4104:&lt;br /&gt;# kill -9 4104&lt;br /&gt;  *Please note that kill -9 does not guarantee to kill a zombie process &lt;br /&gt;&lt;br /&gt;How do I automate zombie process killing?&lt;br /&gt;Write a script and schedule as a cron job.&lt;br /&gt;for each in `ps jauxww | grep Z | grep -v PID | awk ‘{print $3}’`; do for every in `ps auxw | grep $each | grep cron | awk ‘{print $2}’`; do kill -9 $every; done; done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116496303213413499?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116496303213413499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116496303213413499' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116496303213413499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116496303213413499'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/12/zombie-process.html' title='Zombie Process'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116434942177937629</id><published>2006-11-23T22:19:00.000-08:00</published><updated>2006-11-23T22:30:56.436-08:00</updated><title type='text'>grep command : Finds text within a file</title><content type='html'>The grep command searches for the pattern specified by the Pattern parameter and writes each matching line to standard output.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Examples&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;0. $ grep '12.00' /home/prabhat/backup/log.txt&lt;br /&gt;       This command basically shows how you can use grep to extract lines containing  a particular string from a text file.&lt;br /&gt;1. To use a pattern that contains some of the pattern-matching characters *, ^, ?, [, ], \(, \), \{, and \}, enter:&lt;br /&gt;      grep  "^[a-zA-Z]"  pgm.s &lt;br /&gt;      This displays every line in pgm.s whose first character is a letter.&lt;br /&gt;&lt;br /&gt;2. To display all lines that do not match a pattern, enter:&lt;br /&gt;      grep -v "^#" pgm.s&lt;br /&gt;      This displays every line in pgm.s whose first character is not a # (pound sign).&lt;br /&gt;&lt;br /&gt;3. To display all lines in the file1 file that match either the abc or xyz string, enter:&lt;br /&gt;      grep -E "abc|xyz" file1&lt;br /&gt;&lt;br /&gt;4. To search for a $ (dollar sign) in the file named test2, enter:&lt;br /&gt;      grep \\$ test2&lt;br /&gt;                     The \\ (double backslash) characters are necessary in order to force the shell to pass a \$ (single backslash, dollar sign) to the grep command. The \ (single backslash) character tells the grep command to treat the following character (in this example the $) as a literal character rather than an expression character. Use the fgrep command to avoid the necessity of using escape characters such as the backslash. &lt;br /&gt;&lt;br /&gt;^ - match at the beginning of the line&lt;br /&gt;$ - match at the end of the line&lt;br /&gt;&lt;br /&gt;Some extra options for grep&lt;br /&gt;-v&lt;br /&gt;Reverses the normal behavior of the grep command - Instead of selecting lines, it rejects the lines that match the given criteria.&lt;br /&gt;-c&lt;br /&gt;It suppresses the normal output and only prints the total count of matching lines instead of the actual lines.&lt;br /&gt;-i&lt;br /&gt;Ignores the case of the text when matching the given pattern.&lt;br /&gt;-w&lt;br /&gt;Checks if the given pattern is a word by itself and not a part of another word. Thus if you search for 'bay' and the word 'baywatch' is present in a file, the particular line containing that word would not be returned in the result.&lt;br /&gt;-l&lt;br /&gt;Only gives the names of the files in which the given pattern was found.&lt;br /&gt;-r&lt;br /&gt;Checks for the given pattern , recursively within the directory that you specify after the -r option&lt;br /&gt;&lt;br /&gt;know more &lt;br /&gt;&lt;a href="http://www.computerhope.com/unix/ugrep.htm"&gt;http://www.computerhope.com/unix/ugrep.htm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://linux.about.com/od/commands/l/blcmdl1_grep.htm"&gt;http://linux.about.com/od/commands/l/blcmdl1_grep.htm&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.lowfatlinux.com/linux-grep-manual.html"&gt;http://www.lowfatlinux.com/linux-grep-manual.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116434942177937629?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116434942177937629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116434942177937629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116434942177937629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116434942177937629'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/11/grep-command-finds-text-within-file.html' title='grep command : Finds text within a file'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116426113563445339</id><published>2006-11-22T21:45:00.000-08:00</published><updated>2006-11-23T02:56:02.580-08:00</updated><title type='text'>yum :  Yellow dog Updater, Modified</title><content type='html'>&lt;span style="font-weight:bold;"&gt;automated software installation and update for linux&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;yum is software installation tool for Red hat linux and Fedora Linux. It is a complete software management system. yum is designed to use over network/internet. It does not use CDROM to install packages. If you are using fedora you don't have to install it, it is part of fedora itself. &lt;br /&gt;&lt;br /&gt;In the case u don't have yum, then u can download yum from project home page http://linux.duke.edu/projects/yum/download.ptml &lt;br /&gt;u can Install using.(it is avaliable in rmp)&lt;br /&gt;# rpm -ivh yup* &lt;br /&gt;U can Configure yum editing /etc/yum.conf&lt;br /&gt;# emacs /etc/yum.conf&lt;br /&gt;Append or edit code as follows:&lt;br /&gt;[base]&lt;br /&gt;name=Fedora Core $releasever - $basearch - Base&lt;br /&gt;baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag&lt;br /&gt;baseurl=http://mirrors.kernel.org/fedora/core/$releasever/$basearch/os&lt;br /&gt;Install GPG signature key with rpm command:&lt;br /&gt;# rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt&lt;br /&gt; and other keys too (if any using above command)&lt;br /&gt;Update your package list: &lt;br /&gt;# yum check-update &lt;br /&gt;Install a new package called test&lt;br /&gt;# yum install test&lt;br /&gt;To update packages&lt;br /&gt;# yum update &lt;br /&gt;To update a single package called test1&lt;br /&gt;# yum update test1&lt;br /&gt;To remove a package called test2&lt;br /&gt;# yum remove test2&lt;br /&gt;To list all packages&lt;br /&gt;# yum list installed   &lt;br /&gt;You can search using grep command&lt;br /&gt;# yum list installed | grep test1&lt;br /&gt;Display information on a package called test&lt;br /&gt;# yum info test &lt;br /&gt;To display list of packages for which updates are available&lt;br /&gt;# yum list updates &lt;br /&gt;To clean all cahced packages:&lt;br /&gt;# yum clean packages&lt;br /&gt;To remove all cached packages and old headers:&lt;br /&gt;# yum clean all&lt;br /&gt;Force a fresh download of package&lt;br /&gt;yum clean headers&lt;br /&gt;yum clean oldheaders &lt;br /&gt;To Know more visit :&lt;br /&gt;&lt;a  href="http://www.die.net/doc/linux/man/man5/yum.conf.5.html"&gt;http://www.die.net/doc/linux/man/man5/yum.conf.5.html &lt;a href="http://www.linuxcommand.org/man_pages/yum8.html"&gt;http://www.linuxcommand.org/man_pages/yum8.html&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.linuxmanpages.com/man8/yum.8.php"&gt;http://www.linuxmanpages.com/man8/yum.8.php&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116426113563445339?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116426113563445339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116426113563445339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116426113563445339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116426113563445339'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/11/yum-yellow-dog-updater-modified.html' title='yum :  Yellow dog Updater, Modified'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116367418064384015</id><published>2006-11-16T02:45:00.000-08:00</published><updated>2006-11-16T02:49:41.056-08:00</updated><title type='text'>Did u know how many virtual web site's ?</title><content type='html'>Following command show how many virtual web site's running on ur server.&lt;br /&gt;&lt;br /&gt;httpd  -t -D DUMP_VHOSTS&lt;br /&gt;or&lt;br /&gt;apache2  -t -D DUMP_VHOSTS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116367418064384015?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116367418064384015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116367418064384015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116367418064384015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116367418064384015'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/11/did-u-know-how-many-virtual-web-sites.html' title='Did u know how many virtual web site&apos;s ?'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116324267769447260</id><published>2006-11-11T02:55:00.000-08:00</published><updated>2006-11-11T02:57:57.850-08:00</updated><title type='text'>How to keep a computer from answering to ping?</title><content type='html'>it is possible to block pings entirely to your machine..&lt;br /&gt;&lt;br /&gt;a simple &lt;br /&gt;"echo 1 &gt; /proc/sys/net/ipv4/icmp_echo_ignore_all" will do the trick... &lt;br /&gt;&lt;br /&gt;to turn it back on, simply&lt;br /&gt;"echo 0 &gt; /proc/sys/net/ipv4/icmp_echo_ignore_all"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116324267769447260?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116324267769447260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116324267769447260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116324267769447260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116324267769447260'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/11/how-to-keep-computer-from-answering-to.html' title='How to keep a computer from answering to ping?'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116203507328391523</id><published>2006-10-28T04:30:00.000-07:00</published><updated>2006-10-28T04:31:13.380-07:00</updated><title type='text'>How to do backup with tar?</title><content type='html'>You can mantain a list of files that you with to backup into a file and tar&lt;br /&gt;it when you wish.&lt;br /&gt;&lt;br /&gt;tar czvf tarfile.tar.gz -T list_file&lt;br /&gt;&lt;br /&gt;where list_file is a simple list of what you want to include into the tar&lt;br /&gt;&lt;br /&gt;i.e:&lt;br /&gt;&lt;br /&gt;/etc/smb.conf&lt;br /&gt;/root/myfile&lt;br /&gt;/etc/ppp                (all files into the /etc/ppp directory)&lt;br /&gt;/opt/gnome/html/gnome-dev-info.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116203507328391523?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116203507328391523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116203507328391523' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116203507328391523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116203507328391523'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/10/how-to-do-backup-with-tar.html' title='How to do backup with tar?'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-116203462171388222</id><published>2006-10-28T04:22:00.000-07:00</published><updated>2006-10-28T04:30:02.303-07:00</updated><title type='text'>How to remove a file with a dash as first character?</title><content type='html'>If you accidentally created a file with a - in the beginning then you want to&lt;br /&gt;remove it, you have to do :&lt;br /&gt; rm ./-thefile&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-116203462171388222?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/116203462171388222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=116203462171388222' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116203462171388222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/116203462171388222'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/10/how-to-remove-file-with-dash-as-first.html' title='How to remove a file with a dash as first character?'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-115926047190589200</id><published>2006-09-26T01:47:00.000-07:00</published><updated>2006-09-26T01:47:56.430-07:00</updated><title type='text'>Secure Deletion of Data from Magnetic and Solid-State Memory</title><content type='html'>Secure Deletion of Data from Magnetic and Solid-State Memory&lt;br /&gt;&lt;br /&gt;`shred': Remove files more securely&lt;br /&gt;&lt;br /&gt;`shred' overwrites devices or files, to help prevent even very&lt;br /&gt;expensive hardware from recovering the data.&lt;br /&gt;&lt;br /&gt;   Ordinarily when you remove a file (*note rm invocation::), the data&lt;br /&gt;is not actually destroyed.  Only the index listing where the file is&lt;br /&gt;stored is destroyed, and the storage is made available for reuse.&lt;br /&gt;There are undelete utilities that will attempt to reconstruct the index&lt;br /&gt;and can bring the file back if the parts were not reused.&lt;br /&gt;On a busy system with a nearly-full drive, space can get reused in a&lt;br /&gt;few seconds.  But there is no way to know for sure.  If you have&lt;br /&gt;sensitive data, you may want to be sure that recovery is not possible&lt;br /&gt;by actually overwriting the file with non-sensitive data.&lt;br /&gt;&lt;br /&gt;The best way to remove something irretrievably is to destroy the&lt;br /&gt;media it's on with acid, melt it down, or the like.  For cheap&lt;br /&gt;removable media like floppy disks, this is the preferred method.&lt;br /&gt;However, hard drives are expensive and hard to melt, so the `shred'&lt;br /&gt;utility tries to achieve a similar effect non-destructively.&lt;br /&gt;&lt;br /&gt;`Secure Deletion of Data from Magnetic and Solid-State Memory', from the&lt;br /&gt;proceedings of the Sixth USENIX Security Symposium (San Jose,&lt;br /&gt;California, 22-25 July, 1996).&lt;br /&gt;visit: http://www.cs.auckland.ac.nz/~pgut001/pubs/secure_del.html&lt;br /&gt;&lt;br /&gt;So. `shred' a linux command : Remove files more securely&lt;br /&gt;&lt;br /&gt;shred [OPTION]... FILE[...]&lt;br /&gt;&lt;br /&gt;   look man page how to use..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-115926047190589200?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/115926047190589200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=115926047190589200' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115926047190589200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115926047190589200'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/09/secure-deletion-of-data-from-magnetic_26.html' title='Secure Deletion of Data from Magnetic and Solid-State Memory'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-115924973379676750</id><published>2006-09-25T22:48:00.000-07:00</published><updated>2006-09-25T23:01:24.496-07:00</updated><title type='text'>Danger of 'Ctrl+C' on the Web</title><content type='html'>We do copy various data by ctrl+c for pasting elsewhere. This copied data is stored in clipboard and is accessible from the net by a combination of Javascripts and ASP.&lt;br /&gt;&lt;br /&gt;Just try this:&lt;br /&gt;1) Copy any text by 'ctrl+c'&lt;br /&gt;2) Click the Link: www.sourcecodesworld.com/special/clipboard.asp&lt;br /&gt;You will see the text you copied on the Screen which was accessed by this web page. (Check it out !!)&lt;br /&gt;&lt;br /&gt;Do not keep sensitive data (like passwords, reditcard numbers, PIN etc.) in the clipboard while surfing the web. It is extremely easy to extract the text stored in the clipboard to steal your sensitive information.&lt;br /&gt;&lt;br /&gt;Be cautious ...&lt;br /&gt;&lt;br /&gt;To avoid Clipboard Hack Problem, do the following:&lt;br /&gt;1) In Internet Explorer, Go to Tools -&gt; Internet options -&gt; Security&lt;br /&gt;2) Press Custom level.&lt;br /&gt;3) In the security settings, select disable under Allow paste operations via script and click on 'OK. (Now the contents of your clipboard are safe.)&lt;br /&gt;It doesn't work on firefox.&lt;br /&gt;Happy Surfing......&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-115924973379676750?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/115924973379676750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=115924973379676750' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115924973379676750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115924973379676750'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/09/danger-of-ctrlc-on-web_25.html' title='Danger of &apos;Ctrl+C&apos; on the Web'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-115898690576117112</id><published>2006-09-22T21:48:00.000-07:00</published><updated>2006-09-22T21:48:25.900-07:00</updated><title type='text'>Recover from rm</title><content type='html'>In order to undelete a file, you must know the following things:&lt;br /&gt;• On which device your file was stored &lt;br /&gt;• What kind of file system was used (eg. ext2, reiserFS, vfat) &lt;br /&gt;To find it out, type 'mount | column -t'&lt;br /&gt;&lt;br /&gt;Or&lt;br /&gt;echo "DEVICE DIRECTORY FS-TYPE" &gt; tmp; mount | cut -d" " -f1,3,5 | sort &gt;&gt; tmp; cat tmp | column -t | sed -e "1s/.*/`tput smso`&amp;`tput rmso`/"&lt;br /&gt;&lt;br /&gt;The output should be something like this:&lt;br /&gt;&lt;br /&gt;bash$ mount | column -t&lt;br /&gt;/dev/hda5  on  /               type  ext2      (rw)&lt;br /&gt;proc       on  /proc           type  proc      (rw)&lt;br /&gt;usbdevfs   on  /proc/bus/usb   type  usbdevfs  (rw)&lt;br /&gt;devpts     on  /dev/pts        type  devpts    (rw)&lt;br /&gt;/dev/hda1  on  /mnt/windows/C  type  vfat      (rw,noexec,nosuid,nodev)&lt;br /&gt;/dev/hda6  on  /mnt/windows/E  type  vfat      (rw,noexec,nosuid,nodev)&lt;br /&gt;/dev/hdc5  on  /mnt/oldwin     type  vfat      (rw,noexec,nosuid,nodev)&lt;br /&gt;&lt;br /&gt;Now, of which (printed) directory was the directory of your deleted file a subdirectory? E.g. if your file was stored on /home/user , you'll have to look for '/', since no closer match can be found. Found it? Cool, right now it's a piece of cake to find the device on which the file was stored and the filesystem type of the device.&lt;br /&gt;&lt;br /&gt;If you really need to undelete a file, that's the way to do it:&lt;br /&gt;grep -a -B[size before] -A[size after] 'text' /dev/[your_partition]&lt;br /&gt;Replace [size before], [size after] and [your_partition] with something meaningfull. Don't know what your partition is? Read the Linux undelete&lt;br /&gt;.g.: If you want to undelete a letter (+- 200 lines) starting with "Hi mum" which was stored on /dev/hda1 you can try: &lt;br /&gt;grep -a -B2 -A200 "Hi mum" /dev/hda1&lt;br /&gt;Make sure you do this as root (System administrator)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-115898690576117112?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/115898690576117112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=115898690576117112' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115898690576117112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115898690576117112'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/09/recover-from-rm.html' title='Recover from rm'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-115898670355887211</id><published>2006-09-22T21:44:00.000-07:00</published><updated>2006-09-22T21:45:03.700-07:00</updated><title type='text'>Proxy server types and uses for HTTP Server</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Proxy server&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In an enterprise that uses the Internet, a proxy server is a server that acts as an intermediary between a workstation user and the Internet so that the enterprise can ensure security, administrative control, and caching service. A proxy server is associated with or part of a gateway server that separates the enterprise network from the outside network and a firewall server that protects the enterprise network from outside intrusion.&lt;br /&gt;&lt;br /&gt;Proxy servers receive requests intended for other servers and then act to fulfill, forward, redirect, or reject the requests. Exactly which service is carried out for a particular request is based on a number of factors which include: the proxy server's capabilities, what is requested, information contained in the request, where the request came from, the intended destination, and in some cases, who sent the request. &lt;br /&gt;&lt;br /&gt;An advantage of a proxy server is that its cache can serve all users. If one or more Internet sites are frequently requested, these are likely to be in the proxy's cache, which will improve user response time. In fact, there are special servers called cache servers. A proxy can also do logging.&lt;br /&gt;&lt;br /&gt;HTTP Server (powered by Apache) has proxy server capabilities built in. Activating these services is simply a matter of configuration. This topic explains three common proxy concepts: forward proxy, reverse proxy, and proxy chaining.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Forward proxy :&lt;/span&gt;&lt;br /&gt;A forward proxy is the most common form of a proxy server and is generally used to pass requests from an isolated, private network to the Internet through a firewall. Using a forward proxy, requests from an isolated network, or intranet, can be rejected or allowed to pass through a firewall. Requests may also be fulfilled by serving from cache rather than passing through the Internet. This allows a level of network security and lessens network traffic. &lt;br /&gt;A forward proxy server will first check to make sure a request is valid. If a request is not valid, or not allowed (blocked by the proxy), it will reject the request resulting in the client receiving an error or a redirect. If a request is valid, a forward proxy may check if the requested information is cached. If it is, the forward proxy serves the cached information. If it is not, the request is sent through a firewall to an actual content server which serves the information to the forward proxy. The proxy, in turn, relays this information to the client and may also cache it, for future requests. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Reverse proxy&lt;/span&gt;&lt;br /&gt;A reverse proxy is another common form of a proxy server and is generally used to pass requests from the Internet, through a firewall to isolated, private networks. It is used to prevent Internet clients from having direct, unmonitored access to sensitive data residing on content servers on an isolated network, or intranet. If caching is enabled, a reverse proxy can also lessen network traffic by serving cached information rather than passing all requests to actual content servers. Reverse proxy servers may also balance workload by spreading requests across a number of content servers. One advantage of using a reverse proxy is that Internet clients do not know their requests are being sent to and handled by a reverse proxy server. This allows a reverse proxy to redirect or reject requests without making Internet clients aware of the actual content server (or servers) on a protected network. &lt;br /&gt;A reverse proxy server will first check to make sure a request is valid. If a request is not valid, or not allowed (blocked by the proxy), it will not continue to process the request resulting in the client receiving an error or a redirect. If a request is valid, a reverse proxy may check if the requested information is cached. If it is, the reverse proxy serves the cached information. If it is not, the reverse proxy will request the information from the content server and serve it to the requesting client. It also caches the information for future requests.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Proxy chaining&lt;/span&gt;&lt;br /&gt;A proxy chain uses two or more proxy servers to assist in server and protocol performance and network security. Proxy chaining is not a type of proxy, but a use of reverse and forward proxy servers across multiple networks. In addition to the benefits to security and performance, proxy chaining allows requests from different protocols to be fulfilled in cases where, without chaining, such requests would not be possible or permitted. For example, a request using HTTP is sent to a server that can only handle FTP requests. In order for the request to be processed, it must pass through a server that can handle both protocols. This can be accomplished by making use of proxy chaining which allows the request to be passed from a server that is not able to fulfill such a request (perhaps due to security or networking issues, or its own limited capabilities) to a server that can fulfill such a request. &lt;br /&gt;The first proxy server in a chain will check to make sure a request is valid. If a request is not valid, or not allowed (blocked by the proxy), it will reject the request resulting in the client receiving an error or a redirect. If a request is valid, the proxy may check if the requested information is cached and simply serve it from there. If the requested information is not in cache, the proxy will pass the request on to the next proxy server in the chain. This server also has the ability to fulfill, forward, redirect, or reject the request. If it acts to forward the request then it too passes the request on to yet another proxy server. This process is repeated until the request reaches the last proxy server in the chain. The last server in the chain is required to handle the request by contacting the content server, using whatever protocol is required, to obtain the information. The information is then relayed back through the chain until it reaches the requesting client.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;The Squid web caching proxy server &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Users configure their web browsers to use the Squid proxy server instead of going to the web directly. The Squid server then checks its web cache for the web information requested by the user. It will return any matching information that finds in its cache, and if not, it will go to the web to find it on behalf of the user. Once it finds the information, it will populate its cache with it and also forward it to the user's web browser. &lt;br /&gt;As you can see, this reduces the amount of data accessed from the web. Another advantage is that you can configure your firewall to only accept HTTP web traffic from the Squid server and no one else. Squid can then be configured to request usernames and passwords for each user that users its services. This provides simple access control to the Internet&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-115898670355887211?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/115898670355887211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=115898670355887211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115898670355887211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115898670355887211'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/09/proxy-server-types-and-use_115898670355887211.html' title='Proxy server types and uses for HTTP Server'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-115381554293958061</id><published>2006-07-25T01:15:00.000-07:00</published><updated>2006-07-25T01:25:06.916-07:00</updated><title type='text'>Some administration commands</title><content type='html'>cat /var/log/secure&lt;br /&gt;(as root) Inspect the important system log. It is really a good idea to do it from time to time if you use Internet access.&lt;br /&gt;&lt;br /&gt;watch -n 60 my_command&lt;br /&gt;Execute my_command repeatedly at 60-second intervals (the default interval is 2 seconds).&lt;br /&gt;&lt;br /&gt;more u can access.&lt;br /&gt;&lt;a href="http://linux.about.com/od/linux101/l/blnewbie5_12.htm"&gt;http://linux.about.com/od/linux101/l/blnewbie5_12.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-115381554293958061?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/115381554293958061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=115381554293958061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115381554293958061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115381554293958061'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/07/some-administration-commands.html' title='Some administration commands'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31620939.post-115381506143836978</id><published>2006-07-25T01:08:00.000-07:00</published><updated>2006-07-25T01:19:57.726-07:00</updated><title type='text'>Admin Unix</title><content type='html'>This blog for System Administrator of UNIX/LINUX.&lt;br /&gt;This wll help u in Technical and Non- Technical Aspect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31620939-115381506143836978?l=adminlinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://adminlinux.blogspot.com/feeds/115381506143836978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=31620939&amp;postID=115381506143836978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115381506143836978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31620939/posts/default/115381506143836978'/><link rel='alternate' type='text/html' href='http://adminlinux.blogspot.com/2006/07/admin-unix.html' title='Admin Unix'/><author><name>Prabhat Kumar</name><uri>http://www.blogger.com/profile/05143104910338701470</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp0.blogger.com/_NLkmGwwWuto/SAsLYKDv12I/AAAAAAAAAAM/pduVZ0uU0lM/S220/06112007387.jpg'/></author><thr:total>0</thr:total></entry></feed>
