存档

‘科技’ 分类的存档

批量下载新浪共享资料

2011年1月13日 没有评论

新浪(sina)的共享文件(ishare)中有不少比较好的书籍和资料。经过两天研究,我找到一个进行批量下载的方法。最初的思路是找到每个文件的下载链接进行操作,所有的编码和测试工作都是在Ubuntu 10.04下进行的,脚本语言为Perl ,Web浏览器为Chrome。首先对ishare下载页面进行分析,发现这些链接中部分可以使用wget在命令行模式中下载,而更多的被服务器拒绝访问。随后我通过Chrome Dev模式对页面中的JS进行再次分析,发现下载路径被PHP加密无法直接获取,于是决定放弃这种通过源路径下载的方法。有一句Perl名言, “there’s more than one way to do it”。重新对命题进行分析:找到所需下载的文件页面链接,在上述页面中启动下载任务。第一点很容易通过Perl脚本和w3m浏览器实现,关于第二点,上面已经测试了根据源代码使用wget在命令行模式下载。既然是“启动下载任务”,那么是不是可以考虑鼠标点击直接下载呢? 这种最原始的方法说不定就最实用的方法,至少我不用再去纠缠于JS脚本/Cache/解密路径。于是我在万能的CPAN中找到了强大的X11::GUITest,该模块支持鼠标键盘对图形界面的所有操作。理清问题的解决思路: 取得下载页面列表,使用Chrome依次打开每个页面,在每个页面中捕获下载按钮中心鼠标的二维坐标,将鼠标移至指定位置然后点击开始下载,下载完成后关闭页面。根据这个思路编写脚本(下载),测试通过。需要考虑的几点是浏览器打开网页的速度,需要根据网速,文件的平均大小估计文件下载的时间和系统缓存的处理。基于X11::GUITest功能强大,我认为以后实际生活和工作中可以做在自动化操作。比如测试人员根据测试案例设置流程,剩下的就是检查输出和异常处理了,提高测试效率;甚至可以写一些Web游戏“外挂”(偷菜)或者秒杀购买淘宝上的特价物品。

启动日志

2010年5月26日 没有评论

5月15日 Startup Phillip’s Website
5月18日

  • 修改日期参数: 修改the_time参数
  • 调整主页css
  • 安装wp_recentcomment插件
  • 调整sidebar.php中各部分名称及顺序
  • 去掉random posts, 改为recent posts

5月19日

  • 去掉widget中回复人头像
  • 将用户名和发布内容显示为一行
  • 在回复内容区域中, 调整时间和增加文字

5月20日

  • 页面优化: 使用本地头像取代远程连接获取avatar头像, 平均减少700-750ms响应时间.
  • 修改回复栏, 将@author改为对回复帖子的序号.

5月21日 调整侧栏recent post显示摘要内容, 去掉”回复#1楼:”字样
5月26日 将测试域名迁移到www.jikufurito.com

分类: 科技 标签:

Fixed: Can not start mysql service

2008年7月11日 没有评论

Install mysql in CentOS4.5 as default setting, and later find mysqld does not exist.

[root@perl ~]# service mysqld start
mysqld: unrecognized service

[root@perl ~]# mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

Check the current mysql package:
[root@perl ~]# rpm -qa | grep mysql
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
mysql-4.1.20-2.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-devel-4.1.20-2.RHEL4.1

The root cause is no mysql-server package installed. Just use yum to install this package:
[root@perl ~]# yum install mysql-server
Setting up Install Process
Setting up repositories
update 100% |=========================| 951 B 00:01
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for mysql-server to pack into transaction set.
mysql-server-4.1.20-3.RHE 100% |=========================| 30 kB 00:03
—> Package mysql-server.i386 0:4.1.20-3.RHEL4.1.el4_6.1 set to be updated
–> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
mysql-server i386 4.1.20-3.RHEL4.1.el4_6.1 update 9.8 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 9.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): mysql-server-4.1.2 100% |=========================| 184 kB 05:42
http://ftp.cs.pu.edu.tw/Linux/CentOS/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 2.4 MB 03:11
http://ftp.hostrino.com/pub/centos/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 3.3 MB 02:30
http://ftp.twaren.net/Linux/CentOS/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 3.4 MB 00:39
http://ftp.stu.edu.tw/Linux/CentOS/4.6/updates/i386/RPMS/mysql-server-4.1.20-3.RHEL4.1.el4_6.1.i386.rpm: [Errno 4] Socket Error: timed out
Trying other mirror.
(1/1): mysql-server-4.1.2 100% |=========================| 9.8 MB 00:09
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: mysql-server ######################### [1/1]

