- 本文链接地址:http://zhubaining.com/blog/2011/04/20/archives/my-firefox-addons
- 作者:zhubaining
广告拦截:Adblock Plus 把广告图片、flash啥的都拦截了,有时候看起来页面空白区一片一片,也不好看。
鼠标手势:All-in-One Gestures 鼠标右键轻松滑动,就可以实现前进、后退、关闭等动作
智能代理服务器:AutoProxy 自动对被功夫网和谐的站点走proxy通路,其他的直接访问
随意拖拽:Easy DragToGo 对于文字拖放可以立即google搜索,对于链接拖放可以方便地前台/后台访问
IT技术工人必备:Firebug
谷歌工具栏:Google Toolbar for Firefox 在工具栏很方便地搜索网页、bookmarks、notebook、alexa等,还可以方便访问bookmarks、notebook、reader等。谁用谁知道!
猴子脚本:Greasemonkey 安装相应脚本后,可以给某个页面增加新的功能
快速翻页:NextPlease 智能推断“下一页”的链接,可以设置一个快捷键,来迅速实现翻页。
查看、修改保存的用户名和密码:Saved Password Editor
显示IP: ShowIP 在状态栏显示当前站点的IP
下载Flash: Sothink Web Video Downloader for Firefox 方便地下载当前页面中的flash资源
Tab增强:Tab Mix Plus 增强tab管理功能
切换UA: User Agent Switcher 随意切换User agent,有时候用来访问一些wap站点
访问wap站点:wmlbrowser 像手机一样访问wml内容
twitter: Echofon 很方便的查看和发推(用老版本1.9.6.4来进行basic auth,你需要防止它被自动更新)
- 本文链接地址:http://zhubaining.com/blog/2011/04/07/archives/my-wordpress-plugins
- 作者:zhubaining
编辑器:wp-super-edit
随机文章:advanced-random-posts
评论验证码:si-captcha-for-wordpress
语法高亮:syntaxhighlighter-plus
展示&发twitter:twitter-tools
导入wordpress:wordpress-importer
版权信息:wp-posturl
很酷的3D分类/tag: wp-cumulus (原装版本不支持中文,你可以直接复制我的swf文件到对应的位置。)
- 本文链接地址:http://zhubaining.com/blog/2011/03/17/archives/%e4%bb%8e%e7%99%be%e5%ba%a6%e7%a9%ba%e9%97%b4%e6%90%ac%e5%ae%b6
- 作者:zhubaining
试着将百度空间的博客文章搬到这里,google了几把,发现了一个工具:
http://www.yhustc.com/exp/other/BlogMover.zip
按照用法,解压、执行其中的一个脚本,发现出错:
python hi-baidu-mover.py -s http://hi.baidu.com/百度账号
就试着改成:
python hi-baidu-mover.py -s http://hi.baidu.com/百度账号/blog
结果ok了。
脚本执行过程中,屏幕不停地报错:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe9 in position 117: ordinal not in range(128)
Traceback (most recent call last):
File “/usr/lib/python2.6/logging/__init__.py”, line 768, in emit
msg = self.format(record)
File “/usr/lib/python2.6/logging/__init__.py”, line 648, in format
return fmt.format(record)
File “/usr/lib/python2.6/logging/__init__.py”, line 436, in format
record.message = record.getMessage()
File “/usr/lib/python2.6/logging/__init__.py”, line 306, in getMessage
msg = msg % self.args
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe9 in position 117: ordinal not in range(128)
暂不理睬,一会儿功夫,文章抓完了,生成了一个XML文件:
-rw-r–r– 1 zhubaining zhubaining 292403 2011-03-15 00:50 hibaidu_03152011-0050.xml
于是就往WordPress里面导入:
先要安装一个用于导入的插件:WordPress Importer,激活后,在管理后台Tools=> Import里面选择WordPress,然后上传那个xml文件。
不幸的是,报错了:
Sorry, there has been an error.
This does not appear to be a WXR file, missing/invalid WXR version number
看来是抱怨文件缺少wxr版本号,vim打开xml文件后,确实没发现,怎么办?
WordPress不是可以导出xml文件么,那就马上导出一个标准版本。经过对两个xml文件的比对,确实发现少了一行,于是加上蓝色的那一行:
<language>en</language>
<wp:wxr_version>1.0</wp:wxr_version>
<wp:category><wp:cat_name><![CDATA[Jishu]]></wp:cat_name></wp:category>
再次上传,这下OK了。
导入了不少文章,发现有几篇是乱码,直接查看那个xml文件,里面确实也是。一开始以为是由于百度空间博客里面的分类是汉字导致,都改成英文的分类名,重试一次还是乱码。算了,那几篇就人肉复制粘贴过来吧。
还有一个比较倒霉的问题,就是原来文章里面那些图由于防盗链,在这里没法正常显示了。下来准备写个脚本把这些图片从百度空间抓下来,转存一下,然后再把文中的图片链接修改一下。
更新:
解决办法:
- 将数据库dump以收集要修改图片URL,同时也是一个事前备份
- 进入wordpress的uploads目录:$ cd /var/www/zhubaining/wp-content/uploads/2011/03/
- 抓取百度空间的图片:for i in `grep -E ‘http://hiphotos.baidu.com/zhubaining/pic/item/[0-9a-z]{24}\.jpg’ db.sql -o`; do wget $i; done;
- 将文章里面的url替换掉:mysql> update wp_posts set post_content=replace(post_content, ‘http://hiphotos.baidu.com/zhubaining/pic/item/’,'http://zhubaining.com/wp-content/uploads/2011/03/’);
顺带发现:抓取了一个图片,尝试打开看看是否正确,没想到图片查看器报错“Error interpreting JPEG image file (Not a JPEG file: starts with 0×89 0×50)”,file了一把,提示是“PNG image”,改名成png就ok了。
原来,虽然百度空间的图片都是以jpg结尾的,但实际上并不都是jpg,比如png、bmp等什么的都有,貌似是按照你上传格式直接保存(可能还判断了图片的大小,太大的话应该会压缩的)。
- 本文链接地址:http://zhubaining.com/blog/2010/09/16/archives/%e7%bb%99%e7%99%be%e5%ba%a6%e8%af%b4%e5%90%a7
- 作者:zhubaining
关于@的用法:http://t.baidu.com/31642/4c60f7d0bd0fa3e9
关于首页xx图:http://t.baidu.com/31642/95c7a51d51acfbda
关于会话功能:http://t.baidu.com/31642/17fefb32e056a7d3
- 本文链接地址:http://zhubaining.com/blog/2010/09/16/archives/%e5%85%b6%e5%ae%9emp3%e5%8f%af%e4%bb%a5%e6%9b%b4%e7%be%8e%e7%9a%84
- 作者:zhubaining

百度mp3是广大网民很喜欢的产品,一个重要的原因就是那里歌曲应有尽有。然而,由于其音乐资源链接不是来自专业的正版音乐提供机构,所以大家听歌时往往会碰到类似这样令人恶心的事情:看名字明明是那首地球人都喜欢的、悦耳动听的《爱情买卖》,但是却听到恶心的广告,或者是某人下三滥的翻唱版本。
对于这个问题,个人觉得有以下两种解决方案:
1. 对链接人工过滤
考虑到热门歌曲可能也就一二十万首,完全可以使用人肉手段对这些歌曲的来源链接进行过滤,将名不副实的或者低质量的链接去除掉。
2. 系统自动过滤
这里直接用例子进行说明。比如,百度音乐盒里面,有一个“重选”功能,就是更换同一首歌的链接,如下图:

那么,至少可以这么做:系统将用户对某一首歌曲的某个来源链接点击“重选”的次数进行统计,如果达到一定数量,就可以推断出这些链接为不良链接,进而将它们从链接索引库中排除。之所以能做出这样的推断,其原因是显而易见的:你是重选链接而不是换歌,那么说明你确实想听这首歌,只是这个链接有问题,它要么音质太差、要么不是原版、要么有广告等等。
拙见仅供参考,如有脑残之处,请一定指出,不然会对你进行无情的鄙视。
- 本文链接地址:http://zhubaining.com/blog/2009/12/19/archives/alexa-top-20-sit
- 作者:zhubaining
瞻仰alexa全球500大牛网站名单的前二十个,有以下感想:
google及其家族很猛!
没想到microsoft.com也进榜单,都是谁整天去?
“用了都说好”的维基百科流量真大;
排名第八的百度旁边的介绍还是“Music search engine and free MP3 & video streaming for all kind of topic.”,该改一下了;
google排17名,人数不到一亿的德国这么喜欢搜索么;
中文的占四席,中国人很强大。
==== 今日的快照
Top Sites
The top 500 sites on the web.
The sites in the top sites lists are ordered by their 1 month alexa traffic rank.
The 1 month rank is calculated using a combination of average daily visitors and pageviews over the past month. The site with the highest combination of visitors and pageviews is ranked #1.
-
Google
google.com
Enables users to search the Web, Usenet, and images. Features include PageRank, caching and translation of results, and an option to find similar pages. The company’s focus is developing search technology.
-
Facebook
facebook.com
A social utility that connects people, to keep up with friends, upload photos, share links and videos.
-
Yahoo!
yahoo.com
Personalized content and search options. Chatrooms, free e-mail, clubs, and pager.
-
YouTube
youtube.com
YouTube is a way to get your videos to the people who matter to you. Upload, tag and share your videos worldwide!
-
-
-
-
Baidu.com
baidu.com
Music search engine and free MP3 & video streaming for all kind of topic.
-
-
-
-
-
Google India
google.co.in
Indian version of this popular search engine. Search the whole web or only webpages from India. Interfaces offered in English, Hindi, Bengali, Telugu, Marathi and Tamil.
-
Twitter
twitter.com
Social networking and microblogging service utilising instant messaging, SMS or a web interface.
-
-
-
Google
google.de
Suche im gesamten Web, in deutschsprachigen sowie in deutschen Seiten. Zusätzlich ist eine Bildersuche, eine Newsarchiv-Suche (ehemals dejanews) sowie ein Katalog vorhanden.
-
Amazon.com
amazon.com
Amazon.com seeks to be Earth’s most customer-centric company, where customers can find and discover anything they might want to buy online, and endeavors to offer its customers the lowest possible prices. Site has numerous personalization features and services including one-click buying, extensive customer and editorial product reviews, gift registries, gift certificates, wish lists, restaurant and movie listings, travel, and photo processing.
-
-
WordPress.com
wordpress.com
Free blogs managed by the developers of the WordPress software. Includes custom design templates, integrated statistics, automatic spam protection and other features.
Recent Comments