Vishal Gupta's Blog

Unix Resource

Scripts

Bin

Bash

Scripts

Date – how to get different dates link

Linux RPM info with architecture

rpm -q -a --queryformat='%{N}-%{V}-%{R}.%{arch}\n'

Tar on one system, untar on another system, on the fly

gtar zcf – <directory> | ssh <username>@<server> “cd /<destination path> ; gtar zxf – “

Virtual IPs

Add Virtual IP

/sbin/ifconfig ${INTERFACE_NAME} ${IP_ADDRESS}

e.g /sbin/ifconfig eth0:1 192.168.1.2

Remove Virtual IP

/sbin/ifconfig ${INTERFACE_NAME} down

e.g /sbin/ifconfig eth0:1 down

How to Change hostname on Linux?

On Linux :-

– To permanently change hostname edit /etc/sysconfig/network and add following line

HOSTNAME=newhostname

– To change hostname dynamically, issue following command

# hostname

How to change default gateway in routing table on Linux?

On Linux :-

– To permanently change hostname edit /etc/sysconfig/network and add following line

GATEWAY=192.168.1.1

– To change hostname dynamically, issue following command
# route add default gw 192.168.1.1
# route delete default gw 192.168.40.1 (Old Default gateway)

How to change text/Graphic Linux boot mode?

Edit /etc/inittab and change default runlevel at boot time. For text-mode use runlevel=3 and for X11 mode use runlevel=5

# Default runlevel. The runlevels used by RHS are:
#   0 – halt (Do NOT set initdefault to this)
#   1 – Single user mode
#   2 – Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 – Full multiuser mode
#   4 – unused
#   5 – X11
#   6 – reboot (Do NOT set initdefault to this)
#
id:5:initdefault:

How to Change PuTTy windows title

export PROMPT_COMMAND=’echo -ne “33]0;${HOSTNAME}: ${PWD}07″‘

RPM Requirements for Oracle on Linux (Metalink Note – 401705.1)

Identity Management 10.1.4 on RHEL4 x86

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n'   \
glibc              \
glibc-common       \
binutils           \
compat-libstdc++   \
compat-db          \
gcc                \
gcc-c++            \
libstdc++          \
libstdc++-devel    \
openmotif21        \
setarch            \
make               \
gnome-libs         \
sysstat            \
control-center     \
xscreensaver       \
| sort</pre>

Identity Management 10.1.4 on RHEL x86-64

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n'   \
binutils.x86_64            \
compat-db.i386             \
compat-db.x86_64           \
control-center.x86_64      \
compat-libstdc++-296.i386  \
gcc.x86_64                 \
gcc-c++.x86_64             \
glibc.i686                 \
glibc.x86_64               \
glibc-common.x86_64        \
glibc-devel.i386           \
glibc-devel.x86_64         \
gnome-libs.x86_64          \
gnome-libs-devel.x86_64    \
libstdc++.i386             \
libstdc++.x86_64           \
libstdc++-devel.i386       \
libstdc++-devel.x86_64     \
make.x86_64                \
openmotif21.i386           \
setarch.x86_64             \
sysstat.x86_64             \
| sort

Database/Client  10gR2 on RHEL4  x86-64

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n'   \
compat-db.x86_64                \
compat-libstdc++-33.x86_64      \
control-center.x86_64           \
gcc.x86_64                      \
gcc-c++.x86_64                  \
glibc.x86_64                    \
glibc-common.x86_64             \
glibc-devel.x86_64              \
glibc-devel.i386                \
glibc-headers.x86_64            \
glibc-kernheaders.x86_64        \
gnome-libs.x86_64               \
libaio.x86_64                   \
libaio.i386                     \
libstdc++.x86_64                \
libstdc++-devel.x86_64          \
make.x86_64                     \
sysstat.x86_64                  \
xscreensaver.x86_64 |sort

Database/Client  10gR2 on RHEL5  x86 (32bit)

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n' \
binutils              \
compat-libstdc++-33   \
elfutils-libelf       \
elfutils-libelf-devel \
gcc                   \
gcc-c++               \
glibc                 \
glibc-common          \
glibc-devel           \
glibc-headers         \
libaio                \
libaio-devel          \
libgcc                \
libstdc++             \
libstdc++-devel       \
make                  \
sysstat               \
|sort

