Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Installing gcc4 on CentOS 4 from the command line

This is a very simple entry today. I wanted to install gcc 4.x on CentOS 4. But whenever you do a yum install gcc, it gets gcc 3.4.6. Of course, I try yum install gcc4 and was not able to get the package either. I manage to get it only when I
yum install gcc*

ntpdate no server suitable for synchronization found

I was configuring one of head node of our cluster server to synchronise from our time server in our organisation, and in turn the head node becomes a NTP Server for the compute nodes that on a private IP addresses. As I was configuring the compute nodes and encounter "ntpdate[4933]: no server suitable for synchronization found"

I configured the ntp servers and ntp clients according to Setting up NTP Server for Local Network. And yet the error remain unresolved. Finally, I came across a solution

  1. Open /etc/ntp/step-tickers and replace with the name of your local NTP Server
  2. Open /etc/ntp/ntpservers and replace with the name of your local NTP Server
  3. Restart your ntp services. You should eradicate the problem

Installing Likewise - Joining Linux to MS Active Directory

Continuing from Open Source Tools to integrate with MS Active Directory.


Step 1: Changing Your Hostname from localhost to domain name

Step 2: Download and Install Likewise

  • Go to http://www.likewise.com/community/index.php/download/ register and download the essential packages and GUI (optional)
  • # ./LikewiseIdentityServiceOpen-5.2.0.7111-linux-x86_64-rpm.sh
  • Ensure that you register your computer name at your Microsoft Active Directory if your AD require registration
  • # /opt/likewise/bin/domainjoin-cli join Active-Directory-Domain-Name Administrator
  • Log-out from your current session and Log-In with your AD credential


Step 3: Verify that you have join the Domain

  • # /opt/likewise/bin/domainjoin-cli query.
  • You should see Name = ......... Domain = ......... Distinguished Name = CN= ..................

Note: If you are unable to logon, try using the Full Active Directory Name rather than the Short ones, unless you make the Linux Box aware of your WINS Server.


Further Readings:

  1. See Likewise Documentation Library

Configuring SSH to use Protocol 2 or SSHv2 in CentOS

To disable SSHv1 or SSH Protocol 1, do the following:

Check for Protocol configuration
# cat /etc/ssh/sshd_config |grep Protocol

Ensure that you should get only Protocol 2
Protocol 2

If not, Edit the /etc/ssh/sshd_config to reflect only Protocol 2
# vim /etc/ssh/sshd_config
Search for the word Protocol and make the necessary changes.

Restart OpeenSSH Server
# service sshd restart

Installing Subversion on Fedora 11

I was installing Subversion on Fedora 11 using the "Subversion from CentOS" taken from CentOS Wiki and the instruction set work without a hitch. Just a few important commands to take note

Importing commands to take note:
  1. Initial repository layout for MyTestProject
    # svn import /tmp/mytestproject to file://var/www/svn/repos/mytestproject -m

  2. Checking Out
    $ svn co http://yoursvnserver/repos/mytestproject

  3. Edit and Commit
    $ svn co http://yoursvnserver/repos/mytestproject
    $ svn commit -m "Added a line to testconf1.cfg."

  4. Adding and Commit
    $ svn co http://yoursvnserver/repos/mytestproject
    $ svn add configurations/AnotherTestConf2.cfg
    $ svn commit -m "Added something else"

  5. Deleting
    $ svn co http://yoursvnserver/repos/mytestproject
    $ svn delete configurations/AnotherTestConf2.cfg
    $ svn commit -m "Delete something"

  6. Reverting to Previous Version
    $ svn log http://yoursvnserver/repos/mytestproject
    (You will see a complete list of revision numbers along with the comments)
    $ svn co -r (some number) http://yoursvnserver/repos/mytestproject

  7. To add back files to the current repository
    $ svn
    copy
    http://yoursvnserver/repos/mytestproject/oldversionfile@NNN ./oldversionfile (where NNN is the revision number)
For more informatio
  1. Version Control with Subversion (Free Online Documents and Ebook)

Compiling MPI BLACS on CentOS 5

An interesting article from Linux Cluster on Compiling MPI BLACS on CentOS 5. BLACS is compiled with OpenMPI 1.4.x with g77 and gfortran.

For more information see Compiling BLACS on CentOS 5

Compiling LAPACK on CentOS 5

Download the lapack latest stable version (lapack-3.3.0.tgz) from http://www.netlib.org/lapack/
# cd /root
# tar -xzvf lapack-3.3.0.tgz
# cd /root/lapack-3.3.0
# cp make.inc.example make.inc
Assuming Edit make.inc. Assuming the Compiling ATLAS on CentOS 5
#BLASLIB = ../../blas$(PLAT).a
BLASLIB = /usr/local/atlas/lib/libf77blas.a /usr/local/atlas/lib/libatlas.a
Compile lapack package
# make
Copy the libraries to
# mkdir /usr/local/lapack/lib
# cp /root/lapack-3.3.0/*.a /usr/local/lapack/lib
# cd /usr/local/lapack/lib/
# chmod 555 *.a
Other related Information
  1. Compiling ATLAS on CentOS 5

