Proxy auto config

土鳖了,今天才发现还有这个玩意儿:

http://en.wikipedia.org/wiki/Proxy_auto-config

这下方便多了,不用每次都往”No Proxy For”里添加条目了(-_-!)。。

我的PAC (Proxy_auto-config) 文件:

function isBlockedHost(host)
{
if (shExpMatch(host, “*google.*”) ||
shExpMatch(host, “*ggpht.*”) ||
shExpMatch(host, “*alexa.com*”) ||
shExpMatch(host, “*blogspot.com*”) ||
shExpMatch(host, “*facebook.com*”) ||
shExpMatch(host, “*twitter.com*”) ||
shExpMatch(host, “*youtube.com*”) ||
shExpMatch(host, “*appspot.com*”) ||
shExpMatch(host, “*fc2.com”) ) {
return true;
}
return false;
}

// browser’s API
function FindProxyForURL(url, host)
{
var direct = “DIRECT”;
var socksProxy = “SOCKS5 127.0.0.1:9999”; // 注意这里需要指定为SOCKS5,才会进行remote dns resolve

if (isBlockedHost(host))
{
return socksProxy;
}

return direct;
}

参考文章:
http://blog.solrex.org/articles/remote-dns-lookup.html
http://fanqiangchinagfw.blogspot.com/2010/08/dnsfirefox-dns-resolving.html

《Entrepreneur》杂志发刊词 Entrepreneur’s Credo of the American

1776年,美国独立前夜,一本不到20页的小册子开始流传,小册子名为《常识》。
作者托马斯·潘恩用朴素的文字,激励人们反抗暴政和奴役。
北美独立战争期间,《常识》一书对民众的影响力仅次于《圣经》。
1904年,美国《企业家》杂志,选用《常识》中的一段话作为发刊词。
此后百余年中,沧海桑田,物是人非,但杂志扉页上的这段话,却从来没有改变,它被称为企业家誓言。

I do not choose to be a common person.
It is my right to be uncommon—if I can.
I seek opportunity—not security.
I do not wish to be a kept citizen,
humbled and dulled by having the state look after me.
I want to take the calculated risk,
to dream and to build,
to fail and to succeed.

I refuse to barter incentive for a dole;
I prefer the challenges of life to the guaranteed existence;
the thrill of fulfillment to the stale calm of Utopia.
I will not trade my freedom for beneficence
nor my dignity for a handout.
I will never cower before any master
nor bend to any threat.
It is my heritage to stand erect, proud, and unafraid;
to think and act for myself;
to enjoy the benefit of my creations;
and to face the world boldly
and say:
“This, with God’s help, I have done.”

——————————————-
我是不会选择做一个普通人的。
如果我能够做到的话,我有权成为一位不寻常的人。
我寻找机会,但我不寻求安稳,
我不希望在国家的照顾下成为一名有保障的国民,那将被人瞧不起而使我感到痛苦不堪。

我要做有意义的冒险。
我要梦想,我要创造,我要失败,我也要成功。

我拒绝用刺激来换取施舍;
我宁愿向生活挑战,而不愿过有保证的生活;
宁愿要达到目的时的激动,而不愿要乌托邦式毫无生气的平静。

我不会拿我的自由与慈善作交易,也不会拿我的尊严去与发给乞丐的食物作交易。
我决不会在任何一位大师面前发抖,也不会为任何恐吓所屈服。

我的天性是挺胸直立,骄傲而无所畏惧。
我勇敢地面对这个世界,自豪地说:在上帝的帮助下,我已经做到了。
=========================
书单:http://www.douban.com/group/topic/2164260/