Saturday, September 25, 2010

Exim Commands

Some useful Exim Commands

Queues information

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a count of the messages in the queue:
Quote:
# exim -bpc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):
Quote:
# exim -bp

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals):
Quote:
# exim -bp | exiqsumm

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generate and display Exim stats from a logfile:
Quote:
# eximstats /path/to/exim_mainlog

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generate and display Exim stats from a logfile, with less verbose output:
Quote:
# eximstats -ne -nr -nt /path/to/exim_mainlog

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Generate and display Exim stats from a logfile, for one particular day:
Quote:
# fgrep 2007-02-16 /path/to/exim_mainlog | eximstats

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print what Exim is doing right now:
Quote:
# exiwhat

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To delete frozen emails
Quote:
exim -bp | awk ‘$6~”frozen” { print $3 }’ | xargs exim -Mrm

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To deliver emails forcefully
Quote:
exim -qff -v -C /etc/exim.conf &

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To delete nobody mails
Quote:
exim -bp | grep nobody | awk ‘{print $3}’ | xargs exim -Mrm

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Searching the queue

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`.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the queue for messages from a specific sender:

Quote:
# exiqgrep -f [luser]@domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the queue for messages for a specific recipient/domain:
Quote:
# exiqgrep -r [luser]@domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print just the message-id as a result of one of the above two searches:
Quote:
# exiqgrep -i [ -r | -f ] …
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a count of messages matching one of the above searches:
Quote:
# exiqgrep -c [ -r | -f ] …
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print just the message-id of the entire queue:
Quote:
# exiqgrep -i
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Managing the queue, Start a queue run:
Quote:
# exim -q -v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start a queue run for just local deliveries:
Quote:
# exim -ql -v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove a message from the queue:
Quote:
# exim -Mrm [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Freeze a message:
Quote:
# exim -Mf [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thaw a message:
Quote:
# exim -Mt [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Deliver a specific message:
Quote:
# exim -M [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Force a message to fail and bounce:
Quote:
# exim -Mg [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove all frozen messages:
Quote:
# exiqgrep -z -i | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove all messages older than five days (86400 * 5 = 432000 seconds):
Quote:
# exiqgrep -o 1296000 -i | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Freeze all queued mail from a given sender:
Quote:
# exiqgrep -i -f luser@example.tld | xargs exim -Mf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s headers:
Quote:
# exim -Mvh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s body:
Quote:
# exim -Mvb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s logs:
Quote:
# exim -Mvl

Friday, September 17, 2010

List top 10 Files or Directories Size Wise

Type the command below to see the files listed size wise from higher size files to lower size files.

-----------------
for X in $(du -s * | sort -nr | cut -f 2); do du -hs $X ; done
-----------------

Wednesday, September 15, 2010

How to Install compiz in Fedora

Compiz is one of the first compositing window managers for the X Window System that uses 3D graphics hardware to create fast compositing desktop effects for window management. The effects, such as a minimization effect and a cube workspace are implemented as loadable plugins. Because it conforms to the Inter-Client Communication Conventions Manual standard, Compiz can substitute for the default Mutter in GNOME or KWin in KDE.

To install compiz in fedora

1. Become root user.
su -

2. yum install compiz compiz-gnome emerald emerald-themes fusion-icon compiz-fusion-extras compiz-fusion-extras-gnome compizconfig-backend-gconf

3. You can enable it by
System -> Preference-> Desktop Effects and selecte Compiz

4. You can edit settings by
System -> Preference ->CompizConfig Setting Manager

Note: Tested in Fedora 13. Need internet connection.

Tuesday, September 14, 2010

Adding an IP range


Create a file named ifcfg-eth0-range0 in the /etc/sysconfig/network-scripts. Inside this file enter the following:
-----------
IPADDR_START=192.168.0.10
IPADDR_END=192.168.0.110
CLONENUM_START=0

-----------
IPADDR_START: This is the first IP from the address range you want to bind to your ethernet device.
IPADDR_END: This is, of course, the last IP from that address range.
CLONENUM_START: This is the number that will be assigned to the first IP alias interface. For instance, if your Internet interface is eth0 and CLONENUM_START is 0, then this config file will create 100 interfaces starting with eth0:0 (eth0:0, eth0:1, eth0:2 etc) and ending with eth0:100.

NOTE! Be careful if you need to add more ranges of IPs. You'll have to use a proper value for CLONENUM_START. For instance, if you need to add a second range with 100 IPs besides the one above, create a new file called ifcfg-eth0-range1 and set the CLONENUM_START to 101 so an overwrite will be avoided. Also please backup the existing files before editing this.

AFTER THIS DONT FORGET TO RESTART NETWORK
=> service network restart

Sunday, September 12, 2010

Install Java Plugins for Fedora

Fedora includes an open-source version of Java 6, and nearly every Java applet will run if you simply install the Java plugin that comes with Fedora:


   1. Open a Terminal.

   2. Become root:
      su -

   3. Install the plugin:
      yum install java-1.6.0-openjdk-plugin

Note: Tested in Fedora 12. You also need rpmforge configured (http://linux4starters.blogspot.com/2010/09/installing-local-rpms.html).

Friday, September 10, 2010

Installing Local RPMs


To install an RPM file that you downloaded outside of yum, open up a terminal, and as root do:

rpm -Uvh filename.rpm

If you have Internet access, you can also install local files by doing:

yum --nogpgcheck install filename.rpm

Setting Up Package Installation RPMFORGE

After successful installation of Linux OS, many of the commonly used applications cannot be installed using yum. We have to configure the repositories or set-up packages. The easiest way to do it.

To configure your system so that you can install packages from rpmforge, follow these instructions:

   1. Open a Terminal.

   2. Become root:
      su -

   3. Run the following command:
      yum --nogpgcheck install http://rpm.livna.org/livna-release.rpm http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Note: Tested in Fedora and Cent OS

Change / Reset MYSQL password.

Step # 1 : Stop MySQL Server:

# /etc/init.d/mysql stop

Output:
Stopping MySQL database server: mysqld.

Step # 2: Start to MySQL server w/o password:

# mysqld_safe --skip-grant-tables &

Output:
[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

Step # 3: Connect to mysql server using mysql client:

# mysql -u root

Output:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>

Step # 4: Setup New MYSQL Password:

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit


Step # 5: Stop MySQL Server:

# /etc/init.d/mysql stop

Output:
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+  Done                    mysqld_safe --skip-grant-tables

Step # 6: Start MySQL Server:

# /etc/init.d/mysql start
# mysql -u root -p

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews