Some Tips on Using EVIL Windows Like It’s a Linux (1)

With the help of CYGWIN and other GNU or opensource posix aligning softwares, we can get a Windows box very close to a Linux one. What we want is freedom, and there’s no way that our freedom can be deprived of by Bill Gates and his EVIL Windows system.

Say, we use the company network at office, which uses DHCP, and then we go back from work taking the laptop home, where I use ADSL, and the network should be reconfigured. Also, at company, we used proxy for http visiting. Thus every separate software will require reconfiguration! The IP address of the network card, the IE proxy setting, the Windows Live Writer proxy setting, and the Firefox, and so on.

It’ll be pain like hell if you must do it step by step manually every time. So here’s how I liberate myself and obtain freedom from that pain.

I do this at home:

$cat ~/bin/
netsh interface ip set address name=eth0 source=static addr= mask= gateway= gwmetric=1
netsh interface ip set dns name=eth0 source=static addr= register=primary
netsh interface ip add dns name=eth0 addr= index=2
#cygstart ~/bin/ieProxyDisable.reg
cd ~/doc
regedit /s MsnBlogProxyDisable.reg 

And here’s how we do it at office:

$cat ~/bin/
netsh interface ip set address name=eth0 source=dhcp
netsh interface ip set dns name=eth0 source=dhcp
ipconfig /renew
#cygstart ~/bin/ieProxyEnable.reg
cd ~/doc
regedit /s MsnBlogProxyEnable.reg

For the IE and Firefox proxy issue, I used the proxy automatic configuration script feature:

$cat ~/.proxy.pac
function FindClientProxy(url, host) {
    return "DIRECT";

function FindServerProxy(url, host) {
    if (shExpMatch(host, "*") || 
        shExpMatch(host, "") || 
        shExpMatch(host, "localhost") || 
        shExpMatch(host, "192.168.*") ||
        shExpMatch(host, "10.*") ||
    return "DIRECT";
    return "PROXY";

function FindProxyForURL(url, host) {
    if (myIpAddress()=="") {
        return "DIRECT";
    } else if (shExpMatch(host, "")) {
        return "DIRECT";
    else {
        return FindServerProxy(url, host);

## Local Variables: ***
## mode: tcl ***
## End: ***

Here, I have changed my true company name to a make-up Also, for the last three lines, it tells my editor emacs to consider it as tcl code, which of course is not, but it give me a satisfying indentation. So whatever. Lastly, make sure in your ieoptions dialog for choosing the script file:



To be continued…


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: