<?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-1122127822293845269</id><updated>2012-01-02T04:02:36.720-08:00</updated><title type='text'>hosting... servers... solutions... on LINUX      |    Nazeem's Blog</title><subtitle type='html'>You Can find here the tips that was the most useful for server administration in Linux</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-6176801590104038870</id><published>2010-08-18T14:44:00.001-07:00</published><updated>2010-08-18T14:45:33.485-07:00</updated><title type='text'>MySQL Commands</title><content type='html'>This is a list of handy MySQL commands that I use time and time again. At the bottom are statements, clauses, and functions you can use in MySQL. Below that are PHP and Perl API functions you can use to interface with MySQL. To use those you will need to build PHP with MySQL functionality. To use MySQL with Perl you will need to use the Perl modules DBI and DBD::mysql.&lt;br /&gt;&lt;br /&gt;Below when you see # it means from the unix shell. When you see mysql&gt; it means from a MySQL prompt after logging into MySQL.&lt;br /&gt;&lt;br /&gt;To login (from unix shell) use -h only if needed.&lt;br /&gt;&lt;br /&gt;# [mysql dir]/bin/mysql -h hostname -u root -p&lt;br /&gt;&lt;br /&gt;Create a database on the sql server.&lt;br /&gt;&lt;br /&gt;mysql&gt; create database [databasename];&lt;br /&gt;&lt;br /&gt;List all databases on the sql server.&lt;br /&gt;&lt;br /&gt;mysql&gt; show databases;&lt;br /&gt;&lt;br /&gt;Switch to a database.&lt;br /&gt;&lt;br /&gt;mysql&gt; use [db name];&lt;br /&gt;&lt;br /&gt;To see all the tables in the db.&lt;br /&gt;&lt;br /&gt;mysql&gt; show tables;&lt;br /&gt;&lt;br /&gt;To see database's field formats.&lt;br /&gt;&lt;br /&gt;mysql&gt; describe [table name];&lt;br /&gt;&lt;br /&gt;To delete a db.&lt;br /&gt;&lt;br /&gt;mysql&gt; drop database [database name];&lt;br /&gt;&lt;br /&gt;To delete a table.&lt;br /&gt;&lt;br /&gt;mysql&gt; drop table [table name];&lt;br /&gt;&lt;br /&gt;Show all data in a table.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM [table name];&lt;br /&gt;&lt;br /&gt;Returns the columns and column information pertaining to the designated table.&lt;br /&gt;&lt;br /&gt;mysql&gt; show columns from [table name];&lt;br /&gt;&lt;br /&gt;Show certain selected rows with the value "whatever".&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM [table name] WHERE [field name] = "whatever";&lt;br /&gt;&lt;br /&gt;Show all records containing the name "Bob" AND the phone number '3444444'.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';&lt;br /&gt;&lt;br /&gt;Show all records not containing the name "Bob" AND the phone number '3444444' order by the phone_number field.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;&lt;br /&gt;&lt;br /&gt;Show all records starting with the letters 'bob' AND the phone number '3444444'.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';&lt;br /&gt;&lt;br /&gt;Show all records starting with the letters 'bob' AND the phone number '3444444' limit to records 1 through 5.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444' limit 1,5;&lt;br /&gt;&lt;br /&gt;Use a regular expression to find records. Use "REGEXP BINARY" to force case-sensitivity. This finds any record beginning with a.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT * FROM [table name] WHERE rec RLIKE "^a";&lt;br /&gt;&lt;br /&gt;Show unique records.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT DISTINCT [column name] FROM [table name];&lt;br /&gt;&lt;br /&gt;Show selected records sorted in an ascending (asc) or descending (desc).&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;&lt;br /&gt;&lt;br /&gt;Return number of rows.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT COUNT(*) FROM [table name];&lt;br /&gt;&lt;br /&gt;Sum column.&lt;br /&gt;&lt;br /&gt;mysql&gt; SELECT SUM(*) FROM [table name];&lt;br /&gt;&lt;br /&gt;Join tables on common columns.&lt;br /&gt;&lt;br /&gt;mysql&gt; select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on lookup.personid=person.personid=statement to join birthday in person table with primary illustration id;&lt;br /&gt;&lt;br /&gt;Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.&lt;br /&gt;&lt;br /&gt;# mysql -u root -p&lt;br /&gt;mysql&gt; use mysql;&lt;br /&gt;mysql&gt; INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password'));&lt;br /&gt;mysql&gt; flush privileges;&lt;br /&gt;&lt;br /&gt;Change a users password from unix shell.&lt;br /&gt;&lt;br /&gt;# [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password 'new-password'&lt;br /&gt;&lt;br /&gt;Change a users password from MySQL prompt. Login as root. Set the password. Update privs.&lt;br /&gt;&lt;br /&gt;# mysql -u root -p&lt;br /&gt;mysql&gt; SET PASSWORD FOR 'user'@'hostname' = PASSWORD('passwordhere');&lt;br /&gt;mysql&gt; flush privileges;&lt;br /&gt;&lt;br /&gt;Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.&lt;br /&gt;&lt;br /&gt;# /etc/init.d/mysql stop&lt;br /&gt;# mysqld_safe --skip-grant-tables &amp;&lt;br /&gt;# mysql -u root&lt;br /&gt;mysql&gt; use mysql;&lt;br /&gt;mysql&gt; update user set password=PASSWORD("newrootpassword") where User='root';&lt;br /&gt;mysql&gt; flush privileges;&lt;br /&gt;mysql&gt; quit&lt;br /&gt;# /etc/init.d/mysql stop&lt;br /&gt;# /etc/init.d/mysql start&lt;br /&gt;Set a root password if there is on root password.&lt;br /&gt;&lt;br /&gt;# mysqladmin -u root password newpassword&lt;br /&gt;&lt;br /&gt;Update a root password.&lt;br /&gt;&lt;br /&gt;# mysqladmin -u root -p oldpassword newpassword&lt;br /&gt;&lt;br /&gt;Allow the user "bob" to connect to the server from localhost using the password "passwd". Login as root. Switch to the MySQL db. Give privs. Update privs.&lt;br /&gt;&lt;br /&gt;# mysql -u root -p&lt;br /&gt;mysql&gt; use mysql;&lt;br /&gt;mysql&gt; grant usage on *.* to bob@localhost identified by 'passwd';&lt;br /&gt;mysql&gt; flush privileges;&lt;br /&gt;&lt;br /&gt;Give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs.&lt;br /&gt;&lt;br /&gt;# mysql -u root -p&lt;br /&gt;mysql&gt; use mysql;&lt;br /&gt;mysql&gt; INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES ('%','databasename','username','Y','Y','Y','Y','Y','N');&lt;br /&gt;mysql&gt; flush privileges; &lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;mysql&gt; grant all privileges on databasename.* to username@localhost;&lt;br /&gt;mysql&gt; flush privileges;&lt;br /&gt;&lt;br /&gt;To update info already in a table.&lt;br /&gt;&lt;br /&gt;mysql&gt; UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';&lt;br /&gt;&lt;br /&gt;Delete a row(s) from a table.&lt;br /&gt;&lt;br /&gt;mysql&gt; DELETE from [table name] where [field name] = 'whatever';&lt;br /&gt;&lt;br /&gt;Update database permissions/privilages.&lt;br /&gt;&lt;br /&gt;mysql&gt; flush privileges;&lt;br /&gt;&lt;br /&gt;Delete a column.&lt;br /&gt;&lt;br /&gt;mysql&gt; alter table [table name] drop column [column name];&lt;br /&gt;&lt;br /&gt;Add a new column to db.&lt;br /&gt;&lt;br /&gt;mysql&gt; alter table [table name] add column [new column name] varchar (20);&lt;br /&gt;&lt;br /&gt;Change column name.&lt;br /&gt;&lt;br /&gt;mysql&gt; alter table [table name] change [old column name] [new column name] varchar (50);&lt;br /&gt;&lt;br /&gt;Make a unique column so you get no dupes.&lt;br /&gt;&lt;br /&gt;mysql&gt; alter table [table name] add unique ([column name]);&lt;br /&gt;&lt;br /&gt;Make a column bigger.&lt;br /&gt;&lt;br /&gt;mysql&gt; alter table [table name] modify [column name] VARCHAR(3);&lt;br /&gt;&lt;br /&gt;Delete unique from table.&lt;br /&gt;&lt;br /&gt;mysql&gt; alter table [table name] drop index [colmn name];&lt;br /&gt;&lt;br /&gt;Load a CSV file into a table.&lt;br /&gt;&lt;br /&gt;mysql&gt; LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3);&lt;br /&gt;&lt;br /&gt;Dump all databases for backup. Backup file is sql commands to recreate all db's.&lt;br /&gt;&lt;br /&gt;# [mysql dir]/bin/mysqldump -u root -ppassword --opt &gt;/tmp/alldatabases.sql&lt;br /&gt;&lt;br /&gt;Dump one database for backup.&lt;br /&gt;&lt;br /&gt;# [mysql dir]/bin/mysqldump -u username -ppassword --databases databasename &gt;/tmp/databasename.sql&lt;br /&gt;&lt;br /&gt;Dump a table from a database.&lt;br /&gt;&lt;br /&gt;# [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename &gt; /tmp/databasename.tablename.sql&lt;br /&gt;&lt;br /&gt;Restore database (or database table) from backup.&lt;br /&gt;&lt;br /&gt;# [mysql dir]/bin/mysql -u username -ppassword databasename &lt; /tmp/databasename.sql&lt;br /&gt;&lt;br /&gt;Create Table Example 1.&lt;br /&gt;&lt;br /&gt;mysql&gt; CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));&lt;br /&gt;&lt;br /&gt;Create Table Example 2.&lt;br /&gt;&lt;br /&gt;mysql&gt; create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default 'bato');&lt;br /&gt;&lt;br /&gt;MYSQL Statements and clauses&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ALTER DATABASE&lt;br /&gt;&lt;br /&gt;ALTER TABLE&lt;br /&gt;&lt;br /&gt;ALTER VIEW&lt;br /&gt;&lt;br /&gt;ANALYZE TABLE&lt;br /&gt;&lt;br /&gt;BACKUP TABLE&lt;br /&gt;&lt;br /&gt;CACHE INDEX&lt;br /&gt;&lt;br /&gt;CHANGE MASTER TO&lt;br /&gt;&lt;br /&gt;CHECK TABLE&lt;br /&gt;&lt;br /&gt;CHECKSUM TABLE&lt;br /&gt;&lt;br /&gt;COMMIT&lt;br /&gt;&lt;br /&gt;CREATE DATABASE&lt;br /&gt;&lt;br /&gt;CREATE INDEX&lt;br /&gt;&lt;br /&gt;CREATE TABLE&lt;br /&gt;&lt;br /&gt;CREATE VIEW&lt;br /&gt;&lt;br /&gt;DELETE&lt;br /&gt;&lt;br /&gt;DESCRIBE&lt;br /&gt;&lt;br /&gt;DO&lt;br /&gt;&lt;br /&gt;DROP DATABASE&lt;br /&gt;&lt;br /&gt;DROP INDEX&lt;br /&gt;&lt;br /&gt;DROP TABLE&lt;br /&gt;&lt;br /&gt;DROP USER&lt;br /&gt;&lt;br /&gt;DROP VIEW&lt;br /&gt;&lt;br /&gt;EXPLAIN&lt;br /&gt;&lt;br /&gt;FLUSH&lt;br /&gt;&lt;br /&gt;GRANT&lt;br /&gt;&lt;br /&gt;HANDLER&lt;br /&gt;&lt;br /&gt;INSERT&lt;br /&gt;&lt;br /&gt;JOIN&lt;br /&gt;&lt;br /&gt;KILL&lt;br /&gt;&lt;br /&gt;LOAD DATA FROM MASTER&lt;br /&gt;&lt;br /&gt;LOAD DATA INFILE&lt;br /&gt;&lt;br /&gt;LOAD INDEX INTO CACHE&lt;br /&gt;&lt;br /&gt;LOAD TABLE...FROM MASTER&lt;br /&gt;&lt;br /&gt;LOCK TABLES&lt;br /&gt;&lt;br /&gt;OPTIMIZE TABLE&lt;br /&gt;&lt;br /&gt;PURGE MASTER LOGS&lt;br /&gt;&lt;br /&gt;RENAME TABLE&lt;br /&gt;&lt;br /&gt;REPAIR TABLE&lt;br /&gt;&lt;br /&gt;REPLACE&lt;br /&gt;&lt;br /&gt;RESET&lt;br /&gt;&lt;br /&gt;RESET MASTER&lt;br /&gt;&lt;br /&gt;RESET SLAVE&lt;br /&gt;&lt;br /&gt;RESTORE TABLE&lt;br /&gt;&lt;br /&gt;REVOKE&lt;br /&gt;&lt;br /&gt;ROLLBACK&lt;br /&gt;&lt;br /&gt;ROLLBACK TO SAVEPOINT&lt;br /&gt;&lt;br /&gt;SAVEPOINT&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;&lt;br /&gt;SET&lt;br /&gt;&lt;br /&gt;SET PASSWORD&lt;br /&gt;&lt;br /&gt;SET SQL_LOG_BIN&lt;br /&gt;&lt;br /&gt;SET TRANSACTION&lt;br /&gt;&lt;br /&gt;SHOW BINLOG EVENTS&lt;br /&gt;&lt;br /&gt;SHOW CHARACTER SET&lt;br /&gt;&lt;br /&gt;SHOW COLLATION&lt;br /&gt;&lt;br /&gt;SHOW COLUMNS&lt;br /&gt;&lt;br /&gt;SHOW CREATE DATABASE&lt;br /&gt;&lt;br /&gt;SHOW CREATE TABLE&lt;br /&gt;&lt;br /&gt;SHOW CREATE VIEW&lt;br /&gt;&lt;br /&gt;SHOW DATABASES&lt;br /&gt;&lt;br /&gt;SHOW ENGINES&lt;br /&gt;&lt;br /&gt;SHOW ERRORS&lt;br /&gt;&lt;br /&gt;SHOW GRANTS&lt;br /&gt;&lt;br /&gt;SHOW INDEX&lt;br /&gt;&lt;br /&gt;SHOW INNODB STATUS&lt;br /&gt;&lt;br /&gt;SHOW LOGS&lt;br /&gt;&lt;br /&gt;SHOW MASTER LOGS&lt;br /&gt;&lt;br /&gt;SHOW MASTER STATUS&lt;br /&gt;&lt;br /&gt;SHOW PRIVILEGES&lt;br /&gt;&lt;br /&gt;SHOW PROCESSLIST&lt;br /&gt;&lt;br /&gt;SHOW SLAVE HOSTS&lt;br /&gt;&lt;br /&gt;SHOW SLAVE STATUS&lt;br /&gt;&lt;br /&gt;SHOW STATUS&lt;br /&gt;&lt;br /&gt;SHOW TABLE STATUS&lt;br /&gt;&lt;br /&gt;SHOW TABLES&lt;br /&gt;&lt;br /&gt;SHOW VARIABLES&lt;br /&gt;&lt;br /&gt;SHOW WARNINGS&lt;br /&gt;&lt;br /&gt;START SLAVE&lt;br /&gt;&lt;br /&gt;START TRANSACTION&lt;br /&gt;&lt;br /&gt;STOP SLAVE&lt;br /&gt;&lt;br /&gt;TRUNCATE TABLE&lt;br /&gt;&lt;br /&gt;UNION&lt;br /&gt;&lt;br /&gt;UNLOCK TABLES&lt;br /&gt;&lt;br /&gt;USE&lt;br /&gt;&lt;br /&gt;String Functions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;AES_DECRYPT&lt;br /&gt;&lt;br /&gt;AES_ENCRYPT&lt;br /&gt;&lt;br /&gt;ASCII&lt;br /&gt;&lt;br /&gt;BIN&lt;br /&gt;&lt;br /&gt;BINARY&lt;br /&gt;&lt;br /&gt;BIT_LENGTH&lt;br /&gt;&lt;br /&gt;CHAR&lt;br /&gt;&lt;br /&gt;CHAR_LENGTH&lt;br /&gt;&lt;br /&gt;CHARACTER_LENGTH&lt;br /&gt;&lt;br /&gt;COMPRESS&lt;br /&gt;&lt;br /&gt;CONCAT&lt;br /&gt;&lt;br /&gt;CONCAT_WS&lt;br /&gt;&lt;br /&gt;CONV&lt;br /&gt;&lt;br /&gt;DECODE&lt;br /&gt;&lt;br /&gt;DES_DECRYPT&lt;br /&gt;&lt;br /&gt;DES_ENCRYPT&lt;br /&gt;&lt;br /&gt;ELT&lt;br /&gt;&lt;br /&gt;ENCODE&lt;br /&gt;&lt;br /&gt;ENCRYPT&lt;br /&gt;&lt;br /&gt;EXPORT_SET&lt;br /&gt;&lt;br /&gt;FIELD&lt;br /&gt;&lt;br /&gt;FIND_IN_SET&lt;br /&gt;&lt;br /&gt;HEX&lt;br /&gt;&lt;br /&gt;INET_ATON&lt;br /&gt;&lt;br /&gt;INET_NTOA&lt;br /&gt;&lt;br /&gt;INSERT&lt;br /&gt;&lt;br /&gt;INSTR&lt;br /&gt;&lt;br /&gt;LCASE&lt;br /&gt;&lt;br /&gt;LEFT&lt;br /&gt;&lt;br /&gt;LENGTH&lt;br /&gt;&lt;br /&gt;LOAD_FILE&lt;br /&gt;&lt;br /&gt;LOCATE&lt;br /&gt;&lt;br /&gt;LOWER&lt;br /&gt;&lt;br /&gt;LPAD&lt;br /&gt;&lt;br /&gt;LTRIM&lt;br /&gt;&lt;br /&gt;MAKE_SET&lt;br /&gt;&lt;br /&gt;MATCH    AGAINST&lt;br /&gt;&lt;br /&gt;MD5&lt;br /&gt;&lt;br /&gt;MID&lt;br /&gt;&lt;br /&gt;OCT&lt;br /&gt;&lt;br /&gt;OCTET_LENGTH&lt;br /&gt;&lt;br /&gt;OLD_PASSWORD&lt;br /&gt;&lt;br /&gt;ORD&lt;br /&gt;&lt;br /&gt;PASSWORD&lt;br /&gt;&lt;br /&gt;POSITION&lt;br /&gt;&lt;br /&gt;QUOTE&lt;br /&gt;&lt;br /&gt;REPEAT&lt;br /&gt;&lt;br /&gt;REPLACE&lt;br /&gt;&lt;br /&gt;REVERSE&lt;br /&gt;&lt;br /&gt;RIGHT&lt;br /&gt;&lt;br /&gt;RPAD&lt;br /&gt;&lt;br /&gt;RTRIM&lt;br /&gt;&lt;br /&gt;SHA&lt;br /&gt;&lt;br /&gt;SHA1&lt;br /&gt;&lt;br /&gt;SOUNDEX&lt;br /&gt;&lt;br /&gt;SPACE&lt;br /&gt;&lt;br /&gt;STRCMP&lt;br /&gt;&lt;br /&gt;SUBSTRING&lt;br /&gt;&lt;br /&gt;SUBSTRING_INDEX&lt;br /&gt;&lt;br /&gt;TRIM&lt;br /&gt;&lt;br /&gt;UCASE&lt;br /&gt;&lt;br /&gt;UNCOMPRESS&lt;br /&gt;&lt;br /&gt;UNCOMPRESSED_LENGTH&lt;br /&gt;&lt;br /&gt;UNHEX&lt;br /&gt;&lt;br /&gt;UPPER&lt;br /&gt;&lt;br /&gt;Date and Time Functions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ADDDATE&lt;br /&gt;&lt;br /&gt;ADDTIME&lt;br /&gt;&lt;br /&gt;CONVERT_TZ&lt;br /&gt;&lt;br /&gt;CURDATE&lt;br /&gt;&lt;br /&gt;CURRENT_DATE&lt;br /&gt;&lt;br /&gt;CURRENT_TIME&lt;br /&gt;&lt;br /&gt;CURRENT_TIMESTAMP&lt;br /&gt;&lt;br /&gt;CURTIME&lt;br /&gt;&lt;br /&gt;DATE&lt;br /&gt;&lt;br /&gt;DATE_ADD&lt;br /&gt;&lt;br /&gt;DATE_FORMAT&lt;br /&gt;&lt;br /&gt;DATE_SUB&lt;br /&gt;&lt;br /&gt;DATEDIFF&lt;br /&gt;&lt;br /&gt;DAY&lt;br /&gt;&lt;br /&gt;DAYNAME&lt;br /&gt;&lt;br /&gt;DAYOFMONTH&lt;br /&gt;&lt;br /&gt;DAYOFWEEK&lt;br /&gt;&lt;br /&gt;DAYOFYEAR&lt;br /&gt;&lt;br /&gt;EXTRACT&lt;br /&gt;&lt;br /&gt;FROM_DAYS&lt;br /&gt;&lt;br /&gt;FROM_UNIXTIME&lt;br /&gt;&lt;br /&gt;GET_FORMAT&lt;br /&gt;&lt;br /&gt;HOUR&lt;br /&gt;&lt;br /&gt;LAST_DAY&lt;br /&gt;&lt;br /&gt;LOCALTIME&lt;br /&gt;&lt;br /&gt;LOCALTIMESTAMP&lt;br /&gt;&lt;br /&gt;MAKEDATE&lt;br /&gt;&lt;br /&gt;MAKETIME&lt;br /&gt;&lt;br /&gt;MICROSECOND&lt;br /&gt;&lt;br /&gt;MINUTE&lt;br /&gt;&lt;br /&gt;MONTH&lt;br /&gt;&lt;br /&gt;MONTHNAME&lt;br /&gt;&lt;br /&gt;NOW&lt;br /&gt;&lt;br /&gt;PERIOD_ADD&lt;br /&gt;&lt;br /&gt;PERIOD_DIFF&lt;br /&gt;&lt;br /&gt;QUARTER&lt;br /&gt;&lt;br /&gt;SEC_TO_TIME&lt;br /&gt;&lt;br /&gt;SECOND&lt;br /&gt;&lt;br /&gt;STR_TO_DATE&lt;br /&gt;&lt;br /&gt;SUBDATE&lt;br /&gt;&lt;br /&gt;SUBTIME&lt;br /&gt;&lt;br /&gt;SYSDATE&lt;br /&gt;&lt;br /&gt;TIME&lt;br /&gt;&lt;br /&gt;TIMEDIFF&lt;br /&gt;&lt;br /&gt;TIMESTAMP&lt;br /&gt;&lt;br /&gt;TIMESTAMPDIFF&lt;br /&gt;&lt;br /&gt;TIMESTAMPADD&lt;br /&gt;&lt;br /&gt;TIME_FORMAT&lt;br /&gt;&lt;br /&gt;TIME_TO_SEC&lt;br /&gt;&lt;br /&gt;TO_DAYS&lt;br /&gt;&lt;br /&gt;UNIX_TIMESTAMP&lt;br /&gt;&lt;br /&gt;UTC_DATE&lt;br /&gt;&lt;br /&gt;UTC_TIME&lt;br /&gt;&lt;br /&gt;UTC_TIMESTAMP&lt;br /&gt;&lt;br /&gt;WEEK&lt;br /&gt;&lt;br /&gt;WEEKDAY&lt;br /&gt;&lt;br /&gt;WEEKOFYEAR&lt;br /&gt;&lt;br /&gt;YEAR&lt;br /&gt;&lt;br /&gt;YEARWEEK&lt;br /&gt;&lt;br /&gt;Mathematical and Aggregate Functions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ABS&lt;br /&gt;&lt;br /&gt;ACOS&lt;br /&gt;&lt;br /&gt;ASIN&lt;br /&gt;&lt;br /&gt;ATAN&lt;br /&gt;&lt;br /&gt;ATAN2&lt;br /&gt;&lt;br /&gt;AVG&lt;br /&gt;&lt;br /&gt;BIT_AND&lt;br /&gt;&lt;br /&gt;BIT_OR&lt;br /&gt;&lt;br /&gt;BIT_XOR&lt;br /&gt;&lt;br /&gt;CEIL&lt;br /&gt;&lt;br /&gt;CEILING&lt;br /&gt;&lt;br /&gt;COS&lt;br /&gt;&lt;br /&gt;COT&lt;br /&gt;&lt;br /&gt;COUNT&lt;br /&gt;&lt;br /&gt;CRC32&lt;br /&gt;&lt;br /&gt;DEGREES&lt;br /&gt;&lt;br /&gt;EXP&lt;br /&gt;&lt;br /&gt;FLOOR&lt;br /&gt;&lt;br /&gt;FORMAT&lt;br /&gt;&lt;br /&gt;GREATEST&lt;br /&gt;&lt;br /&gt;GROUP_CONCAT&lt;br /&gt;&lt;br /&gt;LEAST&lt;br /&gt;&lt;br /&gt;LN&lt;br /&gt;&lt;br /&gt;LOG&lt;br /&gt;&lt;br /&gt;LOG2&lt;br /&gt;&lt;br /&gt;LOG10&lt;br /&gt;&lt;br /&gt;MAX&lt;br /&gt;&lt;br /&gt;MIN&lt;br /&gt;&lt;br /&gt;MOD&lt;br /&gt;&lt;br /&gt;PI&lt;br /&gt;&lt;br /&gt;POW&lt;br /&gt;&lt;br /&gt;POWER&lt;br /&gt;&lt;br /&gt;RADIANS&lt;br /&gt;&lt;br /&gt;RAND&lt;br /&gt;&lt;br /&gt;ROUND&lt;br /&gt;&lt;br /&gt;SIGN&lt;br /&gt;&lt;br /&gt;SIN&lt;br /&gt;&lt;br /&gt;SQRT&lt;br /&gt;&lt;br /&gt;STD&lt;br /&gt;&lt;br /&gt;STDDEV&lt;br /&gt;&lt;br /&gt;SUM&lt;br /&gt;&lt;br /&gt;TAN&lt;br /&gt;&lt;br /&gt;TRUNCATE&lt;br /&gt;&lt;br /&gt;VARIANCE&lt;br /&gt;&lt;br /&gt;Flow Control Functions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CASE&lt;br /&gt;&lt;br /&gt;IF&lt;br /&gt;&lt;br /&gt;IFNULL&lt;br /&gt;&lt;br /&gt;NULLIF&lt;br /&gt;&lt;br /&gt;Command-Line Utilities&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;comp_err&lt;br /&gt;&lt;br /&gt;isamchk&lt;br /&gt;&lt;br /&gt;make_binary_distribution&lt;br /&gt;&lt;br /&gt;msql2mysql&lt;br /&gt;&lt;br /&gt;my_print_defaults&lt;br /&gt;&lt;br /&gt;myisamchk&lt;br /&gt;&lt;br /&gt;myisamlog&lt;br /&gt;&lt;br /&gt;myisampack&lt;br /&gt;&lt;br /&gt;mysqlaccess&lt;br /&gt;&lt;br /&gt;mysqladmin&lt;br /&gt;&lt;br /&gt;mysqlbinlog&lt;br /&gt;&lt;br /&gt;mysqlbug&lt;br /&gt;&lt;br /&gt;mysqlcheck&lt;br /&gt;&lt;br /&gt;mysqldump&lt;br /&gt;&lt;br /&gt;mysqldumpslow&lt;br /&gt;&lt;br /&gt;mysqlhotcopy&lt;br /&gt;&lt;br /&gt;mysqlimport&lt;br /&gt;&lt;br /&gt;mysqlshow&lt;br /&gt;&lt;br /&gt;perror&lt;br /&gt;&lt;br /&gt;Perl API - using functions and methods built into the Perl DBI with MySQL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;available_drivers&lt;br /&gt;&lt;br /&gt;begin_work&lt;br /&gt;&lt;br /&gt;bind_col&lt;br /&gt;&lt;br /&gt;bind_columns&lt;br /&gt;&lt;br /&gt;bind_param&lt;br /&gt;&lt;br /&gt;bind_param_array&lt;br /&gt;&lt;br /&gt;bind_param_inout&lt;br /&gt;&lt;br /&gt;can&lt;br /&gt;&lt;br /&gt;clone&lt;br /&gt;&lt;br /&gt;column_info&lt;br /&gt;&lt;br /&gt;commit&lt;br /&gt;&lt;br /&gt;connect&lt;br /&gt;&lt;br /&gt;connect_cached&lt;br /&gt;&lt;br /&gt;data_sources&lt;br /&gt;&lt;br /&gt;disconnect&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;&lt;br /&gt;dump_results&lt;br /&gt;&lt;br /&gt;err&lt;br /&gt;&lt;br /&gt;errstr&lt;br /&gt;&lt;br /&gt;execute&lt;br /&gt;&lt;br /&gt;execute_array&lt;br /&gt;&lt;br /&gt;execute_for_fetch&lt;br /&gt;&lt;br /&gt;fetch&lt;br /&gt;&lt;br /&gt;fetchall_arrayref&lt;br /&gt;&lt;br /&gt;fetchall_hashref&lt;br /&gt;&lt;br /&gt;fetchrow_array&lt;br /&gt;&lt;br /&gt;fetchrow_arrayref&lt;br /&gt;&lt;br /&gt;fetchrow_hashref&lt;br /&gt;&lt;br /&gt;finish&lt;br /&gt;&lt;br /&gt;foreign_key_info&lt;br /&gt;&lt;br /&gt;func&lt;br /&gt;&lt;br /&gt;get_info&lt;br /&gt;&lt;br /&gt;installed_versions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;last_insert_id&lt;br /&gt;&lt;br /&gt;looks_like_number&lt;br /&gt;&lt;br /&gt;neat&lt;br /&gt;&lt;br /&gt;neat_list&lt;br /&gt;&lt;br /&gt;parse_dsn&lt;br /&gt;&lt;br /&gt;parse_trace_flag&lt;br /&gt;&lt;br /&gt;parse_trace_flags&lt;br /&gt;&lt;br /&gt;ping&lt;br /&gt;&lt;br /&gt;prepare&lt;br /&gt;&lt;br /&gt;prepare_cached&lt;br /&gt;&lt;br /&gt;primary_key&lt;br /&gt;&lt;br /&gt;primary_key_info&lt;br /&gt;&lt;br /&gt;quote&lt;br /&gt;&lt;br /&gt;quote_identifier&lt;br /&gt;&lt;br /&gt;rollback&lt;br /&gt;&lt;br /&gt;rows&lt;br /&gt;&lt;br /&gt;selectall_arrayref&lt;br /&gt;&lt;br /&gt;selectall_hashref&lt;br /&gt;&lt;br /&gt;selectcol_arrayref&lt;br /&gt;&lt;br /&gt;selectrow_array&lt;br /&gt;&lt;br /&gt;selectrow_arrayref&lt;br /&gt;&lt;br /&gt;selectrow_hashref&lt;br /&gt;&lt;br /&gt;set_err&lt;br /&gt;&lt;br /&gt;state&lt;br /&gt;&lt;br /&gt;table_info&lt;br /&gt;&lt;br /&gt;table_info_all&lt;br /&gt;&lt;br /&gt;tables&lt;br /&gt;&lt;br /&gt;trace&lt;br /&gt;&lt;br /&gt;trace_msg&lt;br /&gt;&lt;br /&gt;type_info&lt;br /&gt;&lt;br /&gt;type_info_all&lt;br /&gt;&lt;br /&gt;Attributes for Handles&lt;br /&gt;&lt;br /&gt;PHP API - using functions built into PHP with MySQL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mysql_affected_rows&lt;br /&gt;&lt;br /&gt;mysql_change_user&lt;br /&gt;&lt;br /&gt;mysql_client_encoding&lt;br /&gt;&lt;br /&gt;mysql_close&lt;br /&gt;&lt;br /&gt;mysql_connect&lt;br /&gt;&lt;br /&gt;mysql_create_db&lt;br /&gt;&lt;br /&gt;mysql_data_seek&lt;br /&gt;&lt;br /&gt;mysql_db_name&lt;br /&gt;&lt;br /&gt;mysql_db_query&lt;br /&gt;&lt;br /&gt;mysql_drop_db&lt;br /&gt;&lt;br /&gt;mysql_errno&lt;br /&gt;&lt;br /&gt;mysql_error&lt;br /&gt;&lt;br /&gt;mysql_escape_string&lt;br /&gt;&lt;br /&gt;mysql_fetch_array&lt;br /&gt;&lt;br /&gt;mysql_fetch_assoc&lt;br /&gt;&lt;br /&gt;mysql_fetch_field&lt;br /&gt;&lt;br /&gt;mysql_fetch_lengths&lt;br /&gt;&lt;br /&gt;mysql_fetch_object&lt;br /&gt;&lt;br /&gt;mysql_fetch_row&lt;br /&gt;&lt;br /&gt;mysql_field_flags&lt;br /&gt;&lt;br /&gt;mysql_field_len&lt;br /&gt;&lt;br /&gt;mysql_field_name&lt;br /&gt;&lt;br /&gt;mysql_field_seek&lt;br /&gt;&lt;br /&gt;mysql_field_table&lt;br /&gt;&lt;br /&gt;mysql_field_type&lt;br /&gt;&lt;br /&gt;mysql_free_result&lt;br /&gt;&lt;br /&gt;mysql_get_client_info&lt;br /&gt;&lt;br /&gt;mysql_get_host_info&lt;br /&gt;&lt;br /&gt;mysql_get_proto_info&lt;br /&gt;&lt;br /&gt;mysql_get_server_info&lt;br /&gt;&lt;br /&gt;mysql_info&lt;br /&gt;&lt;br /&gt;mysql_insert_id&lt;br /&gt;&lt;br /&gt;mysql_list_dbs&lt;br /&gt;&lt;br /&gt;mysql_list_fields&lt;br /&gt;&lt;br /&gt;mysql_list_processes&lt;br /&gt;&lt;br /&gt;mysql_list_tables&lt;br /&gt;&lt;br /&gt;mysql_num_fields&lt;br /&gt;&lt;br /&gt;mysql_num_rows&lt;br /&gt;&lt;br /&gt;mysql_pconnect&lt;br /&gt;&lt;br /&gt;mysql_ping&lt;br /&gt;&lt;br /&gt;mysql_query&lt;br /&gt;&lt;br /&gt;mysql_real_escape_string&lt;br /&gt;&lt;br /&gt;mysql_result&lt;br /&gt;&lt;br /&gt;mysql_select_db&lt;br /&gt;&lt;br /&gt;mysql_stat&lt;br /&gt;&lt;br /&gt;mysql_tablename&lt;br /&gt;&lt;br /&gt;mysql_thread_id&lt;br /&gt;&lt;br /&gt;mysql_unbuffered_query&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-6176801590104038870?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/6176801590104038870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2010/08/this-is-list-of-handy-mysql-commands.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6176801590104038870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6176801590104038870'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2010/08/this-is-list-of-handy-mysql-commands.html' title='MySQL Commands'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-2054633699812582392</id><published>2010-05-22T13:20:00.000-07:00</published><updated>2010-05-23T12:05:58.999-07:00</updated><title type='text'>Introduction to lsof</title><content type='html'>Introduction to lsof&lt;br /&gt;&lt;br /&gt;Overview&lt;br /&gt;&lt;br /&gt;    LiSt Open Files is a useful and powerful tool that will show you opened files. In Unix everything is a file: pipes are files, IP sockets are files, unix sockets are files, directories are files, devices are files, inodes are files...&lt;br /&gt;&lt;br /&gt;Useful Examples&lt;br /&gt;&lt;br /&gt;    So in this tangle of files lsof listst files opened by processes running on your system.&lt;br /&gt;&lt;br /&gt;    When lsof is called without parameters, it will show all the files opened by any processes.&lt;br /&gt;&lt;br /&gt;         lsof | nl&lt;br /&gt;&lt;br /&gt;    Let us know who is using the apache executable file, /etc/passwd, what files are opened on device /dev/hda6 or who's accessing /dev/cdrom:&lt;br /&gt;&lt;br /&gt;         lsof `which apache2`&lt;br /&gt;         lsof /etc/passwd&lt;br /&gt;         lsof /dev/hda6&lt;br /&gt;         lsof /dev/cdrom&lt;br /&gt;&lt;br /&gt;    Now show us what process IDs are using the apache binary, and only the PID:&lt;br /&gt;&lt;br /&gt;         lsof -t `which apache2`&lt;br /&gt;&lt;br /&gt;    Show us what files are opened by processes whose names starts by "k" (klogd, kswapd...) and bash. Show us what files are opened by init:&lt;br /&gt;&lt;br /&gt;         lsof -c k&lt;br /&gt;         lsof -c bash&lt;br /&gt;         lsof -c init&lt;br /&gt;&lt;br /&gt;    Show us what files are opened by processes whose names starts by "courier", but exclude those whose owner is the user "zahn":&lt;br /&gt;&lt;br /&gt;         lsof -c courier -u ^zahn&lt;br /&gt;&lt;br /&gt;    Show us the processes opened by user apache and user zahn:&lt;br /&gt;&lt;br /&gt;         lsof -u apache,zahn&lt;br /&gt;&lt;br /&gt;    Show us what files are using the process whose PID is 30297:&lt;br /&gt;&lt;br /&gt;         lsof +p 30297&lt;br /&gt;&lt;br /&gt;    Search for all opened instances of directory /tmp and all the files and directories it contains:&lt;br /&gt;&lt;br /&gt;         lsof +D /tmp&lt;br /&gt;&lt;br /&gt;    List all opened internet sockets and sockets related to port 80:&lt;br /&gt;&lt;br /&gt;         lsof -i&lt;br /&gt;         lsof -i :80&lt;br /&gt;&lt;br /&gt;    List all opened Internet and UNIX domain files:&lt;br /&gt;&lt;br /&gt;         lsof -i -U&lt;br /&gt;&lt;br /&gt;    Show us what process(es) has an UDP connection opened to or from the host www.test.com at port 123 (ntp):&lt;br /&gt;&lt;br /&gt;         lsof -iUDP@www.test.com:123&lt;br /&gt;&lt;br /&gt;    lsof provides many more options and could be an unvaluable foresinc tool if your system get compromised or as daily basis check tool..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mylivesignature.com" target="_blank"&gt;&lt;img src="http://signatures.mylivesignature.com/54488/176/EA2153FA754D9E185A3DB803EB70154D.png" style="border: 0 !important; background: transparent;"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-2054633699812582392?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/2054633699812582392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2010/05/introduction-to-lsof.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/2054633699812582392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/2054633699812582392'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2010/05/introduction-to-lsof.html' title='Introduction to lsof'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-1926800934689421814</id><published>2010-05-22T12:04:00.000-07:00</published><updated>2010-05-22T12:06:05.589-07:00</updated><title type='text'>How to Mounting an USB External Hardrive on Linux Machine</title><content type='html'>Here are few tips to mounting your external or USB hardrive:&lt;br /&gt;&lt;br /&gt;after you plug your usb drive just type in your console&lt;br /&gt;&lt;br /&gt;[code] [root@austin]# dmesg [/code]&lt;br /&gt;&lt;br /&gt;then look at this following message&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;usb hd plugin&lt;br /&gt;&lt;br /&gt;at this picture the device is detected as sdb1&lt;br /&gt;then you should now that the device you need to mount is on /dev/sdb1&lt;br /&gt;&lt;br /&gt;now create the directory that will be linked to the drive&lt;br /&gt;[code] mkdir /mnt/usbdrive [/code]&lt;br /&gt;&lt;br /&gt;now mount your drive to the directory that just created before:&lt;br /&gt;&lt;br /&gt;[code] mount -t (your partition type) /dev/sdb1 /mnt/usbdrive [/code]&lt;br /&gt;&lt;br /&gt;remember, you should know your partition type corectly before mounting&lt;br /&gt;&lt;br /&gt;you can try to check with this command:&lt;br /&gt;&lt;br /&gt;[code][root@austin]#fdisk -l&lt;br /&gt;Disk /dev/hda: 240 heads, 63 sectors, 1940 cylinders&lt;br /&gt;Units = cylinders of 15120 * 512 bytes&lt;br /&gt;&lt;br /&gt;Device Boot Start End Blocks Id System&lt;br /&gt;/dev/hda 1 286 2162128+ c Win95 FAT32 (LBA)&lt;br /&gt;/dev/hda2 * 288 1940 12496680 5 Extended&lt;br /&gt;/dev/hda5 288 289 15088+ 83 Linux&lt;br /&gt;/dev/hda6 290 844 4195768+ 83 Linux&lt;br /&gt;/dev/hda7 845 983 1050808+ 82 Linux swap&lt;br /&gt;/dev/hda8 984 1816 6297448+ 83 Linux&lt;br /&gt;/dev/hda9 1817 1940 937408+ 83 Linux&lt;br /&gt;/dev/sdb1 1 2010 156301488+ 83 Linux [/code]&lt;br /&gt;&lt;br /&gt;Various filesystem types like xiafs, ext2, ext3, reiserfs is using id 83&lt;br /&gt;Some systems mistakenly assume that 83 must mean ext2.&lt;br /&gt;&lt;br /&gt;example on linux partition:&lt;br /&gt;&lt;br /&gt;[code] mount -t ext2 /dev/sdb1 /mnt/usbdrive [/code]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if you see some error you can try other types of partition id 83&lt;br /&gt;&lt;br /&gt;[code] mount -t ext3 /dev/sdb1 /mnt/usbdrive [/code]&lt;br /&gt;&lt;br /&gt;if you see this kind message.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;that's mean you have succesfully mounting your external hardrive!&lt;br /&gt;now you can move your file through your new mounting directiory /mnt/usbdrive&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;FYI: the name of windows partition in linux is Vfat aka FAT file system or ntfs&lt;br /&gt;the name of usb flash disk partition is usbfs&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-1926800934689421814?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/1926800934689421814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2010/05/how-to-mounting-usb-external-hardrive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1926800934689421814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1926800934689421814'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2010/05/how-to-mounting-usb-external-hardrive.html' title='How to Mounting an USB External Hardrive on Linux Machine'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3259949687637763239</id><published>2010-05-22T12:03:00.000-07:00</published><updated>2010-05-22T12:04:10.569-07:00</updated><title type='text'>How To Format Harddrive in Linux/Unix Console</title><content type='html'>Here is a simple steps how to formatting a new harddrive in linux/unix console :&lt;br /&gt;&lt;br /&gt;First, we need to take a look all partition in your server&lt;br /&gt;&lt;br /&gt;[code]$fdisk -l&lt;br /&gt;.....&lt;br /&gt;.....&lt;br /&gt;Disk /dev/hdd: 320.0 GB, 320072933376 bytes&lt;br /&gt;255 heads, 63 sectors/track, 38913 cylinders&lt;br /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;&lt;br /&gt;Device Boot      Start         End      Blocks   Id  System[/code]&lt;br /&gt;&lt;br /&gt;You will see a result above that tell /dev/hdd is have 320GB but don't have any partition on it.&lt;br /&gt;&lt;br /&gt;We need to create a new partition for /dev/hdd with these steps below :&lt;br /&gt;&lt;br /&gt;[code]$fdisk /dev/hdd&lt;br /&gt;Command  : n&lt;br /&gt;Command Action : p&lt;br /&gt;Partition Number : 1&lt;br /&gt;First Cylinder : Enter&lt;br /&gt;Last Cylinder : Enter&lt;br /&gt;Command : p&lt;br /&gt;&lt;br /&gt;Disk /dev/hdd: 320.0 GB, 320072933376 bytes&lt;br /&gt;255 heads, 63 sectors/track, 38913 cylinders&lt;br /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;&lt;br /&gt;Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/hdd1               1       38913   312568641   83  Linux&lt;br /&gt;&lt;br /&gt;Command : w&lt;br /&gt;The partition table has been altered!&lt;br /&gt;&lt;br /&gt;Calling ioctl() to re-read partition table.&lt;br /&gt;Syncing disks.[/code]&lt;br /&gt;&lt;br /&gt;You will see that /dev/hdd1 is ready to format&lt;br /&gt;We need to verify all devices again before do a format&lt;br /&gt;&lt;br /&gt;[code]$fdisk -l&lt;br /&gt;&lt;br /&gt;......&lt;br /&gt;Disk /dev/hdd: 320.0 GB, 320072933376 bytes&lt;br /&gt;255 heads, 63 sectors/track, 38913 cylinders&lt;br /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;&lt;br /&gt;Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/hdd1               1       38913   312568641   83  Linux&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ls -al /dev/hdd1&lt;br /&gt;brw-r----- 1 root disk 22, 65 Sep  9 21:00 /dev/hdd1[/code]&lt;br /&gt;&lt;br /&gt;Next, we will start formatting the harddrive partition file system with this command below&lt;br /&gt;&lt;br /&gt;[code]$mkfs.ext3 /dev/hdd1&lt;br /&gt;mke2fs 1.39 (29-May-2006)&lt;br /&gt;Filesystem label=&lt;br /&gt;OS type: Linux&lt;br /&gt;Block size=4096 (log=2)&lt;br /&gt;Fragment size=4096 (log=2)&lt;br /&gt;39075840 inodes, 78142160 blocks&lt;br /&gt;3907108 blocks (5.00%) reserved for the super user&lt;br /&gt;First data block=0&lt;br /&gt;Maximum filesystem blocks=4294967296&lt;br /&gt;2385 block groups&lt;br /&gt;32768 blocks per group, 32768 fragments per group&lt;br /&gt;16384 inodes per group&lt;br /&gt;Superblock backups stored on blocks:&lt;br /&gt;32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,&lt;br /&gt;4096000, 7962624, 11239424, 20480000, 23887872, 71663616&lt;br /&gt;&lt;br /&gt;Writing inode tables: 1996/2385&lt;br /&gt;.....&lt;br /&gt;&lt;br /&gt;Writing inode tables: done&lt;br /&gt;Creating journal (32768 blocks): done&lt;br /&gt;Writing superblocks and filesystem accounting information:&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;This filesystem will be automatically checked every 24 mounts or&lt;br /&gt;180 days, whichever comes first.  Use tune2fs -c or -i to override.[/code]&lt;br /&gt;&lt;br /&gt;Finally, We just need to mount the partition and your new harddrive is ready to use&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3259949687637763239?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3259949687637763239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2010/05/how-to-format-harddrive-in-linuxunix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3259949687637763239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3259949687637763239'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2010/05/how-to-format-harddrive-in-linuxunix.html' title='How To Format Harddrive in Linux/Unix Console'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-7765133421504291660</id><published>2010-04-24T15:14:00.000-07:00</published><updated>2010-04-24T15:15:45.284-07:00</updated><title type='text'>How To Create a Container/VPS Machine With OpenVZ Server</title><content type='html'>After We have installed a OpenVZ VPS Master Server, We can create a container or VPS Machine on it.&lt;br /&gt;Please see this URL if you still don't have OpenVZ VPS Master Server running/installed on your server.&lt;br /&gt;http://wowtutorial.org/en/tutorial/97.html&lt;br /&gt;&lt;br /&gt;Create a VPS Machine in OpenVZ VPS Master Server&lt;br /&gt;&lt;br /&gt;First we need to make sure we have a vps config in /etc/vz/conf&lt;br /&gt;All vps config that we have created will store in this directory&lt;br /&gt;VPS config is use to define a harddrive space, memory, and other config stuff&lt;br /&gt;&lt;br /&gt;Example there are 3 config file there&lt;br /&gt;[code]$ls -al /etc/vz/conf&lt;br /&gt;ve-light.conf-sample&lt;br /&gt;ve-vps.basic.conf-sample&lt;br /&gt;ve-vps.heavy.conf-sample[/code]&lt;br /&gt;&lt;br /&gt;Next, We will need to make sure we have precreated template in /vz/template/cache directory&lt;br /&gt;[code]$ls -al /vz/template/cache&lt;br /&gt;&lt;br /&gt;centos-4-i386-default.tar.gz fedora-core-5-i386-minimal.tar.gz-old&lt;br /&gt;centos-4-i386-default.tar.gz-old fedora-core-6-i686-default.tar.gz&lt;br /&gt;centos-4-i386-minimal.tar.gz fedora-core-7-i386-default.tar.gz&lt;br /&gt;centos-4-i386-minimal.tar.gz-old fedora-core-7-i386-minimal.tar.gz&lt;br /&gt;centos-5-i386-minimal.tar.gz mandriva-2006-i386-minimal.tar.gz&lt;br /&gt;debian-3.1-i386-minimal.tar.gz opensuse-10-i386-default.tar.gz&lt;br /&gt;fedora-8-i386-minimal.tar.gz slackware-12.0-i386-minimal.tar.gz&lt;br /&gt;fedora-8-i386-minimal.tar.gz.1 ubuntu-6.06-i386-minimal.tar.gz&lt;br /&gt;fedora-core-5-i386-default.tar.gz ubuntu-7.10-i386-minimal.tar.gz&lt;br /&gt;fedora-core-5-i386-minimal.tar.gz[/code]&lt;br /&gt;&lt;br /&gt;If we have a config and precreated template we can start create a VPS Machine on OpenVZ VPS Master Server&lt;br /&gt;We will use vzctl command to create,start,stop,destroy,etc.. the VPS Machine&lt;br /&gt;&lt;br /&gt;Example command to create a VPS Machine:&lt;br /&gt;[code]$vzctl create NODE --config yourconfigfile --ostemplate yourostemplate --ipadd yourvpsipadd[/code]&lt;br /&gt;&lt;br /&gt;Here is the real examples command&lt;br /&gt;[code]$vzctl create 1 --config vps.basic --ostemplate centos-4-i386-default --ipadd 10.10.1.2[/code]&lt;br /&gt;&lt;br /&gt;Example config is : ve-vps.basic.conf-sample we can just use vps.basic in --config line command&lt;br /&gt;NODE here is just numbering your VPS. we can name it 1, 100, 1000 ,etc&lt;br /&gt;&lt;br /&gt;Next, We need to set a nameserver &amp; Hostname for brandnew VPS Machine&lt;br /&gt;[code]$vzctl set 1 --nameserver 10.10.1.50 --hostname server.testing.com --save[/code]&lt;br /&gt;&lt;br /&gt;Note: Example Nameserver ip address is 10.10.1.50 &lt;br /&gt;&lt;br /&gt;After that, we can start the VPS Machine with this command&lt;br /&gt;[code]$vzctl start 1[/code]&lt;br /&gt;&lt;br /&gt;We also can directly enter into VPS Machine from VPS Master Server&lt;br /&gt;[code]$vzctl enter 1[/code]&lt;br /&gt;&lt;br /&gt;This command will automatically let us enter NODE 1 which is our brandnew vps&lt;br /&gt;Then we can just use passwd to change the root password&lt;br /&gt;&lt;br /&gt;If we want to exit from container/vps machine 1, it's simple type exit&lt;br /&gt;[code]$exit[/code]&lt;br /&gt;&lt;br /&gt;it will automatically logout and stay in OpenVZ Master VPS Machine again&lt;br /&gt;&lt;br /&gt;To take a look a running VPS Machine type&lt;br /&gt;[code]$vzlist&lt;br /&gt;&lt;br /&gt;VEID NPROC STATUS IP_ADDR HOSTNAME&lt;br /&gt;1 46 running 10.10.1.2 server.testing.com[/code]&lt;br /&gt;&lt;br /&gt;Next Step is trying to connect the ip from outside network using putty.&lt;br /&gt;If you are able to connect into 10.10.1.2 port 22 it's mean you are successfully configure a container/VPS Machine&lt;br /&gt;&lt;br /&gt;If you want to stop the VPS Machine type&lt;br /&gt;[code]$vzctl stop 1[/code]&lt;br /&gt;&lt;br /&gt;It will automatically stop container/vps machine 1 (server.testing.com)&lt;br /&gt;&lt;br /&gt;If you want to delete/destroy your VPS Machine, type&lt;br /&gt;[code]$vzctl destroy 1[/code]&lt;br /&gt;&lt;br /&gt;Note : you need to stop vps machine 1 first, before destroy the vps machine&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-7765133421504291660?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/7765133421504291660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2010/04/how-to-create-containervps-machine-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/7765133421504291660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/7765133421504291660'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2010/04/how-to-create-containervps-machine-with.html' title='How To Create a Container/VPS Machine With OpenVZ Server'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-8994175991584382814</id><published>2009-09-03T22:29:00.000-07:00</published><updated>2009-09-03T22:31:39.677-07:00</updated><title type='text'>WordPress or phpBB not Sending Email? Try this fix.</title><content type='html'>Okay, for anybody who just upgraded Wordpress, only to realize you’re not getting notification emails anymore, or the PHP mail() function isn’t working, or SMTP isn’t working, here is your solution. Yes, this is guaranteed to work, even if you’re using Gmail.&lt;br /&gt;&lt;h3&gt;Method 1&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;If you are using c-panel and if you have signed up with google mail application then login to your C-panel and find the option MX Entry.&lt;/p&gt; &lt;p&gt;&lt;img class="alignnone size-full wp-image-864" title="mx entry" src="http://annanta.com/wp-content/uploads/2009/08/mx-entry.JPG" alt="mx entry" width="437" height="153" /&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Make sure that your setting is same as shown in image below&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Click image to Zoome it&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://annanta.com/wp-content/uploads/image/mx%20entry2.JPG" target="_blank"&gt;&lt;img class="alignnone size-full wp-image-865" title="mx entry" src="http://annanta.com/wp-content/uploads/2009/08/mx-entry2.JPG" alt="mx entry" width="435" height="226" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Method 2&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;1. Go to your hosting cpanel and create this email account: wordpress@yourdomain.com. Replace “yourdomain.com” with whatever your domain name is. Make sure that if you have a .net, that you use .net instead of .com in that email. Set up your username and password and remember it.&lt;/p&gt; &lt;p&gt;2. Download &lt;a href="http://www.callum-macdonald.com/code/wp-mail-smtp/"&gt;WP-Mail-SMTP&lt;/a&gt; or &lt;a href="http://www.marcocimmino.net/cimy-wordpress-plugins/cimy-swift-smtp/"&gt;Cimy Swift SMTP&lt;/a&gt;. Just pick one of these and install and activate the plugin.&lt;/p&gt; &lt;p&gt;3a. Configure your SMTP plugin under Settings or Tools in your sidebar. This is the most important step! Do not fill in this info with what Gmail tells you to put in. Do the following instead:&lt;br /&gt;3b. Sender e-mail must be: the new email account you created in your hosting cpanel. Put in the full wordpress@yourdomain.com in there.&lt;br /&gt;3c. If there is a checkbox to use SMTP, check it.&lt;br /&gt;3d. SMTP server address will be: mail.yourdomain.com. Replace “yourdomain.com” with your domain name again.&lt;br /&gt;3e. Port will be 25 or 26. Try those before trying 456 for gmail. Contact your hosting provider if neither works. The chances of neither of these working are small.&lt;br /&gt;3f. Username would be: wordpress@yourdomain.com. Replace “yourdomain.com” with your domain name again.&lt;br /&gt;3g. Password is the password for that account.&lt;br /&gt;3h. Set SSL or TLS to no or no encryption. Try these before using TLS for gmail. Contact your hosting provider in case they require encryption, if this doesn’t work.&lt;/p&gt; &lt;p&gt;4. Wordpress@yourdomain.com will now send the email to your personal account. Make sure that the email on your profile is correct, whether it’s yahoo, hotmail, gmail or any other account. If you are using a contact form, make sure that the email is set to your personal account, as well. The emails should now go to your spam or inbox.&lt;/p&gt; &lt;p&gt;If it still doesn’t work, you can have your wordpress@yourdomain.com send the email to itself and have your personal account pop forward it. Read the following if you are still having problems. Gmail is used as an example because most people have problems getting it to agree with their wordpress/hosting.&lt;/p&gt; &lt;p&gt;5a. Make sure that the email on your profile is changed to the wordpress@yourdomain.com email. If you are using a contact form, make sure that the emails are sent to the wordpress@yourdomain.com email. *This is important because wordpress and Gmail conflict and this is the only workaround I’ve come up with.&lt;br /&gt;5b. Now, wordpress is set up to use SMTP to send emails out with your wordpress@yourdomain.com email. Step 5a makes sure that all the emails are sent to that same account. So basically, wordpress@yourdomain.com will send emails to itself.&lt;br /&gt;5c. Now login to Gmail and go to Settings.&lt;br /&gt;5d. Under Settings, go to Accounts.&lt;br /&gt;5e. Under &lt;span&gt;“Get mail from other accounts,” go to “Add a mail account you own”.&lt;br /&gt;5f. Username is wordpress@yourdomain.com. Replace “yourdomain.com” with your domain name.&lt;br /&gt;5g. Password is wordpress@yourdomain.com’s password.&lt;br /&gt;5h. POP Server should be mail.yourdomain.com. &lt;/span&gt;&lt;span&gt;Replace “yourdomain.com” with your domain name.&lt;br /&gt;5i. Port should be 110.&lt;br /&gt;5j. Click Save Changes.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;6. Now, Wordpress will send the emails to the hosting server email account. And Gmail will fetch them. You could also create a Yahoo or Hotmail account and skip step 5 entirely, and then have Yahoo or Hotmail forward those emails to Gmail.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;If you are still having problems, or need assistance, leave a comment. And good luck.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-8994175991584382814?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/8994175991584382814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/09/wordpress-or-phpbb-not-sending-email.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/8994175991584382814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/8994175991584382814'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/09/wordpress-or-phpbb-not-sending-email.html' title='WordPress or phpBB not Sending Email? Try this fix.'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-8003243290917590915</id><published>2009-08-03T23:46:00.000-07:00</published><updated>2009-08-03T23:52:46.240-07:00</updated><title type='text'>Create user in mysql</title><content type='html'>&lt;h3 class="post-title entry-title"&gt; &lt;a href="http://arjudba.blogspot.com/2009/05/create-user-in-mysql.html"&gt;&lt;br /&gt;&lt;/a&gt; &lt;/h3&gt;  &lt;div class="post-body entry-content"&gt; The mysql user information is kept inside USER table under mysql database. So creation of new user will affect the USER table of mysql database. In order to know a list of mysql users according with user table's description issue,&lt;br /&gt;&lt;br /&gt;Here test is the root account password.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql -u root -ptest&lt;/span&gt;&lt;br /&gt;Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;Your MySQL connection id is 5&lt;br /&gt;Server version: 5.1.30-community MySQL Community Server (GPL)&lt;br /&gt;&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; use mysql;&lt;/span&gt;&lt;br /&gt;Database changed&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; desc user;&lt;/span&gt;&lt;br /&gt;+-----------------------+-----------------------------------+------+-----+---------+-------+&lt;br /&gt;| Field                 | Type                              | Null | Key | Default | Extra |&lt;br /&gt;+-----------------------+-----------------------------------+------+-----+---------+-------+&lt;br /&gt;| Host                  | char(60)                          | NO   | PRI |         |       |&lt;br /&gt;| User                  | char(16)                          | NO   | PRI |         |       |&lt;br /&gt;| Password              | char(41)                          | NO   |     |         |       |&lt;br /&gt;| Select_priv           | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Insert_priv           | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Update_priv           | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Delete_priv           | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Create_priv           | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Drop_priv             | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Reload_priv           | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Shutdown_priv         | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Process_priv          | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| File_priv             | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Grant_priv            | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| References_priv       | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Index_priv            | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Alter_priv            | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Show_db_priv          | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Super_priv            | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Create_tmp_table_priv | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Lock_tables_priv      | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Execute_priv          | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Repl_slave_priv       | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Repl_client_priv      | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Create_view_priv      | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Show_view_priv        | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Create_routine_priv   | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Alter_routine_priv    | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Create_user_priv      | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Event_priv            | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| Trigger_priv          | enum('N','Y')                     | NO   |     | N       |       |&lt;br /&gt;| ssl_type              | enum('','ANY','X509','SPECIFIED') | NO   |     |         |       |&lt;br /&gt;| ssl_cipher            | blob                              | NO   |     | NULL    |       |&lt;br /&gt;| x509_issuer           | blob                              | NO   |     | NULL    |       |&lt;br /&gt;| x509_subject          | blob                              | NO   |     | NULL    |       |&lt;br /&gt;| max_questions         | int(11) unsigned                  | NO   |     | 0       |       |&lt;br /&gt;| max_updates           | int(11) unsigned                  | NO   |     | 0       |       |&lt;br /&gt;| max_connections       | int(11) unsigned                  | NO   |     | 0       |       |&lt;br /&gt;| max_user_connections  | int(11) unsigned                  | NO   |     | 0       |       |&lt;br /&gt;+-----------------------+-----------------------------------+------+-----+---------+-------+&lt;br /&gt;39 rows in set (0.14 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select host, user from user;&lt;/span&gt;&lt;br /&gt;+-----------+---------+&lt;br /&gt;| host      | user    |&lt;br /&gt;+-----------+---------+&lt;br /&gt;| %         | magento |&lt;br /&gt;| 127.0.0.1 | root    |&lt;br /&gt;| localhost |         |&lt;br /&gt;| localhost | magento |&lt;br /&gt;| localhost | pma     |&lt;br /&gt;| localhost | root    |&lt;br /&gt;+-----------+---------+&lt;br /&gt;6 rows in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;By query the Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv etc you can check whether user has certain types of privilege or not.&lt;br /&gt;&lt;br /&gt;There are several ways to create user in mysql which is described below.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Way 01: With the CREATE USER statement&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;1)Connect to mysql database as a user who must have the global CREATE USER privilege or the INSERT privilege for the mysql database. You can use root because by default root has privilege to create user.&lt;br /&gt;&lt;br /&gt;2)In fact CREATE USER statement creates a new record in the mysql.user table that has no privileges assigned by default.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; create user arju;&lt;/span&gt;&lt;br /&gt;Query OK, 0 rows affected (0.13 sec)&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select  user,password, host, select_priv, insert_priv from mysql.user where user='arju';&lt;/span&gt;&lt;br /&gt;+------+----------+------+-------------+-------------+&lt;br /&gt;| user | password | host | select_priv | insert_priv |&lt;br /&gt;+------+----------+------+-------------+-------------+&lt;br /&gt;| arju |          | %    | N           | N           |&lt;br /&gt;+------+----------+------+-------------+-------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Notice that if you specify only the user name part of the account name while creating user, a host name part of '%' is used.&lt;br /&gt;&lt;br /&gt;User arju is not assigned any password in this way as you see password is null. To assign password to user arju issue,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; set password for 'arju'=password('test');&lt;/span&gt;&lt;br /&gt;Query OK, 0 rows affected (0.03 sec)&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select  user,password, host, select_priv, insert_priv from mysql.user where user='arju';&lt;/span&gt;&lt;br /&gt;+------+-------------------------------------------+------+-------------+-------------+&lt;br /&gt;| user | password                                  | host | select_priv | insert_priv |&lt;br /&gt;+------+-------------------------------------------+------+-------------+-------------+&lt;br /&gt;| arju | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 | %    | N           | N           |&lt;br /&gt;+------+-------------------------------------------+------+-------------+-------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In one command you can set password while creating user. The following command will crate a user arju2 and password is test in the host localhost. Both password, username and hostname should be within single quote.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; create user 'arju2'@'localhost' identified by 'test';&lt;/span&gt;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select  user,password, host, select_priv, insert_priv from mysql.user where user='arju2';&lt;/span&gt;&lt;br /&gt;+-------+-------------------------------------------+-----------+-------------+-------------+&lt;br /&gt;| user  | password                                  | host      | select_priv | insert_priv |&lt;br /&gt;+-------+-------------------------------------------+-----------+-------------+-------------+&lt;br /&gt;| arju2 | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 | localhost | N           | N           |&lt;br /&gt;+-------+-------------------------------------------+-----------+-------------+-------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you don't put username, host name and password within single quote syntax error will be resulted.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; create user 'arju2'@'localhost' identified by test;&lt;/span&gt;&lt;br /&gt;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'test' at line 1&lt;br /&gt;&lt;br /&gt;An equivalent statement of setting password is issuing update statement.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; UPDATE mysql.user SET Password=PASSWORD('test')&lt;br /&gt;  -&gt;   WHERE User='arju' AND Host='%';&lt;/span&gt;&lt;br /&gt;Query OK, 0 rows affected (0.05 sec)&lt;br /&gt;Rows matched: 1  Changed: 0  Warnings: 0&lt;br /&gt;&lt;br /&gt;Changing via update and insert of the user table, it is necessary to use FLUSH PRIVILEGES to tell the server to reload the grant tables. Otherwise, the changes go unnoticed until you restart the server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; FLUSH PRIVILEGES;&lt;/span&gt;&lt;br /&gt;Query OK, 0 rows affected (0.08 sec)&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select  user,password, host, select_priv, insert_priv from mysql.user where user='arju';&lt;/span&gt;&lt;br /&gt;+------+-------------------------------------------+------+-------------+-------------+&lt;br /&gt;| user | password                                  | host | select_priv | insert_priv |&lt;br /&gt;+------+-------------------------------------------+------+-------------+-------------+&lt;br /&gt;| arju | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 | %    | N           | N           |&lt;br /&gt;+------+-------------------------------------------+------+-------------+-------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, have a look that connecting to mysql database as user arju will fail but arju2 will be successful.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;D:\xampp\mysql\bin&gt;mysql -u arju -ptest&lt;/span&gt;&lt;br /&gt;ERROR 1045 (28000): Access denied for user 'arju'@'localhost' (using password: YES)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;D:\xampp\mysql\bin&gt;mysql -u arju2 -ptest&lt;/span&gt;&lt;br /&gt;Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;Your MySQL connection id is 18&lt;br /&gt;Server version: 5.1.30-community MySQL Community Server (GPL)&lt;br /&gt;&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select user();&lt;/span&gt;&lt;br /&gt;+-----------------+&lt;br /&gt;| user()          |&lt;br /&gt;+-----------------+&lt;br /&gt;| arju2@localhost |&lt;br /&gt;+-----------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that the 'arju'@'localhost' account can be used only when connecting from the local host. The 'arju'@'%' account uses the '%' wildcard for the host part, so it can be used to connect from any host.&lt;br /&gt;&lt;br /&gt;You can check the privilege assigned for a user by issuing,&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; show grants for arju;&lt;/span&gt;&lt;br /&gt;+-----------------------------------------------------------------------------------------------------+&lt;br /&gt;| Grants for arju@%                                                                                   |&lt;br /&gt;+-----------------------------------------------------------------------------------------------------+&lt;br /&gt;| GRANT USAGE ON *.* TO 'arju'@'%' IDENTIFIED BY PASSWORD '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29' |&lt;br /&gt;+-----------------------------------------------------------------------------------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; show grants for arju2;&lt;/span&gt;&lt;br /&gt;ERROR 1141 (42000): There is no such grant defined for user 'arju2' on host '%'&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; show grants for arju2@localhost;&lt;/span&gt;&lt;br /&gt;+--------------------------------------------------------------------------------------------------------------+&lt;br /&gt;| Grants for arju2@localhost                                                                                   |&lt;br /&gt;+--------------------------------------------------------------------------------------------------------------+&lt;br /&gt;| GRANT USAGE ON *.* TO 'arju2'@'localhost' IDENTIFIED BY PASSWORD '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29' |&lt;br /&gt;+--------------------------------------------------------------------------------------------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;By default it is search for host '%'.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Way 02: With the grant option&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;To create a user named momin with password test2 and all privileges for a particular database called ecommerce issue,&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; grant ALL PRIVILEGES on ecommerce.* to 'momin'@'localhost' identified by 'test2';&lt;/span&gt;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; use mysql;&lt;/span&gt;&lt;br /&gt;Database changed&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select host, user from user where user='momin';&lt;/span&gt;&lt;br /&gt;+-----------+-------+&lt;br /&gt;| host      | user  |&lt;br /&gt;+-----------+-------+&lt;br /&gt;| localhost | momin |&lt;br /&gt;+-----------+-------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;D:\xampp\mysql\bin&gt;mysql -u momin -ptest2&lt;/span&gt;&lt;br /&gt;Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;Your MySQL connection id is 32&lt;br /&gt;Server version: 5.1.30-community MySQL Community Server (GPL)&lt;br /&gt;&lt;br /&gt;Type 'help;' or '\h' for help. Type '\c' to clear the buffer.&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; show databases;&lt;/span&gt;&lt;br /&gt;+--------------------+&lt;br /&gt;| Database           |&lt;br /&gt;+--------------------+&lt;br /&gt;| information_schema |&lt;br /&gt;| ecommerce          |&lt;br /&gt;| test               |&lt;br /&gt;+--------------------+&lt;br /&gt;3 rows in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here ecommerce database is shown as we have given permission.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;u&gt;Way 03: Using INSERT statement into Table mysql.user&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;You can also create user in mysql by simply INSERT a new row into mysql.user table. Note that creating user through INSERT statement needs to use FLUSH PRIVILEGES to tell the server to reload the grant tables. If we don't do that the changes go unnoticed until you restart the server. This restriction is not applicable in CREATE USER statement.&lt;br /&gt;Insert statement can be issued in two ways. One way to create user robert,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; use mysql;&lt;/span&gt;&lt;br /&gt;Database changed&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; INSERT INTO user SET Host='localhost',User='robert', Password=password('test');&lt;/span&gt;&lt;br /&gt;Query OK, 1 row affected, 3 warnings (0.00 sec)&lt;br /&gt;&lt;br /&gt;Alternative way of creating user richard is,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; INSERT INTO user (Host,User,Password)&lt;br /&gt;  -&gt;      VALUES('localhost','richard',password('test'));&lt;/span&gt;&lt;br /&gt;Query OK, 1 row affected, 3 warnings (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; FLUSH PRIVILEGES;&lt;/span&gt;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;Check by,&lt;br /&gt;&lt;pre   style=";font-size:12px;color:black;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysql&gt; select user, host, password from user where user in('robert','richard');&lt;/span&gt;&lt;br /&gt;+---------+-----------+-------------------------------------------+&lt;br /&gt;| user    | host      | password                                  |&lt;br /&gt;+---------+-----------+-------------------------------------------+&lt;br /&gt;| robert  | localhost | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 |&lt;br /&gt;| richard | localhost | *94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29 |&lt;br /&gt;+---------+-----------+-------------------------------------------+&lt;br /&gt;2 rows in set (0.01 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;See that while setting password we used the PASSWORD() function with INSERT in order to encrypt the password. But with the CREATE USER statement it was unnecessary as create user statement automatically encrypts the password.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-8003243290917590915?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/8003243290917590915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/08/create-user-in-mysql.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/8003243290917590915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/8003243290917590915'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/08/create-user-in-mysql.html' title='Create user in mysql'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-6824482629151771942</id><published>2009-08-03T02:05:00.001-07:00</published><updated>2009-08-03T02:05:31.010-07:00</updated><title type='text'>How to Fix Cpanel/WHM quota</title><content type='html'>&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;To Fix Common reasons for quota problems&lt;/b&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;Run the following command as root user.&lt;/span&gt;&lt;/p&gt; &lt;div style="color: rgb(255, 0, 0); font-family: trebuchet ms;" class="dean_ch"&gt; &lt;div class="de1"&gt; &lt;span style="font-size:85%;"&gt;/scripts/fixquotas &lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;Try finding other files owned by the user.&lt;/span&gt;&lt;/p&gt; &lt;div style="color: rgb(255, 0, 0); font-family: trebuchet ms;" class="dean_ch"&gt; &lt;div class="de1"&gt; &lt;span style="font-size:85%;"&gt;find -user username &gt; /tmp/username.txt &lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;This will list all files owned by this user that could be affecting the quota reported by Cpanel.&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;Cpanel/WHM sometimes has problems with the user quota files causing all users accounts to have unlimited disk space available or 0 megs of disk space in use.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;*To enable user quota support on a file system, add "usrquota" to the   fourth field containing the word "defaults".&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;If you need both user quota and group quota support on a file system?, then edit /etc/fstab&lt;/span&gt;                  &lt;/p&gt;&lt;pre style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;...&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;/dev/hda2 /home ext3 defaults,usrquota,grpquota 1 1&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p style="color: rgb(255, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;touch /partition/aquota.user   &lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;chmod 600 /partition/aquota.user&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;i&gt;&lt;b&gt;&lt;span style="font-size:85%;"&gt;Re-boot or &lt;span style="color: rgb(255, 0, 0); background-color: rgb(0, 0, 0);"&gt;re-mount&lt;/span&gt; file partition with quotas.    &lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;From the Linux Man Pages:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;quotacheck&lt;/span&gt; - scan a filesystem for disk usage, create, check and repair quota files.&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;quotacheck -vgum&lt;/span&gt; /partition&lt;br /&gt;or&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;quotacheck -vguma   &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;    &lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-v, --verbose&lt;/span&gt;&lt;br /&gt;quotacheck reports its operation as it progresses.  Normally it operates silently.  If the option is  specified  twice,  also the current directory is printed (note that printing can slow down the scan measurably).&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; -u, --user&lt;/span&gt;&lt;br /&gt; Only user quotas listed in /etc/mtab or on the filesystems specified are to be checked.  This is the default action.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; -g, --group&lt;/span&gt;&lt;br /&gt; Only group quotas listed in /etc/mtab or on the filesystems specified are to be checked.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; -m, --no-remount&lt;/span&gt;&lt;br /&gt;Don't try to remount filesystem read-only. See comment with option -M.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-a, --all&lt;/span&gt;&lt;br /&gt;Check all mounted non-NFS filesystems in /etc/mtab&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;NOTE&lt;/b&gt;&lt;br /&gt;quotacheck should only be run by super-user. Non-privileged users are presumably not allowed to read  all  the  directories  on  the  given filesystem.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;FILES&lt;/b&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;aquota.user or aquota.group&lt;/b&gt;  :  located at filesystem root with quotas (version 2 quota, non-XFS filesystems)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;quota.user or quota.group&lt;/b&gt; :located at filesystem root with quotas (version 1 quota, non-XFS filesystems)&lt;br /&gt; /etc/mtab      names and locations of mounted filesystems &lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms; text-align: left;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;&lt;span style="background-color: rgb(255, 255, 51);"&gt;Example Steps for /home partition:&lt;/span&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="font-size:85%;"&gt;1. First check whether quota is enabled for /home partition.&lt;br /&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;vi /etc/fstab&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;LABEL=/home /home ext3 defaults,usrquota 1 2&lt;br /&gt;&lt;br /&gt;2. Remount the /home partition&lt;br /&gt;&lt;br /&gt;#&lt;span style="color: rgb(255, 0, 0);"&gt; mount -o remount /home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3. Create a file called aquota.user for which we need to run quotacheck.&lt;br /&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;quotacheck -c /home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4. Enable quota&lt;br /&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;quotaon /home&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will enable quota on /home. Now you can edit the quota of a user using.&lt;br /&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;edquota &lt;username&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5) Run /scripts/fixquotas this will solve the quota issue of cpanel accounts.&lt;br /&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;/scripts/fixquotas&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6) After this `repquota -a` should print out the soft/hard limits with grace periods for all users. If quotas are still not reporting anything in WHM and/or CPanel, check&lt;br /&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;repquota -a&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;7) /var/cpanel/cpanel.config for disablequotacache=0&lt;br /&gt;&lt;br /&gt;If that is set to 0, try setting it to 1 and see if that fixes it.&lt;br /&gt;&lt;br /&gt;# &lt;span style="color: rgb(255, 0, 0);"&gt;vi /var/cpanel/cpanel.config ; /scripts/fixquotas&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;8) If a user’s quota shows more space being used than is in their home directory chances are there are stray files on the system owned by their UID. To find these files, run the following as root:&lt;br /&gt;&lt;br /&gt;# &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;find -user username &gt; /tmp/username.txt &lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0); font-family: trebuchet ms;"&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;&lt;span style="color:#000000;"&gt;Hope this helps.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-6824482629151771942?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/6824482629151771942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/08/how-to-fix-cpanelwhm-quota.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6824482629151771942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6824482629151771942'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/08/how-to-fix-cpanelwhm-quota.html' title='How to Fix Cpanel/WHM quota'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-6088883226892299739</id><published>2009-07-20T09:42:00.001-07:00</published><updated>2009-07-20T09:42:52.853-07:00</updated><title type='text'>Mod_Rewrite - Hide index.php</title><content type='html'>This article follows Mod_Rewrite and .htaccess which explains how an .htaccess file can be used to prevent search engines from indexing non-www web pages that contain exactly the same content as those with-www in front. By hiding the 'duplicate content' we avoid the risk of a 'downgrading' effect by Google and other search engines.&lt;br /&gt;&lt;br /&gt;Exactly the same principle applies to web page addresses like:&lt;br /&gt;&lt;br /&gt;http://www.mysite.com/index.php&lt;br /&gt;http://www.mysite.com/subfolder/index.php&lt;br /&gt;&lt;br /&gt;when we want the content to be displayed only on:&lt;br /&gt;&lt;br /&gt;http://www.mysite.com/&lt;br /&gt;http://www.mysite.com/subfolder/&lt;br /&gt;&lt;br /&gt;This can be done by using ModRewrite to permanently redirect (eg):&lt;br /&gt;&lt;br /&gt;http://www.mysite.com/index.php&lt;br /&gt;to&lt;br /&gt;http://www.mysite.com/&lt;br /&gt;&lt;br /&gt;The file index.php continues to exist on the website but there's no need for 'index.php' to appear in the page address for its content to be displayed. The same applies to 'index.html', 'default.html' (etc) and to 'index' pages located in sub-folders, eg '/subfolder/index.php' or '/subfolder/another/index.php'. Those filenames should never normally be displayed to the visitor. The process of hiding them is sometimes referred to as the canonicalization of index pages.&lt;br /&gt;The .htaccess file&lt;br /&gt;&lt;br /&gt;For websites running on Apache web server (most websites do), a Mod_Rewrite module can be enabled to allow an .htaccess file to be installed in the root folder, containing rules on how web page requests should be rewritten 'behind the scenes' by the 'rewriting engine'. The Mod_Rewrite rules to achieve the effect we want here are:&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;#&lt;br /&gt;# REDIRECT /folder/index.php to /folder/&lt;br /&gt;RewriteCond %{THE_REQUEST}&lt;br /&gt;   (on same line) ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/&lt;br /&gt;RewriteRule ^(([^/]+/)*)index\.php$&lt;br /&gt;   (on same line) http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;Piece by piece…&lt;br /&gt;&lt;br /&gt;A line beginning with hash (#) is ignored by the web server and is useful to split up the rules visually, and to add comments.&lt;br /&gt;&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;&lt;br /&gt;For the rewriting engine to work, we need to enable Options FollowSymLinks and set RewriteEngine On (this is for security).&lt;br /&gt;&lt;br /&gt;# REDIRECT /folder/index.php to /folder/&lt;br /&gt;RewriteCond %{THE_REQUEST}&lt;br /&gt;   (on same line) ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/&lt;br /&gt;RewriteRule ^(([^/]+/)*)index\.php$&lt;br /&gt;   (on same line) http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;&lt;br /&gt;The .htaccess file is eliminating the duplicate content problem by redirecting the visitor (and Google) from all the site's web page addresses that contain the superfluous index.php to the folder name (directory) in which they reside. Exactly the same content is presented as if the index.php file itself was being viewed, but index.php doesn't appear in the browser's address bar.&lt;br /&gt;How the Mod_Rewrite works&lt;br /&gt;&lt;br /&gt;(1) RewriteCond&lt;br /&gt;&lt;br /&gt;Looking first at RewriteCond, we need to specify the conditions under which the RewriteRule will be processed by the server, and here, we want our rule to apply to any 'index.php' page requested on the domain. This prevents the .htaccess file from triggering an 'infinite loop' on the server, in which the RewriteRule keeps repeating itself. If the request contains 'index.php' (as in the condition we've referenced), it has not yet been rewritten. If it has been rewritten, it won't contain 'index.php' and the RewriteRule won't be applied.&lt;br /&gt;&lt;br /&gt;%{THE_REQUEST}&lt;br /&gt;&lt;br /&gt;In this part, {THE_REQUEST}, is a standard server variable, in this instance the page requested by the visitor, because that's what we're going to try to match in the second part. In RewriteCond, a server variable is preceded by $ to denote an Apache variable.&lt;br /&gt;&lt;br /&gt;^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/&lt;br /&gt;&lt;br /&gt;This second part is known as the 'condition'. The ^ caret defines the start, and is followed by a regular expression. Looking at the regular expression in detail:&lt;br /&gt;&lt;br /&gt;[A-Z]{3,9}\ matches from 3 to 9 occurences of any uppercase letter (eg 'GET') followed by an \ escaped space.&lt;br /&gt;&lt;br /&gt;/([^/]+/)* matches a forward slash followed by any quantity of [one or more characters not preceded by a forward slash but ending with a forward slash], eg '/subfolder1/subfolder2/'.&lt;br /&gt;&lt;br /&gt;index\.php\ matches 'index.php' - the backslashes are required to 'escape' (i) the dot metacharacter (to make it into a real dot) and (ii) the space before 'HTTP/'.&lt;br /&gt;&lt;br /&gt;HTTP/ matches 'HTTP/'.&lt;br /&gt;&lt;br /&gt;Why do we need all this? Because we're testing our condition against {THE_REQUEST} - the entire client request header for an 'index' page, which is typically something like:&lt;br /&gt;&lt;br /&gt;GET /index.php HTTP/1.1&lt;br /&gt;or&lt;br /&gt;GET /subfolder1/index.php HTTP/1.1&lt;br /&gt;&lt;br /&gt;(2) RewriteRule&lt;br /&gt;&lt;br /&gt;Looking now at the RewriteRule, it contains three essential parts.&lt;br /&gt;&lt;br /&gt;^(([^/]+/)*)index\.php$&lt;br /&gt;&lt;br /&gt;This first part is the 'thing' that we want to be re-written by the web server. The ^ caret symbol defines the start, (([^/]+/)*) is a designated variable (using brackets) containing a regular expression that matches a forward slash followed by any quantity of [one or more characters not preceded by a forward slash but ending with a forward slash], eg '/subfolder1/subfolder2/', index\.php matches 'index.php', and the $ symbol defines the end.&lt;br /&gt;&lt;br /&gt;http://www.mysite.com/$1&lt;br /&gt;&lt;br /&gt;This second part is what we want the server to process behind the scenes. It consists of the domain's root folder (homepage) plus the designated variable from the first part, expressed as $1.&lt;br /&gt;&lt;br /&gt;In the above example, the designated variable (([^/]+/)*) is added by the server, after the page has been requested, as $1 to the end of http://www.mysite.com/. If the requested 'index' page is the site's homepage, the $1 variable will be empty and the server will simply process http://www.mysite.com/. If the requested 'index' page is in a subfolder and the designated variable's value is '/folder1/', the server will process http://www.mysite.com/folder1/.&lt;br /&gt;&lt;br /&gt;[R=301,L]&lt;br /&gt;&lt;br /&gt;This third part, the flag, designates any special instructions that might be needed, in this instance R=301 for redirect permanently and L for 'last rule' so that no other rules are processed for the specified rewrite condition.&lt;br /&gt;&lt;br /&gt;The full rewrite rule is thus:&lt;br /&gt;&lt;br /&gt;RewriteRule ^(([^/]+/)*)index\.php$&lt;br /&gt;   (on same line) http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;&lt;br /&gt;The RewriteRule in action&lt;br /&gt;&lt;br /&gt;Here, again, is the full .htaccess file:&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;#&lt;br /&gt;# REDIRECT /folder/index.php to /folder/&lt;br /&gt;RewriteCond %{THE_REQUEST}&lt;br /&gt;   (on same line) ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/&lt;br /&gt;RewriteRule ^(([^/]+/)*)index\.php$&lt;br /&gt;   (on same line) http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;In plain English, it's saying that "if someone tries to open a folder's 'index.php' page, redirect them to a version of the folder without 'index.php', and if the visitor is Google(bot), mention the fact that this is permanent."&lt;br /&gt;&lt;br /&gt;See this in action by typing http://www.patricktaylor.com/index.php into an HTTP viewer. The first receiving header is HTTP/1.1 301 Moved Permanently and the second receiving header is HTTP/1.1 200 OK. And of course it can be tested by attempting to view http://www.patricktaylor.com/index.php in your browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-6088883226892299739?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/6088883226892299739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/modrewrite-hide-indexphp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6088883226892299739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6088883226892299739'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/modrewrite-hide-indexphp.html' title='Mod_Rewrite - Hide index.php'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-5075538275275471329</id><published>2009-07-20T09:39:00.001-07:00</published><updated>2009-07-20T09:39:33.849-07:00</updated><title type='text'>Mod_Rewrite and .htaccess</title><content type='html'>Grabbing code snippets off the web and re-using them on one's own websites is easy enough to do. Every web designer solves a problem this way at one time or another. Having done so, why not take a little trouble to understand what the code is doing? This article looks at a simple example of a code snippet and attempts to demystify some of the so-called voodoo surrounding rewriting URLs with .htaccess.&lt;br /&gt;&lt;br /&gt;Mod_Rewrite is an Apache web server module that is often installed on shared web hosting packages. If the module is available, a special file named .htaccess can be uploaded to the server, containing rules on how web page requests should be handled 'behind the scenes' by the 'rewriting engine'. The .htaccess file is normally placed in a website's root folder to apply its effect to all pages on the domain.&lt;br /&gt;Why have an .htaccess file?&lt;br /&gt;&lt;br /&gt;An .htaccess file is important to any webmaster who is interested in a good ranking in search engines, especially Google. It has many uses, the most basic being to prevent search engines from indexing different pages (URLs) that contain exactly the same content.&lt;br /&gt;A simple .htaccess example: the canonical URL&lt;br /&gt;&lt;br /&gt;Consider two web pages:&lt;br /&gt;&lt;br /&gt;http://www.mysite.com/&lt;br /&gt;http://mysite.com/&lt;br /&gt;&lt;br /&gt;Technically, these two URLs are different pages, but they contain exactly the same content when viewed. If Google indexes both, there's a risk that one, or the other, or both, will be 'downgraded' by Google as 'duplicate content'. With the .htaccess file, this can be prevented by nominating only one as the 'canonical' homepage. Here's an example of what to put in the file:&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;#&lt;br /&gt;# REDIRECT to canonical url&lt;br /&gt;RewriteCond %{HTTP_HOST} ^mysite\.com [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;Piece by piece…&lt;br /&gt;&lt;br /&gt;A line beginning with hash (#) is ignored by the web server and is useful to split up the rules visually, and to add comments.&lt;br /&gt;&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;&lt;br /&gt;For the rewriting engine to work, we need to enable Options FollowSymLinks and set RewriteEngine On (this is for security).&lt;br /&gt;&lt;br /&gt;# REDIRECT to canonical url&lt;br /&gt;RewriteCond %{HTTP_HOST} ^mysite\.com [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;&lt;br /&gt;The 'canonical URL' is the preferred internet address for a web page, and in the above instance is any page at http://www.mysite.com/. The .htaccess file is removing the duplicate content problem by redirecting the visitor (and Google) from the non-www version to the with-www version. This means that only canonical URLs will ever be accessible - for all the pages on the domain, not just the homepage.&lt;br /&gt;How the Mod_Rewrite works&lt;br /&gt;&lt;br /&gt;(1) RewriteCond&lt;br /&gt;&lt;br /&gt;Looking firstly at RewriteCond, we need to specify the conditions under which the RewriteRule will be processed by the server, and here, we want our rule to apply only when a visitor (or Google) attempts to view http://mysite.com/any-page (without www).&lt;br /&gt;&lt;br /&gt;%{HTTP_HOST}&lt;br /&gt;&lt;br /&gt;In this first part, {HTTP_HOST}, is a standard server variable, in this instance the site's host (domain name), because that's what we're going to try to match in the second part. In RewriteCond, a server variable is preceded by $ to denote an Apache variable.&lt;br /&gt;&lt;br /&gt;^mysite\.com&lt;br /&gt;&lt;br /&gt;This second part is known as the 'condition'. The ^ caret symbol defines the start and mysite\.com is the pattern to be matched, in this instance http://mysite.com without www. The backslash before the dot is required to 'escape' it, because in a regular expression, the dot is a special 'metacharacter'. Escaping the dot converts it back to a normal character - a plain dot.&lt;br /&gt;&lt;br /&gt;[NC]&lt;br /&gt;&lt;br /&gt;This third part is known as the flag. [NC] stands for no case (case-insensitive).&lt;br /&gt;&lt;br /&gt;The full rewrite condition is thus:&lt;br /&gt;&lt;br /&gt;RewriteCond %{HTTP_HOST} ^mysite\.com [NC]&lt;br /&gt;&lt;br /&gt;(2) RewriteRule&lt;br /&gt;&lt;br /&gt;Looking now at the RewriteRule, it contains three essential parts.&lt;br /&gt;&lt;br /&gt;^(.*)$&lt;br /&gt;&lt;br /&gt;This first part is the 'thing' that we want to be re-written by the web server. The ^ caret symbol defines the start, (.*) is a designated variable (using brackets) containing a regular expression that matches any combination of characters, and the $ symbol defines the end.&lt;br /&gt;&lt;br /&gt;http://www.mysite.com/$1&lt;br /&gt;&lt;br /&gt;This second part is what we want the server to process behind the scenes. It consists of the canonical URL, plus the designated variable from the first part, expressed as $1. If we had two designated variables we could use $1 and $2.&lt;br /&gt;&lt;br /&gt;In the above example, the (.*) (any combination of characters, eg: 'about-us.html') is added by the server, after the page has been requested, as $1 to the end of http://www.mysite.com/ to make http://www.mysite.com/about-us.html.&lt;br /&gt;&lt;br /&gt;[R=301,L]&lt;br /&gt;&lt;br /&gt;This third part, the flag, is an integral part of the rule writing process because it designates any special instructions that might be needed, in this instance R=301 for redirect permanently and L for 'last rule' so that no other rules are processed for the specified rewrite condition.&lt;br /&gt;&lt;br /&gt;The full rewrite rule is thus:&lt;br /&gt;&lt;br /&gt;RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;&lt;br /&gt;The RewriteRule in action&lt;br /&gt;&lt;br /&gt;Here, again, is the full .htaccess file:&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;Options +FollowSymLinks&lt;br /&gt;RewriteEngine On&lt;br /&gt;#&lt;br /&gt;# REDIRECT to canonical url&lt;br /&gt;RewriteCond %{HTTP_HOST} ^mysite\.com [NC]&lt;br /&gt;RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;In plain English, it's saying that "if someone tries to open any page on our website without entering www at the front, redirect them to a version of the page with the www, and if the visitor is Google(bot), mention the fact that this is permanent."&lt;br /&gt;&lt;br /&gt;The redirect can be tested by typing a web page address like http://patricktaylor.com/mod_rewrite-htaccess into an HTTP viewer. The first receiving header is HTTP/1.1 301 Moved Permanently and the second receiving header is HTTP/1.1 200 OK. And of course the addition of www can be tested by pasting http://patricktaylor.com/ into your browser's address bar.&lt;br /&gt;&lt;br /&gt;A general note: on some shared web hosting accounts, the .htaccess file can't be seen when the root folder is opened in an FTP client. This can often be corrected by enabling server side filtering in the FTP client program and setting the remote filter as -rtaF. The precise details of how to do this will vary from one program to another.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-5075538275275471329?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/5075538275275471329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/modrewrite-and-htaccess.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5075538275275471329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5075538275275471329'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/modrewrite-and-htaccess.html' title='Mod_Rewrite and .htaccess'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-2056369953137091780</id><published>2009-07-02T19:16:00.001-07:00</published><updated>2009-07-02T19:16:13.958-07:00</updated><title type='text'>Generate CSR for Red Hat Linux Apache / SSL Server</title><content type='html'>Step 1: Generating the Private Key&lt;br /&gt;&lt;br /&gt;   1. Use the cd command to move to the /etc/httpd/conf directory.&lt;br /&gt;&lt;br /&gt;   2. As root, type in one of the following three commands to generate your key:&lt;br /&gt;&lt;br /&gt;   3. If you're using Official Red Hat Linux Professional and you want to use the included password feature, type in the following command: make genkey&lt;br /&gt;&lt;br /&gt;   4. Your key will be generated and you will be asked to enter and confirm a password. Please note that you will need to remember and enter this password every time you start your secure Web server, so don't forget it.&lt;br /&gt;&lt;br /&gt;   5. If you're using Official Red Hat Linux Professional and you don't want to be required to type in a password every time you start your secure Web server, use the following command instead of make genkey to create your key (note that the following command should be typed in all on one line): &lt;br /&gt;&lt;br /&gt;            /usr/sbin/sslgenrsa -rand /dev/urandom -out ssl.key/server.key 1024&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   6. Then use the following command to set the correct permissions on your key: &lt;br /&gt;&lt;br /&gt;            chmod go-rwx ssl.key/server.key&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   7. If you use the above commands to create your key, you will not need to use a password to start your secure Web server. However, we don't recommend that you disable the password feature for your secure Web server, since it decreases the level of security for your server.&lt;br /&gt;&lt;br /&gt;   8. Your key will be created and saved to a file named server.key. If you're using Official Red Hat Linux Professional, server.key will be located in the /etc/httpd/conf/ssl.key directory. If you're using Official Red Hat Linux Professional, International Edition, server.key will be located in /etc/httpd/conf.&lt;br /&gt;&lt;br /&gt;Step 2: Create the Certificate Signing Request&lt;br /&gt;&lt;br /&gt;   1. In the /etc/httpd/conf directory, become root and type in one of the following two commands:&lt;br /&gt;&lt;br /&gt;   2. If you're using Official Red Hat Linux Professional, type in the following command: &lt;br /&gt;           make certreq&lt;br /&gt;&lt;br /&gt;   3. If you're using Official Red Hat Linux Professional, International Edition, type in the following single command (all on one line): &lt;br /&gt;           /usr/bin/openssl req -new -key /etc/httpd/conf/server.key -out /etc/httpd/conf/server.csr&lt;br /&gt;&lt;br /&gt;   4. You will be prompted for your password (if you used a password when you generated your key). Type in the password, if necessary.&lt;br /&gt;&lt;br /&gt;   5. You'll see some instructions and you will be prompted for responses. Your inputs will be incorporated into the CSR.&lt;br /&gt;&lt;br /&gt;   6. When you've finished entering your information, a file named server.csr will be created. If you're using Official Red Hat Linux Professional, server.csr will be located in the /etc/httpd/conf/ssl.csr directory.&lt;br /&gt;&lt;br /&gt;   7. You have just created a key pair and a CSR.&lt;br /&gt;&lt;br /&gt;   8. The server.csr file contains your certificate request. To copy and paste the information into the orderform, open the file in a text editor that does not add extra characters (Notepad or Vi are recommended).&lt;br /&gt;&lt;br /&gt;   9. Go to our website ssl.nu for the SSL Certicate request&lt;br /&gt;&lt;br /&gt;Terms defined:&lt;br /&gt;Country Name (C):&lt;br /&gt;Use the two-letter code without punctuation for country, for example: US or CA.&lt;br /&gt;&lt;br /&gt;State or Province (S):&lt;br /&gt;Spell out the state completely; do not abbreviate the state or province name, for example: California&lt;br /&gt;&lt;br /&gt;Locality or City (L):&lt;br /&gt;The Locality field is the city or town name, for example: Berkeley.&lt;br /&gt;&lt;br /&gt;Organization (O):&lt;br /&gt;If your company or department has an &amp;, @, or any other symbol using the shift key in its name, you must spell out the symbol or omit it to enroll.  Example: XYZ Corporation&lt;br /&gt;&lt;br /&gt;Organizational Unit (OU):&lt;br /&gt;This field is optional; but can be used to help identify certificates registered to an organization. The Organizational Unit (OU) field is the name of the department or organization unit making the request.&lt;br /&gt;&lt;br /&gt;Common Name (CN):&lt;br /&gt;The Common Name is the Host + Domain Name. It looks like "www.company.com" or "company.com".&lt;br /&gt;Note: When prompted for your "first- and lastname", enter the desired Common Name.&lt;br /&gt;&lt;br /&gt;SSL Certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain "domain.com" will receive a warning if accessing a site named "www.domain.com" or "secure.domain.com", because "www.domain.com" and "secure.domain.com" are different from "domain.com".&lt;br /&gt;&lt;br /&gt;Networking4all certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain "domain.com" will receive a warning if accessing a site named "www.domain.com" or "secure.domain.com", because "www.domain.com" and "secure.domain.com" are different from "domain.com".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please do not enter your email address, challenge password or an optional company name when generating the CSR.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-2056369953137091780?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/2056369953137091780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/generate-csr-for-red-hat-linux-apache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/2056369953137091780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/2056369953137091780'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/generate-csr-for-red-hat-linux-apache.html' title='Generate CSR for Red Hat Linux Apache / SSL Server'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-6350195718095522</id><published>2009-07-02T19:13:00.000-07:00</published><updated>2009-07-02T19:15:43.723-07:00</updated><title type='text'>Create a Certificate Signing Request using the RSA private key</title><content type='html'>Create a Certificate Signing Request using the RSA private key&lt;br /&gt;&lt;br /&gt;openssl req -new -key domain.com.key -out domain.com.csr&lt;br /&gt;&lt;br /&gt;Use following script for generating CSR&lt;br /&gt;&lt;br /&gt;#/scripts/gencrt&lt;br /&gt;&lt;br /&gt;This script will ask you all the information like email address , domain name, Ip Address country code , Locality , Company , company Divison etc.&lt;br /&gt;&lt;br /&gt;enter the proper information as per the request and the certificate will get generated under directory /usr/share/ssl/Certs/ as www.tuks123.com.csr&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-6350195718095522?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/6350195718095522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/create-certificate-signing-request.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6350195718095522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6350195718095522'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/create-certificate-signing-request.html' title='Create a Certificate Signing Request using the RSA private key'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-1467886490997336086</id><published>2009-07-02T19:10:00.000-07:00</published><updated>2009-07-02T19:11:27.848-07:00</updated><title type='text'>Generate csr and install SSL through shell</title><content type='html'>You can generate a csr through the shell using the following command:&lt;br /&gt;root@server1[/]# /scripts/gencsr&lt;br /&gt;This will ask you all the information like email address, domain name, country code, City, Company etc; fill the values and it generates a csr certificate and a private key.Use the following steps to install an ssl certificate:&lt;br /&gt;&lt;br /&gt;Please check the domain name for which the ssl certificate is issued means www.domainname.com or domainname.com. Suppose you have to install an ssl certificate for domainname.com. You already generate csr for the domainname.com. Check following steps.&lt;br /&gt;&lt;br /&gt;1)&lt;br /&gt;Go to directory /usr/share/ssl/certs&lt;br /&gt;&lt;br /&gt;root@server1[/]# cd /usr/share/ssl/certs&lt;br /&gt;&lt;br /&gt;Please check domainname.com.csr file is present already.&lt;br /&gt;&lt;br /&gt;root@server1[/usr/share/ssl/certs]# ls –l | grep domainname.com.csr&lt;br /&gt;&lt;br /&gt;Create the .crt file and paste the ssl certificate into a .crt file as per below&lt;br /&gt;&lt;br /&gt;root@server1 [/usr/share/ssl/certs]# vi domainname.com.crt&lt;br /&gt;&lt;br /&gt;paste ssl certificate&lt;br /&gt;save the file.&lt;br /&gt;&lt;br /&gt;If cabundle is provided by the client then add it in the domainname.com.cabundle file under the directory /usr/share/ssl/certs&lt;br /&gt;&lt;br /&gt;root@server1 [/usr/share/ssl/certs]# vi domainname.com.cabundle&lt;br /&gt;&lt;br /&gt;paste the cabundle key and save the file.&lt;br /&gt;&lt;br /&gt;2)&lt;br /&gt;&lt;br /&gt;Go to directory /usr/share/ssl/private and check to see if the file domainname.com.key is already present.&lt;br /&gt;&lt;br /&gt;root@server1[/]# cd /usr/share/ssl/private&lt;br /&gt;root@server1[/usr/share/ssl/private]# ls –l | grep domainname.com.key&lt;br /&gt;&lt;br /&gt;3)&lt;br /&gt;Go to the file /etc/httpd/conf/httpd.conf and copy the virtual host entry for the domainname.com in notepad and add the following line above the end of the tag&lt;br /&gt;&lt;br /&gt;SSLEnable&lt;br /&gt;SSLCertificateFile /usr/share/ssl/certs/domainname.com.crt&lt;br /&gt;SSLCertificateKeyFile /usr/share/ssl/private/domainname.com.key&lt;br /&gt;SSLCACertificateFile /usr/share/ssl/certs/domainname.com.cabundle&lt;br /&gt;SSLLogFile /usr/local/apache/domlogs/shop.discdudes.com-ssl_data_log&lt;br /&gt;SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown&lt;br /&gt;&lt;br /&gt;Add the following line above the virtual host entry.&lt;br /&gt;&lt;br /&gt;add the following line at the end of the virtualhost tag.&lt;br /&gt;&lt;br /&gt;Now your sslVH entry should look like as per below. Please check the sample sslVH entry.&lt;br /&gt;&lt;br /&gt;ServerAlias domainname.com&lt;br /&gt;ServerAdmin webmaster@domainname.com&lt;br /&gt;DocumentRoot /home/username/public_html&lt;br /&gt;BytesLog domlogs/domainname.com-bytes_log&lt;br /&gt;ServerName domainname.com&lt;br /&gt;&lt;br /&gt;User username&lt;br /&gt;Group username&lt;br /&gt;&lt;br /&gt;CustomLog /usr/local/apache/domlogs/domainname.com combined&lt;br /&gt;ScriptAlias /cgi-bin/ /home/username/public_html/cgi-bin/&lt;br /&gt;&lt;br /&gt;SSLEnable&lt;br /&gt;SSLCertificateFile /usr/share/ssl/certs/domainname.com.crt&lt;br /&gt;SSLCertificateKeyFile /usr/share/ssl/private/domainname.com.key&lt;br /&gt;SSLCACertificateFile /usr/share/ssl/certs/domainname.com.cabundle&lt;br /&gt;SSLLogFile /usr/local/apache/domlogs/shop.discdudes.com-ssl_data_log&lt;br /&gt;SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown&lt;br /&gt;&lt;br /&gt;4)&lt;br /&gt;If cabundle is not given by the client then remove the following line from the sslVH entry&lt;br /&gt;&lt;br /&gt;SSLCACertificateFile /usr/share/ssl/certs/domainname.com.cabundle&lt;br /&gt;&lt;br /&gt;5)&lt;br /&gt;Add the sslVH entry in httpd.conf file and restart the httpd service.&lt;br /&gt;&lt;br /&gt;Now you are able to access site https://domainname.com&lt;br /&gt;&lt;br /&gt;Please check the file paths are correctly specified for .crt, .key and .cabundle file. If the file paths are incorrect in the sslVH entry then the httpd service won’t started.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-1467886490997336086?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/1467886490997336086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/generate-csr-and-install-ssl-through.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1467886490997336086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1467886490997336086'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/generate-csr-and-install-ssl-through.html' title='Generate csr and install SSL through shell'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-7172322355853287078</id><published>2009-07-01T22:06:00.003-07:00</published><updated>2009-07-01T22:06:38.801-07:00</updated><title type='text'>Processes listening on a particular port</title><content type='html'>Inorder to find out the process listening on a particula port you can use the following command&lt;br /&gt;&lt;br /&gt;lsof -i TCP:portnumber&lt;br /&gt;&lt;br /&gt;eg: lsof -i TCP:80&lt;br /&gt;&lt;br /&gt;httpd 31969 linux 3u IPv6 8152068 TCP *:http (LISTEN)&lt;br /&gt;httpd 31971 linux 3u IPv6 8152068 TCP *:http (LISTEN)&lt;br /&gt;httpd 31972 linux 3u IPv6 8152068 TCP *:http (LISTEN)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-7172322355853287078?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/7172322355853287078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/processes-listening-on-particular-port.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/7172322355853287078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/7172322355853287078'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/processes-listening-on-particular-port.html' title='Processes listening on a particular port'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3511955590432858182</id><published>2009-07-01T22:06:00.001-07:00</published><updated>2009-07-01T22:06:17.970-07:00</updated><title type='text'>Fixing corrupted RPM db</title><content type='html'>Remove /var/lib/rpm/__db* files to avoid stale locks:&lt;br /&gt;&lt;br /&gt;cd /var/lib/rpm&lt;br /&gt;rm -rf __db*&lt;br /&gt;&lt;br /&gt;Rebuild RPM database&lt;br /&gt;&lt;br /&gt;# rpm --rebuilddb&lt;br /&gt;# rpmdb_verify Packages&lt;br /&gt;&lt;br /&gt;If you are still getting errors, then try your luck with following commands:&lt;br /&gt;&lt;br /&gt;# mv Packages Packages-BAKUP&lt;br /&gt;# db_dump Packages-BAKUP | db_load Packages&lt;br /&gt;# rpm -qa&lt;br /&gt;# rpm --rebuilddb&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3511955590432858182?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3511955590432858182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/fixing-corrupted-rpm-db.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3511955590432858182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3511955590432858182'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/fixing-corrupted-rpm-db.html' title='Fixing corrupted RPM db'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-28175422369702750</id><published>2009-07-01T22:05:00.001-07:00</published><updated>2009-07-01T22:05:55.406-07:00</updated><title type='text'>password protecting directories using .htaccess</title><content type='html'>If you want to protect /home/username/publlic_html do as follows&lt;br /&gt;&lt;br /&gt;cd /home/username/publlic_html&lt;br /&gt;touch .htaccess [if it is already there you can use it no need to create]&lt;br /&gt;&lt;br /&gt;Add the following line to the .htaccess file&lt;br /&gt;&lt;br /&gt;AuthUserFile /home/username/public_html/.htpasswd&lt;br /&gt;AuthName "Title for Protected Site"&lt;br /&gt;AuthType Basic&lt;br /&gt;Require valid-user&lt;br /&gt;&lt;br /&gt;The next stage is creating the .htpasswd file create it in the same directory as .htaccess&lt;br /&gt;&lt;br /&gt;cd /home/username/public_html [same place where your .htaccess is]&lt;br /&gt;&lt;br /&gt;touch .htpasswd&lt;br /&gt;htpasswd -c .htpasswd test&lt;br /&gt;New password:&lt;br /&gt;Re-type new password:&lt;br /&gt;Adding password for user test&lt;br /&gt;&lt;br /&gt;Thats it dont forget to change ownership and permission&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-28175422369702750?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/28175422369702750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/password-protecting-directories-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/28175422369702750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/28175422369702750'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/password-protecting-directories-using.html' title='password protecting directories using .htaccess'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-4715178887194380997</id><published>2009-07-01T22:04:00.002-07:00</published><updated>2009-07-01T22:05:05.643-07:00</updated><title type='text'>How to enable and disable ping request</title><content type='html'>To disable ping&lt;br /&gt;&lt;br /&gt;echo 1 &gt; /proc/sys/net/ipv4/icmp_echo_ignore_all&lt;br /&gt;&lt;br /&gt;To enable ping&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/1122127822293845269-4715178887194380997?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/4715178887194380997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-to-enable-and-disable-ping-request.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4715178887194380997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4715178887194380997'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-to-enable-and-disable-ping-request.html' title='How to enable and disable ping request'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-6233032631584422409</id><published>2009-07-01T22:04:00.001-07:00</published><updated>2009-07-01T22:04:20.989-07:00</updated><title type='text'>WHAT IS RSYNC</title><content type='html'>RSYNC&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rsync utility is used for synchronising files one of the major adavantage of rsync is that rsync can preserve permissions and ownership information, copy symbolic links, and generally is designed to intelligently handle your files&lt;br /&gt;&lt;br /&gt;The basic syntax for rsync is simple enough -- just run&lt;br /&gt;rsync [options] source destination&lt;br /&gt;&lt;br /&gt;If you want to rsync the contents from /home/mabin/ to /var/www/html/ the command&lt;br /&gt;&lt;br /&gt;rsync -a /home/mabin /var/www/html&lt;br /&gt;&lt;br /&gt;Whe doing rsync there is a big meaning in the ending '/' because if I rsync /home/mabin/ then only the contents inside the folder mabin will be copied.....but if didn't used the '/' ie /home/mabin then the entire directory will be taken ..that is a directory named mabin will be created at the destination&lt;br /&gt;&lt;br /&gt;some switches with rsync&lt;br /&gt;-----------------------------&lt;br /&gt;-a --&gt; archive option, which actually combines several rsync options. It combines the recursive and copy symlinks options, preserves group and owner, and generally makes rsync suitable for making archive copies. Note that it doesn't preserve hardlinks&lt;br /&gt;&lt;br /&gt;-H --&gt; Copies hard link&lt;br /&gt;&lt;br /&gt;-v --&gt; verbose mode&lt;br /&gt;&lt;br /&gt;-z --&gt; Compress option, will compress the data during transfer&lt;br /&gt;&lt;br /&gt;--delete --&gt; For deleting the already transferred data from source (a dangerous option, try to avoid it)&lt;br /&gt;&lt;br /&gt;--exclude=".*/" --&gt; To avoid copying hidden files. With this option you can avoid copying any particular file( If you dont want to copy .php files then pot it like this --exclude="*.php/"&lt;br /&gt;&lt;br /&gt;sample command for local copying&lt;br /&gt;----------------------------------------&lt;br /&gt;&lt;br /&gt;rsync -avh /home/mabin/ /var/www/html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Rsync for remote copying&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;rsync -avhe ssh /home/user/dir/ user@remote.host.com:dir/&lt;br /&gt;&lt;br /&gt;If you want to know how fast the transfer is going use the --progress option&lt;br /&gt;&lt;br /&gt;rsync --progress -avhe ssh /home/user/dir/ user@remote.host.com:dir/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-6233032631584422409?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/6233032631584422409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/what-is-rsync.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6233032631584422409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6233032631584422409'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/what-is-rsync.html' title='WHAT IS RSYNC'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3919275305555504487</id><published>2009-07-01T22:03:00.003-07:00</published><updated>2009-07-01T22:03:54.384-07:00</updated><title type='text'>How do I export and import a mysql db using PHPMyAdmin?</title><content type='html'>Step 1: Open phpMyAdmin and select the database from where you want to export data and/or structure. Go to the tab with "Export". Select the table(s) you want to save.&lt;br /&gt;&lt;br /&gt;Select the option you need: Data only or data and structure or structure only:&lt;br /&gt;&lt;br /&gt;--&gt; if you only want to update a table on another server, which has a table with the same structure, then you choose data only&lt;br /&gt;&lt;br /&gt;--&gt; if you want to create a new table on another server (for instance, if you have a development environment and you now want to put your application in production) then choose structure only&lt;br /&gt;&lt;br /&gt;--&gt; if you are moving a complete table, choose data and structure Select "save as file" Hit "go" You can now enter a filename and specify where the file needs to be saved. It's recommended to choose a meaningful filename that includes the date. Like "shop_05_07_03.sql" This creates the dumpfile. If you open it in notepad or any other texteditor, it looks something like: Quote:&lt;br /&gt;&lt;br /&gt;# phpMyAdmin MySQL-Dump # version 2.4.0 # http://www.phpmyadmin.net/ (download page) # # Host: thehostname would be here # Generation Time: Apr 04, 2004 at 02:39 PM # Server version: 4.0.13 # PHP Version: 4.2.3 # Database : `db-name would be here` # -------------------------------------------------------- # # Table structure for table `test` # CREATE TABLE test ( siteID int(6) NOT NULL auto_increment, uname tinytext NOT NULL, upwd tinytext NOT NULL, nick tinytext NOT NULL, sitename text NOT NULL, regdate date NOT NULL default '9999-01-01', numtrial int(7) unsigned NOT NULL default '0', PRIMARY KEY (siteID) ) TYPE=MyISAM COMMENT='Table with userinfo'; # # Dumping data for table `useradmin` # INSERT INTO test VALUES (1, 'mytest', 'testt', 'myteste', 'www.mysite.com/site/test.html', '0000-00-00', 0);&lt;br /&gt;&lt;br /&gt;This is the dumpfile for table 'test' that contains one record. As you can see, it's just a series of sql statements to recreate the table and insert all records.&lt;br /&gt;&lt;br /&gt;Step 2: If necessary, can can upload this file to a server or move it to another PC (on a disk or whatever)&lt;br /&gt;&lt;br /&gt;Step 3: Open phpMyAdmin. Select the database you want to import the table(s) in. Go to the SQL tab. Look at the bottom for "Or location of the textfile" and browse to the dumpfile. Doubleclick on it so that the fileadress appears in the textbox. Then hit "go" All sql-statement will be executed and you will get a notification after the file is processed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3919275305555504487?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3919275305555504487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-do-i-export-and-import-mysql-db.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3919275305555504487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3919275305555504487'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-do-i-export-and-import-mysql-db.html' title='How do I export and import a mysql db using PHPMyAdmin?'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3335549167036428823</id><published>2009-07-01T22:03:00.001-07:00</published><updated>2009-07-01T22:03:25.490-07:00</updated><title type='text'>Quota error on vps while starting a particular node</title><content type='html'>vzquota drop VE ID&lt;br /&gt;Vzctl start VE ID&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3335549167036428823?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3335549167036428823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/quota-error-on-vps-while-starting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3335549167036428823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3335549167036428823'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/quota-error-on-vps-while-starting.html' title='Quota error on vps while starting a particular node'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-897240233202231513</id><published>2009-07-01T21:58:00.000-07:00</published><updated>2009-07-01T22:01:01.554-07:00</updated><title type='text'>Apache not starting:(No space left on device: mod_rewrite)</title><content type='html'>The error specifies that there is no more space left in Semaphore Arrays for Apache.&lt;br /&gt;Please run this through shell&lt;br /&gt;&lt;br /&gt;for ipsemId in $(ipcs -s | grep apache | cut -f 2 -d ' '); do ipcrm $ipsemId; done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-897240233202231513?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/897240233202231513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/apache-not-startingno-space-left-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/897240233202231513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/897240233202231513'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/apache-not-startingno-space-left-on.html' title='Apache not starting:(No space left on device: mod_rewrite)'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-5045566655808220924</id><published>2009-07-01T21:57:00.001-07:00</published><updated>2009-07-01T21:57:14.567-07:00</updated><title type='text'>VPS related issues</title><content type='html'>Please visit this link for vps related issues:&lt;br /&gt;&lt;br /&gt;http://forum.openvz.org/index.php?t=thread&amp;frm_id=2&amp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-5045566655808220924?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/5045566655808220924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/vps-related-issues.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5045566655808220924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5045566655808220924'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/vps-related-issues.html' title='VPS related issues'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-1666976062594004508</id><published>2009-07-01T21:56:00.001-07:00</published><updated>2009-07-01T21:56:37.792-07:00</updated><title type='text'>Adding ssh key-passwordless login</title><content type='html'>On the source server do the following&lt;br /&gt;&lt;br /&gt;ssh-keygen -t dsa -f filename&lt;br /&gt;&lt;br /&gt;It will prompt for a passphrace, it is desirable to leave it empty.&lt;br /&gt;Two files will be created&lt;br /&gt;&lt;br /&gt;filename&lt;br /&gt;filename.pub&lt;br /&gt;&lt;br /&gt;copy the filename.pub file to the destination server to the location /root/.ssh add the public key entry into authorized_keys as follows&lt;br /&gt;&lt;br /&gt;cat filename.pub &gt;&gt; authorized_keys&lt;br /&gt;&lt;br /&gt;/etc/init.d/sshd restart&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-1666976062594004508?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/1666976062594004508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/adding-ssh-key-passwordless-login.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1666976062594004508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1666976062594004508'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/adding-ssh-key-passwordless-login.html' title='Adding ssh key-passwordless login'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-6856930052652219503</id><published>2009-07-01T21:55:00.001-07:00</published><updated>2009-07-01T21:55:47.517-07:00</updated><title type='text'>Disk quota error in VPS</title><content type='html'>This error occurs due to 2 reasons: DISKINODES or DISKSPACE configuration in VPS&lt;br /&gt;solution: This worked for me as the DISKINODES did nto have much space assigned.&lt;br /&gt;Try changing it to : DISKINODES="1000000:1200000" and restart vps&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-6856930052652219503?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/6856930052652219503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/disk-quota-error-in-vps.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6856930052652219503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6856930052652219503'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/disk-quota-error-in-vps.html' title='Disk quota error in VPS'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3670035698919403971</id><published>2009-07-01T21:50:00.000-07:00</published><updated>2009-07-01T21:52:46.104-07:00</updated><title type='text'>Ip tables</title><content type='html'>Iptables is a packet filtering tool which allows system administrator to define incoming and outgoing packets to a system using certain rules. Iptables can be confusing it's pretty straightforward once you get the hang of it.&lt;br /&gt;&lt;br /&gt;Iptables is in short a Linux based packet filtering firewall. Iptables interfaces to the Linux netfilter module to perform filtering of network packets. This can be to deny/allow traffic filter or perform Network Address Translation (NAT). With careful configuration iptables can be a very cost effective, powerful and flexible firewall or gateway solution. Iptables is available from http://www.netfilter.org/ or via your Linux distribution.&lt;br /&gt;&lt;br /&gt;Rules, Chains, and Tables&lt;br /&gt;&lt;br /&gt;Iptables rules are grouped into chains. A chain is a set of rules used to determine what to do with a packet. These chains are grouped into tables. Iptables has three built in tables filter, NAT, mangle. More tables can be added through iptables extensions.&lt;br /&gt;&lt;br /&gt;Filter Table&lt;br /&gt;&lt;br /&gt;The filter table is used to allow and block traffic, and contains three chains INPUT, OUTPUT, FORWARD. The input chain is used to filter packets destined for the local system. The output chain is used to filter packets created by the local system. The forward chain is used for packets passing through the system, mainly used for gateways/routers.&lt;br /&gt;&lt;br /&gt;There are three real "chains" which iptables uses:&lt;br /&gt;&lt;br /&gt;* INPUT&lt;br /&gt;Which is used to grant or deny incoming connections to your machine.&lt;br /&gt;* OUTPUT&lt;br /&gt;Which is used to grant or deny outgoing connections from your machine.&lt;br /&gt;* FORWARD&lt;br /&gt;Which is used for forwarding packages across interfaces, only really needed (in general) when you're setting up a gateway machine.&lt;br /&gt;&lt;br /&gt;NAT Table&lt;br /&gt;&lt;br /&gt;The NAT table is used to setup the rules to rewrite packets allowing NAT to happen. This table also has 3 chains, PREROUTING, POSTROUTING, and OUTPUT. The prerouting chain is where packets come to prior to being parsed by the local routing table. The postrouting chain is where packets are sent after going through the local routing table. The output chain&lt;br /&gt;&lt;br /&gt;The general form of an IP tables command is:&lt;br /&gt;&lt;br /&gt;iptables -A CHAIN -p tcp/udp [options] -j ACTION&lt;br /&gt;&lt;br /&gt;The CHAIN we've briefly covered before, "INPUT", "OUTPUT", "FORWARD", etc. Here "-A INPUT" means "append this rule to the input chain".&lt;br /&gt;&lt;br /&gt;The "-p tcp" means this rule applies only to TCP connections, not UDP. (To specify UDP connections you'd use "-p udp" instead.)&lt;br /&gt;&lt;br /&gt;"[options]" is where you specify what you wish to match against.&lt;br /&gt;&lt;br /&gt;Finally "-j ACTION" is used to specify what to do to packets which match your rule. Usually an action will be one of "-j DROP" to drop the package, "-j ACCEPT", to accept the packet or "-j LOG" to log it.&lt;br /&gt;&lt;br /&gt;Commands&lt;br /&gt;&lt;br /&gt;The first step is to know iptables commands.&lt;br /&gt;&lt;br /&gt;Main commands&lt;br /&gt;&lt;br /&gt;* -A --append : Add the rule a the end of the specified chain&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -A INPUT ...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* -D --delete : Allow to delete a chain.&lt;br /&gt;There's 2 way to use it, you can specify the number of the chain to delete or specify the rule to delete&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -D INPUT 1&lt;br /&gt;iptables -D INPUT --dport 80 -j DROP&lt;br /&gt;&lt;br /&gt;* -R --replace : Allow to replace the specified chain&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -R INPUT 1 -s 192.168.0.1 -j DROP&lt;br /&gt;&lt;br /&gt;* -I --insert : Allow to add a chain in a specific area of the global chain&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -I INPUT 1 --dport 80 -j ACCEPT&lt;br /&gt;&lt;br /&gt;* -L --list : Display the rules&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -L # Display all the rules of the FILTER chains&lt;br /&gt;iptables -L INPUT # Display all the INPUT rules (FILTER)&lt;br /&gt;&lt;br /&gt;* -F --flush : Delete all the rules of a chain&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -F INPUT # Delete all the rules of the INPUT chain&lt;br /&gt;iptables -F # Delete all the rules&lt;br /&gt;&lt;br /&gt;* -N --new-chain : Allow to create a new chain&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -N LOG_DROP&lt;br /&gt;&lt;br /&gt;* -X --delete-chain : Allow to delete a chain&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;iptables -X LOG_DROP # Delete the LOG_DROP chain&lt;br /&gt;iptables -X # Delete the chains&lt;br /&gt;&lt;br /&gt;* -P --policy : Allow to specify to the kernel the default policy of a chain ACCEPT, REJECT, DROP ...&lt;br /&gt;Code:&lt;br /&gt;iptables -P INPUT DROP&lt;br /&gt;&lt;br /&gt;Basic Uses&lt;br /&gt;&lt;br /&gt;The most common use of iptables is to simply block and allow traffic.&lt;br /&gt;&lt;br /&gt;Allow Traffic&lt;br /&gt;&lt;br /&gt;Iptables allows you to allow traffic based on a number of different conditions such as Ethernet adapter, IP Address, port, and protocol.&lt;br /&gt;&lt;br /&gt;Allow incoming TCP traffic on port 22 (ssh) for adapter eth0&lt;br /&gt;iptables -A INPUT -i eth0 -p tcp -m tcp --dport 22 -j ACCEPT&lt;br /&gt;&lt;br /&gt;Allow incoming TCP traffic on port 80 (HTTP) for the IP range 192.168.0.1 Ã¢â‚¬â€œ 192.168.0.254.&lt;br /&gt;iptables -A INPUT -s 192.168.0.0/24 -p tcp -m tcp --dport 80 -j ACCEPT&lt;br /&gt;&lt;br /&gt;Block Traffic&lt;br /&gt;&lt;br /&gt;Iptables can block traffic on the same conditions that traffic can be allowed.&lt;br /&gt;&lt;br /&gt;Blocks inbound TCP traffic port 22 (ssh)&lt;br /&gt;iptables -A INPUT -p tcp -m tcp --dport 22 -j DRROP&lt;br /&gt;&lt;br /&gt;Blocks inbound TCP traffic on port 80 (HTTP) from the IP 192.168.1.100&lt;br /&gt;iptables -A INPUT -s 192.168.1.100 -p tcp -m tcp --dport 80 -j DRROP&lt;br /&gt;&lt;br /&gt;Limit Traffic&lt;br /&gt;&lt;br /&gt;Along with allowing and denying traffic IP tables can be used to limit the number of connections allowed over time thresholds.&lt;br /&gt;&lt;br /&gt;iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m sshbrute --set&lt;br /&gt;iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m sshbrute --update --seconds 60 --hitcount 4 -j DRROP&lt;br /&gt;&lt;br /&gt;[:p:] this is a common set of rules used to block brute force ssh attacks. The first rule makes sure the IP connecting is added to the sshbrute list. The second rule tells iptables to check the sshbrute list and if the packet threshold is exceeded to drrop the traffic.&lt;br /&gt;&lt;br /&gt;Common Options and Switches&lt;br /&gt;-A -- adds a rule at the end of the chain&lt;br /&gt;-I -- inserts the rule at the given rule number. If no rule number is given the rule is inserted at the head of the chain.&lt;br /&gt;-p -- protocol of the rule&lt;br /&gt;--dport the destination port to check on the rule&lt;br /&gt;-i -- interface on which the packet was received.&lt;br /&gt;-j -- what to do if the rule matches&lt;br /&gt;-s -- source IP address of packet&lt;br /&gt;-d -- destination IP address of packet&lt;br /&gt;&lt;br /&gt;Examples :&lt;br /&gt;&lt;br /&gt;Drop all inbound telnet traffic&lt;br /&gt;iptables -I INPUT -p tcp --dport 23 -j DRrOP&lt;br /&gt;&lt;br /&gt;Drop all outbound web traffic&lt;br /&gt;iptables -I OUTPUT -p tcp --dport 80 -j DRROP&lt;br /&gt;&lt;br /&gt;Drop all outbound traffic to 192.168.0.1&lt;br /&gt;iptables -I OUTPUT -p tcp --dest 192.168.0.1 -j DRROP&lt;br /&gt;&lt;br /&gt;Allow all inbound web traffic&lt;br /&gt;iptables -I INPUT -p tcp --dport 80 -j ACCEPT&lt;br /&gt;&lt;br /&gt;Allow inbound HTTPS traffic from 10.2.2.4&lt;br /&gt;iptables -I INPUT -s 10.2.2.4 -p tcp -m tcp --dport 443 -j DRROP&lt;br /&gt;&lt;br /&gt;Deny outbound traffic to 192.2.4.0-192.2.4.255&lt;br /&gt;iptables -I OUTPUT -d 192.2.4.6.0/24 -j DRROP&lt;br /&gt;&lt;br /&gt;Allow incoming connections to port 21 from one IP address 11.22.33.44&lt;br /&gt;iptables -A INPUT -p tcp -m state --state NEW --dport 21 --source 11.22.33.44&lt;br /&gt;&lt;br /&gt;Deny all other incoming connections to port 21.&lt;br /&gt;iptables -A INPUT -p tcp -m state --state NEW --dport 21 -j DROP&lt;br /&gt;&lt;br /&gt;We used the "-m state --state NEW --dport 21" to match against new connections to port 21. Other options allow you to match against different things.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3670035698919403971?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3670035698919403971/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/ip-tables.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3670035698919403971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3670035698919403971'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/ip-tables.html' title='Ip tables'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-2718955659183886475</id><published>2009-07-01T21:49:00.001-07:00</published><updated>2009-07-01T21:49:27.630-07:00</updated><title type='text'>Squirrel mail login prompting repeatedly</title><content type='html'>Sometimes these issue is found in cpanel servers.&lt;br /&gt;If you are facing any such issues. Please restart the following services&lt;br /&gt;&lt;br /&gt;/scripts/restartsrv_exim&lt;br /&gt;/scripts/restartsrv_cppop&lt;br /&gt;/scripts/restartsrv_imap&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-2718955659183886475?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/2718955659183886475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/squirrel-mail-login-prompting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/2718955659183886475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/2718955659183886475'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/squirrel-mail-login-prompting.html' title='Squirrel mail login prompting repeatedly'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-388375473363493791</id><published>2009-07-01T21:48:00.000-07:00</published><updated>2009-07-01T21:49:02.736-07:00</updated><title type='text'>Log File Paths</title><content type='html'>The first place you should go when trying to debug a problem is the log file for that program.&lt;br /&gt;&lt;br /&gt;The list of Log Files are as follows:&lt;br /&gt;&lt;br /&gt;DirectAdmin:&lt;br /&gt;/var/log/directadmin/error.log&lt;br /&gt;/var/log/directadmin/errortaskq.log&lt;br /&gt;/var/log/directadmin/system.log&lt;br /&gt;/var/log/directadmin/security.log&lt;br /&gt;&lt;br /&gt;Apache:&lt;br /&gt;/var/log/httpd/error_log&lt;br /&gt;/var/log/httpd/access_log&lt;br /&gt;/var/log/httpd/suexec_log&lt;br /&gt;/var/log/httpd/fpexec_log&lt;br /&gt;/var/log/httpd/domains/domain.com.error.log&lt;br /&gt;/var/log/httpd/domains/domain.com.log&lt;br /&gt;/var/log/messages (generic errors)&lt;br /&gt;&lt;br /&gt;Proftpd:&lt;br /&gt;/var/log/proftpd/access.log&lt;br /&gt;/var/log/proftpd/auth.log&lt;br /&gt;/var/log/messages (generic errors)&lt;br /&gt;&lt;br /&gt;vm-pop3d:&lt;br /&gt;/var/log/maillog&lt;br /&gt;/var/log/messages&lt;br /&gt;&lt;br /&gt;named (bind):&lt;br /&gt;/var/log/messages&lt;br /&gt;&lt;br /&gt;exim:&lt;br /&gt;/var/log/exim/mainlog&lt;br /&gt;/var/log/exim/paniclog&lt;br /&gt;/var/log/exim/processlog&lt;br /&gt;/var/log/exim/rejectlog&lt;br /&gt;(on FreeBSD, they have "exim_" in front of the filenames)&lt;br /&gt;&lt;br /&gt;mysqld:&lt;br /&gt;&lt;br /&gt;RedHat:&lt;br /&gt;/var/lib/mysql/server.hostname.com.err&lt;br /&gt;FreeBSD:&lt;br /&gt;/usr/local/mysql/data/server.hostname.com.err&lt;br /&gt;&lt;br /&gt;crond:&lt;br /&gt;/var/log/cron&lt;br /&gt;&lt;br /&gt;To view a log file, run:&lt;br /&gt;&lt;br /&gt;less /var/log/filename&lt;br /&gt;Where /var/log/filename is the path of the log you wish to view. If the log is too large you can use the "tail" command:&lt;br /&gt;&lt;br /&gt;tail -n 30 /var/log/filename&lt;br /&gt;Where 30 is the number of lines from the end you wish to view.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-388375473363493791?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/388375473363493791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/log-file-paths.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/388375473363493791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/388375473363493791'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/log-file-paths.html' title='Log File Paths'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-5025690303803402705</id><published>2009-07-01T21:47:00.002-07:00</published><updated>2009-07-01T21:48:07.377-07:00</updated><title type='text'>Basic commands in Exim</title><content type='html'>Print a count of the messages in the queue:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -bpc&lt;br /&gt;&lt;br /&gt;Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):&lt;br /&gt;&lt;br /&gt;root@localhost# exim -bp&lt;br /&gt;&lt;br /&gt;Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals):&lt;br /&gt;&lt;br /&gt;root@localhost# exim -bp | exiqsumm&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Print what Exim is doing right now:&lt;br /&gt;&lt;br /&gt;root@localhost# exiwhat&lt;br /&gt;&lt;br /&gt;Test how exim will route a given address:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -bt alias@localdomain.com&lt;br /&gt;user@thishost.com&lt;br /&gt;&lt;-- alias@localdomain.com&lt;br /&gt;router = localuser, transport = local_delivery&lt;br /&gt;&lt;br /&gt;root@localhost# exim -bt user@thishost.com&lt;br /&gt;user@thishost.com&lt;br /&gt;router = localuser, transport = local_delivery&lt;br /&gt;root@localhost# exim -bt user@remotehost.com&lt;br /&gt;router = lookuphost, transport = remote_smtp&lt;br /&gt;host mail.remotehost.com [1.2.3.4] MX=0&lt;br /&gt;&lt;br /&gt;Run a pretend SMTP transaction from the command line, as if it were coming from the given IP address. This will display Exim's checks, ACLs, and filters as they are applied. The message will NOT actually be delivered.&lt;br /&gt;&lt;br /&gt;root@localhost# exim -bh 192.168.11.22&lt;br /&gt;&lt;br /&gt;Display all of Exim's configuration settings:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -bP&lt;br /&gt;&lt;br /&gt;Searching the queue with exiqgrep&lt;br /&gt;&lt;br /&gt;Exim includes a utility that is quite nice for grepping through the queue, called exiqgrep. Learn it. Know it. Live it. If you're not using this, and if you're not familiar with the various flags it uses, you're probably doing things the hard way, like piping `exim -bp` into awk, grep, cut, or `wc -l`. Don't make life harder than it already is.&lt;br /&gt;&lt;br /&gt;First, various flags that control what messages are matched. These can be combined to come up with a very particular search.&lt;br /&gt;&lt;br /&gt;Use -f to search the queue for messages from a specific sender:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -f [luser]@domain&lt;br /&gt;&lt;br /&gt;Use -r to search the queue for messages for a specific recipient/domain:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -r [luser]@domain&lt;br /&gt;&lt;br /&gt;Use -o to print messages older than the specified number of seconds. For example, messages older than 1 day:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -o 86400 [...]&lt;br /&gt;&lt;br /&gt;Use -y to print messages that are younger than the specified number of seconds. For example, messages less than an hour old:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -y 3600 [...]&lt;br /&gt;&lt;br /&gt;Use -s to match the size of a message with a regex. For example, 700-799 bytes:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -s '^7..$' [...]&lt;br /&gt;&lt;br /&gt;Use -z to match only frozen messages, or -x to match only unfrozen messages.&lt;br /&gt;&lt;br /&gt;There are also a few flags that control the display of the output.&lt;br /&gt;&lt;br /&gt;Use -i to print just the message-id as a result of one of the above two searches:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -i [ -r | -f ] ...&lt;br /&gt;&lt;br /&gt;Use -c to print a count of messages matching one of the above searches:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -c ...&lt;br /&gt;&lt;br /&gt;Print just the message-id of the entire queue:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -i&lt;br /&gt;&lt;br /&gt;Managing the queue&lt;br /&gt;&lt;br /&gt;The main exim binary (/usr/sbin/exim) is used with various flags to make things happen to messages in the queue. Most of these require one or more message-IDs to be specified in the command line, which is where `exiqgrep -i` as described above really comes in handy.&lt;br /&gt;&lt;br /&gt;Start a queue run:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -q -v&lt;br /&gt;&lt;br /&gt;Start a queue run for just local deliveries:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -ql -v&lt;br /&gt;&lt;br /&gt;Remove a message from the queue:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mrm [ ... ]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Freeze a message:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mf [ ... ]&lt;br /&gt;&lt;br /&gt;Thaw a message:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mt [ ... ]&lt;br /&gt;&lt;br /&gt;Deliver a message:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -M [ ... ]&lt;br /&gt;&lt;br /&gt;Force a message to fail and bounce as "cancelled by administrator":&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mg [ ... ]&lt;br /&gt;&lt;br /&gt;Remove all frozen messages:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -z -i | xargs exim -Mrm&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remove all messages older than five days (86400 * 5 = 432000 seconds):&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -o 432000 -i | xargs exim -Mrm&lt;br /&gt;&lt;br /&gt;Freeze all queued mail from a given sender:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -i -f luser@example.tld | xargs exim -Mf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;View a message's headers:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mvh&lt;br /&gt;&lt;br /&gt;View a message's body:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mvb&lt;br /&gt;&lt;br /&gt;View a message's logs:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mvl&lt;br /&gt;&lt;br /&gt;Add a recipient to a message:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mar&lt;br /&gt;[&lt;br /&gt;... ]&lt;br /&gt;&lt;br /&gt;Edit the sender of a message:&lt;br /&gt;&lt;br /&gt;root@localhost# exim -Mes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Access control&lt;br /&gt;&lt;br /&gt;Exim allows you to apply access control lists at various points of the SMTP transaction by specifying an ACL to use and defining its conditions in exim.conf. You could start with the HELO string.&lt;br /&gt;&lt;br /&gt;# Specify the ACL to use after HELO&lt;br /&gt;acl_smtp_helo = check_helo&lt;br /&gt;&lt;br /&gt;# Conditions for the check_helo ACL:&lt;br /&gt;check_helo:&lt;br /&gt;&lt;br /&gt;deny message = Gave HELO/EHLO as "friend"&lt;br /&gt;log_message = HELO/EHLO friend&lt;br /&gt;condition = ${if eq {$sender_helo_name} }&lt;br /&gt;&lt;br /&gt;deny message = Gave HELO/EHLO as our IP address&lt;br /&gt;log_message = HELO/EHLO our IP address&lt;br /&gt;condition = ${if eq {$sender_helo_name}{$interface_address} }&lt;br /&gt;&lt;br /&gt;accept&lt;br /&gt;&lt;br /&gt;NOTE: Pursue HELO checking at your own peril. The HELO is fairly unimportant in the grand scheme of SMTP these days, so don't put too much faith in whatever it contains. Some spam might seem to use a telltale HELO string, but you might be surprised at how many legitimate messages start off with a questionable HELO as well. Anyway, it's just as easy for a spammer to send a proper HELO than it is to send HELO im.a.spammer, so consider yourself lucky if you're able to stop much spam this way.&lt;br /&gt;&lt;br /&gt;Next, you can perform a check on the sender address or remote host. This shows how to do that after the RCPT TO command; if you reject here, as opposed to rejecting after the MAIL FROM, you'll have better data to log, such as who the message was intended for.&lt;br /&gt;&lt;br /&gt;# Specify the ACL to use after RCPT TO&lt;br /&gt;acl_smtp_rcpt = check_recipient&lt;br /&gt;&lt;br /&gt;# Conditions for the check_recipient ACL&lt;br /&gt;check_recipient:&lt;br /&gt;&lt;br /&gt;# [...]&lt;br /&gt;&lt;br /&gt;drop hosts = /etc/exim_reject_hosts&lt;br /&gt;drop senders = /etc/exim_reject_senders&lt;br /&gt;&lt;br /&gt;# [ Probably a whole lot more... ]&lt;br /&gt;&lt;br /&gt;This example uses two plain text files as blacklists. Add appropriate entries to these files - hostnames/IP addresses to /etc/exim_reject_hosts, addresses to /etc/exim_reject_senders, one entry per line.&lt;br /&gt;&lt;br /&gt;It is also possible to perform content scanning using a regex against the body of a message, though obviously this can cause Exim to use more CPU than it otherwise would need to, especially on large messages.&lt;br /&gt;&lt;br /&gt;# Specify the ACL to use after DATA&lt;br /&gt;acl_smtp_data = check_message&lt;br /&gt;&lt;br /&gt;# Conditions for the check_messages ACL&lt;br /&gt;check_message:&lt;br /&gt;&lt;br /&gt;deny message = "Sorry, Charlie: $regex_match_string"&lt;br /&gt;regex = ^Subject:: .*Lower your self-esteem by becoming a sysadmin&lt;br /&gt;&lt;br /&gt;accept&lt;br /&gt;&lt;br /&gt;Fix SMTP-Auth for Pine&lt;br /&gt;&lt;br /&gt;If pine can't use SMTP authentication on an Exim host and just returns an "unable to authenticate" message without even asking for a password, add the following line to exim.conf:&lt;br /&gt;&lt;br /&gt;begin authenticators&lt;br /&gt;&lt;br /&gt;fixed_plain:&lt;br /&gt;driver = plaintext&lt;br /&gt;public_name = PLAIN&lt;br /&gt;server_condition = "${perl{$1}{$2}{$3}}"&lt;br /&gt;server_set_id = $2&lt;br /&gt;&gt; server_prompts = :&lt;br /&gt;&lt;br /&gt;This was a problem on CPanel Exim builds awhile ago, but they seem to have added this line to their current stock configuration.&lt;br /&gt;Log the subject line&lt;br /&gt;&lt;br /&gt;This is one of the most useful configuration tweaks I've ever found for Exim. Add this to exim.conf, and you can log the subject lines of messages that pass through your server. This is great for troubleshooting, and for getting a very rough idea of what messages may be spam.&lt;br /&gt;&lt;br /&gt;log_selector = +subject&lt;br /&gt;&lt;br /&gt;Reducing or increasing what is logged.&lt;br /&gt;Disable identd lookups&lt;br /&gt;&lt;br /&gt;Frankly, I don't think identd has been useful for a long time, if ever. Identd relies on the connecting host to confirm the identity (system UID) of the remote user who owns the process that is making the network connection. This may be of some use in the world of shell accounts and IRC users, but it really has no place on a high-volume SMTP server, where the UID is often simply "mail" or whatever the remote MTA runs as, which is useless to know. It's overhead, and results in nothing but delays while the identd query is refused or times out. You can stop your Exim server from making these queries by setting the timeout to zero seconds in exim.conf:&lt;br /&gt;&lt;br /&gt;rfc1413_query_timeout = 0s&lt;br /&gt;&lt;br /&gt;Disable Attachment Blocking&lt;br /&gt;&lt;br /&gt;To disable the executable-attachment blocking that many Cpanel servers do by default but don't provide any controls for on a per-domain basis, add the following block to the beginning of the /etc/antivirus.exim file:&lt;br /&gt;&lt;br /&gt;if $header_to: matches "example\.com|example2\.com"&lt;br /&gt;then&lt;br /&gt;finish&lt;br /&gt;endif&lt;br /&gt;&lt;br /&gt;It is probably possible to use a separate file to list these domains, but I haven't had to do this enough times to warrant setting such a thing up.&lt;br /&gt;Searching the logs with exigrep&lt;br /&gt;&lt;br /&gt;The exigrep utility (not to be confused with exiqgrep) is used to search an exim log for a string or pattern. It will print all log entries with the same internal message-id as those that matched the pattern, which is very handy since any message will take up at least three lines in the log. exigrep will search the entire content of a log entry, not just particular fields.&lt;br /&gt;&lt;br /&gt;One can search for messages sent from a particular IP address:&lt;br /&gt;&lt;br /&gt;root@localhost# exigrep '&lt;= .* \[12.34.56.78\] ' /path/to/exim_log&lt;br /&gt;&lt;br /&gt;Search for messages sent to a particular IP address:&lt;br /&gt;&lt;br /&gt;root@localhost# exigrep '=&gt; .* \[12.34.56.78\]' /path/to/exim_log&lt;br /&gt;&lt;br /&gt;This example searches for outgoing messages, which have the "=&gt;" symbol, sent to "user@domain.tld". The pipe to grep for the "&lt;=" symbol will match only the lines with information on the sender - the From address, the sender's IP address, the message size, the message ID, and the subject line if you have enabled logging the subject. The purpose of doing such a search is that the desired information is not on the same log line as the string being searched for.&lt;br /&gt;&lt;br /&gt;root@localhost# exigrep '=&gt; .*user@domain.tld' /path/to/exim_log | fgrep '&lt;='&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Generate and display Exim stats from a logfile:&lt;br /&gt;&lt;br /&gt;root@localhost# eximstats /path/to/exim_mainlog&lt;br /&gt;&lt;br /&gt;Same as above, with less verbose output:&lt;br /&gt;&lt;br /&gt;root@localhost# eximstats -ne -nr -nt /path/to/exim_mainlog&lt;br /&gt;&lt;br /&gt;Same as above, for one particular day:&lt;br /&gt;&lt;br /&gt;root@localhost# fgrep YYYY-MM-DD /path/to/exim_mainlog | eximstats&lt;br /&gt;&lt;br /&gt;Bonus!&lt;br /&gt;&lt;br /&gt;To delete all queued messages containing a certain string in the body:&lt;br /&gt;&lt;br /&gt;root@localhost# grep -lr 'a certain string' /var/spool/exim/input/ | \&lt;br /&gt;sed -e 's/^.*\/\([a-zA-Z0-9-]*\)-[DH]$/\1/g' | xargs exim -Mrm&lt;br /&gt;&lt;br /&gt;Note that the above only delves into /var/spool/exim in order to grep for queue files with the given string, and that's just because exiqgrep doesn't have a feature to grep the actual bodies of messages. If you are deleting these files directly, YOU ARE DOING IT WRONG! Use the appropriate exim command to properly deal with the queue.&lt;br /&gt;&lt;br /&gt;If you have to feed many, many message-ids (such as the output of an `exiqgrep -i` command that returns a lot of matches) to an exim command, you may exhaust the limit of your shell's command line arguments. In that case, pipe the listing of message-ids into xargs to run only a limited number of them at once. For example, to remove thousands of messages sent from joe@example.com:&lt;br /&gt;&lt;br /&gt;root@localhost# exiqgrep -i -f '' | xargs exim -Mrm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-5025690303803402705?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/5025690303803402705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/basic-commands-in-exim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5025690303803402705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5025690303803402705'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/basic-commands-in-exim.html' title='Basic commands in Exim'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-5341151135917670478</id><published>2009-07-01T21:47:00.001-07:00</published><updated>2009-07-01T21:47:18.731-07:00</updated><title type='text'>How to enable“Update Now” Button in Cpanel Awstats</title><content type='html'>Tired of bugging your host to update Cpanel awstats? You can generate stats, update it by your own by clicking the ‘update now’ link at the top of the main page in the awstats. You can place this “update now” by yourself .&lt;br /&gt;Find out how to change the configuration file for Awstats to re-enable the ‘update now’ button.&lt;br /&gt;&lt;br /&gt;Follow these steps:&lt;br /&gt;1. login into cPanel&lt;br /&gt;1a. Open File Manager&lt;br /&gt;2. navigate to /home/username/tmp/awstats/&lt;br /&gt;3. edit the .conf file (e.g. awstats.yourdomain.com.conf)&lt;br /&gt;4. look for this line: AllowToUpdateStatsFromBrowser, set the value to 1 (AllowToUpdateStatsFromBrowser=1)&lt;br /&gt;5. Save the .conf file. When you refresh your statistics page. you will get ‘update now’ link at the top of the page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-5341151135917670478?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/5341151135917670478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-to-enableupdate-now-button-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5341151135917670478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5341151135917670478'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-to-enableupdate-now-button-in.html' title='How to enable“Update Now” Button in Cpanel Awstats'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-4425118971557915849</id><published>2009-07-01T21:44:00.001-07:00</published><updated>2009-07-01T21:44:30.869-07:00</updated><title type='text'>Managing mail queue</title><content type='html'>If mail queue have more then 10000 mails client is unable to send the mails, you may need to clear out frozen mails.&lt;br /&gt;&lt;br /&gt;exim -bpru|grep frozen | wc -l --- This will list the number of frozen mails&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;exim -bpru|grep frozen|awk {'print $3'}|xargs exim -Mrm --- Remove the frozen messages.&lt;br /&gt;&lt;br /&gt;Please check mail queue properly and observer which account is sending the mask mails.&lt;br /&gt;run following command to delete mails of that account.&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;grep -lr account@yourdomain.com /var/spool/exim/input/* | xargs rm -rf&lt;br /&gt;&lt;br /&gt;Do the following things to delete mail from perticuler domains.&lt;br /&gt;&lt;br /&gt;grep -lr domainname.com /var/spool/exim/input/* |xargs rm -rf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-4425118971557915849?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/4425118971557915849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/managing-mail-queue.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4425118971557915849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4425118971557915849'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/managing-mail-queue.html' title='Managing mail queue'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3906670784200016820</id><published>2009-07-01T21:43:00.003-07:00</published><updated>2009-07-01T21:43:53.361-07:00</updated><title type='text'>Cannot login to Horde</title><content type='html'>Hope you would have got this issue often. The client cannot able to login to his Horde account to check his mail. He would have reached till the login screen and if he click "Login" it will stay back in the same screen instead of going to his inbox. Here is the fix for it,&lt;br /&gt;&lt;br /&gt;Check the following first,&lt;br /&gt;&lt;br /&gt;1. goto " cd var/lib/mysql/horde " and check if there is a file named " horde_sessionhandler.frm "&lt;br /&gt;&lt;br /&gt;2. move all the file named "horde_sessionhandler" with other name&lt;br /&gt;&lt;br /&gt;3. Or you can goto mysql and can drop the table "horde_sessionhandler". It will show error message some times. If so use the step 2, so that the table gets moved automatically.(Remember that if you are using step2 skip the step 3)&lt;br /&gt;&lt;br /&gt;4. Now type in shell "mysql"&lt;br /&gt;&lt;br /&gt;5. It will take to mysql prompt . type "use horde";&lt;br /&gt;&lt;br /&gt;6. copy this command and paste there :&lt;br /&gt;&lt;br /&gt;CREATE TABLE horde_sessionhandler (session_id VARCHAR(32) NOT NULL, session_lastmodified INT NOT NULL, session_data LONGBLOB, PRIMARY KEY (session_id)) ENGINE = InnoDB;&lt;br /&gt;&lt;br /&gt;7. quit from mysql and restart mysql.&lt;br /&gt;&lt;br /&gt;8. Try now... Your issue is fixed!!!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3906670784200016820?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3906670784200016820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/cannot-login-to-horde.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3906670784200016820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3906670784200016820'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/cannot-login-to-horde.html' title='Cannot login to Horde'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3232298913997266209</id><published>2009-07-01T21:43:00.001-07:00</published><updated>2009-07-01T21:43:24.521-07:00</updated><title type='text'>Important Vps commands</title><content type='html'>Following are some important commands which are normally used while working on a Hardware Node.&lt;br /&gt;&lt;br /&gt;1) vzlist -a : Shows list of all the VPS’s hosted on the Node.&lt;br /&gt;2) vzctl start VPS_ID: To start the VPS.&lt;br /&gt;3) vzctl stop VPS_ID : To stop (Shut Down) the VPS&lt;br /&gt;4) vzctl status VPS_ID : To view the status of the particular VPS&lt;br /&gt;5) vzctl stop VPS_ID –-fast : to stop the VPS quickly and forcefully&lt;br /&gt;6) vzctl enter VPS_ID : To enter in a particular VPS&lt;br /&gt;&lt;br /&gt;Configuration Commands&lt;br /&gt;&lt;br /&gt;1) vzctl set VPS_ID –hostname vps.domain.com –save: To set the Hostname of a VPS.&lt;br /&gt;2) vzctl set VPS_ID –ipadd 1.2.3.4 –save : To add a new IP to the VPS.&lt;br /&gt;3) vzctl set VPS_ID –ipdel 1.2.3.4 –save : To delete the IP from VPS.&lt;br /&gt;4) vzctl set VPS_ID –userpasswd root:new_password –save : to reset root password of a VPS.&lt;br /&gt;5) vzctl set VPS_ID –nameserver 1.2.3.4 –save : To add the nameserver IP’s to the VPS.&lt;br /&gt;6) vzctl exec VPS_ID command : To run any command on a VPS from Node.&lt;br /&gt;6) vzyum VPS_ID install package_name : To install any package/Software on a VPS from Node.&lt;br /&gt;&lt;br /&gt;Here VPS_ID refers to the ID of the Particular VPS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3232298913997266209?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3232298913997266209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/important-vps-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3232298913997266209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3232298913997266209'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/important-vps-commands.html' title='Important Vps commands'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-7058775057128298650</id><published>2009-07-01T21:42:00.001-07:00</published><updated>2009-07-01T21:42:48.401-07:00</updated><title type='text'>Adding Reverse Dns</title><content type='html'>Adding reverse dns on a DC's resolvers need much care and attention you should ensure that you are going through the right path always. Any error in that may cause a down time to the resolvers.&lt;br /&gt;Inoredr add reverse entries please follow the steps given below&lt;br /&gt;&lt;br /&gt;1.) Ensure that the hostname resolves to the IP that the client is requesting prior to inserting the reverse DNS record. This can be done by pinging the hostname&lt;br /&gt;&lt;br /&gt;2.) Login to the resolver server&lt;br /&gt;&lt;br /&gt;3.) Edit the correct file for the IP address of the reverse DNS record. For example, if a client requested "please add abc.domain.com -&gt; 205.64.34.142" then we will need to edit the file for c-class 205.64.142.1. The command would be as follows: ee /etc/namedb/master/34.64.205.in-addr.arpa&lt;br /&gt;5. You will then need to insert a reverse DNS entry like: 142 IN PTR abc.domain.com.&lt;br /&gt;6. Once inserted, you need to change the serial number in the file.&lt;br /&gt;7. Save the file, and exit.&lt;br /&gt;8. Reload named to reflect the new changes by executing the command: /etc/rc.d/named reload&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-7058775057128298650?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/7058775057128298650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/adding-reverse-dns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/7058775057128298650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/7058775057128298650'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/adding-reverse-dns.html' title='Adding Reverse Dns'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-4161187203284907202</id><published>2009-07-01T21:41:00.001-07:00</published><updated>2009-07-01T21:41:29.230-07:00</updated><title type='text'>Reset Mysql Root Password:</title><content type='html'>Stop mysql server&lt;br /&gt;&lt;br /&gt;/etc/init.d/mysql.server stop&lt;br /&gt;&lt;br /&gt;Start mysql in safe mode&lt;br /&gt;&lt;br /&gt;/usr/local/mysql/bin/mysqld_safe --user=root --skip-grant-tables --skip-networking &amp;&lt;br /&gt;&lt;br /&gt;NOw the mysql will be running in the background in safe mode. You will be able to klogin as root by just using&lt;br /&gt;&lt;br /&gt;mysql -u root&lt;br /&gt;&lt;br /&gt;Once you got in you can use the following commands to reset the root password.&lt;br /&gt;&lt;br /&gt;UPDATE mysql.user SET Password=PASSWORD('qwert123') WHERE User='root'; //Here password is qwert123&lt;br /&gt;&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;&lt;br /&gt;Now just quit from the mysql prompt and try using the new password&lt;br /&gt;&lt;br /&gt;mysql -u root -p&lt;br /&gt;&lt;br /&gt;When it ask for passwprd, provide the new password. It will work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-4161187203284907202?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/4161187203284907202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/reset-mysql-root-password.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4161187203284907202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4161187203284907202'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/reset-mysql-root-password.html' title='Reset Mysql Root Password:'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-1432924621904039066</id><published>2009-07-01T21:39:00.001-07:00</published><updated>2009-07-01T21:39:41.201-07:00</updated><title type='text'>Some useful commands</title><content type='html'>mkdir - make directories&lt;br /&gt;&lt;br /&gt;Usage&lt;br /&gt;&lt;br /&gt;mkdir [OPTION] DIRECTORY&lt;br /&gt;&lt;br /&gt;Options&lt;br /&gt;&lt;br /&gt;Create the DIRECTORY(ies), if they do not already exist.&lt;br /&gt;&lt;br /&gt;Mandatory arguments to long options are mandatory for short options too.&lt;br /&gt;&lt;br /&gt;-m, mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask&lt;br /&gt;&lt;br /&gt;-p, parents no error if existing, make parent directories as needed&lt;br /&gt;&lt;br /&gt;-v, verbose print a message for each created directory&lt;br /&gt;&lt;br /&gt;-help display this help and exit&lt;br /&gt;&lt;br /&gt;-version output version information and exit&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cd - change directories&lt;br /&gt;&lt;br /&gt;Use cd to change directories. Type cd followed by the name of a directory to access that directory.Keep in mind that you are always in a directory and can navigate to directories hierarchically above or below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mv- change the name of a directory&lt;br /&gt;&lt;br /&gt;Type mv followed by the current name of a directory and the new name of the directory.&lt;br /&gt;&lt;br /&gt;Ex: mv testdir newnamedir&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;pwd - print working directory&lt;br /&gt;&lt;br /&gt;will show you the full path to the directory you are currently in. This is very handy to use, especially when performing some of the other commands on this page&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;rmdir - Remove an existing directory&lt;br /&gt;&lt;br /&gt;rm -r&lt;br /&gt;&lt;br /&gt;Removes directories and files within the directories recursively.&lt;br /&gt;&lt;br /&gt;chown - change file owner and group&lt;br /&gt;&lt;br /&gt;Usage&lt;br /&gt;&lt;br /&gt;chown [OPTION] OWNER[:[GROUP]] FILE&lt;br /&gt;&lt;br /&gt;chown [OPTION] :GROUP FILE&lt;br /&gt;&lt;br /&gt;chown [OPTION] --reference=RFILE FILE&lt;br /&gt;&lt;br /&gt;Options&lt;br /&gt;&lt;br /&gt;Change the owner and/or group of each FILE to OWNER and/or GROUP. With --reference, change the owner and group of each FILE to those of RFILE.&lt;br /&gt;&lt;br /&gt;-c, changes like verbose but report only when a change is made&lt;br /&gt;&lt;br /&gt;-dereference affect the referent of each symbolic link, rather than the symbolic link itself&lt;br /&gt;&lt;br /&gt;-h, no-dereference affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)&lt;br /&gt;&lt;br /&gt;-from=CURRENT_OWNER:CURRENT_GROUP&lt;br /&gt;&lt;br /&gt;change the owner and/or group of each file only if its current owner and/or group match those specified here. Either may be omitted, in which case a match is not required for the omitted attribute.&lt;br /&gt;&lt;br /&gt;-no-preserve-root do not treat `/' specially (the default)&lt;br /&gt;&lt;br /&gt;-preserve-root fail to operate recursively on `/'&lt;br /&gt;&lt;br /&gt;-f, -silent, -quiet suppress most error messages&lt;br /&gt;&lt;br /&gt;-reference=RFILE use RFILE's owner and group rather than the specifying OWNER:GROUP values&lt;br /&gt;&lt;br /&gt;-R, -recursive operate on files and directories recursively&lt;br /&gt;&lt;br /&gt;-v, -verbose output a diagnostic for every file processed&lt;br /&gt;&lt;br /&gt;The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the final one takes effect.&lt;br /&gt;&lt;br /&gt;-H if a command line argument is a symbolic link to a directory, traverse it&lt;br /&gt;&lt;br /&gt;-L traverse every symbolic link to a directory encountered&lt;br /&gt;&lt;br /&gt;-P do not traverse any symbolic links (default)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;chmod - change file access permissions&lt;br /&gt;&lt;br /&gt;Usage&lt;br /&gt;&lt;br /&gt;chmod [-r] permissions filenames&lt;br /&gt;&lt;br /&gt;r Change the permission on files that are in the subdirectories of the directory that you are currently in. permission Specifies the rights that are being granted. Below is the different rights that you can grant in an alpha numeric format.filenames File or directory that you are associating the rights with Permissions&lt;br /&gt;&lt;br /&gt;u - User who owns the file.&lt;br /&gt;&lt;br /&gt;g - Group that owns the file.&lt;br /&gt;&lt;br /&gt;o - Other.&lt;br /&gt;&lt;br /&gt;a - All.&lt;br /&gt;&lt;br /&gt;r - Read the file.&lt;br /&gt;&lt;br /&gt;w - Write or edit the file.&lt;br /&gt;&lt;br /&gt;x - Execute or run the file as a program.&lt;br /&gt;&lt;br /&gt;Numeric Permissions:&lt;br /&gt;&lt;br /&gt;CHMOD can also to attributed by using Numeric Permissions:&lt;br /&gt;&lt;br /&gt;400 read by owner&lt;br /&gt;&lt;br /&gt;040 read by group&lt;br /&gt;&lt;br /&gt;004 read by anybody (other)&lt;br /&gt;&lt;br /&gt;200 write by owner&lt;br /&gt;&lt;br /&gt;020 write by group&lt;br /&gt;&lt;br /&gt;002 write by anybody&lt;br /&gt;&lt;br /&gt;100 execute by owner&lt;br /&gt;&lt;br /&gt;010 execute by group&lt;br /&gt;&lt;br /&gt;001 execute by anybody&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ls - Short listing of directory contents&lt;br /&gt;&lt;br /&gt;-a list hidden files&lt;br /&gt;&lt;br /&gt;-d list the name of the current directory&lt;br /&gt;&lt;br /&gt;-F show directories with a trailing '/'&lt;br /&gt;&lt;br /&gt;executable files with a trailing '*'&lt;br /&gt;&lt;br /&gt;-g show group ownership of file in long listing&lt;br /&gt;&lt;br /&gt;-i print the inode number of each file&lt;br /&gt;&lt;br /&gt;-l long listing giving details about files and directories&lt;br /&gt;&lt;br /&gt;-R list all subdirectories encountered&lt;br /&gt;&lt;br /&gt;-t sort by time modified instead of name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;cp - Copy files&lt;br /&gt;&lt;br /&gt;cp myfile yourfile&lt;br /&gt;&lt;br /&gt;Copy the files "myfile" to the file "yourfile" in the current working directory. This command will create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.&lt;br /&gt;&lt;br /&gt;cp -i myfile yourfile&lt;br /&gt;&lt;br /&gt;With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.&lt;br /&gt;&lt;br /&gt;cp -i /data/myfile&lt;br /&gt;&lt;br /&gt;Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt before overwriting the file.&lt;br /&gt;&lt;br /&gt;cp -dpr srcdir destdir&lt;br /&gt;&lt;br /&gt;Copy all files from the directory "srcdir" to the directory "destdir" preserving links (-poption), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another dir&lt;br /&gt;&lt;br /&gt;ln - Creates a symbolic link to a file.&lt;br /&gt;&lt;br /&gt;ln -s test symlink&lt;br /&gt;&lt;br /&gt;Creates a symbolic link named symlink that points to the file test Typing "ls -i test symlink" will show the two files are different with different inodes. Typing "ls -l test symlink" will show that symlink points to the file test.&lt;br /&gt;&lt;br /&gt;locate - A fast database driven file locator.&lt;br /&gt;&lt;br /&gt;slocate -u&lt;br /&gt;&lt;br /&gt;This command builds the slocate database. It will take several minutes to complete this command.This command must be used before searching for files, however cron runs this command periodically on most systems.locate whereis Lists all files whose names contain the string "whereis". directory.&lt;br /&gt;&lt;br /&gt;more - Allows file contents or piped output to be sent to the screen one page at a time&lt;br /&gt;&lt;br /&gt;less - Opposite of the more command&lt;br /&gt;&lt;br /&gt;cat - Sends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping.&lt;br /&gt;&lt;br /&gt;whereis - Report all known instances of a command&lt;br /&gt;wc - Print byte, word, and line counts&lt;br /&gt;&lt;br /&gt;bg&lt;br /&gt;&lt;br /&gt;bg jobs Places the current job (or, by using the alternative form, the specified jobs) in the background, suspending its execution so that a new user prompt appears immediately. Use the jobs command to discover the identities of background jobs.&lt;br /&gt;&lt;br /&gt;cal month year - Prints a calendar for the specified month of the specified year.&lt;br /&gt;&lt;br /&gt;cat files - Prints the contents of the specified files.&lt;br /&gt;&lt;br /&gt;clear - Clears the terminal screen.&lt;br /&gt;&lt;br /&gt;cmp file1 file2 - Compares two files, reporting all discrepancies. Similar to the diff command, though the output format differs.&lt;br /&gt;&lt;br /&gt;diff file1 file2 - Compares two files, reporting all discrepancies. Similar to the cmp command, though the output format differs.&lt;br /&gt;&lt;br /&gt;dmesg - Prints the messages resulting from the most recent system boot.&lt;br /&gt;&lt;br /&gt;fg&lt;br /&gt;&lt;br /&gt;fg jobs - Brings the current job (or the specified jobs) to the foreground.&lt;br /&gt;&lt;br /&gt;file files - Determines and prints a description of the type of each specified file.&lt;br /&gt;&lt;br /&gt;find path -name pattern -print&lt;br /&gt;&lt;br /&gt;Searches the specified path for files with names matching the specified pattern (usually enclosed in single quotes) and prints their names. The find command has many other arguments and functions; see the online documentation.&lt;br /&gt;&lt;br /&gt;finger users - Prints descriptions of the specified users.&lt;br /&gt;&lt;br /&gt;free - Displays the amount of used and free system memory.&lt;br /&gt;&lt;br /&gt;ftp hostname&lt;br /&gt;&lt;br /&gt;Opens an FTP connection to the specified host, allowing files to be transferred. The FTP program provides subcommands for accomplishing file transfers; see the online documentation.&lt;br /&gt;&lt;br /&gt;head files - Prints the first several lines of each specified file.&lt;br /&gt;&lt;br /&gt;ispell files - Checks the spelling of the contents of the specified files.&lt;br /&gt;&lt;br /&gt;kill process_ids&lt;br /&gt;&lt;br /&gt;kill - signal process_ids&lt;br /&gt;&lt;br /&gt;kill -l&lt;br /&gt;&lt;br /&gt;Kills the specified processes, sends the specified processes the specified signal (given as a number or name), or prints a list of available signals.&lt;br /&gt;&lt;br /&gt;killall program&lt;br /&gt;&lt;br /&gt;killall - signal program&lt;br /&gt;&lt;br /&gt;Kills all processes that are instances of the specified program or sends the specified signal to all processes that are instances of the specified program.&lt;br /&gt;&lt;br /&gt;mail - Launches a simple mail client that permits sending and receiving email messages.&lt;br /&gt;&lt;br /&gt;man title&lt;br /&gt;&lt;br /&gt;man section title - Prints the specified man page.&lt;br /&gt;&lt;br /&gt;ping host - Sends an echo request via TCP/IP to the specified host. A response confirms that the host is operational.&lt;br /&gt;&lt;br /&gt;reboot - Reboots the system (requires root privileges).&lt;br /&gt;&lt;br /&gt;shutdown minutes&lt;br /&gt;&lt;br /&gt;shutdown -r minutes&lt;br /&gt;&lt;br /&gt;Shuts down the system after the specified number of minutes elapses (requires root privileges). The -r option causes the system to be rebooted once it has shut down.&lt;br /&gt;&lt;br /&gt;sleep time - Causes the command interpreter to pause for the specified number of seconds.&lt;br /&gt;&lt;br /&gt;sort files - Sorts the specified files. The command has many useful arguments; see the online documentation.&lt;br /&gt;&lt;br /&gt;split file - Splits a file into several smaller files. The command has many arguments; see the online documentation&lt;br /&gt;&lt;br /&gt;sync - Completes all pending input/output operations (requires root privileges).&lt;br /&gt;&lt;br /&gt;telnet host - Opens a login session on the specified host.&lt;br /&gt;&lt;br /&gt;top - Prints a display of system processes that's continually updated until the user presses the q key.&lt;br /&gt;&lt;br /&gt;traceroute host - Uses echo requests to determine and print a network path to the host.&lt;br /&gt;&lt;br /&gt;uptime - Prints the system uptime.&lt;br /&gt;&lt;br /&gt;w - Prints the current system users.&lt;br /&gt;&lt;br /&gt;wall - Prints a message to each user except those who've disabled message reception. Type Ctrl-D to end the message.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-1432924621904039066?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/1432924621904039066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/some-useful-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1432924621904039066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1432924621904039066'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/some-useful-commands.html' title='Some useful commands'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-1362757152910961694</id><published>2009-07-01T21:38:00.001-07:00</published><updated>2009-07-01T21:38:34.510-07:00</updated><title type='text'>Get mysql root password from</title><content type='html'>Get mysql root password from&lt;br /&gt;If you forgot your mysql root password you can get it from&lt;br /&gt;/root/.my.cnf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-1362757152910961694?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/1362757152910961694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/get-mysql-root-password-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1362757152910961694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/1362757152910961694'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/get-mysql-root-password-from.html' title='Get mysql root password from'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-5831174830897900083</id><published>2009-07-01T21:37:00.001-07:00</published><updated>2009-07-01T21:37:47.748-07:00</updated><title type='text'>Some useful Mysql Queries</title><content type='html'>Mysql query to delete a user&lt;br /&gt;&lt;br /&gt;mysql&gt; delete from user where user='username';&lt;br /&gt;mysql&gt; FLUSH PRIVILEGES;&lt;br /&gt;&lt;br /&gt;Setting Privileges&lt;br /&gt;&lt;br /&gt;grant all privileges on DB.* to 'username'@'localhost' identified by 'pass';&lt;br /&gt;&lt;br /&gt;SET PASSWORD FOR &lt;User&gt;@localhost = OLD_PASSWORD('passwd');&lt;br /&gt;&lt;br /&gt;To see Tables:&lt;br /&gt;&lt;br /&gt;mysql&gt; use DB;&lt;br /&gt;mysql&gt; show tables;&lt;br /&gt;&lt;br /&gt;To see fields &lt;br /&gt;&lt;br /&gt;mysql&gt; desc tablename;&lt;br /&gt;&lt;br /&gt;To View The contents of the table&lt;br /&gt;&lt;br /&gt;mysql&gt; select * from &lt;tablename&gt;;&lt;br /&gt;&lt;br /&gt;UPDATE Query&lt;br /&gt;&lt;br /&gt; mysql&gt; update &lt;table name&gt; &lt;field to update&gt;='' where &lt;condition&gt;;&lt;br /&gt;&lt;br /&gt;Eg :update wp_users  set user_pass=md5('one') where user_login='cee';&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/1122127822293845269-5831174830897900083?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/5831174830897900083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/some-useful-mysql-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5831174830897900083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5831174830897900083'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/some-useful-mysql-queries.html' title='Some useful Mysql Queries'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-554001312546658610</id><published>2009-07-01T21:35:00.000-07:00</published><updated>2009-07-01T21:36:26.897-07:00</updated><title type='text'>How to disable direct root login</title><content type='html'>Inorder to disable direct root login on a linux server, you need to do the following things&lt;br /&gt;&lt;br /&gt;1. vi /etc/ssh/sshd_config in that file make&lt;br /&gt;Permitrootlogin no then save it&lt;br /&gt;&lt;br /&gt;2. Restart sshd service&lt;br /&gt;/etc/init.d/sshd restart&lt;br /&gt;&lt;br /&gt;3. Now create a new user and set password for that user.&lt;br /&gt;&lt;br /&gt;4. Add that user to the wheel group&lt;br /&gt;vi /etc/groups // add that user to the group of wheel&lt;br /&gt;&lt;br /&gt;5. Now logon to the server using the username and password and then do&lt;br /&gt;su - and provide the root password&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Inorder to work this properly you should have the following permission settings&lt;br /&gt;&lt;br /&gt;chmod 4755 /bin/su&lt;br /&gt;chmod 1700 /etc/passwd&lt;br /&gt;chmod 1700 /etc/shadow&lt;br /&gt;chmod 1755 /etc/groups&lt;br /&gt;&lt;br /&gt;If there is anything wrong with this permission, you may get permission denied or incorrect password errors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-554001312546658610?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/554001312546658610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-to-disable-direct-root-login.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/554001312546658610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/554001312546658610'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/07/how-to-disable-direct-root-login.html' title='How to disable direct root login'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-6507876404617150512</id><published>2009-06-30T13:48:00.000-07:00</published><updated>2009-06-30T13:51:00.718-07:00</updated><title type='text'>Park wrapper error</title><content type='html'>Sometimes you may get the park wrapper error while creating a new parked domain(example.com) in cpanel. In order that you can remove the domain name(example.com) in the following files and try. It will fix the issue.&lt;br /&gt;&lt;br /&gt;/etc/usrdomains&lt;br /&gt;/etc/localdomains&lt;br /&gt;/etc/named.conf&lt;br /&gt;/etc/valiases&lt;br /&gt;/etc/vdomainaliases&lt;br /&gt;http.conf&lt;br /&gt;/var/named/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-6507876404617150512?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/6507876404617150512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/06/park-wrapper-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6507876404617150512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/6507876404617150512'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/06/park-wrapper-error.html' title='Park wrapper error'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3145864179376521050</id><published>2009-06-30T13:43:00.002-07:00</published><updated>2009-06-30T13:44:22.492-07:00</updated><title type='text'>Important Directories in Linux</title><content type='html'>Different distributions have different directory structures, despite attempts at standardization such as the the Linux Filesystem Hierarchy Standard (FHS) organization.&lt;br /&gt;&lt;br /&gt;* /bin - essential UNIX commands such as ls, etc. Should contain all binaries needed to boot the system or run it in single-user mode&lt;br /&gt;&lt;br /&gt;* /boot - files used during booting and possibly the kernel itself are stored here&lt;br /&gt;&lt;br /&gt;* /dev - contains device files for various devices on system&lt;br /&gt;&lt;br /&gt;* /etc - files used by subsystems such as networking, NFS, and mail. Includes tables of disks to mount, processes to run on startup, etc.&lt;br /&gt;&lt;br /&gt;* /etc/profile.d - contains scripts that are run by /etc/profile upon login.&lt;br /&gt;&lt;br /&gt;* /etc/rc.d - contains a number of shell scripts that are run on bootup at different run levels. There is also typically an rc.inet1 script to set up networking (in Slackwar), an rc.modules script to load modular device drivers, and an rc.local script that can be edited to run commands desired by the administrator, along the lines of autoexec.bat in DOS.&lt;br /&gt;&lt;br /&gt;* /etc/rc.d/init.d - contains most of the initialization scripts themselves on an rpm-based system.&lt;br /&gt;&lt;br /&gt;* /etc/rc.d/rc*.d - where ``*'' is a number corresponding to the default run level. Contains files for services to be started and stopped at that run level. On rpm-based systems, these files are symbolic links to the initialization scripts themselves, which are in /etc/rc.d/init.d.&lt;br /&gt;&lt;br /&gt;* /etc/skel - directory containing several example or skeleton initialization shells. Often contains subdirectories and files used to populate a new user's home directory.&lt;br /&gt;&lt;br /&gt;* /etc/X11 - configuration files for the X Window system&lt;br /&gt;&lt;br /&gt;* /home - home directories of individual users&lt;br /&gt;&lt;br /&gt;* /lib - standard shared library files&lt;br /&gt;&lt;br /&gt;* /lib/modules - modular device driver files, most with .o extensions&lt;br /&gt;&lt;br /&gt;* /mnt - typical mount point for many user-mountable devices such as floppy drives, cd-rom readers, etc. Each device is mounted on a subdirectory of /mnt.&lt;br /&gt;&lt;br /&gt;* /proc - virtual file system that provides a number of system statistics&lt;br /&gt;&lt;br /&gt;* /root - home directory for root&lt;br /&gt;&lt;br /&gt;* /sbin - location of binaries used for system administration, configuration, and monitoring&lt;br /&gt;&lt;br /&gt;* /tmp - directory specifically designed for programs and users to store temporary files.&lt;br /&gt;&lt;br /&gt;* /usr - directory containing a number of subdirectory with programs, libraries, documentation, etc.&lt;br /&gt;&lt;br /&gt;* /usr/bin - contains most user commands. Should not contain binaries necessary for booting the system, which go in /bin. The /bin directory is generally located on the same disk partition as /, which is mounted in read-only mode during the boot process. Other filesystems are only mounted at a later stage during startup, so putting binaries essential for boot here is not a good idea.&lt;br /&gt;&lt;br /&gt;* /usr/bin/X11 - most often a symbolic link to /usr/X11R6/bin, which contains executable binaries related to the X Window system&lt;br /&gt;&lt;br /&gt;* /usr/doc - location of miscellaneous documentation, and the main location of program documentation files under Slackware&lt;br /&gt;&lt;br /&gt;* /usr/include - standard location of include files used in C programs such as stdio.h&lt;br /&gt;&lt;br /&gt;* /usr/info - primary location of the GNU info system files&lt;br /&gt;&lt;br /&gt;* /usr/lib - standard library files such as libc.a. Searched by the linker when programs are compiled.&lt;br /&gt;&lt;br /&gt;* /usr/lib/X11 - X Window system distribution&lt;br /&gt;&lt;br /&gt;* /usr/local/bin - yet another place to look for comon executables&lt;br /&gt;&lt;br /&gt;* /usr/man - location of manual page files&lt;br /&gt;&lt;br /&gt;* /usr/sbin - other commands used by superuser for system administration&lt;br /&gt;&lt;br /&gt;* /usr/share - contains subdirectories where many installed programs have configuration, setup and auxiliary files&lt;br /&gt;&lt;br /&gt;* /usr/share/doc - location of program documentation files under Mandrake and Red Hat&lt;br /&gt;&lt;br /&gt;* /usr/src - location of source programs used to build system. Source code for programs of all types are often unpacked in this directory.&lt;br /&gt;&lt;br /&gt;* /usr/src/linux - often a symbolic link to a subdirectory whose name corresponds to the exact version of the Linux kernel that is running. Contains the kernel sources.&lt;br /&gt;&lt;br /&gt;* /var - administrative files such as log files, used by various utilities&lt;br /&gt;&lt;br /&gt;* /var/log/packages - contains files, each of which has detailed information on an installed package in Slackware. The same file can also be found at /var/adm/packages, since the adm subdirectory is a symbolic link to log. Each package file contains a short description plus a list of all installed files.&lt;br /&gt;&lt;br /&gt;* /var/log/scripts - package installation scripts in Slackware are stored here. You can inspect these scripts to see what special features are included in individual packages.&lt;br /&gt;&lt;br /&gt;* /var/spool - temporary storage for files being printed, mail that has not yet been picked up, etc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3145864179376521050?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3145864179376521050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/06/important-directories-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3145864179376521050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3145864179376521050'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/06/important-directories-in-linux.html' title='Important Directories in Linux'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-5275489971865687421</id><published>2009-06-30T13:43:00.001-07:00</published><updated>2009-06-30T13:43:25.219-07:00</updated><title type='text'>Linux-Overview</title><content type='html'>Linux is a Unix-like computer Operating System (or OS) that uses the Linux kernel. Linux started out as a personal computer system used by individuals, and has since gained the support of several large corporations, such as Sun Microsystems, HP and IBM. It is now used mostly as a server operating system, with some large organizations using an enterprise version for desktops. Linux is a prime example of open-source development, which means that the source code is available freely for anyone to use.&lt;br /&gt;Back in August of 1991, a student from Finland began a post to the comp.os.minix newsgroup with the words&lt;br /&gt;Hello everybody out there using minix -I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones.&lt;br /&gt;&lt;br /&gt;The student was Linus Torvalds, and the "hobby" he spoke of eventually became what we know today as Linux.&lt;br /&gt;&lt;br /&gt;A full-featured POSIX-like operating system, Linux has been developed not just by Linus, but by hundreds of programmers around the world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-5275489971865687421?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/5275489971865687421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/06/linux-overview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5275489971865687421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/5275489971865687421'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/06/linux-overview.html' title='Linux-Overview'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-4225853257344398273</id><published>2009-06-24T05:49:00.000-07:00</published><updated>2009-06-24T09:01:18.786-07:00</updated><title type='text'>Script For DNS forwarding of all accounts under a RESELLER Account</title><content type='html'>updateResellerDNS.sh &lt;br /&gt;&lt;br /&gt;Written By Nazeem S &lt;br /&gt;Copy the bellow content and put it in file called "updateResellerDNS.sh" and give permission 755(executable) then run it (sh updateResellerDNS.sh or ./updateResellerDNS.sh)&lt;br /&gt;&lt;br /&gt;############# Starting  ########################&lt;br /&gt;###############NAZEEM S####################&lt;br /&gt;#############################################&lt;br /&gt;#! /bin/bash&lt;br /&gt;&gt;/var/log/updateResellerDNS.log&lt;br /&gt;&gt;user&lt;br /&gt;&gt;domains&lt;br /&gt;echo -n "Enter Reseller Account Name:---  "&lt;br /&gt;read a&lt;br /&gt;echo -n "Enter IP to be Changed (Source IP):---  "&lt;br /&gt;read b&lt;br /&gt;echo -n  "Enter the New IP (Destination IP):--- "&lt;br /&gt;read c&lt;br /&gt;grep $a  /etc/trueuserowners |cut -d ':' -f1|sort &gt;user&lt;br /&gt;&lt;br /&gt;for i in `cat user`&lt;br /&gt;do&lt;br /&gt;cat /etc/userdomains|grep $i |cut -d: -f1|sort &gt;&gt;domains;&lt;br /&gt;done&lt;br /&gt;for x in `cat domains`&lt;br /&gt;do&lt;br /&gt;ls /var/named/ |grep $x|sort &gt;&gt;updateResellerDNS.log;&lt;br /&gt;done&lt;br /&gt;for y in `cat updateResellerDNS.log`&lt;br /&gt;do&lt;br /&gt;#replace '$b' '$c' --/var/named/$y;&lt;br /&gt;sed -i 's/$b/$c/g' /var/named/$y;&lt;br /&gt;echo "$y---------------- converted"&lt;br /&gt;done&lt;br /&gt;export c=`cat updateResellerDNS.log | wc -l`&lt;br /&gt;echo "Total count of zone files has been updated = $c"&lt;br /&gt;echo "log file on /var/log/updateResellerDNS.log"&lt;br /&gt;#############################################&lt;br /&gt;###############NAZEEM S####################&lt;br /&gt;############### Ending  #######################&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-4225853257344398273?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/4225853257344398273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/06/script-for-dns-forwarding-of-all_24.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4225853257344398273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/4225853257344398273'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/06/script-for-dns-forwarding-of-all_24.html' title='Script For DNS forwarding of all accounts under a RESELLER Account'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1122127822293845269.post-3405580477580844344</id><published>2009-06-22T09:05:00.000-07:00</published><updated>2009-06-24T08:46:59.029-07:00</updated><title type='text'>GREP _ the most useful command</title><content type='html'> &lt;meta name="qrichtext" content="1"&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;style type="text/css"&gt; p, li { white-space: pre-wrap; } &lt;/style&gt; &lt;p  style="margin: 16px 0px 12px; text-indent: 0px; font-weight: 600;font-size:x-large;"&gt;&lt;!--StartFragment--&gt;&lt;span style="font-size:x-large;"&gt;grep command syntax&lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 16px 0px 12px; text-indent: 0px; font-weight: 600;font-size:x-large;"&gt;&lt;span style="color: rgb(194, 12, 185);font-family:'Courier New,courier';" &gt;grep&lt;/span&gt;&lt;span style="font-family:'Courier New,courier';"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:'Courier New,courier';" &gt;'word'&lt;/span&gt;&lt;span style="font-family:'Courier New,courier';"&gt; filename&lt;/span&gt;&lt;/p&gt; &lt;pre  style="margin: 0px; text-indent: 0px;font-family:'Courier New,courier';"&gt;&lt;span style="font-weight: 600; color: rgb(194, 12, 185);"&gt;grep&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;'string1 string2'&lt;/span&gt;  filename&lt;/pre&gt; &lt;pre  style="margin: 0px; text-indent: 0px;font-family:'Courier New,courier';"&gt;&lt;span style="font-weight: 600; color: rgb(194, 12, 185);"&gt;cat&lt;/span&gt; otherfile | &lt;span style="font-weight: 600; color: rgb(194, 12, 185);"&gt;grep&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;'something'&lt;/span&gt;&lt;/pre&gt; &lt;pre  style="margin: 0px 0px 12px; text-indent: 0px; color: rgb(255, 0, 0);font-family:'Courier New,courier';"&gt;&lt;span style="font-weight: 600; color: rgb(122, 8, 116);"&gt;command&lt;/span&gt; | &lt;span style="font-weight: 600; color: rgb(194, 12, 185);"&gt;grep&lt;/span&gt; 'something'&lt;/pre&gt; &lt;pre style="margin: 0px 0px 12px; text-indent: 0px; color: rgb(255, 0, 0); font-family: 'Courier New,courier';"&gt;&lt;/pre&gt; &lt;pre  style="margin: 0px 0px 12px; text-indent: 0px; color: rgb(255, 0, 0);font-family:'Courier New,courier';"&gt;&lt;span style="font-weight: 600;font-size:x-large;" &gt;Use grep to search file&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt; &lt;pre style="margin: 0px 0px 12px; text-indent: 0px; font-size: x-large; font-weight: 600;"&gt;Search /etc/passwd for boo user:&lt;/pre&gt; &lt;pre style="margin: 0px 0px 12px; text-indent: 0px;"&gt;&lt;span style="font-family:'Courier New,courier';"&gt;$ grep boo /etc/passwd&lt;/span&gt;&lt;/pre&gt; &lt;pre face="'Courier New,courier'" style="margin: 0px 0px 12px; text-indent: 0px;"&gt;&lt;/pre&gt;   &lt;pre style="margin: 0px 0px 12px; text-indent: 0px; font-family: 'Courier New,courier';"&gt;You can force grep to ignore word case i.e match boo, Boo, BOO and all other combination with -i option:&lt;br /&gt;$ grep -i "boo" /etc/passwd&lt;span style="font-weight: 600;font-size:x-large;" &gt;&lt;br /&gt;Use grep recursively&lt;/span&gt;&lt;/pre&gt; &lt;p style="margin: 12px 0px; text-indent: 0px;"&gt;You can search recursively i.e. read all files under each directory for a string "192.168.1.5"&lt;br /&gt;&lt;span style="font-family:'Courier New,courier';"&gt;$ grep -r "192.168.1.5" /etc/&lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 12px 0px; text-indent: 0px;font-family:'Courier New,courier';"&gt;&lt;/p&gt; &lt;p  style="margin: 12px 0px; text-indent: 0px;font-family:'Courier New,courier';"&gt;&lt;span style="font-weight: 600;font-size:x-large;" &gt;Use grep to search 2 different words &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 12px 0px; text-indent: 0px;"&gt;use egrep as follows:&lt;br /&gt;&lt;span style="font-family:'Courier New,courier';"&gt;$ egrep -w 'word1|word2' /path/to/file&lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 12px 0px; text-indent: 0px;font-family:'Courier New,courier';"&gt;&lt;/p&gt; &lt;p face="'Courier New,courier'" style="margin: 12px 0px; text-indent: 0px;"&gt;&lt;span style="font-weight: 600;font-size:x-large;" &gt;Count line when words has been matched&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 12px 0px; text-indent: 0px;"&gt;grep can report the number of times that the pattern has been matched for each file using -c (count) option:&lt;br /&gt;&lt;span style="font-family:'Courier New,courier';"&gt;$ grep -c 'word' /path/to/file&lt;/span&gt;&lt;/p&gt; &lt;p face="'Courier New,courier'" style="margin: 12px 0px; text-indent: 0px;"&gt;&lt;/p&gt;   &lt;p face="'Courier New,courier'" style="margin: 12px 0px; text-indent: 0px;"&gt;Also note that you can use -n option, which causes grep to precede each line of output with the number of the line in the text file from which it was obtained:&lt;br /&gt;$ grep -n 'word' /path/to/file&lt;span style="font-weight: 600;font-size:x-large;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p face="'Courier New,courier'" style="margin: 12px 0px; text-indent: 0px;"&gt;&lt;span style="font-weight: 600;font-size:x-large;" &gt;Grep invert match&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 12px 0px; text-indent: 0px;"&gt;You can use -v option to print inverts the match; that is, it matches only those lines that do not contain the given word. For example print all line that do not contain the word bar:&lt;br /&gt;&lt;span style="font-family:'Courier New,courier';"&gt;$ grep -v bar /path/to/file&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 12px 0px; text-indent: 0px; font-family: 'Courier New,courier';"&gt;&lt;span style="font-weight: 600;font-size:x-large;" &gt;Colour&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 12px 0px; text-indent: 0px; font-family: 'Courier New,courier';"&gt;Finally, you can force grep to display output in colors:&lt;br /&gt;$ grep --color vivek /etc/passwd&lt;/p&gt; &lt;p style="margin: 12px 0px; text-indent: 0px; font-family: 'Courier New,courier';"&gt;&lt;/p&gt; &lt;p style="margin: 12px 0px; text-indent: 0px; font-family: 'Courier New,courier';"&gt;&lt;span style="font-weight: 600;font-size:x-large;" &gt;list file name&lt;/span&gt;&lt;/p&gt; &lt;p  style="margin: 12px 0px; text-indent: 0px; font-weight: 600;font-size:x-large;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-weight: normal;"&gt;Use the -l option to list file name whose contents mention main():&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:'Courier New,courier';font-size:85%;"  &gt;$ grep -l 'main' *.c&lt;/span&gt;&lt;!--EndFragment--&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1122127822293845269-3405580477580844344?l=nazeem86.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nazeem86.blogspot.com/feeds/3405580477580844344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nazeem86.blogspot.com/2009/06/grep-most-use-full-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3405580477580844344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1122127822293845269/posts/default/3405580477580844344'/><link rel='alternate' type='text/html' href='http://nazeem86.blogspot.com/2009/06/grep-most-use-full-command.html' title='GREP _ the most useful command'/><author><name>Nazeem S</name><uri>http://www.blogger.com/profile/09117859341800612633</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='http://1.bp.blogspot.com/_VNm38Y-DvSU/SlzW-t7s9ZI/AAAAAAAAAFY/gmGRTCjdk6E/S220/3.jpg'/></author><thr:total>0</thr:total></entry></feed>
