• Aucun résultat trouvé

Communicating with Other Computers

Dans le document URLs Referenced in This Book (Page 137-142)

Part II: The Bioinformatics Workstation

SEQRES 1 357 GLU VAL LEU ILE THR GLY LEU ARG THR ARG ALA VAL ASN 2MNR 106 SEQRES 2 357 VAL PRO LEU ALA TYR PRO VAL HIS THR ALA VAL GLY THR 2MNR 107

5.8 Communicating with Other Computers

As we'll see in Chapter 6, the ability to plug into other computers and networks across the world allows you to read and download an amazing amount of information, as well as share data with your colleagues. In fact, your work as a bioinformatician depends on having access to public databases and other repositories of biological data. In this section, we look at how your computer communicates with other machines and the tools it uses to do so.

5.8.1 The Web

The easiest way to communicate with other computers is via the Web. Most distributions of Linux include web browser software—usually Netscape—which, if you select it from the list of installation options, is automatically installed for you. Setting up a web browser on a Linux system is the same as setting up a browser on other computers; you need to set the browser's preferences and tell it where the correct utilities are located to open different kinds of file attachments.

You may want to maintain a web page on your machine, and in order to do that, you need to install web server software. Again, most Linux distributions allow you to install the Apache web server software as one of your installation options. If you choose to install the Apache web server, you can publish a simple web site by placing the appropriate HTML files in the /home/httpd/html directory.

5.8.2 IP Addresses and Hostnames

In the world of the Internet, computers recognize each other by their Internet Protocol (IP) addresses.

Computers that are constantly connected to the Internet have permanently allocated IP addresses and hostnames, while computers that only connect to the Internet occasionally may have dynamically allocated IP addresses, or no IP address at all, depending on the protocol they use to connect.

IP addresses consist of four numbers separated by dots (e.g., 128.174.55.33). These are interpreted as directions to the host (a computer that communicates with other computers) by network software.

Computers also have hostnames, such as gibas.biotech.vt.edu. Name servers are dedicated machines that maintain information about the relationships among IP addresses and hostnames.

5.8.3 telnet

Usage: telnet full.hostname

The telnet command opens a shell on a remote Unix machine; the workstation on which the command is issued becomes a terminal for that machine. To telnet to another Unix machine, you must have a login on that machine. Once you're logged in to the remote host, the shell works just as if you were working directly on the remote machine.[6]

[6] If you are logged in as root, there are certain tasks you can't do from a remote terminal.

Safari | Developing Bioinformatics Computer Skills -> 5.8 Communicating with Other Computers

http://safari.oreilly.com/main.asp?bookname=bioskills&snode=57 (1 of 5) [6/2/2002 8:59:39 AM]

All Books Search

A "login:" prompt should appear, followed by a "password:" prompt after your ID is entered.

5.8.4 ftp

Usage: ftp full.host.name.edu

The File Transfer Protocol (ftp) is a method for transferring files from one computer to another. You may be familiar with Fetch, Interarchy, or other PC-based FTP clients; Unix ftp is conceptually similar to these programs (and many of them have analogs that run under Linux, if you like their graphical user interfaces). When you use ftp to connect to another host, you will find yourself in an operating environment that is unique to ftp. Unix commands don't always work in the ftp

environment, although the commands ls and cd have similar functions.

Again, a "login:" prompt appears, followed by a "password:" prompt. If you are accessing an

anonymous FTP server (a common way to distribute software), the standard username is anonymous, and your email address is the password. Once in the FTP environment, the most important commands to know are:

help

Prints out the list of ftp commands. help command prints out information on a specific command.

ls

Lists the contents of the directory on the remote host.

cd

Changes the working directory on the remote host.

lcd

Changes the working directory on the local host.

get, mget

get copies a single file from the remote host to the local host. mget copies multiple files.

put, mput

put copies a single file from the local host to the remote host. mput copies multiple files.

binary, ascii

Changes the file-transfer mode to binary or ASCII. You should choose binary when you are downloading binary executables, images, and other encoded file formats.

prompt

Toggles the interactive mode that asks you to confirm every transfer when you transfer multiple files.

5.8.5 Displaying from a Remote Terminal

Sometimes you need to run an X program on another computer and have it display on your terminal.

This is relatively simple to do. First, you need to set your own terminal to allow remote displays from other hosts. This is done using the xhost command:

% xhost +

A confirmation that access is allowed from other hosts is then printed to standard output.

Next, you need to change the display environment on the remote machine. This is done with the

Safari | Developing Bioinformatics Computer Skills -> 5.8 Communicating with Other Computers

http://safari.oreilly.com/main.asp?bookname=bioskills&snode=57 (2 of 5) [6/2/2002 8:59:39 AM]

setenv command:

% setenv DISPLAY yourmachine.yoursubnet.wherever.edu:0

Not all X applications running on a remote server can use your terminal for display, generally because the remote machine and your machine don't have the same graphics capabilities. For instance, programs running on a remote Silicon Graphics machine can't display on your local Linux workstation, because Silicon Graphics uses proprietary graphics libraries that aren't currently

available to Linux users. However, even if both machines are compatible, bandwidth limitations can make running large X programs over the network extremely slow.

5.8.6 Communication and File Sharing

One of the biggest inconveniences for Linux users in a primarily Mac/PC environment is the sharing of files generated by PC productivity software with other users. While it's not our purpose to teach you to use these packages here, we can mention a few options that will help you handle

communication with non-Unix users.

Fortunately, there are relatively low-cost software products available for Linux that make it possible to work with common file types, such as Microsoft Word and rich-text format (RTF) documents, PowerPoint presentations, and Excel spreadsheets. Sun's StarOffice (http://www.staroffice.com) and Applix's Applixware (http://www.vistasource.com) are two possibilities; at the time of this writing, StarOffice seemed to do the cleanest job of converting files generated by Microsoft Word and other commonly used programs. Adding one of these packages to your Linux system will add most of the basic PC functions (word processing, electronic presentations, etc.) that may be vital to your work.

Most kinds of graphics files are easily handled and converted on Linux systems. One powerful tool for manipulating graphics files is called the GIMP (Gnu Image Manipulation Program,

http://www.gimp.org). The GIMP is commonly included in Linux distributions, so be sure to select it as part of your installation if you will be doing anything with graphics files. The GIMP is analogous to Adobe Photoshop program and shares most of the same functionality.

5.8.7 Media Compatibility

Linux users can read and write files on Microsoft-formatted floppy disks and Zip disks. A floppy or Zip disk is treated as an additional filesystem on your computer. The most basic way to access this filesystem is to mount it using the mount command. To do this, you need to know the device ID of the disk you are trying to mount and establish a mount point for the new filesystem.

Determining the device IDs of the various drives is usually straightforward. One way is to open the file /var/log/dmesg. This file contains the system information that is printed to standard output when the machine is booted. Scan through the file and find the drive information, which should look like this:

hdc: SAMSUNG SC-140B, ATAPI CDROM drive

hdd: IOMEGA ZIP 250 ATAPI, ATAPI FLOPPY drive hdc: ATAPI 40X CD-ROM drive, 128KB Cache

Floppy drive(s): fd0 is 1.44M

This section of the file contains information about IDE devices. On this particular machine, the IDE devices include a CD-ROM drive, a Zip drive, and a floppy drive. The three-letter codes hdc, hdd, and fd0 are the device IDs.

The next section of the file contains information about SCSI devices. On this particular machine, the main hard disk is a SCSI drive, and its ID is sda. sda1, sda2, etc., are the individual IDs of the partitions on the hard drive:

Safari | Developing Bioinformatics Computer Skills -> 5.8 Communicating with Other Computers

http://safari.oreilly.com/main.asp?bookname=bioskills&snode=57 (3 of 5) [6/2/2002 8:59:39 AM]

Detected scsi disk sda at scsi0, channel 0, id 0, lun 0 SCSI device sda: hdwr sector= 512 bytes. Sectors= 35566499 [17366 MB] [17.4 GB]

sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 sda9 >

5.8.8 Accessing Devices as Unix Filesystems

Once you know the device IDs, mounting these new filesystems is simple. If you're the root user of your own machine, the command is:

mount -t [filesystem type] devicefile mount point

For example, to mount a PC-formatted floppy disk at /mnt/floppy, the command is:

% mount -t msdos /dev/fd0 /mnt/floppy

You can find a listing of allowed file types in the manpages for mount.

As a shortcut, you can modify your /etc/fstab file to contain the following lines:

/dev/fd0 /mnt/floppy vfat noauto,owner 0 0 /dev/hdd4 /mnt/zip vfat noauto,owner 0 0

On this system, the Zip drive is located at /dev/hdd. All PC-formatted Zip disks use partition number 4, and the device file for that partition is /dev/hdd4. The noauto flag means that these disks aren't mounted automatically at boot time. Once these lines are added to /etc/fstab, the devices can be mounted with the shortened command mount devicefilename.

Once the Zip or floppy is mounted as a partition, the files on that disk can be treated like any other file on the system.

Getting some of these devices working isn't as straightforward as we'd like it to be. For further help, you can search the Web for the Linux how-to pages for the particular device you're using.

5.8.9 Accessing Devices as DOS Disks

If you install the utility package mtools and its graphical frontend mfm, you can run mfm and move files to Zip or floppy disks, using a graphical interface similar to that on a PC. However, if you use this method to access devices, you can't run Unix commands on the files stored on your media until you move them onto the local hard disk.

By default, processes to access media may be run only by the root user. It's possible to configure your system so that other users can write to floppy and Zip drives. However, this creates a security hole in your system. You have to decide for yourself whether the benefits of easy disk access outweigh any potential risks.

Delivered for Maurice ling Swap Option Available: 7/15/2002

Last updated on 10/30/2001 Developing Bioinformatics Computer Skills, © 2002 O'Reilly

< BACK Make Note | Bookmark CONTINUE >

Safari | Developing Bioinformatics Computer Skills -> 5.8 Communicating with Other Computers

http://safari.oreilly.com/main.asp?bookname=bioskills&snode=57 (4 of 5) [6/2/2002 8:59:39 AM]

Index terms contained in this section

computers

communication with others devices

accessing as a Unix filesystems accessing as DOS disks DOS disks, accessing devices as

File Transfer Protocol (ftp), communicating with other computers files, in Unix

accessing devices as sharing, communicating

ftp (File Transfer Protocol), communicating with other computers hostnames, communicating with other computers

Internet

communicating with other computers

IP addresses, communicating with other computers media compatibility

remote terminals, communicating with telnet command

Unix

accessing devices as filesystems

© 2002, O'Reilly & Associates, Inc.

Safari | Developing Bioinformatics Computer Skills -> 5.8 Communicating with Other Computers

http://safari.oreilly.com/main.asp?bookname=bioskills&snode=57 (5 of 5) [6/2/2002 8:59:39 AM]

Show TOC | Frames My Desktop | Account | Log Out | Subscription | Help

Programming > Developing Bioinformatics Computer Skills > 5. Working on a Unix System > 5.9 Playing Nicely with Others in a Shared Environment

See All Titles

< BACK Make Note | Bookmark CONTINUE >

158127045003020048038218232180015152050067001135112006120214154184001152226231155110239

Dans le document URLs Referenced in This Book (Page 137-142)