Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

01 February 2014

Step by Step Oracle public yum server configutation

Oracle public yum server configutation

Step 1 :

Download and copy the appropriate yum configuration file in place, by running the following commands as root:

Oracle Linux 4, Update 6 or Newer

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-el4.repo

Oracle Linux 5

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-el5.repo

Oracle Linux 6

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ol6.repo

Oracle VM 2

# cd /etc/yum.repos.d
# wget http://public-yum.oracle.com/public-yum-ovm2.repo


Step2 :

Enable the appropriate repository by editing the yum configuration file

    Open the yum configuration file in a text editor
    Locate the section in the file for the repository you plan to update from, e.g. [el4_u6_base]
    Change enabled=0 to enabled=1


Step 3:

[root@muthu yum.repos.d]# yum list unixODBC
Loading "security" plugin
el5_latest                100% |=========================| 1.4 kB    00:00
primary.xml.gz            100% |=========================|  18 MB    00:06
el5_latest: ################################################## 12671/12671
Installed Packages
unixODBC.x86_64                          2.2.11-7.1             installed
unixODBC.i386                            2.2.11-7.1             installed
Available Packages
unixODBC.x86_64                          2.2.11-10.el5          el5_latest
unixODBC.i386                            2.2.11-10.el5          el5_latest
[root@muthu yum.repos.d]#

04 March 2013

End-of-central-directory signature not found

Error:-

[oracle@HQSRVDBA2 ~]$ unzip V34898-01.zip
Archive:  V34898-01.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of V34898-01.zip or
        V34898-01.zip.zip, and cannot find V34898-01.zip.ZIP, period.

Solution:-

[oracle@HQSRVDBA2 ~]$ cksum V35586-01.zip
1599202357 2342612234 V35586-01.zip
[oracle@HQSRVDBA2 ~]$ unzip V34898-01.zip
Archive:  V34898-01.zip
  inflating: ES_7.4_cluster_coordinator_linux.tgz
  inflating: ES_7.4_README.txt
  inflating: ES_7.4.sh
[oracle@HQSRVDBA2 ~]$

27 February 2013

ld.so: object '/lib/libcwait.so' from /etc/ld.so.preload cannot be preloaded: ignored.

ld.so: object '/lib/libcwait.so' from /etc/ld.so.preload cannot be preloaded: ignored.

Changes
Check compat-libcwait-2.1-1.i386.rpm was installed  if yes


Solution:-
Workaround
~~~~~~~~~~

1- It's possible to workaround the problem by moving the "libcwait.so" library from "/usr/lib" to "/lib", and modifying the path given  in the file "/etc/ld.so.preload" to point to the new location.

2- Install compat-libcwait-2.1-2 of 64 bit.

[root@prodbi11g /]# rpm -e compat-libcwait-2.1-1.i386

[root@prodbi11g /]# rpm -ivh compat-libcwait-2.1-2.x86_64.rpm

12 January 2013

Step by Step to create & delete GPG key

Step by Step to Delete GPG key
[oracle@muthu ~]$ gpg --delete-secret-keys 0FD2BDAA
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


sec  1024D/0FD2BDAA 2013-01-11 Muthu <thalaimuthu@gmail.com>

Delete this key from the keyring? (y/N) y
This is a secret key! - really delete? (y/N) y
[oracle@muthu ~]$ gpg --delete-keys 0FD2BDAA
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.


pub  1024D/0FD2BDAA 2013-01-11 Muthu <thalaimuthu@gmail.com>

Delete this key from the keyring? (y/N) y

Step by Step to Create GPG key :-

[oracle@muthu ~]$ gpg --gen-key
gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

Please select what kind of key you want:
   (1) DSA and Elgamal (default)
   (2) DSA (sign only)
   (5) RSA (sign only)
Your selection? 1
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Requested keysize is 2048 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 0
Key does not expire at all
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: Muthu
Email address: thalaimuthu@gmail.com
Comment:
You selected this USER-ID:
    "Muthu  <thalaimuthu@gmail.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.

