Sunday, April 19, 2009

Open Source antivirus - ClamWare .

ClamWin is free, open source antivirus software for Microsoft Windows,(dont worry you can run it on Ubuntu using Wine).I Liked ClamWin because , it is OpenSource and also its PORTABLE. Yes, it has a portable version that can be used from a USB flash drive. Scan baby Scan!!!

some of the features of ClamWin are:

  1. Standalone virus-scanner
  2. Scanning scheduler.
  3. Automatic virus database updates on a regular basis.
  4. Context menu integration for Windows Explorer.
  5. Add-in for Microsoft Outlook.
  6. And is portable that can be used from a USB flash drive :)
  7. Extensions availabe to scan file that are downloaded.
  8. Addin to Microsoft Outlook to remove virus-infected attachments automatically.
  9. Standalone virus scanner and right-click menu integration to Microsoft Windows Explorer

The latest version of Clamwin Free Antivirus is 0.95.1.Please note that ClamWin Free Antivirus does not include an on-access real-time scanner. You need to manually scan a file in order to detect a virus or spyware.ClamWin Free Antivirus is based on ClamAV engine and uses GNU General Public License.



Portable ClamWin on a USB or Removable Drive:

Follow this guide to make your own portable ClamWin

You can take ClamWin Free Antivirus with you on a USB pen drive, CD or DVD

1)Install ClamWin on a host PC with Windows XP or higher

2)Copy all the files from "c:\program files\clamwin" to a "clamwin" folder on a removable drive. unins000.exe and unins000.dat files are not needed

3)Copy the following files:
Microsoft.VC80.CRT.manifest
msvcm80.dll
msvcm80.dll
msvcr80.dll
from "c:\program files\clamwin\bin\Microsoft.VC80.CRT" to the "clamwin\bin" folder on your removable drive.

4)Copy this ClamWin.conf (right-click to Save) file to "clamwin\bin" folder on the removable drive (note Standalone=1 setting)

5)Create the folowing foldres on the removable drive:
"clamwin\log"
"clamwin\db"
"clamwin\quarantine"

6)Copy the database files (main.cvd and daily.cvd) from your database directory on the host PC (default location is "C:\Documents and Settings\All Users\.clamwin\db") to the "clamwin\db" folder on the removable drive.

That's it, you can now run clamwin.exe from clamwin folder on your removable drive.

Notes:
It may take a while to load ClamWin.exe depending on the removable drive speed
If you use ClamWin Free Antivirus on a read-only drive (CD or DVD) your need to burn the latest database before use and won't be able to change preferences.

Tip: Click here to see the list of some portabe softwares.


thanks & regards
tell2humanlinux@gmail.com

Saturday, April 18, 2009

nagios installation steps!


Nagios is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users when things go wrong and again when they get better.Nagios, originally created under the name NetSaint, was written and is currently maintained by Ethan Galstad, along with a group of developers actively maintaining both official and unofficial plugins.Nagios was originally designed to run under Linux, but also runs well on other Unix variants.Nagios is free software licensed under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Download nagios 3.1.0(latest)

As a newbie i decided to install the nagios in my ubuntu 9.04 to monitor my own system services & i succedeed in it. The nagios documentation was pretty simple to follow. But i have written a documentation of my own. This documentaion is for those who are lazy(like me :)) to read whole crap given in the official documentaion.Here i just posted the step by step instllation.

N.B: This is the documentaion for Ubuntu. If need to install on other distros goahead and follow this Documentation.
And use sudo in appropriate places.

Lets begin:

1)Nagios need Apache & gdlibrary to work.

sudo apt-get install apache2 (will install apache 2)

sudo apt-get install build-essential

sudo apt-get install libgd2-xpm

2)Create an Account for nagios

sudo useradd -m nagios ( -m is used to create home if donot exist)

passwd nagios

If you are using server edition do the next step , else skip it and goto a).

/usr/sbin/groupadd nagios
/usr/sbin/usermod -G nagios nagios

a)Create a new nagcmd group for allowing external commands to be submitted through web interfacw. Add both nagios & Apache user to the group.

/usr/sbin/groupadd nagcmd

/usr/sbin/usermod -a -G nagcmd nagios

/usr/sbin/usermod -a -G nagcmd www-data


3)Download nagios & Plugins

mkdir ~/downloads
cd ~/downloads

download the nagios & plugins in this folder(downloads). Extract the package.

wget -c http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz

wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz

Extract the packages:

tar xzf nagios-3.0.6.tar.gz

cd nagios-3.0.6

Run the Nagios configure script, passing the name of the group you created earlier like so:

./configure --with-command-group=nagcmd

Compile the Nagios source code.

make all
make install
make install-init
make install-config
make install-commandmode

4)Don't start Nagios yet, we have to do some more.

Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.

vi /usr/local/nagios/etc/objects/contacts.cfg

just change the email address you need to receive the alerts.

5)Configure the webinterface.

dont leave the current directory ( ~/downloads/nagios-3.0.6)

make install-webconf

Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Restart Apache to make the new settings take effect.

sudo /etc/init.d/apache2 reload (restart)

6)Compile and install nagios plugin

Extract the Nagios plugins..

cd ~/downloads
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
Compile and install the plugins.

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

7)login to your web interface(Browser)

You should now be able to access the Nagios web interface at the URL below. You'll be prompted for the username (nagiosadmin) and password you specified earlier.

http://localhost/nagios/

type the nagiosadmin username & password

Click on the "Service Detail" navbar link to see details of what's being monitored on your local machine. It will take a few minutes for Nagios to check all the services associated with your machine, as the checks are spread out over time

DONE! :)

For detailed instllation documentation refer: here

thanks & regards
tell2humanlinux@gmail.com

Thursday, April 16, 2009

How to create a local Repository for Linux!

Creating a Local Repository of Yum and apt:-

You should have a FTP server or HTTP server to make yum actually working. However since we haven't really gone through setting up FTP or HTTP server, please read-on and understand the process. If you have got vsftpd installed, use that. Otherwise, don't forget to actually set it up yourself later.

Here we will create a local repository for Fedora and CentOS in the easy way.

0. You should have the yum as well as the createrepo package installed first.

1. Create the directory to hold the repository.

mkdir -p /var/ftp/pub/yum-repo/centos/
mkdir -p /var/ftp/pub/yum-repo/fedora/

2. createrepo /var/ftp/pub/yum-repo/centos/ ; createrepo /var/ftp/pub/yum-repo/fedora/ will create the local yum repository by creating a folder named "repodata with four xml files named, filelists.xml.gz, other.xml.gz, primary.xml.gz and repomd.xml

You will have to run the createrepo command each time a rpm is added there.

3. Now in the client's yum.conf, add the repo directly. However in recent versions, the repositories are put in a separate directory called /etc/yum.repos.d/ . If so, put the contents in a filename, with the extension .repo

[humanlinux repo]
name=Fedora Core $releasever - humanlinux Local Repo
baseurl=file:///var/ftp/pub/yum-repo/fedora/
enabled=1
gpgcheck=0
#gpgkey=file:///path/to/your/RPM-GPG-KEY

Fedora Specific Local Repository:- 

NB : You can create directories inside /var/ftp/pub/yum-repo/fedora/ to look like /var/ftp/pub/yum-repo/fedora/base/8/i386 , /var/ftp/pub/yum-repo/fedora/updates/8/i386 , /var/ftp/pub/yum-repo/fedora/base/9/i386, /var/ftp/pub/yum-repo/fedora/updates/9/i386 and so on.

1) Filling the repos with RPMs:- 

Copy the rpm packages to /var/ftp/pub/yum-repo/fedora/ or /var/ftp/pub/yum-repo/fedora/base/8/i386 from the DVD's Packages directory.

OR

rsync from a rsync supported mirror from the list, http://mirrors.fedoraproject.org//mirrorlists/publiclist/Fedora/8/ like rsync://ftp.sh.cvut.cz/fedora/linux and

rsync -avrt rsync://ftp.sh.cvut.cz/fedora/linux/releases/8/Everything/i386/os/ /var/ftp/pub/yum-repo/fedora/base/8/i386 (remember to have a slash after os/ :-))

2) Updates and regular downloading:- 

/var/ftp/pub/yum-repo/fedora/updates/8/i386

rsync the updates from rsync://ftp.sh.cvut.cz/fedora/linux/updates/8/i386/ to /var/ftp/pub/yum-repo/fedora/updates/8/i386

And then enter the command in a cron job too, to download the updates frequently.

Creating Apt repository:- 

This is done using the apt-mirror tool. Download and install apt-mirror first and then edit the /etc/apt/mirror.list ( to list which packages tree should be mirrored ) which is similar to /etc/apt/sources.list.

apt-mirror will do the rest of the job. Once it is finished, clean up the repositories by running /var/spool/apt-mirror/var/clean.sh.