Tex4ht for CentOS, Redhat and Fedora

TeX4ht is a highly configurable TeX-based authoring system dedicated mainly to produce hypertext.

To install text4ht, make sure you install the repository from http://centos.karan.org/

#yum install tex4ht (That's it)

How to edit a read-only /etc/fstab during single-mode on CentOS

If somehow like me, you edited the /etc/fstab wrongly and have to enter the maintenance mode to rescue it but was not able to edit it.



For this blog entry, I'm writing on using a Linux CD to do a rescue.

Step 1: Put in the CentOS 5.4 CD and boot to CD

Step 2: Press F5 and type linux rescue at the boot prompt
linux rescue

Step 3: When given the command prompt again after a series of screen
# vi /mnt/sysimage/etc/fstab
Do the necessary changes to /etc/fstab
Step 4: Do the reboot
# reboot

Finding problematic updates

I read about this tip from LINUX Format March 2009 Issue (page 83)

If you installed a software updates and something broke or no longer works, you may have to look at the Package Manager log File.

For Debian-based LINUX like Ubuntu, Linux Mint, the log file is /var/log/dpkg.log

For Redhat-based Linux like CentOS, Fedora, the log file is /var/log/yum.log

Installing Nvdia FX570 drivers on CentOS 5.x

I was trying out an installation on CentOS 5.3 (x86-64) on a workstation which have Nvidia Fx570 card.

The installation of CentOS was very smooth. No hiccups.

  1. I've downloaded the Nvidia Drivers for Linux from Nvidia Site
  2. I did a "# yum install gcc" as Nvidia Drivers need gcc to compile
  3. I run the ./NVIDIA-Linux-x86_64-185.18.29-pkg2.run. But I seems to encounter the "No precompiled kernel interface was found to match your kernel; would you like the installer to attempt to download a kernel interface for your kernel" error
  4. I "yum install kernel-devel" and the error still appear
  5. Finally I run the application with the full kernel source path "./NVIDIA-Linux-x86_64-185.18.29-pkg2.run --kernel-source-path=/usr/src/kernels/2.6.18-128.2.1.el5-x86_64/"
It works.... :)

Encountering State Initializing after installing Voltaire Drivers

First thing first,

For more information on downloading the appropriate Voltaire Drivers, see blog entry Download Voltaire OFED Drivers for CentOS. After you have downloaded the appropriate and install Voltaire Drivers, you may encounter something like:

CA 'mlx4_0'
CA type: MT26428
Number of ports: 1
Firmware version: 2.6.0
Hardware version: a0
Node GUID: 0x0008f1476328oaf0
System image GUID: 0x0008fd6478a5af3
Port 1:
State: Initializing
Physical state: LinkUp
Rate: 40
Base lid: 2
LMC: 0
SM lid: 14
Capability mask: 0x0251086a
Port GUID: 0x0008f103467a5af1

It is due to the Subnet Manager (opensm) not being installed. Voltaire OFED Installation package installed only the OpenIB Packages. Even if you have install the opensm before installing the Voltaire OFED Package, the Voltaire OFED Package will uninstall the existing opensm packages to ensure openib packages are fully compatible.

To install the Opensm packages nicely, do read on the blog entry Installing Voltaire QDR Infiniband Drivers for CentOS 5.4

Other good reasing materials:
  1. RHEL and Infiniband - basic diagnostics

Installing lammps using Intel Compilers, OpenMPI and FFTW

This is a entry on how I install LAMMPS using Intel, OpenMPI and FFTW
  1. If you are eligible for the Intel Compiler Free Download. Download the Free Non-Commercial Intel Compiler Download
  2. Build OpenMPI with Intel Compiler
  3. Install FFTW. Remember to install FFTW-2.1.x and not FFTW-3.x or you will face an issue fft3d.h(164): catastrophic error: could not open source file "fftw.h" . Read the LAMMPS "Getting Started" Section for more information
  4. When you are ready and about to compile, there are several "Make" selection found at "$SOURCE/lammps-30Mar10/src/MAKE". I chose the makefile.openmpi. Be default you do not need to edit the Makefile.openmpi. But if you are a guru and want to edit the file, feel free to
  5. Finally go to the preceding directory by typing
    cd .. (ie $SOURCE/lammps-30Mar10/src)
    make openmpi -j (-j for parallel compilation)
  6. At the end of the compilation, you should see a lmp_openmpi binary at the src directory. You are almost done
  7. Check that the executable are properly linked by doing a
    # ldd lmp_openmpi
  8. Remember to include /usr/local/lib in the LD_LIBRARY_PATH if libmpi_cxx.so.0 is located at /usr/local/lib

Compiling ATLAS on CentOS 5

This tutorial is to help you compile ATLAS (Automatically Tuned Linear Algebra Software) with gFortran. For those who are using Intel Compiler, you have the reliable Intel MKL (Math Kernel Library)

First thing first, some comparison between ATLAS and MKL.

ATLAS
ATLAS The Automatically Tuned Linear Algebra Software (ATLAS) provides a complete implementation of the BLAS API 3 and a subset of LAPACK 3. A big number of instructions-set specific optimizations are used throughout the library to achieve peak-performance on a wide variety of HW-platforms.

ATLAS provides both C and Fortran interfaces.

ATLAS is available for all HW-platforms capable of running UNIX or UNIX-like operating systems as well as Windows (tm).
MKL
Intel's Math Kernel Library (MKL) implements a set of linear algebra, fast Fourier transforms and vector math functions. It includes LAPACK 3, BLAS 3 and extended BLAS and provides both C and Fortran interfaces.

MKL is available for Windows (tm) and Linux (x86/i686 and above) only.
Download the latest stable package from ATLAS (http://sourceforge.net/projects/math-atlas/files/Stable/). The current stable version is atlas3.8.0.tar.gz. Do note that ATLAS don't like configuration on its original location, hence the need to create ATLAS_BUILD directory.
# cd /root
# tar -xzvf atlas3.8.3.tar.gz
# mkdir /root/ATLAS_BUILD
# cd /root/ATLAS_BUILD
# /root/ATLAS/configure
You will need to turn off CPU Throttling. For CentOS and Fedora, you will use
# /usr/bin/cpufreq-selector -g performance
For more information, you can see my blog entry Switching off CPU Throttling on CentOS or Fedora

Compile ATLAS
make
make check
make ptcheck
make time
make install
By default, ATLAS installed to /usr/local/atlas

Finally remember to add /usr/local/atlas/lib to your LD_LIBRARY_PATH

Scalpel - Recover lost file

Scalpel is a fast file carver that reads a database of header and footerdefinitions and extracts matching files from a set of image files or rawdevice files. Scalpel is filesystem-independent and will carve files fromFATx, NTFS, ext2/3, or raw partitions. It is useful for both digitalforensics investigation and file recovery

Step 1: Install scalpel
# yum install scalpel

Step 2: Define the file type you wish to recover by uncommenting it.
# vim /etc/scalpel.conf

Step 3: Recover the file
# scalpel /dev/mapper/VolGroup00-LogVol00 -o output

Note:
  1. Make sure you do not have a directory output or scalpel will not work.
  2. Scalpel search by partition and not directory. So don't specify directory. It simply cannot work
  3. to know which partition yo have, type # mount

Article: For more information, see Recover Deleted Files With Scalpel by HowToForge

Testing for Saturated Network for NFS

How do we test for saturated network for NFS. Is there a systematic way of doing it? You can read my Linux Cluster blog entry Testing for Saturated Network for NFS

Compiling Grace: checking for a Motif >= 1002 compatible API... no

When you are compiling source package from Grace, you may encounter error during compiling on CentOS 5.x "checking for a Motif >= 1002 compatible API... no"

To resolve the issues, you will need to install the
# yum install openmotif openmotif-devel

Installing Voltaire QDR Infiniband Drivers for CentOS 5.4

This blog writeup Installing Voltaire QDR Infiniband Drivers for CentOS 5.4 (linuxcluster.wordpress.com) is on how you can
  1. Download the drivers from the Voltaire Website
  2. Install the Infiniband Drivers
  3. Install the Subnet Manager - opensmd
  4. Test the State is "Active"
  5. Connectivity Test between Server and Client
For more information, on Voltaire Infiniband installation, do read on
  1. Voltaire OFED 1.5 User Manual
  2. Infiniband HOWTO by Guy Coates

OpenMPI, CentOS Linking Error - libmpi.so.0 :cannot open shared object file: No such file or directory

I was installing OpenMPI on CentOS 5.x. After installation, I  tried to  use pirun, I encountered this error
libmpi.so.0 :cannot open shared object file: No such file or directory

The reason for the error is that the the loader is not able to find the libmpi.so because /usr/local/lib is not in its PATH

To resolve the issues, you have to do the following
# vim /etc/ld.so.conf
(Add the /usr/local/lib into the file)
# ldconfig

Encrypting VNC Traffic with Putty



Assuming you are using a Windows Clients and you wish to have a Secure Shell Connection to Windows, you have to do the followings:

Step 1: Assuming you have launch the VNC Session at the vncserver Server
$ vncserver

New 'xxx.yourserverdomain.com:2 (root)' desktop is xxx.yourserverdomain.com:2
Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/xxx.yourserverdomain.com:2.log

Step 2: Configuration at the SSH Client
  • At Putty Client, Enter the IP of hostname of the VNCServer
  • On the left-hand pane, click Connection > SSH > Tunnels
  • Source Port: 590x (depending on the return port above in step 1)
  • Destination Port: xxx.serverhostname.com:590x (depending on the return port in step 1)
  • Connect to the Server via SSH

Step 3: Use the VNC Client to connect to local VNC Port. On the TightVNC connection,
$ localhost:2