You don't want a passphrase - this is probably a *bad* idea!
I will do it anyway.  You can change your passphrase at any time,
using this program with the option "--edit-key".

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++++++++++++++++++++++.+++++++++++++++.++++++++++.++++++++++.+++++.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++..................................+++++

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 86 more bytes)
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
.++++++++++.++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++.+++++.+++++.++++++++++.+++++++++++++++++++++++++.+++++..++++++++++++++++++++>++++++++++.>.+++++<.+++++..........>+++++.....................<+++++.>+++++........................+++++^^^^^^^^^^^
gpg: key FD3D8E3C marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:  22  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 22u
gpg: next trustdb check due at 2018-07-29
pub   1024D/FD3D8E3C 2013-01-11
      Key fingerprint = 1709 3B52 C2E1 73CD 3CFC  461D 3220 850C FD3D 8E3C
uid                  Muthu  <thalaimuthu@gmail.com>
sub   2048g/EB04ED8C 2013-01-11

[oracle@muthu ~]$

22 October 2012

passwd: Authentication token manipulation error


passwd: Authentication token manipulation error on Linux 

[muthu@testserver ~]$ passwd
Changing password for user muthu.
Changing password for muthu
(current) UNIX password:
passwd: Authentication token manipulation error

[muthu@testserver ~]$ ls -lrt /etc/passwd


-rw-r--r-- 1 root root 2499 Oct 17 05:17 /etc/passwd
[muthu@testserver ~]$ ls -lrt /etc/shadow
-r-------- 1 root root 1899 Oct 17 05:15 /etc/shadow
[muthu@testserver ~]$ cat /etc/shadow
cat: /etc/shadow: Permission denied
[muthu@testserver ~]$ su -
Password:
[root@testserver ~]# chmod -R 755 /etc/shadow /etc/passwd
[root@testserver ~]# su - muthu

Password:
[muthu@testserver ~]$ passwd
Changing password for user muthu.
Changing password for muthu
(current) UNIX password:
New UNIX password:

Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[muthu@testserver ~]# ls -lr /etc/shadow /etc/passwd
-rwxr-xr-x 1 root root 1920 Oct 22 01:42 /etc/shadow
-rwxr-xr-x 1 root root 2499 Oct 17 05:17 /etc/passwd
[muthu@testserver ~]$





02 May 2012

How can I disable "Set as Desktop Background" as an option in Firefox

How can I disable "Set as Desktop Background" as an option in Firefox

You Need to Configure userChrome.css file  Click Here to Configure

Click Add to Firefox  then Click Install  Afer completing the installation restart Your browser

Then Click Tools --> ChromeEdit Plus --> ChromeEdit

You need to Add below line
#context-setDesktopBackground {display: none !important;}
 
 
Then Click restart.
 
Dont forget to remove ChromeEditor addon. 

Manual Method :-

You need to edit below File Open with as a NotePad
 
C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\36xwzu03.default\chrome\userChrome.css
 
Clear all the data  
 
Add below Lines
 
 /*
 * Edit this file and copy it as userChrome.css into your
 * profile-directory/chrome/
 */

/*
 * This file can be used to customize the look of Mozilla's user interface
 * You should consider using !important on rules which you want to
 * override default settings.
 */

/*
 * Do not remove the @namespace line -- it's required for correct functioning
 */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */

#context-setDesktopBackground {display: none !important;}

/*
 * Some possible accessibility enhancements:
 */
/*
 * Make all the default font sizes 20 pt:
 *
 * * {
 *   font-size: 20pt !important
 * }
 */
/*
 * Make menu items in particular 15 pt instead of the default size:
 *
 * menupopup > * {
 *   font-size: 15pt !important
 * }
 */
/*
 * Give the Location (URL) Bar a fixed-width font
 *
 * #urlbar {
 *    font-family: monospace !important;
 * }
 */

/*
 * For more examples see http://www.mozilla.org/unix/customizing.html
 */
 
then save and restart your browser .   

28 April 2012

PRVF-5436 : The NTP daemon running on one or more nodes lacks the slewing option "-x"

When I am Executing Cluster Verification utility I am facing below Error :


[oracle@dev147 bin]$ ./cluvfy stage -pre crsinst -n dev133,dev147 -fixup -verbose

Checking NTP daemon command line for slewing option "-x"
Check: NTP daemon command line
  Node Name                             Slewing Option Set?
  ------------------------------------  ------------------------
  dev147                                   no
  dev133                                   no