Database/Client  10gR2 on RHEL5  x86-64

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n' \
binutils.x86_64             \
compat-db.x86_64            \
compat-libstdc++-296.i386   \
compat-libstdc++-33.i386    \
compat-libstdc++-33.x86_64  \
gcc.x86_64                  \
gcc-c++.x86_64              \
glibc.x86_64                \
glibc.i686                  \
glibc-common.x86_64         \
glibc-devel.x86_64          \
glibc-devel.i386            \
glibc-headers.x86_64        \
libaio.x86_64               \
libgcc.i386                 \
libgcc.x86_64               \
libgnome.x86_64             \
libgnomeui.x86_64           \
libgomp.x86_64              \
libstdc++.x86_64            \
libstdc++-devel.x86_64      \
libXp.i386                  \
make.x86_64                 \
sysstat.x86_64              \
|sort

Database/Client  11gR1 on RHEL4  x86-64

rpm -q  --queryformat='%{N}-%{V}-%{R}.%{arch}\n'  \
binutils.x86_64                     \
compat-libstdc++-33.x86_64          \
elfutils-libelf.x86_64              \
elfutils-libelf-devel.x86_64        \
gcc.x86_64                          \
gcc-c++.x86_64                      \
glibc.x86_64                        \
glibc-common.x86_64                 \
glibc-headers.x86_64                \
glibc-devel.x86_64                  \
glibc-devel.i386                    \
libstdc++-devel.x86_64              \
libaio.x86_64                       \
libaio.i386                         \
libaio-devel.x86_64                 \
libgcc.x86_64                       \
libstdc++.x86_64                    \
libstdc++-devel.x86_64              \
make.x86_64                         \
sysstat.x86_64                      \
| sort

Database/Client 11gR1 on RHEL5  x86-64

rpm -q  --queryformat='%{N}-%{V}-%{R}.%{arch}\n'  \
binutils.x86_64               \
compat-libstdc++-33.i386      \
compat-libstdc++-33.x86_64    \
elfutils-libelf.x86_64        \
elfutils-libelf-devel.x86_64  \
gcc.x86_64                    \
gcc-c++.x86_64                \
glibc.x86_64                  \
glibc.i386                    \
glibc-common.x86_64           \
glibc-devel.x86_64            \
glibc-devel.i386              \
glibc-headers.x86_64          \
libaio.x86_64                 \
libaio.i386                   \
libaio-devel.x86_64           \
libgcc.x86_64                 \
libgcc.i386                   \
libstdc++.x86_64              \
libstdc++.i386                \
libstdc++-devel.x86_64        \
make.x86_64                   \
sysstat.x86_64                \
|sort

Database/Client 11gR2 on RHEL5 x86-32

rpm -q  --queryformat='%{N}-%{V}-%{R}.%{arch}\n'  \
binutils.i386                     \
compat-libstdc++-33.i386          \
elfutils-libelf.i386              \
elfutils-libelf-devel.i386        \
gcc.i386                          \
gcc-c++.i386                      \
glibc.i386                        \
glibc-common.i386                 \
glibc-devel.i386                  \
glibc-headers.i386                \
kernel-headers.i386               \
ksh-20060214.i386                 \
libaio.i386                       \
libaio-devel.i386                 \
libgcc.i386                       \
libgomp.i386                      \
libstdc++.i386                    \
libstdc++-devel.i386              \
make.i386                         \
sysstat.i386                      \
unixODBC.i386                     \
unixODBC-devel.i386               \
|sort

Database/Client  11gR2 on RHEL5  x86-64

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n' \
 binutils.x86_64 \
 compat-libstdc++-33.i386 \
 compat-libstdc++-33.x86_64 \
 elfutils-libelf.x86_64 \
 elfutils-libelf-devel.x86_64 \
 gcc.x86_64 \
 gcc-c++.x86_64 \
 glibc.x86_64 \
 glibc.i686 \
 glibc-common.x86_64 \
 glibc-devel.x86_64 \
 glibc-devel.i386 \
 glibc-headers.x86_64 \
 libaio.x86_64 \
 libaio.i386 \
 libaio-devel.i386 \
 libaio-devel.x86_64 \
 libgcc.x86_64 \
 libgcc.i386 \
 libstdc++.x86_64 \
 libstdc++.i386 \
 libstdc++-devel.x86_64 \
 make.x86_64 \
 sysstat.x86_64 \
 unixODBC.i386 \
 unixODBC.x86_64 \
 unixODBC-devel.i386 \
 unixODBC-devel.x86_64 \
 |sort

