Thursday, 1 March 2012

Install NTFS driver

With the repositories it's now very easy to add NTFS support to Fedora:
# yum -y install ntfs-3g-devel ntfs-config
Then you can simply mount NTFS file systems just like any other filesystem. You can find more detailed information about this driver at http://www.ntfs-3g.org/ The ntfs-config package contains applications that allow you to more easily manage NTFS partitions.

Install Other Odds and Ends

This section used to have information on installing additional fonts. With the font improvements in Fedora 7 they really aren't needed any more.

Other Handy Utilities

Here are a few other tools that aren't installed by default but a lot of people find handy:
# yum -y install  gnomebaker testdisk thunderbird \
         screen cups-pdf filelight unrar boost
boost - Advanced graphical Bittorrent client
cups-pdf - Add-on to CUPS which creates a PDF Printer which you can use to print any document in PDF format. The file is written to your Desktop.
filelight - A wonderful graphical viewer of where your disk space usage is. Very handy for cleaning up your home directory. gnomebaker - GTK based CD/DVD burning utility
screen - If you do a lot with the command line you'll find screen invaluable
testdisk - Two command line utilities to recover lost partitions and undelete files on FAT filesystems. VERY handy for undeleting files on flash memory cards.
thunderbird - Excellent E-mail client that complements Firefox
unrar - Useful utility to extract RAR archives

Install Java J2RE and Mozilla Plug-in

It's also very handy to have the Java run-time environment available and most importantly a Mozilla plug-in so you can view dynamic content. It's unfortunate that Mozilla will actually crash if you go to a site containing Java and you don't have the plug-in installed. The libraries in Fedora 7 are newer than the ones used by Sun's build so you'll also need to install a compatability library.
Java Runtime Environment (JRE) 6 Update 2 (at the time I wrote this) from Java.com. You'll want to grab the Linux RPM in self-extracting file. Then you want to install it with:
# yum -y install compat-libstdc++-33
# sh ./jre-6u2-linux-i586-rpm.bin
Then you'll probably want to enable Java Plug-ins and here once again there is no easy way:
# ln -s /usr/java/jre1.6.0_02/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
And finally you'll need to tell Fedora that you wish to use this version of Java as the preferred interpreter rather than the Open Source version that's installed by default. You'll of course need to adjust the full pathname if you install a newer version of the jre than the one in this example:
# /usr/sbin/alternatives --install /usr/bin/java java \
 /usr/java/jre1.6.0_02/bin/java 1602
# /usr/sbin/alternatives --config java
There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
 + 1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*  2           /usr/java/jre1.6.0_02/bin/java

Enter to keep the current selection[+], or type selection number: 2
# java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)
If you know of an easier way please post it to the Comments section below.
After you re-start your browser you can test the Java plug-in installation at http://java.com/en/download/installed.jsp

Install MPlayer Media Player

At some point you're probably going to want to play a QuickTime, AVI or ASF file so you'll want the MPlayer media player. Fortunately with the FreshRpms repositories it's also very easy to download and install. Then you can go ahead and install mplayer and all it's dependencies:
# yum -y install mplayer mplayer-gui mplayer-skins mplayer-fonts mplayerplug-in
This command line will download the whole kit and kaboodle, command line utilities, plug-ins, etc. If you want to play content from a command line you will want to use thegmplayer  version which will include a skin-able control panel. Restart your web browser after that whole mess is done installing and you'll also have a plug-in for Mozilla so you can play embedded content. While you're at it be sure to configure mplayer to use the ALSA sound system rather than the default. It just works better. Edit the file~/.mplayer/config and add the following line:
ao=alsa
You can enable support for mms streaming by opening Firefox and click on the special URL about:config. Right click on the list and choose New then choose String. For the preference name enter network.protocol-handler.app.mms then for the string value enter gmplayer.
Special 64-bit instructions:
The above installs the 64-bit version of everything but because your other plug-ins are 32-bits you need to run the 32-bit version of Firefox, which won't be able to use the 64-bit version of the plug-in you just installed. The plug-in can use the 64-bit version of the mplayer application just fine so all you need to do then is to install the 32-bit mplayerplug-in plus a dependency it requires. If you know of any easier way to do this please let me know below.
# rpm -ihv http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/7/mplayerplug-in/mplayerplug-in-3.40-1.fc7.i386.rpm
Both 32-bit and 64-bit instructions:
And finally you'll probably also want some additional codecs to play all that proprietary video that seems to have infected the Internet. Go to the MPlayer Download page and download the essential Binaries Codec Package. You'll need to install those files in /usr/local/lib/win32. Here are the steps. Remember the exact file names may change at some point. If you also installed xine you will need a symlink since it expects codecs to be in a different directory.
# gtar xjvf essential-20061022.tar.bz2 
# mkdir /usr/local/lib/win32
# mv essential-20061022/* /usr/local/lib/win32
# ln -s /usr/local/lib/win32 /usr/lib/win32
# ln -s /usr/local/lib/win32 /usr/local/lib/codecs
# ln -s /usr/local/lib/win32 /usr/lib/codecs