Result:
NTP daemon slewing option check failed on some nodes
PRVF-5436 : The NTP daemon running on one or more nodes lacks the slewing option "-x"
Result: Clock synchronization check using Network Time Protocol(NTP) failed

The solution was to re-configure the NTP server as follows:

Edit the /etc/sysconfig/ntpd configuration file and add the -x 

example :
Old Value

OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"

New Value :

OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

The NTP server was then restarted as follows:

service ntpd restart


Result :

Starting Clock synchronization checks using Network Time Protocol(NTP)...

NTP Configuration file check started...
The NTP configuration file "/etc/ntp.conf" is available on all nodes
NTP Configuration file check passed

Checking daemon liveness...

Check: Liveness for "ntpd"
  Node Name                             Running?
  ------------------------------------  ------------------------
  dev147                                yes
  dev133                                yes
Result: Liveness check passed for "ntpd"
Check for NTP daemon or service alive passed on all nodes

Checking NTP daemon command line for slewing option "-x"
Check: NTP daemon command line
  Node Name                             Slewing Option Set?
  ------------------------------------  ------------------------
  dev147                                yes
  dev133                                yes
Result:
NTP daemon slewing option check passedStarting Clock synchronization checks using Network Time Protocol(NTP)...

NTP Configuration file check started...
The NTP configuration file "/etc/ntp.conf" is available on all nodes
NTP Configuration file check passed

Checking daemon liveness...

Check: Liveness for "ntpd"
  Node Name                             Running?
  ------------------------------------  ------------------------
  dev147                                yes
  dev133                                yes
Result: Liveness check passed for "ntpd"
Check for NTP daemon or service alive passed on all nodes

Checking NTP daemon command line for slewing option "-x"
Check: NTP daemon command line
  Node Name                             Slewing Option Set?
  ------------------------------------  ------------------------
  dev147                                yes
  dev133                                yes
Result:
NTP daemon slewing option check passed

30 March 2012

Step by Step Oracle ASM Disk creation on Linux 4.5 32bit

