Pages

Thursday, May 05, 2005

1 2 3 testing ...

Now this entry is just to test if the gnome blogspot entry really works. Seems like it does. Formatting options are limited, but this is still very convenient. If only blogger will export an API to publish pictures, I would have posted an screenshot.


To test the add link button here is a link to my resume

Tuesday, May 03, 2005

Automatic Proxy Configuration

I connect to two different networks while at home and office, and one of them uses an http proxy, while the other one doesn't.

The solution is to have an autoproxy.pac file, accessible from the localhost ( I am anyway running apache on my laptop, but the same thing should work using file://somedir/autoproxy.pac.

You configure the proxy script in Edit->Preferences->Connection Settings->Automatic proxy configuration url

So here is the one I found from the net, and the ideal version of autoproxy.pac (that didn't work)

function FindProxyForURL(url, host)
{
if (isInNet(myIpAddress(),"192.168.82.0","255.255.255.0"))
return "PROXY 192.168.82.56:3128";
else
return "DIRECT";
}

It doesn't works becausemyIpAddress() returns 127.0.0.1, which has something to do with interface metrics. So this is my modified version, that works

function FindProxyForURL(url, host)
{
if (isResolvable("server.delhi.solidcore.com"))
return "PROXY 192.168.82.56:3128";
else
return "DIRECT";
}

This would put some load on the DNS, in that server will be resolved, and it would take slightly more time, but this works, esp. in a DHCP environment.

My home network consists of a Fedora Linux router that connects to 24online cable network. Sometimes I don't want to put the router on to just access internet from my laptop, so I use this script (run as root)

#!/bin/sh

# Set environment for cable access
ifconfig eth1 172.16.6.1
route add -net 0 gw 172.16.1.1
echo 'nameserver 172.16.1.1' > /etc/resolv.conf
linc start

where 172.16.6.1 is the static IP assigned to me by my cablewalah , and 172.16.1.1 is the 24online gateway. linc is a daemon that allows you to log-in to a 24online network (you can use crclient instead, but thats closed source and buggy). Actually just saying closed source would have been enough :)