vCard Assistant:将 vCard 导入 Nokia S60v2 手机的辅助工具

2009/09/02 | 00:17 | 分类:Web与移动平台 | 标签: | 1,303次阅读

  晚上为 Nokia S60v2 老机型用户写了一个 PC 端的小工具——vCard Assistant,用于将含有中文姓名的 vCard 文件(可以是 GB、UTF-8 或 UTF-16LE 编码的)转换成 ASCII 字节编码 UTF-8 形式;并可将 vCard 3.0 格式转为 2.1 格式,便于在某些对 vCard 中文姓名或 3.0 标签支持不好的手机中导入联系人。效果如下:
  输入:

BEGIN:VCARD
VERSION:3.0
N:;张三
FN:张三
TEL;TYPE=CELL;TYPE=VOICE:13811112222
EMAIL;TYPE=PREF;TYPE=INTERNET:foo@bit.edu.cn
REV:20090901T035836Z
END:VCARD
BEGIN:VCARD
VERSION:3.0
N:;李四
FN:李四
EMAIL;TYPE=PREF;TYPE=INTERNET:bar@gmail.com
REV:20090901T035835Z
END:VCARD
...

  输出:

BEGIN:VCARD
VERSION:2.1
N;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:;=E5=BC=A0=E4=B8=89
FN;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:=E5=BC=A0=E4=B8=89
TEL;CELL;VOICE:13811112222
EMAIL;PREF;INTERNET:foo@bit.edu.cn
REV:20090901T035836Z
END:VCARD
BEGIN:VCARD
VERSION:2.1
N;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:;=E6=9D=8E=E5=9B=9B
FN;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:=E6=9D=8E=E5=9B=9B
EMAIL;PREF;INTERNET:bar@gmail.com
REV:20090901T035835Z
END:VCARD
...

  这种格式可以被 Best vCard for S60 等软件读取,导入手机通信录。
  vCard Assistant 下载地址(包含源代码):
  http://files.linjian.org/dotNet/VCardAssistant.zip
  http://www.linjian.cn/files/dotNet/VCardAssistant.zip
  (需要 .Net Framework 3.5 平台支持)


  我为什么要写这个东西呢?主要还是自己的需求。我使用的 Nokia 6600 的 PC Suite 只支持从 IBM Lotus Notes、Microsoft Outlook 这类庞大的程序或 Windows Address Book 这种已被放弃的格式中导入联系人。我没有使用这两个商业软件,也不愿使用已经失去官方支持的 WAB 格式,而选择使用跨平台的、广为各类软件支持的 vCard 格式管理联系人,以便在多个系统、软件中直接共享。以前同步联系人时,先将 vCard 导出为 CSV,再使用虚拟机中的 Windows XP 通信录将 CSV 转换成 WAB 格式,然后通过 PC Suite 同步,比较折腾。现在只需要将 vCard 转换一次,通过蓝牙或 Email 发到手机上,用手机端的软件做同步,简便不少。
  事实上我以前也尝试过用 Google Sync 服务在线同步联系人(Gmail 也支持 vCard 导入导出),但同步过程总是异常停止。换用其它一些 SyncML 同步服务问题依旧。最终我在 mobical 网站发现一句话:“Nokia 6600: This device has a known issue where the synchronization may stop working at any time. As far as we can tell this is a bug in the Nokia software.”原来这是 Nokia 6600 的 bug……我也没有找到其它免费的 SyncML for S60v2 客户端,只能作罢。

Imagoxy: A Picasa Image Proxy for Personal Website and Blog

2009/07/17 | 22:59 | 分类:Linux与开源 | 标签: | 1,569次阅读

Picasa had been banned in Mainland China yesterday. I don't know if it is temporary or persistent. Lots of pictures on my blog are stored in Picasa. Unlike Flickr, I found it difficult to replace domain name or IP to pass the URL/IP filter. So I choose another way: download pictures from Picasa server to my Godaddy host, and replace the picture links in my posts from Picasa to my host. I wrote Imagoxy, a tiny PHP toolkit and Imagoxy-WP, a wordpress plug-in to implement this automatically and dynamically. This mechanism will certainly apply additional overhead and occupy more bandwidth. However, it is sustainable for my small website. Experiment shows it works well with wordpress 2.8.1. I make it open-source under a BSD license and you can get it from SourceForge or WordPress Plugin page.

Security issues should be considered carefully before it being used in significant applications. Some measures had been taken, but I hope you to review my codes and eliminate the hidden dangers. If you are interested in Imagoxy, welcome to join the small project at SourceForge and contribute your codes! Thanks. :)

I do not profit from my open source works. But if you really think they are useful, you can click here.

