Friday, 17 February 2012

20 BASIC LINUX COMMANDS

pwd - show path of present working dir

ls - list directory contents

cd - change to a directory

rm - to delete files

nano - text editor to open file

su - run the shell of another user

sudo - execute a command with temporary root privileges

cat - display file contents

echo - display msg on screen

free - to display memory usage

fsck - to check disk

kwrite - to launch a GUI text editor

grep - to search for files with given string

chmod - change privileges for a file

init - switch between run levels

/etc/init.d/gdm stop - to stop the gnome desktop manager & enter shell mode

/etc/init.d/kdm stop - to stop kde desktop manager

ifconfig - configure network adapter

iwconfig - configure a wireless card

man - gives manual, entire details for a command

sudo dpkg -i to install a Debian .deb package

How To Reinstall Windows Without Losing Anything

You can use this method as often as you like when you need to repair something that had gotten corrupted and you don't want to do a clean install.

This is better than doing a windows repair install from the CD because doing that can cause changes to settings and even make it so you can't get updates anymore from Microsoft update site because of the 'silent install' they did a year or so ago (unless you re-reg some dll files).

1- Start WindowsXP

2- Go to the location of your source files

3- Run WINNT32 /unattend

For example, D:\I386\winnt32 /unattend ( copy & paste this command into the RUN box, then press ENTER ) Your computer will do the rest.

OR

Start > All Programs > Accessories > Command Prompt.

Copy & paste > D:\I386\winnt32 /unattend (notice the space between 32 and / )

Press Enter.

If you have i386 on your drive, you can replace D: ( if D: is your cd drive ) with the location of it. (be sure it's the full i386 though)

D: is the driver letter where your windows XP Cd is

if D:\I386\winnt32 /unattend doesn't work then try : d:\winnt32 /unattend.

disable and enable usb port using C Program


 Anyone with a basic knowledge of C language should be able to understand the working of this virus program.

Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you’ll will not be able to use your pen drive or any other USB peripheral on the computer. You can test this virus on your own computer without any worries since I have also given a program to re-enable all the USB ports.



Code: To disable the USB ports 

#include


void main()


{

system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f");

}


Save the above program as 
block_usb.c and compile using turbo C. Upon compilation of block_usb.c you get block_usb.exe which is a simple virus that will block (disable) all the USB ports on the computer upon execution (double click).


To test this virus, just run the block_usb.exe file and insert a USB pen drive (thumb drive). Now you can see that your pen drive will never get detected.



Code: To re-enable the USB ports 

#include


void main()

{

system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");

}


Save the above program as unblock_usb.c and compile using turbo C.Then
 run the unblock_usb.exe (you need to compile unblock_usb.c) file.

Now insert the pen drive and it should get detected.

How To Prevent Your Pen Drive From Virus

Many of your PCs/Laptops are normally affected by viruses because of Pen Drives or USB devices (Even PCs who are not connected to network). Some Virus like Ravmon Virus , Heap41a wormwhich are not detected by any antivirus normally spreads mostly by the Pen Drives . In such a case what can you do to prevent your PC from getting infected with Virus that spreads through USB devices or Pen Drives ?


You can protect your PC by just following the simple steps below . It won't take much time.


Connect your Pen Drive or USB drive to your computer .


Now a dialogue window will popup asking you to choose among the options as shown in the figure.


Don't choose any of them , Just simply click Cancel.

Now go to Start--> Run and type cmd to open the Command Prompt window .

Now go to My Computer and Check the Drive letter of your USB drive or Pen Drive.
(Eg: If it is written Kingston (I), then I: will be the drive letter)

In the Command Window ( cmd ) , type the drive letter: and Hit Enter .

Now type dir/w/o/a/p and Hit Enter. You will get a list of files .


In the list , search if anyone of the following do exist


1. Autorun.inf

2. New Folder.exe

3. Bha.vbs

4. Iexplore.vbs

5. Info.exe

6. New_Folder.exe

7. Ravmon.exe

8. RVHost.exe or any other files with .exe Extension .

If you find any one of the files above , Run the command attrib -h -r -s -a *.* and Hit Enter.

Now Delete each File using the following Command del filename (Eg: del autorun.inf ) 

That's it. Now just scan your USB drive with the anti virus you have to ensure that you made your Pen Drive free of Virus.



Note:

Heap41a is a very common virus affecting a lot of computers via Pen Drives and USB ports.
To know whether your system is infected just type C:\heap41a in the address bar. If there is a folder named heap41a, then your system is infected.


(Avast Antivirus is the best solution for this worm...) Symantec Antivirus is also effective.