Showing posts from October, 2007

Linux - grep with color highlighting

Quoted from
> grep --color='auto' -i error /var/log/messages

Set for shell default usage
> vi ~/.bash_profile
# add the following lines
export GREP_COLOR='1;37;41'
alias grep='grep --color=auto'

Linux - command to check driver/module

> cat /proc/modules
> lsmod
> modinfo [mod_name_from_lsmod]

Linux - Combine ISOs into DVD

# download ISO files under /tmp
ls /tmp

# write script to combine ISO files
# This script is writen by Chris Kloiber.


# by Chris Kloiber

# A quick hack that will create a bootable DVD iso of a Red Hat Linux
# Distribution. Feed it either a directory containing the downloaded
# iso files of a distribution, or point it at a directory containing
# the "RedHat", "isolinux", and "images" directories.

# This version only works with "isolinux" based Red Hat Linux versions.

# Lots of disk space required to work, 3X the distribution size at least.

# GPL version 2 applies. No warranties, yadda, yadda. Have fun.

if [ $# -lt 2 ]; …

Linux - Network Auditing NMAP (1)

Nmap ("Network Mapper") is a free and open source (license) utility for network exploration or security auditing.
Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.
Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and both console and graphical versions are available

[root@lsvr02 ~]# nmap

Starting Nmap 4.11 ( ) at 2007-10-25 09:47 HKT
Interesting ports on lsvr02 (
Not shown: 1668 closed ports
21/tcp …

Linux - compile .src.rpm

The difference between .rpm and .src.rpm is that .src.rpm includes the source codes and it is required to compile to install.

rpm -i [software-package].src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -bp [software-package].specs
cd /usr/src/redhat/BUILD/[software-package]
make && make install


rpmbuild --target i386 --rebuild [software-package].src.rpm