SSH Tunneling Via PuTTY

A day or two ago, I stayed at home. I have my notebook, a bunch of DVDs, a good speed Internet connection, pizza, and unlimited beer. Okay, not the beer, I’ve sworn off it. But what else do you need, right? The answer came as soon as I tried sending my first email. Connection failed. I did some sleuthing and concluded that for some bizarre reason, my ISP seems to be blocking SMTP. WTF! Anyway, rather than complaining and getting it solved by them (what’s the fun in that?) I searched for another solution.

Enter SSH tunneling. This technology allows you to forward most any network traffic through an SSH connection to your SSH server and on to the target server. You login to your SSH server, preferably one with unlimited access to the Internet. Then you can map local ports to be forwarded to your SSH server which will then act as an intermediary between you and your target server. Of course, although the communications between your computer and the SSH server will be pretty much secure, the communication between the SSH server and the target server may not be.

So how did this all work for me and my problem? I loaded up PuTTY and created a new session to my SSH server which is on an ISP who doesn’t block SMTP. Then under Connection->SSH->Tunnels, I added source port 25 and destination port mymailserver:25. I then connected and logged on to my SSH server. While connected, I reconfigured Thunderbird‘s outgoing email server to localhost and then pressed the send button. Voila! Mail sent! :)

Time to make that complaint.

Adventures and Misadventures

I don’t know what it is about today :P but I found myself thinking back. Yes, for most of us life is good even with its ups and downs but sometimes it does get monotonic. And so once in a while we would go out and do something adventurous. Something, anything to stop that feeling of being trapped in the daily grind. These adventures are welcome respite. A reminder that there is more to life, a lot more.

Of course, if you have adventures, you inevitably would have misadventures. Though definitely not as much as some of my friends, I have my fair share including:

  1. Crashing onto a center island on a drive. It was due to miscommunication with my co-driver. She was saying left, then right, then center. Luckily we both had seat belts on and the damage was limited to a blown-out tire and a slightly dented rim.
  2. Going hypothermic on a climb. We were hiking up and it rained slowing us down and causing a drop on the temperature. Then night fell and the temperature dropped some more. We had to pitch a tent in the middle of the trail. I was shaking uncontrollably. Good thing my buddy helped me dry out and kept me warm.
  3. SUV I was co-driving running out of control on a drive. We found ourselves heading straight at the concrete center dividers. Fortunately, my driver recovered and got it back on its direction, Unfortunately, she also slowed down and the pig truck behind crashed in and totaled the rear window.
  4. Running low on air on a dive. It was my first time on that site and the current was stronger than what I was used to. Good thing the divemaster was around and gave me his octopus.
  5. Crashing while karting. I was going at high speed and took a hairpin turn. I plowed into the crash barriers. I injured my hands and my knee. More here.
  6. Getting food poisoned after eating spoiled fish. This actually happened twice. More here and here.

Will I let these misadventures stop me? Hell no! They’re nothing compared to others’. And as the last one illustrates, we run risks in even the ordinary and mundane things we do. So might as well try to make it extraordinary and fun, right?

Skydiving anyone?

Misconceptions About IT People

It irritates me when people think that IT is some magical solution to all the world’s problems. An unrealistic expectation to say the least. But it irritates me even more when these same people think that just because you’re an IT guy (or girl), you can fix computers, program, know office applications, cook, paint, write, sing, dance, and be the best lovers :P

Yes, some of us can actually do those. Okay, maybe not the last one. But here’s a revelation for you poorly-informed (I do not wish to use the word ignorant) people: We don’t know everything. IT is a broad field and we have specializations. Those of us who knows the innards of PCs are usually computer engineers or computer technicians. Those of us who crawl up ceilings and down floors with wires and wireless devices are usually the network and communications engineers. Those of us who give you access to email, the web, and file shares are usually the system administrators. Those of us who can program are usually the software developers.

Oh and just because we are software developers doesn’t mean we know how to program using some bizarre programming language you read about from somewhere who knows where. We have language specializations be it Java, C, C++ (yes it is different from C), Basic, etc. and usually for specific platforms like Windows, Mac, Linux, etc.

And regarding applications like MS/Open Office, Photoshop, InDesign CS blablabla, or whatever: Those are your damn tools, you should know how to use them. We don’t use those lame ass apps. For us, vim works just fine thank you. So don’t rely on us for help because we’re not trained to spoon-feed you. Thankfully, since that would’ve been a frustrating experience. Besides, training for MS/Open Office?!? What are you? Stupid? Save yourself the shame and embarrassment and use the F1 key.

Lucky for you we are usually of above average intelligence :P, learn quickly, are multi-talented, and can usually wing it with most anything IT. So don’t bash us when we take longer than you unreasonably think is normal when we try to help you. Believe me, we can do it much faster than you can given the same amount of studying. But if you don’t believe me, if you think you can do a better job, then please save yourself and us the time, stop whining, and just do the freakin’ job yourself. We have better things to do like solving the world’s problems.

LDAP Authentication For Squid

One of the things you want to do as you integrate your systems would be to have them authenticate from a common user base. That user base is usually an LDAP source, in my case Microsoft Active Directory (don’t say anything!!!). One of the systems you would want to use the common user base is your web proxy, Squid in my case. Here is how to integrate the two. It’s quite simple actually though, as usual, LDAP gave me a bit of a hard time.

First you need to configure Squid to use LDAP. Just add the following in your squid.conf:

auth_param basic program /usr/lib/squid/squid_ldap_auth -P -R -b “dc=your,dc=domain” -D “cn=user,cn=Users,dc=your,dc=domain” -w “password” -f “(&(objectClass=person)(sAMAccountName=%s))” yourldapserver

If you’re encountering problems add the -d parameter at the end and do a tail -f on /var/log/squid/cache.log Now that Squid can authenticate using LDAP, just add your ACLs in squid.conf:

acl youracl1 proxy_auth “/path/to/userlist”
http_access allow youracl1

That’s it!