Install VLC (VideoLAN Client)

Multimedia can be the achilles heel of Linux, but with just a little work you should be able to play just about anything your friends can. Besides Mplayer the other great video player is called VLC. It too is trivially easy to install once you have your repositories set up:
# yum -y install videolan-client
Once the client and a zillion dependencies get installed you can play a huge variety of video formats easy with the command vlc 

Install Macromedia Flash/Shockwave plug-in

Flash Plug-in 9.0
32-bit instructions:
To automatically install/update the Macromedia Flash version 9.0 plug-in install the YUM configuration RPM direction from Adobe:
# rpm -ihv http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
You can read more about Adobe's options for installing the Flash Plug-in at http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash.
64-bit instructions:
The Adobe repositories aren't set up to handle 64-bit architectures so you have to get the same package but from a different source. You need to download This File and copy it to your /etc/yum.repos.d directory.
# cd /etc/yum.repos.d
# wget http://macromedia.mplug.org/macromedia-i386.repo
Both architecture instructions:
One you have the correct repository you just have to do this to install the Flash plug-in version 9.0:
# yum -y install flash-plugin
You can get more information about this plug-in at http://macromedia.mplug.org/. Before the plug-in gets installed you'll need to agree to the terms of the license.
Special 64-bit instructions:
Now the problem with 64 bit, even on Windows, is that most plug-ins are still for some reason only available in a 32 bit version. This is a problem because a 64 bit version of Firefox can only use 64 bit plugins. There are several ways to solve this and the easiest method seems to change all the time. Until all plug-ins are available in 64 bit versions some type of hack will be necessary.
As several people have mentioned in the comments section below, the nspluginwrapper is becoming the preferred way of solving this problem. What this plug-in does is allow 32-bit plug-ins to be used in a 64-bit browser. Installing it is not complicated but you do have to be careful to "refresh" it any time you install/update any 32-bit plugins.
You can download the latest plug-in and viewer, BOTH are necessary, from http://gwenole.beauchesne.info/en/projects/nspluginwrapper then install them. If you had previously installed the 32-bit version of Firefox you'll need to remove that first. The versions are accurate as of the time I wrote this so you might need to update the paths below if the versions were updated and I haven't updated this guide yet.
# rpm -ev firefox-32
# rpm -ihv http://gwenole.beauchesne.info/projects/nspluginwrapper/files/nspluginwrapper-0.9.91.4-1.x86_64.rpm \
http://gwenole.beauchesne.info/projects/nspluginwrapper/files/nspluginwrapper-i386-0.9.91.4-1.x86_64.rpm
If you do update/add/remove any 32-bit plug-ins you'll need to run a command line program to make sure the wrapper catches the update:
$ nspluginwrapper -u

Install DVD player

Currently I find the DVD player that works best is the Xine Multimedia Player which is found in the Livna repository so installing it is just this simple:
# yum -y install xine xine-lib xine-skins xine-lib-extras-nonfree libdvdcss
This will install the xine DVD/VCD/CD player. Now to get xine to automatically play a DVD upon insertion instead of the Totem player which can't actually play DVDs, you can simply use the gconftool-2 utility as follows:
$ gconftool-2 --set /desktop/gnome/volume_manager/autoplay_dvd_command \
'xine --auto-play --auto-scan dvd' --type='string'

Add support for other repositories

Fedora comes with a ton of software but there are still plenty of packages of interest to most users that are not included for a variety of reasons. This is where you find the MP3 plug-in and a ton of other packages.
These instructions can vary depending on 32bit or 64bit architecture. If there is a difference it will be noted. If you don't know which architecture you're running you can run the following command:
$ uname -m
x86_64
...or...
i686
I'm still working on the 64 bit specific instructions so your feedback is very important.
Before you add repositories it's probably a good idea to make sure your system is fully updated first. At this point I'm prefering the Livna repository as it's the most useful and complete but at some point I might need to add another one for things that are lacking there. The easiest way to get started is to install the livna-releasepackages:
# rpm -ihv http://rpm.livna.org/livna-release-7.rpm
Please note: If you are upgrading from a previous release this command will fail with a conflict.


When adding additional repositories be very careful as many respositories don't mix well. It's ok to add specialized repositories such as the one for Flash below, but when mixing general repositories such as FreshRPMs, Livna or ATrpms there are often conflicts that are difficult to recover from.
You can browse the packages available there at http://livna-dl.reloumirrors.net/fedora/7/.

Install MP3 Plug-in

