Got stomach ache this morning and I feel too lazy to get into office. Thinking that I would not be so comfortable at the office in this situation, I decided to stay at home. Then I try to log to my office’s internal jabber network, in case some one (my boss) need to contact me on urgent matter.
$ ssh -L 5222:internal-jabber-server:5222 my_office_server
However, for some reasons my Gaim client refused the connection with Stream Error message when I try to connect. After trying for a few times, I guess the problem was with the authentication process. The internal-jabber-server used username@internal-jabber-server to verify the user but I’m specifying localhost as my server resulting in the screenname username@localhost. As usual, I tried to search google for a possible solutions but can’t find any. Almost give up then I realized something … stupid me !!! All the jabber server need is just a screenname in form of username@internal-jabber-server and all that I need to do just specify internal-jabber-server as my server instead of localhost. Then I just edit my /etc/hosts file to point internal-jabber-server to 12.0.0.1.
done … !
and wow … using the same method, now I can access the internal subversion server which I got problem to access it from home before. Adding the CNAME of the internal subversion server to my /etc/hosts, forward my local port to the subversion server which running at port 80, I can just checkout all the source code like usual, as I’m at the office.
$ svn co http://internal-subversion-server:8080/svn/path/to/project
Where 8080 is my local ssh forwarded port to the internal-subversion-server. Ok .. now I can start hacking ;)

Comments
tunnel
you can put extra flag on SSH. if only using -L i guess you'll prompted with the remote shell(which i bet you don't want to use if u want to tunnel for gaim).
http://mnajem.blogspot.com/2005/05/gentoo-rsync-with-ssh-tunnel-why-i.html
example of pointing localhost,not necessarily edit /etc/hosts/ you can try
$gaim localhost &
try,and give us feedback.