Database/Client  11gR2 on RHEL6  x86-64

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n' \
 binutils.x86_64 \
 compat-libstdc++-33.i686 \
 compat-libstdc++-33.x86_64 \
 elfutils-libelf.x86_64 \
 elfutils-libelf-devel.x86_64 \
 gcc.x86_64 \
 gcc-c++.x86_64 \
 glibc.x86_64 \
 glibc.i686 \
 glibc-common.x86_64 \
 glibc-devel.x86_64 \
 glibc-devel.i686 \
 glibc-headers.x86_64 \
 libaio.x86_64 \
 libaio.i686 \
 libaio-devel.i686 \
 libaio-devel.x86_64 \
 libgcc.x86_64 \
 libgcc.i686 \
 libstdc++.x86_64 \
 libstdc++.i686 \
 libstdc++-devel.x86_64 \
 make.x86_64 \
 sysstat.x86_64 \
 unixODBC.i686 \
 unixODBC.x86_64 \
 unixODBC-devel.i686 \
 unixODBC-devel.x86_64 \
 |sort

Database/Client  12cR1 on RHEL5  x86-64

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n' \
 binutils.x86_64 \
 compat-libstdc++-33.i686 \
 compat-libstdc++-33.x86_64 \
 gcc.x86_64 \
 gcc-c++.x86_64 \
 glibc.x86_64 \
 glibc.i686 \
 glibc-devel.x86_64 \
 glibc-devel.i686 \
 ksh \
 libaio.i686 \
 libaio.x86_64 \
 libaio-devel.i686 \
 libaio-devel.x86_64 \
 libgcc.x86_64 \
 libgcc.i686 \
 libstdc++.x86_64 \
 libstdc++.i686 \
 libstdc++-devel.x86_64 \
 libXext.x86_64 \
 libXext.i686 \
 libXtst.x86_64 \
 libXtst.i686 \
 libX11.x86_64 \
 libX11.i686 \
 libXau.x86_64 \
 libXau.i686 \
 libXi.x86_64 \
 libXi.i686 \
 make.x86_64 \
 sysstat.x86_64 \
 |sort

Database/Client  12cR1 on RHEL6  x86-64

rpm -q --queryformat='%{N}-%{V}-%{R}.%{arch}\n' \
 binutils.x86_64 \
 compat-libcap1-1.10-1.x86_64 \
 compat-libstdc++-33.i686 \
 compat-libstdc++-33.x86_64 \
 gcc.x86_64 \
 gcc-c++.x86_64 \
 glibc.x86_64 \
 glibc.i686 \
 glibc-devel.x86_64 \
 glibc-devel.i686 \
 ksh \
 libaio.i686 \
 libaio.x86_64 \
 libaio-devel.i686 \
 libaio-devel.x86_64 \
 libgcc.x86_64 \
 libgcc.i686 \
 libstdc++.x86_64 \
 libstdc++.i686 \
 libstdc++-devel.i686 \
 libstdc++-devel.x86_64 \
 libXext.x86_64 \
 libXext.i686 \
 libXtst.x86_64 \
 libXtst.i686 \
 libX11.x86_64 \
 libX11.i686 \
 libXau.x86_64 \
 libXau.i686 \
 libxcb.x86_64 \
 libxcb.i686 \
 libXi.x86_64 \
 libXi.i686 \
 make.x86_64 \
 sysstat.x86_64 \
 |sort

How can a non-root user mount and unmount discs?

Most mount commands support the user option. If you make an entry such as the following in /etc/fstab:

/dev/hdc /mnt/cdrom   iso9660     user,noauto,ro

then an ordinary user will be allowed to mount and unmount the drive using these commands:

% mount /mnt/cdrom% umount /mnt/cdrom

By default the disc will be mounted with some options that help enforce security (e.g. programs cannot executed, device files are ignored). If this is too restrictive you can use additional options (e.g. the “exec” option will enable execution or programs). See the mount(8) man page for details.

Another method is to get the usermount package which allows non-root users to mount and unmount removable devices such as floppies and CD-ROMs, but restricts access to other devices (such as hard disk partitions). It is available on major archive sites.

Yet another option is to use the sudo program which allows users to run selective programs with root privileges.

For Oracle software CDs use following options.

/dev/hdc /mnt/cdrom   auto     user,noauto,ro,exec,suid,uid=oracle,gid=dba  0 0 

Veritas IO Monitoring

# Display all the Veritas diskgroup
 vxprint -ht | grep -i ^dg

# Get Veritas IO Stats
 nohup /usr/sbin/vxstat -g <diskgroupname> -uk -i <interval_in_sec> -c <count> > vxstat.results.txt &

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: