How can I install applications, share files on a remote computer?

view story

http://askubuntu.com – My friend and I are both using ubuntu 12.04, however we live in different places. We want to access each other's computer through internet. How can we do that? For example, if I want to install a program to my friend's computer-by using my computer, is it possible? (HowTos)