tell2humanlinux@gmail.com

Wednesday, April 15, 2009

How to sent gmail from/using terminal!

We can sent emails using the terminals. This is an advantage if the internet connection is very slow , since it take much time to load the GUI web interface.
Here are the steps to sent a gmail using/from the terminal.

1)We have to install a package
for Debain : apt-get install ssmtp
gnu/linux : yum install ssmtp

2)edit the file /etc/ssmtp/ssmtp.conf with your favourite editor.
Add the following lines at the end.

AuthUser=youremailaddress(senders adress)
AuthPass=email password
FromLineOverride=Yes
mailhub=smtp.gmail.com
Use STARTTLS=YES


save & quit!

3)To sent an email, type this on the terminal

echo "This is a test mail' | mail -s "hello" receiptemailaddress@gmail.com
tell2humanlinux@gmail.com

How to turn-on the num lock on every boot-up!

It is frustating to see that the numlock is turned off on very reboot in ubuntu. But it is quite easy to fix it.Just install a tiny package.

sudo apt-get install numlockx

This can:-
1)Control the state of NumLock

2)Provides control over the keyboard number lock from scripts.
3)Particularly useful for use with .xinitrc/.xsession or GDM/XDM/KDM sessions
4)Included is an optional script that can be used to start numlockx automatically
in every X session.

thankyou:-
tell2humanlinux@gmail.com

Tuesday, April 14, 2009

How to put .htpasswd protection for a web directory!

Protecting content on the web is something that most savvy users will have to do at one point or another. Whether the content is personal or professional, there comes a time when that content must only be seen by "authorized" eyes. The Apache web server ( that daemon that serves up your marvelous content ) allows a user to configure two files to facilitate this very purpose. Those files are .htaccess and .htpasswd.

.htaccess
The .htaccess file is a simple text file placed in the directory you want the contents of the file to affect. The rules and configuration directives in the .htaccess file will be enforced on whatever directory it is in and all sub-directories as well. In order to password protect content, there are a few directives we must become familiar with. One of these directives in the .htaccess file ( the AuthUserFile directive ) tells the Apache web server where to look to find the username/password pairs.
.htpasswd
The .htpasswd file is the second part of the affair. The .htpasswd file is also a simple text file. Instead of directives, the .htpasswd file contains username/password pairs. The password will be stored in encrypted form and the username will be in plaintext.
Apache Server
We have to make some changes on the apache conf file, & rester the service.The procedure is explained below.

Creating an .htaccess file:-
goto the directory you need to password protect. create a file named .htaccess.
add the following lines into it.

AuthName "Hello user!"
AuthType Basic
AuthUserFile /usr/local/humanlinux/.htpasswd (this is the location of the .htpasswd, you have to specify accourdingly)
Require user john (replace the john with desired username)

Save the file.


Creating an .htpasswd file:-


To create a .htpasswd file in /usr/local/humanlinux

htpasswd -c /usr/local/humanlinux/.htpasswd john

Note the '-c' is only used when creating a new .htpasswd file.

To add dave to an existing .htpasswd file located in /usr/local/humanlinux/ the following command will be used.

htpasswd /usr/local/humanlinux/.htpasswd dave

Sample .htpasswd File

Below is a sample .htpasswd file that contains users john and dave

john:n5MfEoHOIQkKg
dave:9fluR/1n73p4c


Changes in the apache conf file:-

open the httpd.conf file using your favourote editor.goto the diretory area.


AllowOverride All


you have to specify the correct path for the directory you need to pasword protect.Here i have protected the directory /home/humanlinux/public_html/protected.

Restart the apache service.


Troubleshooting

  • Make sure that the path specified in AuthUserFile is the correct full path. This is a major cause of problems. If Apache cannot find the .htpasswd file, then all attempts will fail.
  • Make sure the permissions on the .htaccess and .htpasswd files are set so that Apache can read them.
    • chmod 0644 .htaccess
    • chmod 0644 .htpasswd
  • Other issues may be out of your control. Web administrators can lock down Apache so that it ignores all .htaccess files it encounters. This can be achieved with an AllowOverride None directive and option on the ServerRoot/DocumentRoot directories. If this is the case (.htaccess not allowed) you will have to kindly ask your web administrator to allow .htaccess files with authorization directives in your personal web directory. This can be achieved with AllowOverride AuthConfig directive and option.
tell2humanlinux@gmail.com