Add Swap Partition in Linux/Ubuntu

  Create a 512MB swap file
  #dd if=/dev/zero of=/mnt/new.swap bs=1M count=512
  Change Permission to new.swap
  #chmod 600 /mnt/new.swap
  Formatting that file to create a swapping device:
  #mkswap /mnt/512Mb.swap
  Adding the swap to the running system:
  #swapon /mnt/512Mb.swap
  To check swap info
  #cat /proc/meminfo.
 Making the change permanent, open fstab 
 #  vi /etc/fstab
Add below line at the end of the file and save.
/mnt/new.swap none swap sw 0 0

Change Computer or Host Name in Windows Using Command

Below is the command to rename Computer Name or Hostname in Windows.Changing Computer name will require a reboot. Follow below commands to change computer name and reboot system.

wmic computersystem where name="OLDNAME" call rename name="NEWNAME"
shutdown -r   ---Reboot System
hostname       ----Display Computer Name or Hostname in Windwos  and Linux as well.

check running status & kill services in Windows from command line

tasklist  --- To see the list of running services & PID (Process ID) on Windows from command line.
taskkill --- To kill any running services on Windows from command line
  1. Go to Start > Run, then type CMD and press Enter.
  2. In the Command Prompt window type any of the above commands(taskkill,tasklist) and press enter key
Ex: taskkill /PID 1412 /PID 139 /T /F  ---- To kill running service
above command will kill process id 1412 and 139 forcefully 
/T -Tree kill
/F -forcefully

Fastest way of transferring files between 2 server's over network in Linux

Fastest way of transferring files between 2 server's over network in Linux

-- SCP :  It showed 20MB/sec
-- FTP : Requires ftp installed id/password  : 40MB/sec
-- NetCAT : Might work if netcat is installed.  : 60MB/sec      
   source : tar -cvzf /dir/ |netcat -l 7777
   client :  netcat source_ip:7777 |tar -xvzf path

-- Using Python / WGet  : 80MB/sec

Server:
 # cd $folder_have the file
 # Start python webserver with this command.
 python -m SimpleHTTPServer
Client :
 wget -c http://Server IP:8000/$file
-c will recover from a file break if something broke half way.


Convert Windows Physical System to Virtual Using disk2vhd

Disk2vhd is a tool that creates VHD (Virtual Hard Disk - Microsoft's Virtual Machine disk format) versions of physical disks for use in Microsoft Virtual PC or Microsoft Hyper-V virtual machines (VMs) or Latest KVM Hypervisor.

Steps to Convert Windows 2003 Physical System to VHD format
============================================
1.Download disk2vhd tool from below link into windows server 2003
http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
2.Extaract Disk2vhd.zip file
3.Run or double click disk2chd.exe, it will pupup a windows with all drives selected.On it select the drive you would like to convert into VHD format. De-select other drives and only keep selected C drive.
For now we need to convert only C Drive, so select only C Drive.Please find enclosed image.
4.At VHD File Name:
Browse a target location where we want to store or save VHD. Make sure we have sufficient space on it.Means we should have free space on target drive as C drive' data size.
5.Click on Create to start conversion process.
6.Once the conversion process completed, click Close to close the tool.

Domain,Tree,Forest & Domain Controller

Domain: Domain is a logical grouping present in the network, in which one or more systems can access one or more shared resources and there is a centralized database.
              All the systems are depend upon the Server carrying the Database.
              Once we created Domain, it logically creates Domain,Tree and Forest 
Tree: Tree is a set of one or more Domains with contiguous names or Collection of multiple Domains.
Root Domain: The first Domain created is the "Root Domain" of the first tree.The first domain that you create in your Active Directoryforest is automatically designated as the forest root domain     
Child Domain: Other Domains in the same domain tree is called Child Domain.
Parent Domain: A Domain immediately above another domain in the same domain tree is it Parent Domain 

Forest: Forest is a collection of multiple Trees.

Domain Controller: The system which maintain Active Directory Service(ADS) is called Domain
Controller.
ADDS: In Windows Server 2008 the Active Directory Service(ADS) is called Active Directory Domain
Service(ADDS).                                

smtp mail test in windows with Telnet

Testing with Telnet: Sent a mail using command line
You can also use TELNET to test your SMTP service. SMTP uses port number 25,so in order to use telnet to open an SMTP session with the command
telnet abc.test.com  25 or telnet 192.168.10.17  (EX:IP of smtp server space and port number)
If the connection is successful, we should see a banner and a command line interface.We then need to follow RFC 821 for the accepted SMTP commands, which are quite simple(as the name says...)
220 abc.test.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.5329 ready at Mon,25
Nov 2002 02:51:06 +0200
helo abc.test.com or helo 192.168.10.17 (EX:ip address of smpt or name)
250 abc.test.com Hello [192.168.0.100]
mail from:admin@gmail.com or mail form zyz (Ex:can specify mail id or name)
250 2.1.0 admin@gmail.com....Sender OK
rcpt to:testmailid@gmail.com  (mail id to whom you want to send)
250 2.1.5 testmailid@gmail.com
data
354 Start mail input; end with .(Means once you done with matter then press enter and .(dot) to finish)
subject: this is a test
Hi John
I'm trying to test this connection from Telnet.
Let me know if you get this message.
. (this dot will end of your mail matter)

=========================
options to send mail
=========================
telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
 -a      Attempt automatic logon. Same as -l option except uses
         the currently logged on user's name.
 -e      Escape character to enter telnet client prompt.
 -f      File name for client side logging
 -l      Specifies the user name to log in with on the remote system.
         Requires that the remote system support the TELNET ENVIRON option.
 -t      Specifies terminal type.
         Supported term types are vt100, vt52, ansi and vtnt only.
 host    Specifies the hostname or IP address of the remote computer
         to connect to.
 port    Specifies a port number or service name.