Sunday, October 16, 2011

Common Linux log files name and usage


  • /var/log/message: General message and system related stuff
  • /var/log/auth.log: Authenication logs
  • /var/log/kern.log: Kernel logs
  • /var/log/cron.log: Crond logs (cron job)
  • /var/log/maillog: Mail server logs
  • /var/log/qmail/ : Qmail log directory (more files inside this directory)
  • /var/log/httpd/: Apache access and error logs directory
  • /var/log/lighttpd: Lighttpd access and error logs directory
  • /var/log/boot.log : System boot log
  • /var/log/mysqld.log: MySQL database server log file
  • /var/log/secure: Authentication log
  • /var/log/utmp or /var/log/wtmp : Login records files

Friday, October 14, 2011

Postfix Flush the Mail Queue commands

# postfix flush

To see mail queue, enter:
# mailq



To remove all mail from the queue, enter:
# postsuper -d ALL


To remove all mails in the deferred queue, enter:
# postsuper -d ALL deferred

Wednesday, August 31, 2011

Install and Configure Mail Server on Linux System

Mail Transfer Agent
A Mail Transfer Agent (MTA) is the program which receives and sends out the email from your server, and is therefore the key part. The default MTA in Ubuntu is Postfix, but exim4 is also fully supported and in the main repository.
Postfix - this guide explains how to set up Postfix.

In order to install Postfix with SMTP-AUTH and TLS, first install the postfix package from the Main repository using your favorite package manager. For example:
sudo aptitude install postfix


Configuration
From a terminal prompt:
sudo dpkg-reconfigure postfix
Insert the following details when asked (replacing server1.example.com with your domain name if you have one):
General type of mail configuration: Internet Site
NONE doesn't appear to be requested in current config
System mail name: server1.example.com
Root and postmaster mail recipient: <admin_user_name>
Other destinations for mail: server1.example.com, example.com, localhost.example.com, localhost
Force synchronous updates on mail queue?: No
Local networks: 127.0.0.0/8
Yes doesn't appear to be requested in current config
Mailbox size limit (bytes): 0 
Local address extension character: + 
Internet protocols to use: all

Saturday, June 25, 2011

Using patch and diff commands

Creating patches with diff

Using diff is simple when you are working with single files. To create a patch for a single .
diff -u file1.txt  new.txt  > new_file.patch

For  the directory, use following command:
diff -rupN  directory1/   directory2/   >  dir.patch




Apply  patch  

To apply a patch to a single file, change to the directory where the file is located and call patch:
patch  < dir.patch

you can specify the file on the command line:
patch  file.txt < dir.patch

To remove a patch, use the -R flag, 
patch -R file.txt < file.patch



Thursday, June 9, 2011

Network Manager Error : Device not managed (ubuntu)


I am facing the problem with Network Manager shows  error, with Wired and Wireless connection. When I click on  tetwork connection, It show "device not managed".

Problem Solve :

> First run command on terminal to see the connection status  sudo  lshw -C Network 
 This show ouput like :

sudo lshw -C network
[sudo] password for jagdeep: 
  *-network DISABLED               
       description: Wireless interface
       product: Centrino Wireless-N 1000
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlan0
       version: 00
       serial: 8c:a9:82:5e:e4:e2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlagn driverversion=2.6.38-8-generic firmware=128.50.3.1 build 13488 ip=192.168.1.34 latency=0 link=yes multicast=yes wireless=IEEE 802.11bgn

Tuesday, February 15, 2011

PHP/MySql : Store file path or name in database, file in folder.

Create a file : form.html

<form action=addmembers.php method=post enctype="multipart/form-data">
<table border="0" cellspacing="0" align=center cellpadding="3" bordercolor="#cccccc">
<tr>
<td>File:</td>
<td><input type="file" name="filep" size=45></td>
</tr>
<tr>
<td colspan=2><p align=center>
<input type=submit name=action value="Load">
</td>
</tr>
</table>
</form>


Create another file : addmembers.php
<?

if ($_POST["action"] == "Load")
{
$folder = "images/";