颠覆软件

关注 : 架构与设计,敏捷,快速开发,项目管理,执行力,SSH,RoR

Archive for the ‘IT生活’ Category

2010年第一博

January 4, 2010

好久不博了,惭愧。

查看了下PR目前是1(这个是最低的吗?)

咱也大言不惭的看下Alex排名:

alexa排名

alexa排名

mark一下,一段时间后再回头review

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

it经验网的创意不错

October 18, 2007

ithao123_logo.gifit经验网:  ithao123.com,这个名字是不是很眼熟?是的,在hao123前面加了一个it,虽然有抄袭的嫌疑,不过我还是觉得不错,不为别的,就是因为比较适用!

启示:模仿本身并没有问题,只要能为用户带来价值就是有意义的,这也是web2.0之路的一个现实。

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

在blog中加入美味书签

October 14, 2007

看到很多人在blog中放置“每日阅读”,内容来自美味书签,一直想知道怎么实现的,今天终于如愿以偿,感觉这个很使用,推荐之!

以前在美味书签中大都是放置www.url.com的地址,但是发现更多的人收集的是内容,还是后者更有意义,内容为王.

参考文档请看这里 

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

听歌用什么方便?

October 6, 2007

上次看到keso推荐keso推荐友播,试验了一下,感觉很失望,一开始用一个什么DNA测试,我以为还有什么智能功能,因为不喜欢周杰伦的歌,所以我把周杰伦设为不喜欢的歌手,但是后面出来的歌曲还是有很多是周杰伦的,那我设置不喜欢还有什么意义。另外,感觉歌曲推荐上也没什么特色。

还是想起了酷狗,这个软件发展了好多年了,我记得我刚毕业那会就在用,算是老字号了,资源比较丰富,基本想听的歌曲都有。

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

十一放假期间,把blog装修一下

September 30, 2007

77_363_7fe9882c9094713.jpg

guoqingyanlian.jpg

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

交友网站现在怎么像是卖春的?

September 28, 2007

以前的一个gmail很久不用了,打开一看吓我一跳,大家来欣赏一下吧

shit_web20.png

真是让人反感,能不能换一种方式?

而且,上面的发件人有些居然是我认识的一些同事同学朋友,我感到很奇怪,是他们主动发的还是背着他们网站自己发的? 有空得问一下

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

试用下中国移动的桌面助理

July 17, 2007

感觉还不错,大家可以试一下
功能如下:

中国移动手机桌面助理是中国移动最新推出的一款集短信、彩信、联系人管理、话费查询等强大功能于一体的通讯软件。

 提供稳定安全的,可定时发送的短信;强大的彩信、贺卡编辑功能;创意无穷的彩信文字;简约快捷的个人通讯录与企业通讯录管理;方便的用户话费查询;移动最新相关信息的更新等。

 通过个人电脑的优势,将您从手机终端解脱出来,您不用费力在手机上一个一个的打字,不用为了忘记发送某条短信而懊悔,不用担心手机里的图片匮乏,缺少新意,不用再登录网站查话费、搜索移动相关新信息,一切都由手机桌面助理帮您完成。

 

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

[zt]自动代理脚本的函数说明与应用

July 21, 2006

key words:自动脚本 代理脚本 代理 冲出窗子

本文献给那些对自动代理脚本有兴趣、想自己写的朋友。

1、什么是代理脚本(PAC)
一个PAC文件其实就是一个文本文件,最简单的格式就是包含一个叫FindProxyForURL的
JScript函数,IE通过传入两个变量来调用这个函数,一个是用户浏览的地址URL全路经,
一个是这个URL中的主机名部分(host)。这个FindProxyForURL函数有三种可能的字符串
返回值,一是”DIRECT”,就是直接连接,不通过代理;二是”PROXY proxyaddr:port”,
其中proxyaddr和port分别是代理的地址和代理的端口;三是”SOCKS socksaddr:port”,
其中socksaddr和port分别是socks代理的地址和端口,一个自动代理文件可以是多个
选择的组合,其中用分号(;)隔开,如:

function FindProxyForURL(url,host)
{
if (host == ”www.mydomain.com”)
return ”DIRECT”;

return ”PROXY myproxy:80;
PROXY myotherproxy:8080;
DIRECT”;
}

2、下面是代理脚本可能用到的函数和说明:
PAC Helper Functions

dnsDomainIs(host, domain)              Returns true if the host is part of the
specified domain, false otherwise.

