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.