2010-10-23

Upgrade to python3.1.2 in my Arch box, phew!

When I did
yaourt -Syu --aur
yesterday, I found that a lot of packages with new version available. Wow, what happed?  I checked those packages, most of them were python related.  I saw python3.1.2 there in the upgrade list. Archlinux will go with python3?! Did some google search, found the blog entry.  Yep, arch is a real bleeding edge distribution.

However I am not sure what is gonna happen if I replace python with python2 and install python3 as default python.  All python scripts with #!/usr/bin/python may have problem. also, those applications using old python libraries would not run smoothly either. It was late, I just added python python2 to IgnorePkg, and did the upgrade.

Today I rethink about it. If  Arch maintainer had done a lot of rebuild work and decided to make the transition, it is worth trying to upgrade! At least all packages in [core] should not have problem (hopefully). For the packages in aur, I can rebuild again by myself. So I removed python and python2 from IgnorePkg, executed -Syu.

After the upgrade, I did followings.

- link /usr/bin/python to /usr/bin/python2.
Most python scripts were still developed with python2.x.  This will make them still working without changing those scripts' shebang.

- rebuild and reinstall packages in AUR
Some changes need to be made in PKGBUILD files during installation, particularly for those marked as 'out-dated' but no newer version available yet packages. for example, tpfand and tpfan-admin. (Thinkpad fan control) are looking for /usr/lib/python2.6/... libraries in building phase. Just pointing to /usr/lib/python2.7/... will get them rebuild and work.

- Oops, vi/vim/gvim 7.2 doesn't work any longer! 
since I am not yet used to working with vim 7.3. I put vim-runtime, gvim into IgnorePkg. but vim7.2 needs libpython2.6.so.1.0., which doesn't exist anymore. I can download vim source code and rebuild. But I did it in a dirty/lazy way, well, I like dirty. ;)  I think there might be other applications need libpython2.6 as well, so I made libpython2.6.so.1.0 link to the python2.7 library.  then vim is back! 


So far so good, although I haven't got time to test all my applications.

probably the transition of Arch will push some teams to make python3 compatible releases, e.g. pygtk, pyqt, django...

2010-10-21

选择不同视频清晰度,格式来下载youtube视频的脚本

因为某些原因。需要把一些youtube视频下载到本地。youtube发布视频的页面也更新了。网上一些办法有的不好用。而且youtube现在提供不同的清晰度和视频格式(flv, mp4,3gp),如果下载到本地,能选择格式和清晰度,就比较理想了。 于是就有了这个脚本。

因为脚本主要自用,所以不是非常完善:

  •     只输出到~/Desktop
  •     下载的文件名是video id,而不是title。 因为title有时包括一些文件名不允许的字符,懒得再处理了

现在还没需要批量下载。如果有,下一步就加上个批量下载的功能,顺便把输出目录变成用户输入参数。

脚本的代码在这里:

youtube downloader


 运行时的截图是这样的:

2010-10-20

Time is flying... I am back!

这个blog应该是我2003年左右申请的,那时候还是blogspot。可后来因为国内访问起来有困难,就搬家到msn spaces了。 没想到,微软不想继续这个服务了,全部用户都要强行搬迁到word press. 而且word press国内访问也不是很顺畅。 干脆我就接着转到这里算了,只要我自己能看到就行了。 时间很快,一转眼几年了,又回来了。呵呵。 给blog改了个名儿,接着用了。

几年间变化挺多。

工作经历了从北到南,又从南回北的转变。

摄影,仍然是瘾大技术差。可装备却越折腾越高级。 从以前的D70 + 18-70 到现在的D300 AF Nikkor 35mm/F2D, Nikkor 85mm f/1.8D, Nikkor AFS 18-70mm ED, Sigma 10-20mm 还有SB-800灯。

常用的系统从Ubuntu已经彻底换成了Archlinux.

生活上,最大的变化就是有了下一代啦!

最近有些东西需要记下来,等有空总结一下慢慢贴上来。

blog又重新开始了。