Sunday, 17 November 2013

How to Print Previous date in Bash


To print previous day date and time use the following script

#!/bin/bash
EPOCH=`date +%s`
YESTERDAY=$(($EPOCH - 86400))
echo `date -d @$YESTERDAY`

Friday, 27 April 2012


How to Add RHEL 6 iso as Repository


 1. Mount iso

[root@sheraz ~]# mount -o loop /home/rhel-server-6.0-x86_64-dvd.iso /mnt/

2. Create DVD.repo in /etc/yum.repos.d/ with the following content


[root@sheraz ~]# vi /etc/yum.repos.d/DVD.repo

[DVDREPO]
name=RHEL6 DVD
baseurl=file:///mnt/
enabled=1
gpgcheck=0

Tuesday, 12 July 2011

NTOP 4.0 installation on Fedora 15

Introduction
Ntop is a network monitoring tool, this is a small Howto which explains the installation of ntop-4 on fedora 15 from source, this may also work on  RedHat-5 and CentOS-5.

STEPS
1. Install the ntop requirements

[root@sheraz ~]# yum install libpcap.i686 libpcap-devel.i686 rrdtool.i686 rrdtool-devel.i686 rrdtool-perl.i686 GeoIP.i686 graphviz.i686 install python-setuptools.noarch

[root@sheraz ~]# easy_install Mako

2. Download ntop and untar it

[root@sheraz ~]# tar -xvf ntop-4.0.tar.gz

3. Change the directory

[root@sheraz ~]# cd ntop-4.0

4. Now configure, compile and install

[root@sheraz ~]# ./autogen.sh

[root@sheraz ~]# make

[root@sheraz ~]# make install

5. Add ntop user

[root@sheraz ~]# useradd -M -s /sbin/nologin -r ntop

6. Change the permissions

[root@sheraz ~]# chown -cR ntop:root /usr/local/var/ntop/

[root@sheraz ~]# chown -cR ntop:ntop /usr/local/share/ntop/

7. Set the administrator password

[root@sheraz ~]# ntop -A

8. Start the ntop

[root@sheraz ~]# /usr/local/bin/ntop -d -L -u ntop -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon

9. Access the ntop

http://hostname.com:3000