Showing posts with label RHEL. Show all posts
Showing posts with label RHEL. Show all posts

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

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)

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

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

Creating a Yum Local Repository at CentOS

Sometimes, you may want a yum local repository for your CentOS 5 Server as yum automatically resolve all the dependency, With a local repo as a resource it will help resolve potential dependencies especially if you do not have internet access

Step 1: You will need an utility, named createrepo.
# yum install createrepo Or
# rpm -Uvh createrepo-0.4.11-3.el5.noarch.rpm

Step 2: Copy the whole CentOS CD to a directory (E.g. /install/centos5.2/x86_64/CentOS)

Step 3: Createrepo
# createrepo /install/centos5.2/x86_64/CentOS
(you will need to run the above command again, so that the repository metadata gets updated)

Step 4: Create a local-repo file
(You may want to remove CentOS-Base.repo, CentOS-Media.repo if you are not connected to network)
# touch install-local.repo


Type the followings:
[localrepo]
name=CentOS $releasever - My Local Repo
baseurl=file:///install/centos5.2/x86_64/

enabled=1
gpgcheck=0
gpgkey=file:///install/centos5.2/x86_64/RPM-GPG-KEY



Further Information:
  1. Local YUM Repository by George Notaras
  2. Docs/Drafts/SoftwareManagementGuide from Fedora

Using VNC Server on CentOS with Windows VNC Viewer

Virtual Network Computing (VNC) allows user to have access to remote GUI console. For CentOS, the vncserver comes installed.


Step 1: Starting a  VNC Session on Vncserver

Step 1a: Remember to turn on the services by issuing the commands
# service vncserver start


Step 1b: Enter the VNC Password
# vncpasswd
(Type and confirm the password)


Step 1c: Test the VncServer
# 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 - Connecting to VNC session using VN Client 

Step 2: Use an TightVNC or RealVNC for the Client


Step 2a: Type into the VNC Clients the VNC Server connection
xxx.yourdomainserver.com:2

You have your connection.........


Step 3 - Changing default Windows Manager to Gnome Session
(Change the default twm windows )
# vim ~/.vnc/xstartup

# Type the following at your xstartup:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid greyvncconfig -iconic &xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &


Step 4: How to kill VNC Server Connection
At the VNCServer,
# vncserver -kill :2

How to install SSHFS and FUSE

  1. SSH File System (SSHFS) Website: http://fuse.sourceforge.net/sshfs.html
    Filesystem in UserSpace (FUSE) Website: http://fuse.sourceforge.net/

    How to install SSHFS and FUSE: http://crazytoon.com/2008/10/07/sshfs-how-do-you-install-sshfs-and-fuse-centoslinuxredhat/
  2. Some potential error during my installation:

    "fuse: failed to open /dev/fuse: Permission denied", the solution is to use root to run"chmod o+rw /dev/fuse"

    "sshfs: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory." The solution is to run "ln -s /usr/local/lib/libfuse.so.2 /lib64/" for 64 bit or ln -s /usr/local/lib/libfuse.so.2 /lib/ for 32-bit

Using nautilus to display icons at Fedora 9

On a clean install of Fedora 9, you will not be able to see icons on the Desktop, as the nautilus package is not install by default.

Just do a "yum install nautilus"

Installing IPW2x00 Kernel Modules

A good article on how to configure the ipw2xxx Wireless Modules. Make sure your Yum repository contains RPM Fusion

AS for the main installation of Installing IPW2x00 Kernel Modules, Read on....

Thoughts on users-install software

Read an interesting FAQ writeup on user-installed software found on Linux Format Aug 09. I thought I summarise the article in my own words.

I think as most system administration will encounter this scenario quite frequently especially in a academic environment that users wants to install software of their own. How do we cope with this?

Suggestion 1: Building from Source
I think one of the easiest method is to simply allow users to install from source file. The users can unpack the source and configure, make and make install. For example:

$ ./configure --prefix=$HOME
$ make
$ make install

(which will install directories like bin, lib and share to the user's home directory)


Suggestion 2: If using RPM, you can use some prefix
$ rpm --prefix=/home/user/local --otheroptions
(and adding an entry to sudoers with sudo)

However, there are some issues as many packages are NOT relocatable and have to be installed to the path that was given when they are compiled.


Suggestion 3: Allowing restricted sudo access
If you allow users to install onto system directories, you can give them restricted rights like installing without removing.

Access Windows shares from Linux

To access Windows Shares from your Linux Box, do the following

Step 1: Create a Directory for mounting
# mkdir /mnt/Windows

Step 2: Install smbfs
# yum install smbfs (RH derivatives) OR
# apt-get smbfs

Step 3: Mount the Windows File System
# mount -t cifs //server-ip-addr-or-server-domain-name/share /mnt/Windows -o username=(your windows userid),password=(Your Windows Password),domain=(Your AD Domain)

Step 4: To umount
# umount /mnt/Windows

EXT3-fs error (device hda3) in start_transaction: Journal has aborted

Taken from Racker Hacker *(http://rackerhacker.com/2007/11/20/ext3-fs-error-device-hda3-in-start_transaction-journal-has-aborted/)

If your system abruptly loses power, or if a RAID card is beginning to fail, you might see an ominous message like this within your logs:

EXT3-fs error (device hda3) in start_transaction: Journal has aborted

Basically, the system is telling you that it’s detected a filesystem/journal mismatch, and it can’t utilize the journal any longer. When this situation pops up, the filesystem gets mounted read-only almost immediately. To fix the situation, you can remount the partition as ext2 (if it isn’t your active root partition), or you can commence the repair operations.

If you’re working with an active root partition, you will need to boot into some rescue media and perform these operations there. If this error occurs with an additional partition besides the root partition, simply unmount the broken filesystem and proceed with these operations.
Remove the journal from the filesystem (effectively turning it into ext2):

# tune2fs -O ^has_journal /dev/hda3


Now, you will need to fsck it to correct any possible problems (throw in a -y flag to say yes to all repairs, -C for a progress bar):

# e2fsck /dev/hda3

Once that's finished, make a new journal which effectively makes the partition an ext3 filesystem again

# tune2fs -j /dev/hda3

You should be able to mount the partition as an ext3 partition at this time:

# mount -t ext3 /dev/hda3 /mnt/fixed

Be sure to check your dmesg output for any additional errors after you’re finished!

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

lshw - Listing hardware specification on CentOS


ishw is a small but useful tool to help you list the hardware of your linux box. Alternatively you can use dmidecode to list hardware too. For more information, you can read blog entry dmidecode - Finding hardware details remotely


To install lshw on CentOS, first ensure you have RPMForge Repository installed. For more information on RPMForge, you can take a look at blog entry Installing RPMForge


Step 1: Install lshw
# yum install lshw


Step 2: Install the gui version of lshw
# yum install lshw-gui


Step 3: To have a quick look of your hardware specification
# lshw -short


Step 4: To view specific hardware, you have to use the class option
# lshw -class memory
(For more information on what class, you can find it from lshw -short)


Step 5: To launch the gui version of lshw
# lshw-gui


Notes:
  1. lshw Project Page

Singular Application

SINGULAR is a Computer Algebra System for polynomial computations with special emphasis on the needs of commutative algebra, algebraic geometry, and singularity theory.

# wget http://www.mathematik.uni-kl.de/%7emschulze/repo/RPMS/Singular-release.rpm
# rpm -Uvh Singular-release.rpm
# yum install Singular-icons Singular-help


For more information on the application, see http://www.singular.uni-kl.de/index.html

NTFSProgs to fix NTFS Issues (Part 3)

This is Part 3 of the the 2 Series of NTFSprogs
  1. NTFSProgs to fix NTFS Issues (Part 1)
  2. NTFSProgs to fix NTFS Issues (Part 2)

Note 1: To Clone Partition, you can use the commands
# ntfsclone --save-image /dev/sdc1 -output ntfs-image-file.img

Note 2: To overwrite the Partition, you can use the commands
# ntfsclone --save-image /dev/sdc1 --0verwrite ntfs-image-file.img

Note 3: To create an uncompress image with the option to mount using loopback
# ntfsclone /dev/sdc1 --output ntfs-image-file.img
(without the --save-image)
# mkdir /mnt/nfs-mount-point
# mount -0 rw,loop -t ntfs-image-file.img /mnt/nfs-mount-point
(You can edit, delete, move files)

Dstat a versatile resource statistics tool


Taken from DAG

Dstat is a versatile replacement for vmstat, iostat, netstat, nfsstat and ifstat. Dstat overcomes some of their limitations and adds some extra features, more counters and flexibility. Dstat is handy for monitoring systems during performance tuning tests, benchmarks or troubleshooting.

Dstat allows you to view all of your system resources instantly, you can eg. compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).

Some of the features includes:
  • Combines vmstat, iostat, ifstat, netstat information and more
  • Shows stats in exactly the same timeframe
  • Enable/order counters as they make most sense during analysis/troubleshooting
  • Modular design
  • Written in python so easily extendable for the task at hand
  • Easy to extend, add your own counters (please contribute those)
  • Includes about 10 external plugins to show how easy it is to add counters
  • Can summarize grouped block/network devices and give total numbers
  • Can show interrupts per device
  • Very accurate timeframes, no timeshifts when system is stressed
  • Shows exact units and limits conversion mistakes
  • Indicate different units with different colors
  • Show intermediate results when delay > 1
  • Allows to export CSV output, which can be imported in Gnumeric and Excel to make graphs

Make sure you have rpmforge repository installed.

# yum install dstat

Some of the useful commands are as followed:
# dstat --help
# dstat --full
# dstat --vmstat
# dstat --mem
# dstat --load

Turn off checking for signature during yum localinstall

yum localinstall is a wonderful utility where I can download and install an rpm package and let yum resolve all the dependencies issues for me. Occasionally, during installation, if I don't want to do a signature check. I can use this commands with a --nogpgcheck flag

# yum localinstall gummi-0.4.2-1.noarch.rpm --nogpgcheck

And it work wonderfully

Lyx - For superior Latex Documents

LyX is a document processor that encourages an approach to writing based on the structure of your documents (WYSIWYM) and not simply their appearance (WYSIWYG).

LyX combines the power and flexibility of TeX/LaTeX with the ease of use of a graphical interface. This results in world-class support for creation of mathematical content (via a fully integrated equation editor) and structured documents like academic articles, theses, and books.

To install Lyx, first ensure that you have RPMForge Repository. The download is quite big, approximately 67M

#yum install lyx

NTFSProgs to fix NTFS Issues (Part 2)

This is a continuation of NTFSProgs to fix NTFS Issues (Part 1)

Note 1: Command line copying using ntfscp
# ntfscp /dev/sdc1 /home/user/new_test.ini test.ini
(Copy the new_test.ini from /home/user as test.ini to the root of /dev/sdc1 NTFS Volume


Note 2: Undeleting files at NTFS Volume

First do a scan for the deleted files
# ntfsundelete --scan /dev/sdc1 (where /dev/sdc1 is the NTFS volume)

Take note of the the number of recoverable files and inode number of the file you wish to recover
# ntfsundelete --undelete --inode 25 --output Documents/deleted.pdf /dev/sdc1
(The command undelete inode number of the file (25) and recovered to Documents directory at NTFS Volume /dev/sdc1)