Monthly Archive for 四月, 2009

关于transmission的ipv6支持问题

transmission是一个在linux下比较流行的bt客户端,gtk界面,支持daemon,并有方便的web前端第三方的客户端

transmission在大约1.50版的时候开始声明支持ipv6了,但是实际使用过程中却发现连接到byrbt的tracker时,服务端见到的ip是v4的ip,即使在/etc/hosts文件中指定了tracker的v6地址也一样。

google到了transmission的trac上有讨论这个问题(12)。似乎是transmission在对byrbt这样的v4/v6双栈的tracker时只解析v4地址,不解析v6地址。

trac里原文:

Brief explanation for posterity and those out of the loop: In libTransmission (pre-1.60?, that’s the plan anyway) “torrent” and “tracker” are used interchangeably. With the addition of IPv6 support, the two concepts need to be separated. This is a fairly major refactoring job. For 1.5x and in trunk currently, IPv6 DNS resolution in libcurl (the library we use for tracker communication) is disabled to prevent breakage of trackers with AAAA and A records on the same hostname (notably, TPB). For those of you coming here from #1937, the curl option to disable IPv6 “DNS resolution” apparently also causes curl to bail if given an explicit IPv6 tracker address (such as http://[::1]/announce), so that bug is the same as this one.

解决的办法很简单,修改源码里libtransmission/web.c,找到curl_easy_setopt( easy, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );一行,将CURL_IPRESOLVE_V4修改为CURL_IPRESOLVE_V6,然后正常编译安装即可。如果同时需要使用v4的tracker,可以把这部分修改成CURL_IPRESOLVE_WHATEVER。

实际使用效果甚好。原本都是做种很久后才有零星的ipv6的peer连接,现在连上tracker后不久就能得到ipv6的peer了

BTW,不知道为什么,transmissionbt.com也被墙了……万恶的GFW……

House S05E20片尾截图

screenshot of House.S05E20

screenshot of House.S05E20

挺好的……

用bash往豆瓣上更新广播

豆瓣……咋说呢……丫虽然有开放的API,反正我是没折腾明白怎么用最简单的方法把信息发布到它的“广播”上,还是和昨天一样,用wget模拟post

但是仔细看却发现一个问题……丫每次登录给一个不同的随机值,在表单里有个ck项,提交的时候会检查这个东东……

我只能说……何必呢?在正则面前算个毛……

以下为代码,是php的,我也懒得翻译了……自己替换一下就OK了……

btw似乎也就xiaonei和douban的服务这么恶心吧……非得模拟post才能搞定

$doubanlogincmd=”/usr/bin/wget –no-proxy -O – –post-data=\”form_email=$doubanusername&form_password=$doubanpassword\”  –keep-session-cookies –save-cookies=doubancookie http://www.douban.com/login|tee doubanlogin.log|grep logout|sed ‘s/.*ck=\([^\"]*\)\”.*/\\1/’ >ck”;
$doubanpostcmd=”/usr/bin/wget –no-proxy -O doubanpost.log –post-data=\”mb_text=$msg&mb_submit=+我说+&ck=`cat ck`\”  –keep-session-cookies –load-cookies=doubancookie http://www.douban.com/people/3983206/miniblogs –referer=http://www.douban.com/”

用bash脚本更新校内状态

其实就是些模拟post操作……

昨天跟@liufeng在twitter上说研究一下那个python代码……其实我不懂python……仔细看了一下发现看不懂……还是自己用firefox+live http header模拟表单提交吧……

liufeng兄……辜负你的期望了……

我用wget搞定的,应该用curl也行,没去研究了……

登录
wget –no-proxy -O xiaoneilogin.log –post-data=”email=youremailaddr&password=yourpasswd&autoLogin=true”  –keep-session-cookies –save-cookies=xiaoneicookie http://login.xiaonei.com/Login.do

发新日志
wget –no-proxy -O xiaoneipost.log –post-data=”title=Your_blog_title&body=Your_blog_content&categoryId=0&blogControl=99&passwordProtected=0″ –load-cookies=xiaoneicookie http://blog.xiaonei.com/NewEntry.do

默认发到“默认分类”

发新状态
wget –no-proxy -O xiaoneipost.log –post-data=”c=Your_Status”  –keep-session-cookies –load-cookies=xiaoneicookie http://status.xiaonei.com/doing/update.do –referer=http://status.xiaonei.com/getdoing.do

显卡挂掉了……

状况疑似NVIDIA经典的显卡门的现象,dmesg显示cannot copy vbios to main memory

问题是已经过保了……

目前是偶尔显卡会回光返照一下(比如现在),其余情况下只能在终端下用fbterm了……

话说fbterm真棒,支持ttf字体,配上ucimf做输入法,差不多解决了终端下的中文输入和显示。再用mplayer播放视频、mpd播放音乐、w3m上网=。=、finch聊天,基本没遇到啥问题……

受到linuxpilot的约稿……惭愧啊=。=

现在显卡回光返照,都不愿意重启电脑了,怕一重启显卡就又不行了……