Showing posts from February, 2015

send email through SMTP in

Imports System.Net
Imports System.IO
Imports System.Net.Mail

Following is the Code

PrivateFunction SendEmail(ByVal mailfrom AsString, ByVal mailto AsString, ByVal cc AsString, ByVal bcc AsString, ByVal subject AsString, ByVal message AsString, ByVal attach1 AsString, ByVal attach2 AsString, ByVal userid AsString, ByVal pwd AsString) AsString Try 'create the mail message Dim mail AsNewMailMessage()
'set the addresses             mail.From = NewMailAddress(mailfrom)             mail.To.Add(mailto)             mail.CC.Add(cc) 'mail.Bcc.Add(bcc)
'set the content             mail.IsBodyHtml = True             mail.Subject = subject             mail.Body = message
' add an attachment from the filesystem             mail.Attachments.Add(NewAttachment(attach1))
'to add additional attachments, simply call .Add(...) again '  mail.Attachments.Add(New Attachment(attach2)) ' mail.Attachments.Add(New Attachment("c:\temp\example3.txt"))
'send the message Dim mailClient As…

Linux Basics: Installing FTP, WEB SERVER APACHE, YUM Server, MySQL

//only standalone packages are installed by rpm

// yum to install inter dependent rpm

$ rpm -ivh vsftpd*.rpm

//To enable yum server it has to be atleast ftp/web server

installing FTP

 go to cd drive/server
$cd /media/RED*
$cd server
$rpm -ivh vsftpd*.rpm

To check installed are not query all
$rpm -qa | grep vsftpd

To check all folders query list
$ rpm -ql vsftpd

make service entry for boot time
$chkconfig vsftpd on
start service
$ service vsftpd start

Making yum Server/Client:
Test ftp in browser ftp://localhost/pub
copy all cd rpm to ftp folder. In short create two folder RHEL5 and VT inside pub and copy data from CD. VT is already having repository directory created.
$mkdir /var/ftp/pub/rhel5
$ cd /media
$cp -rvf /media/RHEL*/server /var/ftp/pub/rhel5
$cp -rvf VT /var/ftp/pub/VT

Create repository for yum server
install createrepo command
$rpm -ivh /var/ftp/pub/rhel5/server/createrepo*.rpm

To create repository file. It will create a repodata subfolder
$createrepo -v /var/ftp/pub/rhel5/

Linux Basics : Installing Webmin

set proxy settings (if required)

$ export http_proxy=

Installing Webmin
1. RedHat
# cd /opt
# wget
# wget
and then run the command :
# rpm --import jcameron-key.asc
# rpm -Uvh webmin*.rpm

2. Debian

$ wget
then run the command :
$ dpkg --install webmin_1.730_all.deb

Uninstalling Webmin

rpm -qa | grep -i webmin
You should then find the exact package name. Then run

$ rpm -e

if http://localhost:10000 dosent run then

Edit the firewall configuration file.
On Redhat and derived systems, this is /etc/sysconfig/iptables, while on Debian it is /var/lib/iptables.
The line you need to add is :
-A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT

$ /etc/init.d/iptables restart

if webmin run on http://localhost:10000 then edit firewall setting from here
delete firewall setting for reject all incoming connection.

Linux Basics: User and Group Management

Add User

$ useradd student

Switching user:

$su - student

switch to root:

$ su -

set/change password for user 'student':

$ passwd student

remove password:

$ passwd -d student

Let's make student’s account password expire on 09/15/97:

$usermod -e 09/15/97 student

Delete User:
$userdel student

create a 'sales' group and add 'student' as member and removing 'student' from the 'sales' group:

$ groupadd sales
$ gpasswd sales                     -Assign password
$ gpasswd -r sales                   -Remove password
$ usermod -G sales student
$ gpasswd -d student sales

Default user accounts DB: 
$ vi /etc/passwd

stores password in encryptes form:
$ vi /etc/shadow

Default Group Members accounts DB:
$vi /etc/group

Group Password strore in encryptes form:
$vi /etc/gshadow

Set file permission: 

Ownership: (User , Group, Others) rwx rwx rwx
Permissions: 4 = read (r) 2 = write (w) 1 = execute (x) 0 = no permission (-)

$ chmod 755 test.txt

Linux Basics: Directory, Partition and Mounting File system

Directory Description
The root directory, the top-level directory in the FHS. All other directories are subdirectories of root, which is always mounted on some partition.
Essential command line utilities. Should not be mounted separately; otherwise, it could be difficult to get to these utilities when using a rescue disk.
Includes Linux startup files, including the Linux kernel. The default, 100MB, is usually sufficient for a typical modular kernel and additional kernels that you might install during the RHCE or RHCT exams.
Hardware and software device drivers for everything from floppy drives to terminals. Do not mount this directory on a separate partition.
Most basic configuration files.
Home directories for almost every user.
Program libraries for the kernel and various command line utilities. Do not mount this directory on a separate partition.
The mount point for removable media, including floppy drives, CD-ROMs, and Zip disks.

Linux Basics: Installation in Windows VMWare

1. Install VMware workstation

2. Download linux ISO

3. Create a new virtual machine in custom mode with OS to be installed later option.

4. Give ISO path in CD/DVD and power on Virtual machine.

5. Install in step by step: Create 3 basic partitions



Google+ Followers