Imagoxy Version 0.53 - Update: 2009/12/10
Imagoxy-WP Version 0.53 - Update: 2009/12/10

Imagoxy

Imagoxy ("image proxy") is a tiny PHP toolkit. It downloads pictures from remote server to local server and relocate corresponding http requests to the local one. It is used to access pictures when the remote server is banned or slow from the network of clients (e.g. Download pictures from Picasa on an unbanned US server and tranfer them to China's viewers where Picasa is banned sometimes).

Licensed under a BSD license.

Install:

1. Modify Imagoxy 'getimg.php' file:
* Set '$work_dir' to the location you wish Imagoxy works at.
* Set '$cache_dir' to the location you wish files downloaded to. (default is OK in most cases)
* Set '$error_file' as the file relocated to when access control denied. (default is OK in most cases)
* Set '$reffer_list' as the legal HTTP_REFERER prefix list.
* Set '$check_reffer_before_download' as whether to check HTTP_REFERER before downloading new picutre.
* Set '$check_reffer_before_show' as whether to check HTTP_REFERER before showing downloaded picutre.
* Set '$legal_pattern' as the legal file URL patterns. (default is for Picasa; you can add more)
2. Update the 'imagoxy' directory to your '$work_dir' and make the '$cache_dir' writable.
3. Configure and deploy Imagoxy front-ends such as Imagoxy-WP.

Usage:

1. [ http://www.example.com/imagoxy/getimg.php?s={original URL} ] In this format (we called 'Imagoxy URL'), the http request will be relocated to a file on local server which is downloaded from the original URL. You can embed the Imagoxy URL into your <img src="..."> label. 'http://' in original URL is omissible and the other protocols are not allowed. Notice: as a parameter, original URL should be url-encoded again even if it has been url-encoded. e.g. 'Pic%20A.jpg' -> 'Pic%2520A.jpg'.
2. [ http://www.example.com/imagoxy/getimg.php?u={encoded URL} ] Also does downloading and relocation. However, you should base64-encode, reverse and then url-encode the original URL. In PHP, these are done by 'urlencode(strrev(base64_encode($original_url)))'. This encoding method can pass the URL filter in certain regions.

Test:

You can write a html page with an Imagoxy URL in <img src="..."> label. Open it locally, you should see the '$error_file'; after uploading it to the server with the URL prefix in '$reffer_list', you will see the relocated picture correctly.

Enjoy it!

Imagoxy-WP

Imagoxy-WP is a wordpress front-end for Imagoxy. Imagoxy downloads pictures from remote server to local server and relocate corresponding http requests to the local one. It is used to access pictures when the remote server is banned or slow from the network of clients. Imagoxy-WP now converts Picasa URLs to local Imagoxy URLs, and you can also add your customed conversion.

Licensed under a BSD license.

Install:

1. Download Imagoxy. Imagoxy is available at https://sourceforge.net/projects/imagoxy/.
2. Configure and deploy Imagoxy on your server as Imagoxy's README file described.
3. Modify Imagoxy-WP 'imagoxy-wp.php' file:
* Set '$imagoxy_dir' to your Imagoxy location, which is the same as '$work_dir' in Imagoxy.
4. Upload Imagoxy-WP php file or the whole directory to your wordpress '/wp-content/plugins' directory.
5. Enable it in the dashboard.

After that, You will see:
<img src="http://lhX.ggpht.com/_WWW/XXX/YYY/ZZZ/sMMM/IMG_NNN.JPG" />
in your blog posts now becomes:
<img src="http://www.example.com/imagoxy/getimg.php?u=AABBCCDDEEFFGGHH" />
Since pictures are downloaded from your own server, it won't be banned then.

Enjoy it!

LisTX: A PHP-based Web Kit for Directory Index

2008/02/13 | 11:11 | 分类:Web与移动平台 | 标签: | 661次阅读

Powered by idealee and me.
Homepage: http://sourceforge.net/projects/listx/

Demo: http://www.linjian.cn/files/

 

Public Description:
LisTX is a PHP-based web kit for listing directories and files of a specific path on a web server. It just looks like Directory Indexing page of apache. If you have a PHP virtual host but you can't configure apache, you may need it.
 
Registration Description:
LisTX is a PHP-based web kit for listing directories and files of a specific path on a web server. It just looks like Directory Indexing page of apache. You can browser directories and files recursively and download files directly.
It is written in PHP. It can run at apache, litehttpd or IIS on various OS's. The only permission for its working is an executable directory, so users need not the accessibility to web server.
Comparing with other products of the same type, LisTX is simple. It has only one PHP web, so it takes little disk space, which is faster than others.