An ethernet cable typically uses RJ-45 connectors (RJ for Registered Jack) on both ends. If the two ports you wish to use are both MDI-X (e.g. hub to hub) or both MDI (e.g. NIC to NIC), you will need a crossover cable. If you have MDI-X to MDI (e.g. hub to NIC), you will need a straight-thru cable.

The pins on any RJ connector are numbered from left to right when viewed from the side without the clip, and pointed away from you. The standard pinout for an RJ-45 connector on a straight-through cable for use on an ethernet network is:

1. white-orange
2. orange
3. white-green
4. blue
5. white-blue
6. green
7. white-brown
8. brown
on both ends. If you desire a crossover cable for use on a 10Mbps half-duplex network (this is the norm), then the pinout of one side should be as above, and the other should be:
1. white-green
2. green
3. white-orange
4. any (usually blue)
5. any (usually white-blue)
6. orange
7. any (usually white-brown)
8. any (usually brown)
On a half-duplex network, the pins for your standard MDI port (like a NIC) are:
1. Transmit +
2. Transmit -
3. Receive +
4. not used
5. not used
6. Receive -
7. not used
8. not used
...and the pins for your MDI-X port (like a hub) are:
1. Receive +
2. Receive -
3. Transmit +
4. not used
5. not used
6. Trasnmit -
7. not used
8. not used
Notice only wires #1,2,3,6 are used - hence the pinout of the others doesn't matter. You could crimp just those four wires (in the right positions) and it would still work perfectly.

OK, so with that knowlegde, think about this. You have one wire crimped and connected to your NIC. Pins 1 and 2 constitute your Transmit (Tx) pair. In the RJ-45 connector, pins 1 and 2 are your orange pair - your computer is trasmitting data on these two wires. Now follow that data down the orange/white-orange pair of wires to the other end of the wire. Something needs to Receive (Rx) this data or it'll spew all over the place.
If your second device is a hub of any sort, It will have a MDI-X port on it. An MDI-X port receives data on which wire pair? Wires 1 and 2. Your data will be spewing out of which two wires? The orange pair. Therefore, you want to map the orange pair of wires to pins 1 and 2 on this end of the wire. Thats how you know to use a straight-through cable.
One more time, but more concisely put for the weak-minded: data flows out of your NIC on pins 1 and 2. Pins 1 and 2 are mapped to the orange pair of wires in the networking cable. On the other end, data is coming down the orange pair of wires, which is again mapped to pins 1 and 2, which is where the hub listens for data. Understand?

If you really understand then think about this. You have two NICs to connect to each other. Each has an MDI port. How/where does the data flow from one to the other?
Well it starts off the same. On your NIC, the data comes out pins 1 and 2, which is mapped to the orange pair. But on the other end, we have an MDI port (not an MDI-X like the first example). And we all know from above that an MDI port listens (receives) on pins.....3 and 6. Good. So you need to connect the orange wires (with the data coming down 'em) to pins 3 and 6. That looks like the second pinout that I explained way up there, for use with a crossover cable. You are "crossing over" the cables so that it will work correctly.
Cross-over cable are really easy. Think about it like this. You and your friend are on the phone. You speak into the bottom part of the phone, but it would do no good to have your voice coming out the bottom part on his end - he would never hear you because he'd be too busy talking into it himself! So the phone knows to "cross over" the data and output it at the top end, where your friend is listening for you to speak. It's the same principle.