[root@primary ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
[root@primary ~]#oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@primary ~]# oracleasm createdisk DISK01 /dev/sdb1
Writing disk header: failed
Unable to label device "/dev/sdb1"
[root@primary ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 5 will be corrected by w(rite)

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@primary ~]# oracleasm createdisk DISK01 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@primary ~]# oracleasm createdisk DISK02 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@primary ~]# oracleasm listdisks
DISK01
DISK02

Step by Step Raw Device creation on OEL4.5 Linux32bit

Raw Device Setup:-

This step is only necessary if you want ASM to access the disks as raw devices.

Edit the "/etc/sysconfig/rawdevices" file, adding the following lines.

    /dev/raw/raw1 /dev/sdb1
    /dev/raw/raw2 /dev/sdc1

[root@primary dev]# service rawdevices restart
Assigning devices:
           /dev/raw/raw1  -->   /dev/sdb1
/dev/raw/raw1:  bound to major 8, minor 17
           /dev/raw/raw2  -->   /dev/sdc1
/dev/raw/raw2:  bound to major 8, minor 33
done
[root@primary dev]#

Run the following commands and add them the "/etc/rc.local" file.
chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chmod 600 /dev/raw/raw1
chmod 600 /dev/raw/raw2

04 October 2011

Step by Step Oracle Linux Installation

Select Skip

Click Next
Select your Language Click Next
 Click next

 Select Manual
Click Yes

 Enter your Mount point. /boot, /,  Swap

  Click next
 Click next
 Enter your IP address and Host name
 Disable your Firewall  Click next
 Select your country  Click next
 Enter your Root Password  Click next
  Select Everything  Click next
  Click next

 Reboot

You have successfully installed .

25 September 2011

How to remove memory caches in Linux

[root@our12-db1 ~]# free -m -t
             total       used       free     shared    buffers     cached
Mem:         48288      46384       1904          0        315      38199
-/+ buffers/cache:       7870      40418
Swap:        32767        105      32662
Total:       81056      46490      34566
[root@our12-db1 ~]# sudo sync && sudo sysctl -w vm.drop_caches=3 && sudo sysctl -w vm.drop_caches=o
vm.drop_caches = 3
vm.drop_caches = o
[root@our12-db1 ~]# free -m -t
             total       used       free     shared    buffers     cached
Mem:         48288      11533      36755          0          2       4228
-/+ buffers/cache:       7302      40986
Swap:        32767        105      32662
Total:       81056      11638      69418
[root@our12-db1 ~]#

14 April 2011

mount remote ftp directory host locally into linux filesystem

Mount remote ftp directory host locally into linux filesystem
Install below two rpms package

fuse-curlftpfs-0.9.1-1.el5.rf.x86_64.rpm
fuse-libs-2.7.4-8.el5.x86_64.rpm

# mkdir /mnt/Ariba

Examble
    * username: ftp-user
    * password: ftp-pass
    * host/IP: my-ftp-location.local

# curlftpfs ftp-user:ftp-pass@my-ftp-location.local /mnt/Ariba/

Examble :-

curlftpfs username:password@10.2.0.144 /mnt/Ariba/

#df -h
/dev/mapper/VolGroup00-LogVol00_root
                      146G  103G   36G  75% /
/dev/mapper/VolGroup00-LogVol00_rman_bkup
                      133G  188M  126G   1% /rman_bkup
/dev/mapper/VolGroup00-LogVol00_backup
                       97G  189M   92G   1% /backup
/dev/sda1              99M   13M   81M  14% /boot
tmpfs                  24G  8.9M   24G   1% /dev/shm
/dev/mapper/VG_Storage-r01
                       50G   31G   17G  65% /r01
/dev/mapper/VG_Storage-r02
                       50G   19G   28G  41% /r02
/dev/mapper/VG_Storage-r03
                       50G   35G   12G  75% /r03
/dev/mapper/VG_Storage-r04
                       50G   21G   27G  45% /r04
/dev/mapper/VG_Storage-oracle
                       20G   15G  4.4G  77% /oracle
/dev/mapper/VG_Storage-Archive
                       74G  3.3G   67G   5% /Archive
fuse                  7.5T     0  7.5T   0% /mnt/Ariba

Finaly my ftp server is mounted .

01 April 2011

How to install or Register ttf font in Linux

[root@our12-test ~]# mkdir /usr/share/fonts/ttf/     copy your font file
[root@our12-test ~]# cd /usr/share/fonts/ttf/
[root@our12-test ~]# mkdir /usr/local/fonts/ttf/      copy your font file
[root@our12-test ~]# cd /usr/local/fonts/ttf/
[root@our12-test ttf]# ttmkfdir > fonts.scale
[root@our12-test ttf]# mkfontdir
[root@our12-test ttf]# chkfontpath -a /usr/share/fonts/ttf
[root@our12-test ttf]# vi /etc/X11/xfs/config    or   /etc/X11/fs/config
[root@our12-test ttf]# vi /etc/X11/fs/config
#
# Default font server configuration file for Red Hat Linux
#

# allow a max of 10 clients to connect to this font server
client-limit = 10

# when a font server reaches its limit, start up a new one
clone-self = on

# alternate font servers for clients to use
#alternate-servers = foo:7101,bar:7102

# where to look for fonts
#
catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled,
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
/usr/X11R6/lib/X11/fonts/Type1,
/usr/X11R6/lib/X11/fonts/Speedo,
/usr/share/fonts/default/Type1,
/usr/share/fonts/ttf,

# in 12 points, decipoints
default-point-size = 120

# 100 x 100 and 75 x 75
default-resolutions = 75,75,100,100

# use lazy loading on 16 bit (usually Asian) fonts
deferglyphs = 16

# how to log errors
use-syslog = on

# don't listen to TCP ports by default for security reasons
no-listen = tcp

[root@our12-test ttf]# chkfontpath -a /usr/share/fonts/ttf
chkfontpath: /usr/share/fonts/ttf already in list
[root@our12-test ttf]#

24 February 2011

How to Send the Mail using Telnet

[oracle@our12-test ~]$ telnet 10.1.0.209 25
Trying 10.1.0.209...
Connected to 10.1.0.209 (10.1.0.209).
Escape character is '^]'.
220 exccasggnfip01.optibilt.com Microsoft ESMTP MAIL Service ready at Thu, 24 Feb 2011 15:28:06 +0530
helo OPTIBILT
250 exccasggnfip01.optibilt.com Hello [10.2.0.187]
MAIL FROM: our12.mailtest@bilt.com
250 2.1.0 Sender OK
RCPT TO: thalaimuthu@gmail.com
250 2.1.5 Recipient OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Welcome

.
250 2.6.0 <7aec04c1-057e-4fbc-9c4b-25cb2dea19a4@exccasggnfip01.optibilt.com> Queued mail for delivery

quit
221 2.0.0 Service closing transmission channel
Connection closed by foreign host.
[oracle@our12-test ~]$

17 February 2011

How to format the Linux Hard disk

[root@muthu ~]# fdisk -l

Disk /dev/sda: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14        1288    10241437+  83  Linux
/dev/sda3            1289        1549     2096482+  82  Linux swap
/dev/sda4            1550       13054    92413912+   5  Extended
/dev/sda5            1550       13054    92413881   83  Linux

Disk /dev/sdb: 75.1 GB, 75161927680 bytes
255 heads, 63 sectors/track, 9137 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
[root@muthu /]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 9137.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdb: 75.1 GB, 75161927680 bytes
255 heads, 63 sectors/track, 9137 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-9137, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-9137, default 9137):
Using default value 9137

Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@muthu /]# mkfs -t ext3 /dev/sdb
mke2fs 1.35 (28-Feb-2004)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
9175040 inodes, 18350080 blocks
917504 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
560 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information:
done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@muthu /]# mount /dev/sdb /backup/
[root@muthu /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.7G  7.6G  1.7G  83% /
/dev/sda1              99M   20M   74M  22% /boot
none                  501M     0  501M   0% /dev/shm
/dev/sda5              87G   88M   83G   1% /oracle
/dev/hdc              2.6G  2.6G     0 100% /media/cdrom
/dev/sdb               69G   84M   66G   1% /backup
[root@muthu /]#

24 December 2010

Step by Step NFS Configuration

1. Introduction
The Network File System is certainly one of the most widely used network services. Network file system (NFS) is based on the Remote procedure call. It allows the client to automount and therefore, transparently access the remote file systems on the network.
2. Scenario
In this scenario we are going to export the file system from the linuxconfig.org (IP address 10.1.1.200) host and mount it on linuxconfig.local(IP address 10.1.1.100).
3. Prerequisites
At this point, we assume that the NFS service daemon is already installed on your system, including portmap daemon on which NFS setupt depends. Moreover, your system needs to support the NFS file system.
$ cat /proc/filesystems

NFS daemon should be listening on both standard ports 2049 and portmap on port 111.

Another way to check if NFS is functioning, is to use the rpcinfo command.
# rpcinfo -p  
You should get a response/output
4. Server export file
All NFS server exports need to be defined in /etc/exports file.
4.1. Most common exports options
Here are the most common export techniques and options:
/home/nfs/ 10.1.1.100(rw,sync)
export /home/nfs directory for host with IP 10.1.1.100 with read, write permissions, and synchronized mode
/home/nfs/ 10.1.1.0/24(ro,sync)
export /home/nfs directory for network 10.1.1.0 netmask 255.255.255.0 with read only permissions and synchronized mode
/home/nfs/ 10.1.1.100(rw,sync) 10.1.1.10(ro,sync)
export /home/nfs directory for host with IP 10.1.1.100 with read, write permissions, synchronized mode, and also export /home/nfs directory for hosts with IP 10.1.1.10 with read only permissions and synchronized mode
/home/nfs/ 10.1.1.100(rw,sync,no_root_squash)
export /home/nfs directory for host with IP 10.1.1.100 with read, write permissions, synchronized mode and the remote root user will be treated as a root and will be able to change any file and directory.
/home/nfs/ *(ro,sync)
export /home/nfs directory for any host with a read only permission and synchronized mode
/home/nfs/ *.linuxconfig.org(ro,sync)
export /home/nfs directory for any host within linuxconfig.org domain with a read only permission and synchronized mode
/home/nfs/ foobar(rw,sync)
export /home/nfs directory for hostname foobar with read, write permissions and synchronized mode
4.2. Edit exports file
Open up your favorite text editor, for example, vim and edit /etc/exports file and add line /home/nfs/ *(ro,sync) to export /home/nfs directory for any host with read only permissions. 
/home/nfs/ *(rw,sync)
Be sure that the directory you export by NFS exists. You can also create a file inside the /home/nfs directory which will help you troubleshoot once you mount this file system remotely.
# touch /home/nfs/test_file
4.3. Restart NFS daemon
Once you edit /etc/exports file you need to restart NFS daemon to apply changes in the /etc/exports file. Depending on your Linux distribution, the restarting of NFS may differ. Debian users:
# /etc/init.d/nfs-kernel-server restart
Redhat users
# /etc/init.d/nfs restart
If you later decide to add more NFS exports to the /etc/exports file, you will need to either restart NFS daemon or run command exportfs:
# exportfs -ra
5. Mount remote file system on client
First we need to create a mount point:
# mkdir /home/nfs_local
If you are sure that the NFS client and mount point are ready, you can run the mount command to mount exported NFS remote file system:
# mount 10.1.1.200:/home/nfs /home/nfs_local
In case that you need to specify a type of the filesystem you can do this by:
# mount -t nfs 10.1.1.200:/home/nfs /home/nfs_local
You may get error message
mount: mount to NFS server failed: timed out (retrying).
This may mean that your server supports higher versions of nfs and therefore you need to pass one extra argument to your nfs client. In this example we use nfs version 3:
# mount -t nfs -o nfsvers=3 10.1.1.200:/home/nfs /home/nfs_local

Now you should be able to see that the file system is mounted. Notice that the mount command reports that the filesystem is mounted as "read and write", although you can see that it provides a "read only" permission.
6. Configure automount
To make this completely transparent to end users, you can automount the NFS file system every time a user boots a PC, or you can also use PAM modules to mount once a user logs in with a proper username and password. In this situation just edit /etc/fstab to mount system automatically during a system boot. You can use your favorite editor and create new line like this:
10.1.1.200:/home/nfs /home/nfs_local/ nfs defaults 0 0
in /etc/fstab or
# echo "10.1.1.200:/home/nfs /home/nfs_local/ nfs defaults 0 0" >> /etc/fstab
Restart you NFSD daemon with following commands:
# /etc/init.d/nfs restart
# /etc/init.d/nfslock restart

04 October 2010

Basic Linux Commands


Basic Linux Commands
Command                  Example                                            Description
cat           Sends file contents to standard output. This is a way to list the contents of short files to the screen. It works well with piping.
       cat .bashrc   Sends the contents of the ".bashrc" file to the screen.


cd            Change directory
       cd /home      Change the current working directory to /home. The '/' indicates relative to root, and no matter what directory you are in when you execute this command, the directory will be changed to "/home".
      

cd httpd      Change the current working directory to httpd, relative to the current location which is "/home". The full path of the new working directory is "/home/httpd".
      

cd ..  Move to the parent directory of the current directory. This command will make the current working directory "/home.
      

cd ~   Move to the user's home directory which is "/home/username". The '~' indicates the users home directory.
cp            Copy files
       cp myfile yourfile   Copy the files "myfile" to the file "yourfile" in the current working directory. This command will create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.
      

cp -i myfile yourfile      With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.
      
cp -i /data/myfile . Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt before overwriting the file.
      
cp -dpr srcdir destdir     Copy all files from the directory "srcdir" to the directory "destdir" preserving links (-p option), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another directory.


dd     dd if=/dev/hdb1 of=/backup/       Disk duplicate. The man page says this command is to "Convert and copy a file", but although used by more advanced users, it can be a very handy command. The "if" means input file, "of" means output file.


df            Show the amount of disk space used on each mounted filesystem.
less   less textfile Similar to the more command, but the user can page up and down through the file. The example displays the contents of textfile.

ln            Creates a symbolic link to a file.
       ln -s test symlink   Creates a symbolic link named symlink that points to the file test Typing "ls -i test symlink" will show the two files are different with different inodes. Typing "ls -l test symlink" will show that symlink points to the file test.

locate        A fast database driven file locator.
       slocate -u    This command builds the slocate database. It will take several minutes to complete this command. This command must be used before searching for files, however cron runs this command periodically on most systems.
       locate whereis       Lists all files whose names contain the string "whereis".

logout        Logs the current user off the system.

ls            List files
       ls     List files in the current working directory except those starting with . and only show the file name.
       ls -al List all files in the current working directory in long listing format showing permissions, ownership, size, and time and date stamp

more          Allows file contents or piped output to be sent to the screen one page at a time.
       more /etc/profile    Lists the contents of the "/etc/profile" file to the screen one page at a time.
      
ls -al |more  Performs a directory listing of all files and pipes the output of the listing through more. If the directory listing is longer than a page, it will be listed one page at a time.

mv            Move or rename files
       mv -i myfile yourfile      Move the file from "myfile" to "yourfile". This effectively changes the name of "myfile" to "yourfile".
      
mv -i /data/myfile . Move the file from "myfile" from the directory "/data" to the current working directory.

pwd           Show the name of the current working directory
       more /etc/profile    Lists the contents of the "/etc/profile" file to the screen one page at a time.

shutdown             Shuts the system down.
       shutdown -h now      Shuts the system down to halt immediately.
       shutdown -r now      Shuts the system down immediately and the system reboots.

whereis              Show where the binary, source and manual page files are for a command
       whereis ls    Locates binaries and manual pages for the ls command.
      


30 September 2010

Howto : Install Canon LBP2900 printer on Linux

Howto : Install Canon LBP2900 printer on Linux
Features

    * 12 ppm mono printing
    * Zero warm-up time from sleep mode
    * First Print Out Time in only 9.3 seconds
    * Up to 2400 x 600dpi print resolution
    * Energy efficient and quiet operation
    * Easy to use All-in-One cartridg

This tutorial will show you how to install Canon LPB2900 on Linux, tested also on Canon LBP3100 and is working, and should work on all

the Canon laser printers LBP XXXX Series.

Before to begin we have to see if all the necessary dependencies are installed, if not we have to install them, check the ones below if already

are installed :

1/6: printer-testpages

2/6: dynamic
3/6: libopenslp1
4/6: cups-common
5/6: portreserve
6/6: cups

If all is installed then we go with the installation :

1- Download the driver from here, or from :

http://downloads.unixmen.com/drivers/CANONLBP2900/CAPTDRV180.tar.gz

2- change to root :

su -  (root)

3- change to the folder where you download the driver and extract it, in my case :

 cd /home/zinovsky/Desktop

tar -xvf Driver.tar.gz change Driver with the name and version of your driver in my case i downloaded CAPTDRV180.tar.gz

output :

[root@localhost Desktop]# tar xvf CAPTDRV180.tar.gz

CANON_UK/
CANON_UK/Src/
CANON_UK/Driver/
CANON_UK/Doc/
CANON_UK/Src/cndrvcups-capt-1.80-1.tar.gz
CANON_UK/Src/cndrvcups-common-1.80-1.tar.gz
CANON_UK/Driver/RPM/
CANON_UK/Driver/Debian/
CANON_UK/Driver/RPM/cndrvcups-common-1.80-1.i386.rpm
CANON_UK/Driver/RPM/cndrvcups-capt-1.80-1.i386.rpm
CANON_UK/Driver/Debian/cndrvcups-common_1.80-1_i386.deb
CANON_UK/Driver/Debian/cndrvcups-capt_1.80-1_i386.deb
CANON_UK/Doc/README-capt-1.8xE.txt
CANON_UK/Doc/LICENSE-captdrv-1.80E.txt
CANON_UK/Doc/README-capt-1.8xE.pdf
CANON_UK/Doc/guide-capt-1.8xE.tar.gz

so now if we want to install in debian ( ubuntu for exmple) we have to choose :

CANON_UK/Driver/Debian/cndrvcups-common_1.80-1_i386.deb
CANON_UK/Driver/Debian/cndrvcups-capt_1.80-1_i386.deb

if We have to install the driver on red-hat based distribution like in my case will choose

CANON_UK/Driver/RPM/cndrvcups-common-1.80-1.i386.rpm
CANON_UK/Driver/RPM/cndrvcups-capt-1.80-1.i386.rpm

like this :

[root@localhost Desktop]# cd CANON_UK/                                                                                                                  

[root@localhost CANON_UK]# ls                                                                                                                                       
Doc/  Driver/  Src/                                                                                                                                                                                                                                                                                                                                                                                                                             
[root@localhost CANON_UK]# cd Driver/                                                                                                                               
[root@localhost Driver]# ls                                                                                                                                         
Debian/  RPM/                   

in my case i will install in red-hat based distribution so is a RPM package ( fedora,Mandriva, Linpus )

[root@localhost Driver]# cd RPM/

[root@localhost RPM]# rpm -ivh cndrvcups-common-1.80-1.i386.rpm

Preparing... ########################################### [100%]
1:cndrvcups-common ########################################### [100%]
[root@localhost RPM]# rpm -ivh cndrvcups-capt-1.80-1.i386.rpm
Preparing... ########################################### [100%]
1:cndrvcups-capt ########################################### [100%]

Driver is installed .

4- Now we have to restart CUPS :

/etc/init.d/cups restart

5-Now type tail /var/log/messages

[root@localhost ~]# tail /var/log/messages

Jan 24 18:37:51 localhost perl: [RPM] cups-1.3.9-0.2mdv2009.0 installed
Jan 24 18:40:25 localhost kernel: usb 1-1: new high speed USB device using ehci_hcd and address 6
Jan 24 18:40:25 localhost kernel: usb 1-1: configuration #1 chosen from 1 choice
Jan 24 18:40:25 localhost kernel: usb 1-1: New USB device found, idVendor=04a9, idProduct=2676
Jan 24 18:40:25 localhost kernel: usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jan 24 18:40:25 localhost kernel: usb 1-1: Product: Canon CAPT USB Device
Jan 24 18:40:25 localhost kernel: usb 1-1: Manufacturer: Canon
Jan 24 18:40:25 localhost kernel: usb 1-1: SerialNumber: 0000A376H8Jd
Jan 24 18:40:25 localhost kernel: usblp0: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x04A9 pid 0x2676
Jan 24 18:40:25 localhost kernel: usbcore: registered new interface driver usblp

6- Now type :

/usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E



N.B : If you are trying to install another LBP printer other than LBP2900 then use the command bellow and choose the CNCUPSLBPxxxxCAPTK.ppd

that correspond to your printer model and replace it in the the command above.

ls /usr/share/cups/model/ |grep CNCUPS

7-and then

  /usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0

N.B : If you are trying to install another LBP printer other than LBP2900 then change LBP2900 in the command above with your LBPxxxx printer

output :



CUPS_ConfigPath = /etc/cups/



LOG Path = None

UI Port = 59787

Entry Num : Spooler : Backend : FIFO path : Device Path : Status

----------------------------------------------------------------------------

[0] : LBP2900 : ccp : /var/ccpd/fifo0 : /dev/usb/lp0 : New!!

8- /etc/initd/ccpd start :

/etc/init.d/ccpd start

9- Now Set ccpd to start when you startup your computer:

For debian use :

sudo update-rc.d ccpd defaults 20

for other distributions i prefer this methode :

gedit /etc/rc.local

and add at the end :

 /etc/init.d/ccpd start

save and close

10- Printer is ready to print :)