isInNet(hostname,                      Resolves the hostname and subnet IP,
subnet mask) returns true if the
hostname is within the subnet specified
by the IP address and the subnet mask,
false otherwise.

isPlainHostName(host)                  Returns true if there are no dots in the
hostname, false otherwise.

isResolvable(host)                     Internet Explorer tries to resolve the
hostname through DNS and returns true if
successful, false otherwise.

localHostOrDomainIs                    Returns true if the host matches (host,
domain) the host portion of the domain,
or if the host matches the host and
domain portions of the domain, false
otherwise. (Executed only for URLs in
the local domain.)

dnsDomainLevels(host)                  Returns the number of dots in the
hostname.

dnsResolve(host)                       Returns a string containing the IP
address of the specified host.

myIPAddress( )                         Returns a string containing the local
machine’s IP address.

shExpMatch(url, shexp)                 Returns true if the supplied URL matches
the specified shell expression, false
otherwise.

dateRange(parmList)                    Returns true if the current date falls
within the dates specified in parmList,
false otherwise.

timeRange(parmList)                    Returns true if the current time falls
within the times specified in parmList,
false otherwise.

weekdayRange(parmList)                 Returns true if today is within the days
of the week specified in parmList, false
otherwise.

3、下面是各个函数应用的例子:
a、isPlainHostName(host),本例演示判断是否为本地主机,如http://myservername/
的方式访问,如果是直接连接,否则使用代理
function FindProxyForURL(url, host)
{
if (isPlainHostName(host))
return ”DIRECT”;
else
return ”PROXY proxy:80″;
}

b、dnsDomainIs(host, ”")、localHostOrDomainIs(host, ”"),本例演示判断访问主机
是否属于某个域和某个域名,如果属于.company.com域的主机名,而域名不是
www.company.com和home.company.com的直接连接,否则使用代理访问。
function FindProxyForURL(url, host)
{
if ((isPlainHostName(host) ||
dnsDomainIs(host, ”.company.com”)) &&
!localHostOrDomainIs(host, ”www.company.com”) &&
!localHostOrDomainIs(host, ”home.company.com”))

return ”DIRECT”;
else
return ”PROXY proxy:80″;
}

c、isResolvable(host),本例演示主机名能否被dns服务器解析,如果能直接访问,否
则就通过代理访问。
function FindProxyForURL(url, host)
{
if (isResolvable(host))
return ”DIRECT”;
else
return ”PROXY proxy:80″;
}

d、isInNet(host, ”", ”"),本例演示访问IP是否在某个子网内,如果是就直接访问,
否则就通过代理,例子演示访问清华IP段的主页不用代理。
function FindProxyForURL(url, host)
{
if (isInNet(host, ”166.111.0.0″, ”255.255.0.0″))
return ”DIRECT”;
else
return ”PROXY proxy:80″;
}

e、shExpMatch(host, ”"),本例演示根据主机域名来改变连接类型,本地主机、*.edu、
*.com分别用不同的连接方式。
function FindProxyForURL(url, host)
{
if (isPlainHostName(host))
return ”DIRECT”;
else if (shExpMatch(host, ”*.com”))
return ”PROXY comproxy:80″;
else if (shExpMatch(host, ”*.edu”))
return ”PROXY eduproxy:80″;
else
return ”PROXY proxy:80″;
}

f、url.substring(),本例演示根据不同的协议来选择不同的代理,http、https、ftp、
gopher分别使用不同的代理。
function FindProxyForURL(url, host)
{
if (url.substring(0, 5) == ”http:”) {
return ”PROXY proxy:80″;
}
else if (url.substring(0, 4) == ”ftp:”) {
return ”PROXY fproxy:80″;
}
else if (url.substring(0, 7) == ”gopher:”) {
return ”PROXY gproxy”;
}
else if (url.substring(0, 6) == ”https:”) {
return ”PROXY secproxy:8080″;
}
else {
return ”DIRECT”;
}
}

g、dnsResolve(host),本例演示判断访问主机是否某个IP,如果是就使用代理,否则直
接连接。
unction FindProxyForURL(url, host)
{
if (dnsResolve(host) == ”166.111.8.237″) {
return ”PROXY secproxy:8080″;
}
else {
return ”PROXY proxy:80″;
}
}

h、myIpAddress(),本例演示判断本地IP是否某个IP,如果是就使用代理,否则直接使
用连接。
function FindProxyForURL(url, host)
{
if (myIpAddress() == ”166.111.8.238″) {
return ”PROXY proxy:80″;
}
else {
return ”DIRECT”;
}
}

i、dnsDomainLevels(host),本例演示访问主机的域名级数是几级,就是域名有几个点
如果域名中有点,就通过代理访问,否则直接连接。
function FindProxyForURL(url, host)
{
if (dnsDomainLevels(host) > 0) { // if number of dots in host > 0
return ”PROXY proxy:80″;
}
return ”DIRECT”;
}

j、weekdayRange(),本例演示当前日期的范围来改变使用代理,如果是GMT时间周三
到周六,使用代理连接,否则直接连接。
function FindProxyForURL(url, host)
{
if(weekdayRange(“WED”, ”SAT”, ”GMT”))
return ”PROXY proxy:80″;
else
return ”DIRECT”;
}

k、最后一个例子是演示随机使用代理,这样可以好好利用代理服务器。
function FindProxyForURL(url,host)
{
return randomProxy();
}

function randomProxy()
{
switch( Math.floor( Math.random() * 5 ) )
{
case 0:
return ”PROXY proxy1:80″;
break;
case 1:
return ”PROXY proxy2:80″;
break;
case 2:
return ”PROXY proxy3:80″;
break;
case 3:
return ”PROXY proxy4:80″;
break;
case 4:
return ”PROXY proxy5:80″;
break;
}
}

利用上面的函数和例子说明,大家就可以写出比较复杂有效的自动代理脚本。

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)

