Author: 芳草苑主

  • Windows support hard link and symbolic link as well

    很多地方在解释 Linux 软连接时都喜欢把它比作 Windows 的快捷方式(当然它们是有实质区别的),而且在解释硬连接时找不到 Windows 下的对应事物。

    但,我绝没有想到 Windows XP 也能建立如同 Linux 下的硬连接(真正意义上的硬连接,最简单的办法就是下载 Link Shell Extension 来用),据说 Vista 还能建软连接。是不是我的思维太激进了,总认为 Windows 要成为末日黄花?我看到在 Linux 下很普通的技术在 Windows 里也有就觉得很惊奇。

  • Format date in merge field

    Formating date correctly is one of the troublesome work in all computer languages because remembering how to format is difficult.

    In Microsoft Word, the formatting process is –

    1. Press Alt+F9 to show the merge field code
    2. Add the format string to {MERGEFIELD mydate }
    3. The code looks like {MERGEFIELD mydate \@ “dd/MM/yyyy” }
  • I can’t find a way to assign two handlers to a script

    这可能是一个不可能实现的任务。

    Actinic 的动态部分是 perl 写的,我不想触及 perl,陆陆续续做了很多 extensions,都是 php 写的。Actinic perl 有很多漏洞,其中一个就是会把我的 php 源码暴露。可能 Actinic 的目标用户都是 htmler,根本没指望 phper 会给它写 extensions(我也是没办法,早就不想干了)。我能做的,就是尽可能地调整 php 的代码方式,做到即使源码暴露了,也不包含机要信息。

    我也不打算在 Actinic 浪费时间去研究怎么修改漏洞,只是最近把 apache module 研究了一遍,突然想重提这个历史遗留问题是否可以从 apache 方面给予弥补。漏洞的源头是 Actinic perl 读入我的 php script,当成 html 直接输出。如果能把 handler 再交给 php-cgi,那么 php tag 之间的内容就可以得到解析。

    可是 apache 是以后缀推定 handler 的,那么某个后缀怎么可以有两个 cgi handlers?

  • PSP hidden fees

    我们公司用着 PayPal。PayPal 问题很多,但我认为它仍不失为最好的 PSP (或者说最适合的)。

    我老板不这么认为,他认为 PayPal 给顾客付款带来很多障碍(主要是限制已注册信用卡单独付款)。我认为这种限制是必要的,PayPal 不只是 PSP 产品,它要做 Express Checkout,它要给 seller protection (同时也给buyer protection),它必须改变常规信用卡付款的逻辑过程。

    很多顾客不认可这种逻辑,也有顾客根本就反感 PayPal (总有些人在 PayPal 或 ebay 上有过失望或绝望的体验),导致我们最终决定换一个 PSP。如果当初走上 PayPal 算是我积极推荐的话,这次选择新的 PSP 我不想过多参与了。

    最后选了个 Protx,因为它的收费太诱人了,每季度1000笔交易以下月费£20,以上10p每笔(似乎Protx的定价模型有问题,交易越多单笔交易反而更贵?不过我不去深究 Protx)。网上对 Protx 的评论都是正面的,我主要关心是否有 hidden fees,没见 Protx 负面报导。

    于是老板着手落实。很快他就发现还有一个 IMA (internet merchant account) 费用没在 Protx 计算在内。这是一个灰色地带,因为我了解的 PSP 除了 PayPal 就是 WorldPay,它们都不牵涉 IMA(或者说它们本身就是 IMA),所以我是第一次听说从 PSP withdraw money to bank account,不一定是全额入帐。

    PayPal 和 WorldPay settlement 都是全额入帐(小金额除外),Protx 就不是,中途还要扣掉按笔次数或金额百分比交易费。因为 settlement fees 不是 Protx 赚去,所以也不能说 Protx 有 hidden fees。PayPal 和 WorldPay 都是要收 transaction fees 的,Protx 不收 transaction fees 并不意味着它就是最便宜的 PSP。当初我初识 Protx 时觉得它异常便宜,一直想不通 Protx how to cover credit card fees charged by credit card companies,如今想通了,该交的是逃不掉的。

  • I can’t find a way to group releted transactions in PayPal history download

    I have tried all formats of PayPal Download History, and found “Comma Delimited – All Activity” is the most comprehensive one. I send it as an attachment for your review. My problem with this history is – every transaction has a different Transaction ID, it is not give me enough information to group related transactions. Basically, it is missing a column Parent Transation ID (or call it Related Transaction ID, whatever).

    Some virtual terminal transactions have an update transaction, some don’t (depends on whether AVS matches). I can’t use any ID number to trace a update transaction back to its parent transaction ID, so I might calculate one transaction twice.

    PayPal should improve its data download format. At least, it should provide an extra column of “Parent Transaction ID” (indicate its parent transaction if any), or “Unique Tranaction ID” (all related transactions have a unique transaction ID) for me to group related transactions.

  • Zend PHP Server is out

    事情总是很凑巧,这两天我在找 PHP Application Server,没找到理想的——

    1. Phplens 虽然有我想要的功能,但做得太粗糙,而且不免费(免费的只支持30条记录,毫无用处)。
    2. Zend Platform 高不可攀。
    3. Phpappl 虽然免费,好多年前停止更新,不敢用。

    今天 Zend 告诉我说,PHP Server 发布了(虽然还是测试版)。看来同我一样有这种需求的用户不少,被 Zend 盯上了。但各人对 application server 理解略有不同,不晓得 Zend PHP Server 是不是就是我想要的 PHP Application Server,得抽空试用一下。

  • Release on demand: new idea for courier service

    On some ocassion, we need some kind service of “release on demand”. Courier service provider should think of offering it as a value added service.

    The scenario is – We have some customers are desparate for some products, but they can not pay the money up front. It is understandable. There may be a problem with their card issuer at the time they place an order. If customer need the products the next day, we must dispatch one day earlier before they can sort out the payment problem. Most customers have good history – if they say they will pay, they will pay. We do not want to lose those customers. The best solution would be we dispatch the order once we receive the order, then the order is with the courier, and the courier must hold the order for us until we advise them to release the order. That saves time on route.

    Will any courier be thinking of launching this new service?

  • So many bugs in ispconfig

    ispconfig 可以做 hosting account management,但给我的感觉是打磨得不够精致。如果把它应用到生产环境,如果不怕客户抱怨,如果喜欢捉虫游戏,那倒可以用 ispconfig,毕竟免费的嘛,我看功能跟 isp 自己开发的 control panel 差不多(如 godaddy 的 turbo panel)。我感觉 ispconfig 还无法跟 cPanel, plesk 相抗衡,用在开发环境还凑合。

    凭我的肉眼,我就发现了以下几个说大不大,说小不小的毛病。

    按 ispconfig installation on Fedora documentation 一步步安装完毕以后,其实并没有安装 mod_fastcgi 或 mod_fcgid (暂且算是 documentation 失误吧),但控制面板里已经可以选择 php 模式为 fastcgi。我只好自己摸索着装 mod_fcgid。

    但未装 mod_fcgid 倒没有问题,装好 mod_fcgid 重启 apache 反而会出错。因为 ispconfig.conf 里预设的 <IfModule mod_fcgid.c> 生效了,而里面一条 FCGIWrapper /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter .php 会出错。原因是 /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter 不存在,又得自己动手制作一个。

    另外一个问题是,新建第二个站点时,ispconfig 不会自动添加 namevirtualhost directive,导致 apache 启动时会有一个 warn message,但不致命。

    综 上,ispconfig 对 conf 文件生成和管理得不是很好,而 ispconfig 本身也是基于 apache 的 conf 来配置的,所以 ispconfig 一不小心就搞砸了,连 apache 都启动不起来,连更正的机会都没有了。用着 ispconfig,还得时刻准备着 ssh 手动去更正搞砸了的 conf 文件。

  • Do it inhouse

    技术方面,我喜欢亲力亲为,另一方面,我还没有资源可以让我不亲力亲为。

    我曾分析过 outsourcing seo 服务的弊端,here is another negative case of outsourcing email marketing.

    I received a newsletter from Tesco today, and happened to click on one of the embedded links. (I am not a newsletter reading fan. I seldom click on embedded links.)

    I got a “404 Not Found” error when I natigated to that url. After a few seconds, I became aware Tesco link tracking system is hosted on http://ad.doubleclick.net/, which is on my black list. I assume Tesco have a third party doing email marketing for them, otherwise Tesco on their own have no reason to use ad.doubleclick.net as a click tracking provider.

  • Google sandbox applied to my company’s site

    每次更换域名都是一次痛苦的经历,但没办法,业务需要我的公司又更换了新域名。

    原域名在一个主要关键词 google 排名第5(不算很好,勉强凑合),更换后排名第9。这样排了一个月左右,然后突然消失,不过一个星期以后就回来了,还是第9。不过过了一个多月,又消失了(用工具查了一下,准确地说,是被埋在416位)。

    第二次消失的时间比较长,差不多三个星期。期间我们查了各种被 google 惩罚的可能,最后确定我们没做错事,最大的可能是进入了传说中的 google sandbox。于是一方面保持耐心等待,一方面该做的优化继续做。今天早上排名回来了,第5。

    我这下对 google sandbox 有很更深的体验。