RSS
 

Archive for the ‘Windows’ Category

Fun With Ports and Server Processes

30 Mar

The term “server” is used a lot these days to refer to a computer – usually one that is being shared by various users and/or not used as a workstation. But a server also refers to a program that runs constantly, usually in the background, waiting for commands. Just about every computer is technically a “server” because the operating system runs several server processes. Unix people like to call them daemons. Windows people like to call them services.

Here’s a simple example. When you browse to a web page, your machine actually contacts the web server and requests a file. The reason this works is because the server computer has a program (in this case an HTTP server) running. your computer connects to the remote machine. they greet each other. your machine issues a command and the other does the requested action. In the case of a web page, the remote machine sends you the html file that you requested.

You can test this out yourself using telnet. Open a DOS window and type the following:

telnet www.yahoo.com 80

you’ve probably used telnet before. you may not have known that if you enter a number after the address, it specifies the remote port. if you omit the number, it defaults to 25, which is the normal telnet port for shell access. we’re connecting on port 80, because that is the port on which the http/web servers normally listen. you’ll see a quick connect message, then the screen will go blank. at this point you are connected to yahoo and it is waiting for a command. Type the following:

get /

Hit enter after the /. You’ll notice that you can’t see the input you’re typing. This is the normal behavior of an http server. If you typed correctly, though, you’ll see a bunch of HTML output scroll by followed by a message that you have been disconnected. You just manually surfed the front page of yahoo.com! If you’ve done a little web programming, you’re probably familiar with the GET request. This is probably the most basic HTTP command. “GET /” simply requests from the server the default root document “/”. If you know the exact file you want, you can get it with something like this: “GET /mypath/myfile.html” You can put in script arguments as well like so: “GET /cgi-bin/script.pl?a=1&b=2″

Behind the scenes, this is exactly what your browser does. It connects to the remote server and sends commands. Of course, the HTTP protocol has a lot more to it and modern browsers do all kinds of things on the client end as well, like render graphics, process scripts, etc.

The same thing also happens when you check email except a POP server listens on (usually) port 110. You can try telneting into your POP server on port 110 and entering some commands. In this case you have to authenticate and there is a special sequence of commands outlined in the POP Protocol specifications.

An interesting thing to note is that computers use this same technique for internal communication as well. Some of the services that make your computer work are always running, listening on a specific port, waiting for commands. You can use telnet in the same way to poke around your computer’s local services. Download this application from Sysinternals called TCPView from [url]http://www.sysinternals.com/ntw2k/source/tcpview.shtml[/url]. When you run this program, it will show you all open ports on your system. Any port that says “LISTENING” is waiting for commands. You can try connecting to it by typing:

telnet localhost [portnum]

(replace [portnum] with whatever port number you want). Many windows services will not accept a connection in this way. Some accept a connection, but are expecting binary data, so you cannot really enter any commands. However, some use plain text and you can have some fun experimenting.

Behind all those layers of nice looking windows and graphics, this is how the true work is often done on your computer. It reminds me a lot of my old computers where everything was command-line based. To use them, you had to learn the basic syntax. Today we have simple user interfaces, but under the hood our input is still converted into commands. Kinda cool.

 
No Comments

Posted in Windows

 

Still Image Capture From a WebCam

30 Mar

Maybe I’m a little slow, but I just spent about an hour looking for a freeware app to just take a snapshot from my webcam and save it as a jpeg. I know this is a simple function that is included in just about every webcam software out there. But, I didn’t want to install a full video editing suite or a webcam package. Just take a snapshot. That’s all I want!

Well, lucky me. I discovered the Windows Scanner and Camera Wizard, which is located in your Start Menu Accessories folder. I’d used this before to download photos from my digital camera. But, I never realized that it works great with a webcam as well. If you have a webcam, I’d recommend giving the Scanner and Camera Wizard a try. It’s really slick for grabbing a quick photo and saving it as a jpeg.

 
No Comments

Posted in Windows

 

Mapping Network Drives and Microsoft XP Firewall

30 Mar

When you enable the Microsoft Built-In firewall, you usually cannot map drives to computers on your local network. The reason is because the purpose of the firewall is to block all of the ports that Windows normally uses to communicate with other machines on your network. You can resolve this. Unfortunately you have to open one of the more dangerous ports. This somewhat defeats the purpose of using the firewall in the first place.

The best solution is to create a VPN connection with the other machine so that you can connect securely through the VPN ports. I personally find this to be somewhat inconvenient. For whatever reason VPN connections to machines inside my network are buggy and intermitant – definitely not reliable for things such as mapping a network backup drive.

If you’re willing to trade a little security for convenience, then you can simply open port 137 to UDP traffic. Security experts would probably do a spit-take upon hearing this advice. Anyway, to do this, you go to the dialog where you enable the MS firewall and click on the “Settings” button. Click “Add” to open a new port. You can name it whatever you want. The target machine is your own machine, so you can enter “localhost” here. Specify the port is UDP and set both the internal and external value to “137″

One you open this port, Windows can use it to communicate normally with other machines on the network. Unfortunately, it opens your computer up a little (perhaps a lot) more as well. XP SP2 has a more advanced firewall where you can enable access on a per-application level. I installed a beta version of SP2 and i did like this feature, so i’m looking forward to the final release later this year.

 
No Comments

Posted in Windows

 

Managing IE AutoComplete / Intellisense

30 Mar

I like using the IE feature that remembers what I’ve typed into a web form field. When I start typing, it automatically drops down choices of words that I have previously typed in that field. The problem is that, occasionally, I type in something that I don’t want saved. For instance, I mis-spell a username or whatever.

The IE configuration panel doesn’t really give you any options to manage those choices (other than to delete them all). I discovered while reading the MS support site, however, that you can actually get rid of individual entries. If you go to a form field that has some auto-complete items, just hit the down arrow key (or mouseover) until the item in question is highlighted. Then hit Del on your keyboard and that item is deleted from the list. Pretty sweet! Also, if you are looking at a web form, you can hit the down arrow (or double-click) an empty field and it will drop-down all the possible values for that field.

I’m happy that I can delete individual entries. I would personally like to see at least a basic management utility for those words. IE allows you to edit favorites and history items, but it seems to be missing an easy way to manage the intellisense items. I’m sure there is a little shareware utility out there.

 
No Comments

Posted in Windows

 

Changing your default Outlook .pst data file

30 Mar

If you want to replace the default outlook data file (.pst) with another file, you have to change a few things. You may want to do this if you’re upgrading to a new machine or if (like me) you like to move your datafile to a different location.

To replace the default datafile, do the following:

1. Either create a new data (.pst) file or open your old data file that you want to have as your default. Save it wherever you like. (Use File -> New -> Outlook Data File or File -> Open -> Outlook Data File)

2. Go to Tools -> Email Accounts. Select “View or Change Existing Accounts”

3. On this page, you’ll see a drop-down: “Deliver new e-mail to the following location:” Select the new datafile that you want to use as your default.

4. You’ll be alerted that Outlook must be restarted. Go ahead and close Outlook, then re-open it. Your datafile is now the default delivery location for email. You can right-click the old data file and close it if you like.

5. At this point, everything will work except that your contacts will not show up properly when you click the “To:” button. You need to re-link your contacts folder to the Address Book. If you don’t know how to do this, there’s another post here: [url]http://www.verysimple.com/support/viewtopic.php?t=203[/url]

 
No Comments

Posted in Windows