If you just want to use one keyboard and mouse on two computers, you can do it all via software.
If you only have one display, use VNC, light TightVNC to access the second screen on your main PC. Then use Synergy Plus to share the keyboard and mouse:
http://www.tightvnc.com/
http://code.google.com/p/synergy-plus/
And Krispy, to add some more to the Hub and Switch thing. With a hub, the network connection is shared between all the devices connected to it and traffic is sent through every port. So you can use a hub to access the internet on both computers, but you will not get the best performance as all network traffic will go to each computer.
With a switch, only traffic distined to a particular computer will be sent through the port to which that computer is connected. Thus the network is utilised much more efficiently. A switch is much better than a hub if you have a few computers on the network since network traffic is sent only to the port to which it is required, not to all ports.
In my case, when I wanted to sniff my network traffic, I needed to use a hub since it allowed me to tap into all the traffic on my network. A switch didn't work since it would only allow me to sniff the traffic sent direclty to my network sniffer.
Basically, for networking, go for a switch, hubs aren't much use anymore imho.