You can use nmap to do this. If you want to check connectivity from the net (i.e. end-to-end test through your router / ISP), you can use one of the web-based services like
Shields Up.
These methods will tell you if your machine responds on ports (they both use a sub-set of common ports by default. There is a command-line option to nmap which allows you to tell it to scan non-standard ports).
Another approach is to use netstat, e.g.
Code:
sudo netstat -l -t -p