Installed: mysql-server.i386 0:4.1.20-3.RHEL4.1.el4_6.1
Complete!

OK, the mysqld service can be started now.

[root@perl ~]# service mysqld start
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
[root@perl ~]#

Fixed.

分类: 科技 标签:

Motorola A1200 DB waiting

2008年6月28日 没有评论

My A1200 can not read or create short messages, view address book, and later it displayes “DB Waiting”. I find the solution, backup curent profile,and then “Setting-Clear all setting”. Reboot the phone, it turns well now. Today I have to stay at office and lead the test on 6.0.1 Firmware, while I am not satisfied with some testing engineers’ attitude, they always did not focus on the current job. I can not hold my fury to criticize them directly. These men should not be in my team. As former China coach Milutinovic said: Attitude is everything!

分类: 科技 标签:

Personal Development for Smart People

2008年6月24日 没有评论

Good site for self-motivation.
http://www.stevepavlina.com/

分类: 科技 标签:

Finger-ring available

2008年6月23日 没有评论

In slackware12.1, when update the current ATI driver 8.42 to the latest 8.6. I can use the finger-ring on mice now. By the way, after run ATI install scripts, it also should run “aticonfig” to init some parameters. Till now,the screen mess does not happen again.

分类: 科技 标签:

Review: May 5th – June 18th

2008年6月18日 没有评论

HDD lost issue was found at May 5th, as Liu Changjing verified the units sent to customer. Later, we tried almost all LSI firmware including original 6.0.1, 8.0.1-0035/38, and even the latest 9.0. While all this versions have various problems: HDD lost during fast initializing and slow initializing, and 9.0 can not recognize attached JBOD device at all. After contact with manufactory, and decided to upgrade from current backplane firmware 2.92 to 2.94, tuning the i-Button parameter(Post Delay =2). Till not, neither of above can resolve this issue as it seems we did not find the root cause.

Shanghai, an important customer need high-performance equipment, including Quad-Core, and 16GB Fully Buffer DIMM, it will encountered unexpected shutdown when load very heavy. Now, we find it is caused by no sufficient power supply. A solution is change the fan boards cables to motherboard, which is now shared from the backplane and harddisk.

I’m very tired during these days, and I know I can not lose confidence by myself: Life is going on, I must fight with my fate.

分类: 科技 标签:

Firefox crash by scim

2008年6月16日 没有评论

Fix firefox crash in Slackware 12.1
Error messages:
# firefox
/usr/lib/firefox-2.0.0.14/run-mozilla.sh: line 131: 3048 Segmentation fault “$prog” ${1+”$@”}

Resolution:
This issue is caused by “scim”.
# chmod +x /etc/profile.d/scim.sh
# chmod +x /etc/profile.d/scim.csh

And add a new script “scim_start.sh” to “~/.kde/Autostart” directory:
# cat scim_start.sh
scim -d
It means autostart scim after X start.

Now, firefox return.

分类: 科技 标签:

Install ATI driver in Slackware 12.0

2008年6月14日 没有评论

Yesterday installed Slackware 12.0 on dell Optiplex 320, and find its default video driver “VESA” only support “1024×768 61Hz”. So download the latest ATI Linux driver “ati_driver-installer-8.443.1-x86.x86_64.zip”, execute unzip and run the codes in text mode, it would display a command line gui for step-by-step configuration and setup. Follow the way, final can see the LCD has already support “1280×1024 75Hz”. It’s very cool and has nice gui of my slackware, even more beautiful than former Mandriva.

分类: 科技 标签:

Grown-up Life

2008年5月9日 没有评论

Do you know that the harder thing to do and the right thing to do are usually the same thing? Nothing that has meaning is easy. “Easy” doesn’t enter into grown-up life.

I remember once imagining what my life would be like, what I’d be like. I pictured having all these qualities, strong positive qualities that people could pick up on from across the room. But as time passed, few ever became any qualities that I actually had. And all the possibilities I faced and the sorts of people I could be, all of them got reduced every year to fewer and fewer. Until finally they got reduced to one, to who I am. And that’s who I am.

分类: 科技 标签: