Tuesday, March 31, 2009

Using SAMBA 2nd Edition by O'Reilly Online Catalog

O'Reilly put up Using SAMBA (2nd Edition) online. Although this is definitely not a recent edition but it definitely very applicable even for the current version of SAMBA. Interesting information and tips on how to use SAMBA

Must Read....especially if it is free

Monday, March 30, 2009

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)

Sunday, March 29, 2009

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

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

  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

Friday, March 27, 2009

Cooperative Linux - Linux on Windows

Cooperative Linux is the first working free and open source method for optimally running Linux on Microsoft Windows natively. More generally, Cooperative Linux (short-named coLinux) is a port of the Linux kernel that allows it to run cooperatively alongside another operating system on a single machine. For instance, it allows one to freely run Linux on Windows 2000/XP, without using a commercial PC virtualization software such as VMware, in a way which is much more optimal than using any general purpose PC virtualization software.


Thursday, March 26, 2009

Xming, X Windows Server for Microsoft

Use this tools very often when I'm using a Windows OS and need a X Windows to my LINUX Server

Xming is the leading free unlimited X Window server for Microsoft Windows (XP/2003/Vista). It is fully featured, small and fast, simple to install and being standalone native Microsoft Windows, easily transported portable as a Pocket PC X server.

At the download page, download the Xming-mesa instead of Xming. Most versatile so far....

Wednesday, March 25, 2009

Using httping to test http throughput and latency

To test the throughput and latency of a web server from a remote server, you can use the following utilities httping.

Step 1:
Install RPMForge

Step 2:
# yum install httping

Step 3:
# httping -c10 -Grg http://www.yourwebserver.com

-g (URL to probe)
-G (GET request, to fetch the whole page)
-r (Resolve the hostname once, removing latency)
-b (show the transfer rates in bytes)
-s (display return codes)
-l (connect using SSL)

Monday, March 23, 2009

Installing Ganglia on Standalone or Cluster

Good Readup on How to Install Ganglia on Clusters or Standalone Machine. Taken from I do linux blog, an excellent resource.
  1. Ganglia Cluster Monitoring Made Easy by Idolinux.blogspot.com
  2. Ganglia Howto by IBM
  3. Ganglia Documentation by SourceForge.Net

Thursday, March 19, 2009

Xen: Invalid Source and/or Image destination

Xen Virtualisation comes with Redhat Enterprise 5 and its variant such as CentOS 5. A pretty cool package which allow full and para Virtualisation.

Very clear instruction can be found at Virtualization Guide

However during installation, I encounter a error where somehow I cannot install Media URL. I've tried NFS, but it didn't work.

To resolve this issue, look at the CentOS Discussion Forum. Initially I tried to use iso image but couldn't get it to work

  1. Start the Apache Service
  2. Place the CentOS DVD Disk into the Drive
  3. Do a Softlink from "ln -s /media/CentOS_5.2_Final /var/www/html/dvd"
  4. Of course first check that you can see the
  5. Run Virt-Manager

The rest will be quite a breeze

Citrix XenServer Enterprise Free

Citrix XenServer (Enterprise) is provided as free download. According to CITRIX, it offers a competitive, enterprise-ready virtual infrastructure platform with full centralized management, live motion and support for unlimited VMs and servers—with no strings attached.

Citrix XenServer (Enterprise) download

Tuesday, March 17, 2009

Free Non-Commercial Intel Compiler Download

The Intel® Software Development Products listed below are available for free non-commercial download. Click on a product to initiate the download process.
Non-Commercial Software Download

Monday, March 16, 2009

libXp.so.6 error in MATLAB

If you encounter "...... error while loading shared libraries: libXp.so.6: cannot open shared object file: No such file or directory..." when installing MATLAB on CentOS 5, \\.

To solve the problem:

# yum install libXp libXp-devel

Disabling Shutdown and Reboot in GNOME logout menu

For workstations that have to be shared among different users, there are some steps Administrators can do to prevent users from rebooting or shutdown

1. Changing GNOME System Menu

Change the gdm's config file
# vim /etc/X11/gdm/gdm.conf

Find a line in the gdm.conf
# SystemMenu = false

2. To Prevent users from opening a termina and running "poweroff" or "reboot"
Delete or move these files:

3. Prevent shutdown using Alt-Ctrl-Del
# vim inittab

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

And change it to read:
ca::ctrlaltdel:/bin/echo "ctrl-alt-delete has been disabled"

Modify the ownership
#sudo chgrp root /sbin/halt /sbin/shutdown
#sudo chmod 550 /sbin/halt /sbin/shutdown


  1. Disable Shutdown For Normal Users (Ubuntu Blog)
  2. Disable shutdown/reboot in GNOME logout menu (Fedora Mailing List)

Installing RPMForge

RPMForge is a collaboration of Dag, Dries, and other packagers. They provide over 2600 packages for CentOS, including mplayer, xmms-mp3, and other popular media tools. It is not part of RedHat or CentOS but is designed to work with these major distributions.
This Repository is definitely something you will not want to miss out

For CentOS 5 (summary)
# yum install yum-priorities
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
# rpm -ivh rpmforge-release-0.5*.rpm
# yum check-update

For CentOS 4 (summary)
# yum install yum-plugin-priorities
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el4.rf.x86_64.rpm
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el4.rf.i386.rpm
rpm -ivh rpmforge-release-0.5*.rpm
# yum check-update

For more information, read go to http://rpmrepo.org/RPMforge/

Sunday, March 15, 2009

NFS Performance Tuning

According to an article by NFS Performance Tuning by Ben Martin, adding a async parameter in the NFS mount in fstab. Tested on Fedora 9

fileserver:/home /home nfs async,rsize=8192,wsize=8192,intr 0 0

According to the article, using async will cause the speed of the NFS mount to be close to actual local disk speed. Furthermore, you can increase the buffer size of rsize and wsize from the default 4096 to 8192

intr - allow signal to interrupt file operation especialy if it is hard-mounted
hard - by default

dmidecode - Finding the hardware details remotely

dmidecode is a tool to obtain the system hardware information described in the system BIOS according to SMBIOS/DMI standard

Options includes:

  1. bios,
  2. system,
  3. baseboard,
  4. chassis,
  5. processor,
  6. memory,
  7. cache,
  8. connector,
  9. slot

To obtain the information, just type

# dmidecode --type system

To get specific information such as serial number which will be useful for remote fault-reporting without making a trip to the data-center:

# dmidecode -s system-serial-number

To get a list of string keywords:

# dmidecode -s

Followup Articles:

  1. dmidecode: Finding Out Hardware Details Without Opening The Computer Case by HowToForge

Friday, March 13, 2009

Solving "E25: GUI cannot be used: Not enabled at compile time" on CentOS

Solving "E25: GUI cannot be used: Not enabled at compile time"

When you run vim -g , you may encounter the above error "E25: GUI cannot be used: Not enabled at compile time".

Do note that at CentOS, the equivalent of vim -g is gvim. However, there is no package called gvim on CentOS 4 and CentOS 5. To have the gvim equivalent, do the following.

Step 1: yum install vim-enhanced (To install the fuller package of vim)
Step 2: yum install vim-X11 (To installed the equivalent of gvim)
Step 3: Just type gvim......and you have it

Saturday, March 7, 2009

Backup Software - Back In Time

Back In Time is a simple backup system for Linux inspired from “flyback project” and “TimeVault”. The backup is done by taking snapshots of a specified set of directories.

Currently there are two GUI available: Gnome and KDE 4 (>= 4.1).

All you have to do is configure:
  1. Where to save snapshot
  2. What directories to backup
  3. When backup should be done (manual, every hour, every day, every week, every month)
Back In Time URL: http://www.le-web.org/back-in-time/

Extra CentOS Repository (CentOS.karan.org)

Extra CentOS Repository (http://centos.karan.org/).

Thursday, March 5, 2009

Force users to change their passwords upon first login

Taken from Redhat Magazine: Tips and tricks: How do I force users to change their passwords upon first login?

  1. Firstly, lock the account to prevent the user from using the login until the change has been made:

    # usermod -L
  2. Change the password expiration date to 0 to ensure the user changes the password during the next login:

    # chage -d 0

  3. To unlock the account after the change do the following:

    # usermod -U

Wednesday, March 4, 2009

Adding a Directory to the Path

Adding a Directory to the Path

  1. To add a directory to the path of a single user is to modify that user's .bash_profile file.
  2. To add it to all users except user root, add it to /etc/profile.
  3. To also add it to the path of user root, add it to root's .bash_profile file.

Adding to a Single User's Path
To add a directory to the path of a single user, place the lines in that user's .bash_profile file.
PATH=$PATH:/data/myscriptsexport PATH

Adding to All Users' Paths (except root)
You globally set a path in /etc/profile. That setting is global for all users except user root.
export PATH

Adding to the Path of User root
User root's path is set from scratch by its .bash_profile script. In order to add to the path of user root, modify its .bash_profile.

For more information, see the full article "Adding a Directory to the Path"

Tuesday, March 3, 2009

Reverse SSH

Thinking of using your LINUX box hehind a NAT? Here's how to do it....

First thing first:

  1. Make sure you have installed OpenSSH on the destination machine.

  2. ssh -R 1234:localhost:22 home_machine (where home_machine is the IP Address of your home computer)

  3. Once you have established the connection, from your home type: ssh your_name@localhost -p 1234

Similar Article from HowToForge: http://www.howtoforge.com/reverse-ssh-tunneling

Sunday, March 1, 2009

Tuning LINUX Toolbox

Finding Bottlenecks

Columns Information
(r,b) - How many process can be run if a CPU is available and how many are blocked.
(swpd, free, buff, cache) - Show how memory space is used.
(si, so) - Page-In and Page-Out
(io, bi, bo) - Number of Blocks received and sent to block devices
(in, cs) - Number of Interupts and context switches
(us, sy, id, wa) - Indicate percentage of time the CPU(s) has spent in userspace applications, in the kernel, being idle....

# vmstat 5 10 (To run vmstat with ten updates, five seconds )

Articles to consider:

  1. Monitoring Virtual Memory with vmstat by LINUX Journal
  2. Understanding the Linux Virtual Memory Manager by Mel Gorman
  3. Is swap space obsolete? by Martin Pool

Disk Performance
Hdparm is a good tool to determine whether the disks are healthy and configured
# hdparm -tT /dev/sda

Article to consider:

  1. Speeding up Linux Using hdparm by O'Reilly

# iostat -x sda 1
(%iowait) - High means CPU is idele and waiting for outstanding disk I/O requests.
(avgqu-sz) - Value should be less than 1
(%util) - pecentage of time the disk has requests.

To install on CentOS, Fedora, "yum install sysstat", iostat will be installed with the packages.

Articles to consider:

  1. Sysstat Utilities Home Page