Since you've been following along this next step is about as easy as it gets. Just use yum  to automatically install the MP3 plug-ins for xmms and Rhythmbox like this:
# yum -y install xmms xmms-mp3 xmms-faad2 gstreamer-plugins-ugly \
 gstreamer-plugins-bad libmad libid3tag
While you're here you might as well install my personal favorite (this week at least) music player Banshee:
# yum -y install banshee
The -y  flag is to automatically answer yes to any question. If you want to be able to say no you can ignore that flag.
While you're there I highly recommend the grip CD ripper which supports both MP3 and Ogg formats. Once again installation is quite simple:
# yum -y install grip

Upgrading Fedora from previous Fedora

There are a few things you need to do when upgrading from a previous version of Fedora. This was tested only with Fedora Core 6 so older versions may not work quite as easily. The first thing you want to do is upgrade the repository package for the newer version.
# rpm -Uhv http://rpm.livna.org/livna-release-7.rpm
Fedora 7 comes with a much improved font package which does NOT get installed when you upgrade for some reason. You'll first want to remove any of the Microsoft fonts first if you had installed them previously then install the new Red Hat provided fonts:
# rpm -ev msttcorefonts
# yum -y install liberation-fonts
# service xfs restart
And finally you're going to need to do an update of the whole system. This will most likely pick up official Fedora updates as well as updated packages from the Livnarepository. This might take a while.
# yum -y update

Saturday, 10 December 2011

Mount Windows ntfs partition as read-write in Debian Linux


Purpose: We will learn how to mount a Windows NTFS partition as writable (and readable) under Debian Linux. As you must have noticed that under GNOME, Debian mounts your Windows NTFS partition as only “readable” using gnome-volume-manager package. However this is not very useful if you want to copy some data to your Windows partition in Linux. Let’s get started…
Step 1: Find your Windows NTFS partition
First you need to find out what is the partition number of your NTFS partition. You can use any tool like fdisk or cfdisk.
Using fdisk:
debian:~# fdisk -l | grep -i ntfs
/dev/sda1   *           1        3315    26627706    7  HPFS/NTFS
debian:~#
Using cfdisk:
debian:~# cfdisk /dev/sda
cfdisk - NTFS partition
cfdisk - NTFS partition
In this example, the NTFS partition is /dev/sda1. You can substitute your own.
Step 2: Check if your kernel as FUSE support
Note: If you are using the default Debian Lenny kernel (2.6.26) that gets installed then you can skip this step and go to Step 3.
In case if you are like me using a custom compiled kernel then you need to check first if FUSE support is there in your kernel or not. Give the following command:
# cat /boot/config-2.6.26-custom | grep FUSE
You should either get:
CONFIG_FUSE_FS=m
or
CONFIG_FUSE_FS=y
If you don’t see any one of the above output then you will need to re-compile your kernel with FUSE support.
Step 3: Install ntfs-3g utility
To mount NTFS as read-write you will need the ntfs-3g utility from the Linux-NTFS project.
# apt-get update
# apt-get install ntfs-3g
Step 4: Mount your NTFS partition
Finally we can mount our NTFS partition as readable and writable by giving the following command:
# mkdir /mnt/windows
# mount -t ntfs-3g /dev/sda1 /mnt/windows
Check: You can see if the partition mounted correctly or not by giving following command:
debian:/mnt/windows# ls
AUTOEXEC.BAT    pagefile.sys   setup.log
boot.ini                Garmin        PDOXUSRS.NET   Shortcut to Desktop.lnk
Config.Msi              IO.SYS        Program Files  System Volume Information
CONFIG.SYS              MSDOS.SYS     Quarantine     TEMP
Demo Album              NTDETECT.COM  RECYCLER       WINDOWS
Documents and Settings  ntldr         SETUP          YServer.txt
debian:/mnt/windows#
Step 5: Mount NTFS partition on every boot automatically
Instead of giving mount command (like above) every time we boot into Linux, we can make this mount permanent so that the NTFS partition will mount automatically every time you boot into your Linux system. Just add the following line to your ”/etc/fstab’ file:
/dev/sda1       /mnt/windows           ntfs-3g         defaults        0       0
Save the file and reboot your computer and the NTFS partition will be mounted automatically.
You can un-mount the partition by giving the standard command:
# umount /dev/sda1
Happy writing to your NTFS partition.

Implement Virtual Users for VSFTPD Server authentication


Implement Virtual Users for VSFTPD Server authentication


Release:
Redhat Enterprise Linux 5.x
Berkeley DB 4.7.25

Problem:
Create an virtual user database and authenticate ftp server (vsftpd service) using that virtual users.

Solution:

1) First configure the VSFTPD server and make the vsftpd service running

2) Install the required RPMs

# yum install db4-utils

3) Download the Berkeley DB from the below URL


4) Install the Berkeley DB program on the sevrer

