Friday, July 2, 2010

Add a folder to the windows path

Modifying the path statement will enable an MS-DOS window as well as older programs to locate files that may be required to run the program.

TO set the path, follow these steps:

1. From the desktop, right-click "My Computer" and click "Properties".
2. In the System Properties window, click on the "Advanced" tab.
3. In the "Advanced" section, click the "Environment Variables" button.
4. Finally, in the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button.
5. Add or modify the path lines with the paths you wish the computer to access.
6. Each different directory is separated with a semicolon as shown as:-
C:\Program Files\MiKTeX2.7\miktex\bin;C:\Python25\PyQt4\bin;

You can now able to run your program.

Monday, June 28, 2010

using SCREEN command in Linux

There are times when you want to log off your system, but you want the programs to be executed on the server machine which you've initiated from your system. You can use screen command which serves this purpose. It starts a session within the session that you have logged in. Even if you logout from your system, the screen will keep on running until the server stops or you forcefully exit.

Here are the commands which you should use.

$screen //starts a new session in the logged session

$./a.out > output //some command which you want to get it executed

$ CTRL + a + d //closes the screen and brings you back to the original session

$screen -r //displays the screens running on your machine

Hope this is helpful :-)

View, Start, Stop, Pause, Restart a service in Windows

Hi here I am giving you the commands which you should use them from the command line prompt in windows.

There are many a times when you want to know what are the services running while you have logged in to your computer.

Use this command which display a list of services that are running on your computer:

net start

To start a new service, use:

net start

To stop a running service, use:

net stop

To pause a service, use:

net pause

To restart a service, use:

net continue

Hope this is helpful :-)

Saturday, June 19, 2010

Installing gnuplot on windows

You can install gnuplot on windows easily to plot the graphs.

Download gnuplot from this

There is no need to run any exe file but directly copy them to some directory on your system and then make a shortcut to wgnuplot.

It is also useful to install ghostview which allows you to view postscript graphs made with gnuplot. You need gs860w32.exe and gs49w32.exe (or higher?).

Instructions for installing ghostview can be found here;

http://pages.cs.wisc.edu/~ghost/gsview/

Friday, June 11, 2010

Identify the ports in linux

For socket programming, you need to use the port. If you want to identify the ports which are active, you can use the following commands. Generally in linux, the ports from 0 to 1023 are reserved and can be accessed only as a root user.

For checking the information about the port, you can use netstat

If you want to know more about this command, you can check its man page
$ man netstat

But for quick reference, you can use any of these for the appropriate purpose.

For finding the open ports:
$ netstat --listen

For finding the open ports and established TCP connections:
$ netstat -vatn

For checking information about a port,
$ netstat -anp | grep <port>

For identifying the ports already in use:
$ netstat -atnp | grep LISTEN

Tuesday, March 9, 2010

How to mount Windows[NTFS] from Linux

Initially login as the root user.

Then type this command on the console:-

$ fdisk -l

This command shows what are the different disks present on our machine. They generally follow this particular format: /dev/sda[number]

$ mount -t ntfs /dev/sda[number of the disk which you want to mount] [directory on the root from which you will access the mounted disk files say for ex: mountedDir]

Then for viewing the mounted files just type as usual,

$ cd mountedDir

You will be able to access the files of the disk which was mounted.

For unmounting the disk, just simply type this on the console:

$ unmount mountedDir

Hope this will be helpful.

Finding the system information in Linux

These days am using Fedora more than Windows so trying to learn more about that. For finding out the details related to your system, you can use the following commands.

First login in to the root account.

Then, you can run these commands:

% /usr/sbin/dmidecode -t baseboard

This will give details of the motherboard


% /usr/sbin/dmidecode -t processor

This will dump the information about the processor.

Other keywords which are available which can be used as options for ‘t’ are

  1. bios
  2. system
  3. chassis
  4. memory
  5. cache
  6. connector
  7. slot
A easy method to find all the information abuot your cpu, you can execute this command:

$ cat /proc/cpuinfo

Hope this will be helpful.