15 September 2010

Step by Step Openfire Chat server Installation & Configuration

Openfire Chat server Installation
1, Install RHEL
2, Configure mysqld
3, chkconfig mysqld on
4, cd /sbin/
5, /service mysqld start
6, mysql  -uroot  –p
7, enter password …….
8. Create databases openfire
9. Create databases chat
10, grant all privileges on openfire.* root@ ‘localhost’ identified by ‘openfire’;
    grant all privileges on openfire.* root@192.168.3.121 identified by ‘openfire’;
11, grant all privileges on chat.* root@192.168.3.121 identified by ‘chat’;
12 run Sql query is inbuilt for openfire folder
13. Install openfire
14. cd /opt/openfire/bin
15 ./openfire.sh
16 click next
17 select your database
18 next
19 next
20 enter admin new password
21 click finish
cat openfire_mysql.sql | mysql [databaseName];

14 September 2010

Step by step to Create a new partition for linux

Step by step to Create a new partition for linux

login to root user 

1,fdisk -l  view the hdd detail

2, fdisk (hdd type for example /dev/hdb)

3,p to print the partition type ,n to create a new partition .w for save the the partition type .

4 partprobe

5,mke2fs -j (hdd type for example /dev/hdb5)

6,mkdir partition path and folder name

#mkdir -p /data

mount /dev/sdaX /data

You have to entered the entry of new partition in /etc/fstab

#vi /etc/fstab

entered the following line.

/dev/sdaX /data ext3 defaults 1 2

save this file and reboot your machine to verify the changes.