2011-01-28
http tunnel 研究
http://www.nocrew.org/software/httptunnel.html
命令是 htc hts
文档好 谦虚 链接别人
https://bitbucket.org/gotoh/connect/wiki/Home
命令是
connect connect-proxy
文档好
http://proxytunnel.sourceforge.net/paper.php
命令是 proxytunnel
另外 ubuntu 系统自带的 nc 命令 也非常好用
其实cntlm 的 tunnel 和 socks 功能不仅可以应用于微软ntlm代理,完全可以应用于任何http代理 只不过对常规代理 添加了些冗余的头部信息
2011-01-26
写了一个判断是否相离的豆腐块类
import java.security.InvalidParameterException;
import java.util.Date;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
public class SomeSpan<T extends Comparable<T>> {
static Logger log = Logger.getLogger(SomeSpan.class);
private T begin;
private T end;
public SomeSpan(T begin, T end) {
setBegin(begin);
setEnd(end);
}
/**
* @param args
*/
public static void main(String[] args) {
BasicConfigurator.configure();
SomeSpan<Date> t1 = new SomeSpan<Date>(
new Date(1979 - 1900, 8 - 1, 17), new Date(2011 - 1900, 1 - 1,
26));
SomeSpan<Date> t2 = new SomeSpan<Date>(
new Date(2000 - 1900, 10 - 1, 5), new Date(2011 - 1900, 1 - 1,
25));
SomeSpan<Integer> t3 = new SomeSpan<Integer>(new Integer(2000),
new Integer(2011));
SomeSpan<Integer> t4 = new SomeSpan<Integer>(new Integer(1000),
new Integer(2000));
log.debug(t1);
log.debug(t2);
log.debug(t3);
log.debug(t4);
log.debug(t1.isInsection(t2));
log.debug(t3.isDisjoint(t4));
}
public void setBegin(T begin) {
this.begin = begin;
}
public T getBegin() {
return begin;
}
public void setEnd(T end) {
if (end.compareTo(this.getBegin()) < 0) {
throw new InvalidParameterException("Error: end < begin!");
}
this.end = end;
}
public T getEnd() {
return end;
}
/**
* 判断是否相离,相离的定义参见 http://en.wikipedia.org/wiki/Disjoint_sets
*/
public boolean isDisjoint(SomeSpan<T> another) {
return (this.getBegin().compareTo(another.getEnd()) > 0)
|| (this.getEnd().compareTo(another.getBegin()) < 0);
}
/**
* 判断是否相交,相交的定义参见 http://en.wikipedia.org/wiki/Intersection_%28set_theory%29
*/
public boolean isInsection(SomeSpan<T> another) {
return !isDisjoint(another);
}
@Override
public String toString() {
return getBegin().toString() + " -> " + getEnd().toString();
}
}