安装匿名代理绕过GFW

July 17, 2006

Windows

  • 下载并安装 Tor & Privoxy
    http://www.vidalia-project.net/dist/vidalia-bundle-0.1.1.21-0.0.5.exe
    安装完之后,在localhost:8118有http代理(privoxy提供),localhost:9050有socks5代理(tor提供)
    如果这时候可以配置Firefox使用8118和9050这两个端口,那就所有的Internet访问都将通过tor访问,会很慢。所以这种方式不推荐,要自己编辑一下代理配置脚本
    screenshot-win32-firefox-proxies.jpg
  • 编辑proxy.pac
    可以在某个地方创建代理配置脚本, 比如说c:\proxy.pac, 下面是我用的内容, 可以上一些比较常用的网站, 比如wikipedia和google网页快照. 如果查询google也经常有问题, 可以把第一条 nosite.google.com 改成 .google.com 记得google.com前面有个点, 这样所有访问google的请求都会通过代理,不过做好心理准备,会很慢

    function FindProxyForURL(url, host)
    {
    url = url.toLowerCase();
    host = host.toLowerCase();
    
    if(dnsDomainIs(host,"nosite.google.com")) return "PROXY localhost:8118";
    else if(dnsDomainIs(host,".blogspot.com")) return "PROXY localhost:8118";
    else if(dnsDomainIs(host,".wordpress.com")) return "PROXY localhost:8118";
    else if(dnsDomainIs(host,"wikipedia.org")) return "PROXY localhost:8118";
    else if(shExpMatch(url,"*q=cache:*"))  return "PROXY localhost:8118";
    else return "DIRECT";
    }
  • 配置IE使用代理配置脚本
    上面那个Firefox配置界面中,选择Aotumatic proxy configuration URL, 填入

    file://c:/proxy.pac

    IE的配置类似.每次重新修改proxy.pac,都应该到上面的界面Reload代理配置脚本(比较讨厌,好在这个文件修改次数不会很多)

Debian Linux

这里主要讲Debian下的安装配置,其他版本的Linux可以参考tor的官方说明

  • 安装 tor privoxy
     apt-get install tor privoxy
  • 配置privoxyDebian下面的privoxy需要额外的配置,因为privoxy需要使用tor提供的9050 socks5端口.具体是配置/etc/privoxy/config,加一行
    forward-socks4a / localhost:9050 .

    不要漏掉最后的点.然后重起一下privoxy

    /etc/init.d/tor restart
  • 如果使用Firefox,剩下的配置可以参考Windows下面的配置方法

参考

http://www.linuxsir.org/bbs/showthread.php?t=232436
http://tor.eff.org/docs/tor-doc-win32.html.en

Technorati Tags: , ,

VN:F [1.6.3_896]
Rating: 0.0/10 (0 votes cast)
VN:F [1.6.3_896]
Rating: 0 (from 0 votes)