# cd /tmp
# tar -xvf db-4.7.25.tar.tar
# cd db-4.7.25/build_unix/
# ../dist/configure
# make
# make install


Create the Virtual User database:

5) Create text file with the virtual user's username and password information like below one.

# vi login.txt
testuser
12345
user1
12345

6) Create the database file using the “db_load” command.

# db_load -T -t hash -f login.txt /etc/vsftpd/login.db

7) Optionally change the permission of the db file.

# chmod 600 /etc/vsftpd/login.db

8) Edit the PAM configuration file to use the created db file.

# vi /etc/pam.d/vsftpd
session include system-auth
auth required pam_userdb.so db=/etc/vsftpd/login
account required pam_userdb.so db=/etc/vsftpd/login
session required pam_loginuid.so

9) Create a location for the virtual users

# useradd -d /var/ftp/virtualuser virtual

10) Edit the configuration file to use the virtual users

# vi /etc/vsftpd/vsftpd.conf

guest_enable=YES
guest_username=virtual

Note: If you add the above two lines means all the virtual users are redirect to the “/var/ftp/virtualuser” directory. Otherwise if you want to use chroot for every user means, that also possible. Add the below entries for every user login to their respective directory.

# vi /etc/vsftpd/vsftpd.conf

virtual_use_local_privs=YES
write_enable=YES
user_sub_token=$USER
local_root=/home/vftp/$USER
chroot_local_user=YES
hide_ids=YES
guest_enable=YES

11) Restart the ftp service on the server.

# service vsftpd restart

12) Now from the client try to login using that virtual username and password

$ ftp ftpserver
Connected to ftpserver.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (sbssdb5:query1): testuser
331 Please specify the password.
Password: 12345
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
Ftp>

Friday, 9 December 2011

RHEL 6.0 Installation Guide (Step By Step)

Some of the many improvements and new features that are included in Red Hat Enterprise Linux 6.0

  • Power management – Tickless kernel and improvements through the application stack to reduce wakeups, power consumption measurement by Powertop, Power Management (ASPM, ALPM), and adaptive system tuning by Tuned, all enhance more efficient system power usage. 

  • Next generation networking – Comprehensive IPv6 support (NFS 4, CIFS, mobile support [RFC 3775], ISATAP support), FCoE, iSCSI, and a new and improved mac 802.11 wireless stack. 
  •  Scalable filesystems – ext4 file system provides support for larger file sizes and significantly reduces repair times over ext3. XFS® is a high-performance file system that supports extremely large files and is optimized for large data transfers.

  • Virtualization – KVM includes performance improvements and new features, sVirt protects the guest and host from unauthorized access, SR-IOV and NPIV deliver high-performance virtual use of physical devices, and libvirt leverages kernel resource management functionality.

  •   Enterprise security enhancement – SELinux includes improved ease of use, application sandboxing, and significantly increased coverage of system services, while SSSD provides unified access to identity and authentication services as well as caching for off-line use.
Development and runtime support – SystemTap improvements, ABRT is a new framework for simple collection and reporting of bug information, and improvements are made to GCC (version 4.4.3), glibc (version 2.11.1), and GDB (version 7.0.1)   

Download Red Hat 6 Beta DVD images here




RHEL6.0 Installation Process (Step by Step)


Booting:

  • Insert the RHEL6.0 DVD to The Drive and Restart the System.
  • Change the Boot Device Priority to the DVD Drive Save the BIOS Setting Then System is Locate the Boot Image From RHEL6 DVD & Start to Boot.

1. Select Install or upgrade an existing system option on Grub Menu



2. Choose a language




3. Choose a keyboard type



4. Choose a installation media



5. Skip DVD media test (or select media test, if you want to test installation media before installation)




6. Red Hat 6 graphical installer starts, select next




7. Accepct Pre-Release Installation




8. Select storage devices




9. Insert computer name




10. Select time zone




11. Enter a password for root user




12. Select type of installation
Read every options info carefully. And select encrypting if needed and option to review and modify partition layout



13. Review partition layout
Modify if needed. Default setup with ext4 and LVM looks good for desktop machine.



14. Accept write changes to disc




15. Writing changes (creating partitions) to disc




16. Configure boot loader options
Select device to install bootloader and check/create boot loader operating system list



17. Select softwares to install and enable repositories



18. Customize package selection




20. Starting installation process




21. Installing packages







22. Installation is complete
Click reboot computer and remove installation media.



Finishing the Installation Process

Now Start the Post Installation 

23. Selecting RHEL 6 from grub




24. Booting Red Hat 6




25. Red Hat 6 Welcome screen




26. Create normal user



27. Setup date and time and keep up-to-date with NTP







28. Login Red Hat 6 Gnome Desktop



29. Red Hat (RHEL6)  Gnome Desktop



Enjoy!!!