OpenVPN and default gateway

I rarely have to use a VPN, usually ssh does the trick for what I need. However, for one subject I need to access a server from within a variety of applications, and that server is not exposed outside of the campus network, even though it has a global DNS entry.

I can use Tunnelblick to VPN into the system, and then access the server as if I were on campus. The downside of this is that with the default settings, it routes all traffic through the VPN, which then would either slow everything down, or in this case, prevents anything from getting to the outside internets.

This is not really acceptable: if I am working on a problem and I need to access something I don’t have locally, like some documentation, then I have to disconnect the VPN, look up the data and then reconnect the VPN.

There is a line near the bottom of the .ovpn file that sets up the default gateway:

# Make the VPN the default route. redirect-gateway def1

It’s somewhat tricky to understand how to fix this - I had to restart a couple of times because I had screwed up the routing table.

You need to replace that line with one like the following:

route <address-inside-network> <netmask> <gateway>

In my case, to access barker.infoeng.flinders.edu.au, I needed to have:

route 129.96.22.79 255.255.255.255 129.96.59.73

Restarting the VPN connection then means I can access barker.infoeng.flinders.edu.au, and the wider internets.

I’ve also written a script that gets a new authentication keyfile, since the one that is provided doesn’t work very well. I’ve even made it so that it will automatically grab a new keyfile when the old one is out of date.

Procedural Programming

A big thing is made about teaching Java, and using Object Oriented techniques. “You can only program using Object Oriented methodologies in Java.”

Crap.

You can, and I have noticed it happening more, easily fudge up a procedural programming paradigm in Java.

Static methods appear as procedures and functions.

In CP2A, this is exactly what is starting to happen. Instead of building on the OO crap, stuff is being done in public static void main(String[] args), which is all procedural.

This is fine, but why bother teaching OO under Java first, and then this after? Just skip the middle man and start with the procedural stuff. I’d rather have done Pascal again… nah, just kidding.

iCal and Attachments

I use iCal for all of my time management needs, and I mostly like it. It allows me to keep my timetable well organised, and with some of the new features, it makes it quick and easy for me to find information as well.

In a recent incarnation, iCal obtained the capability of storing attachments as well as URLs. In the past, I just used to drag a document from the Finder to the URL area, and it creates an ugly-looking but still functional link to the document. Thus, for a Tutorial, I can have the answers in a PDF document, and easily get access to it directly from iCal.

Attachments are better, as you can have more than one of them. But there is a problem. Whilst you can have a document as an attachment, if you have a document bundle, it doesn’t work. You can create the attachment, but you cannot open it.

It took me some time to figure this out.

So, you can have many single-file documents as attachments, but only one bundle, as a URL.

The other issue with attachments is that they are copies. If you have an attachment, and you edit it, it doesn’t edit the original file you dragged there, only the one that is stored with that calendar entry. Thus, URLs are actually more useful, as this creates a link to the original document.

If only you could have multiple URLs stored in one calendar entry or to do item.