Blog

  • Magento not rebuilding image cache

    I changed a server for Magento sites. When I migrated the sites, they looked fine. However after I flushed Magento image cache, all sites stopped working. Web pages were not completed. The code stopped rendering after the first product image’s “src”. But there was no error message afterwards.

    At first I thought it was file permission problem. But it was not.

    Then I thought it was some rubbish left over after flushing cache. So I took the advice by removing the folder media/catalog/product/cache and clearing everything under var. But the problem was still there.

    Then I realised it was php not generating images for Magento. Magento requires php-gd to generate images. My new server did not have php-gd installed. If I was installing a Magento instance, I would not get through. But I migrated the sites. So they “looked” fine.

    After installed php-gd, product images came back.

    By the way, Magento requires some other PHP extensions to run. I took the chance to install them all.
    pdo_mysql
    simplexml
    mcrypt
    hash
    gd
    dom
    iconv
    curl
    soap

  • Ngnix 502 bad gateway error after a recent php-fpm update

    I recently updated php-fpm from 5.4.16 to 5.5.16. After the update, Nginx comes up with 502 bad gateway error. Googling the error pointed me to look into permission of php socket file.

    In php-fpm 5.4.16, if no value is given to listen.mode, php socket file is assumed to 0666.

    But in php-fpm 5.5.16, if no value is given to listen.mode, php socket file is assumed to 0660.

    That is why Nginx no longer has permission to php socket and occurs 502 error.

  • A simple multi-skills test

    Excellent Excel
    Excellent Excel
    考考各位看官的猜想、推理、数学、EXCEL能力:

    新建一份EXCEL表格(Google Spreadsheet 也行),在 A1:I9 的每个单元格内输入以下公式——

    =IF(COLUMN()>ROW(),"",VLOOKUP(COLUMN(),$L$1:$M$9,2)&VLOOKUP(ROW(),$L$1:$M$9,2)&IF(COLUMN()*ROW()<10,"得","")&IF(COLUMN()*ROW()<10,VLOOKUP(COLUMN()*ROW(),$L$1:$M$9,2),VLOOKUP(INT(COLUMN()*ROW()/10),$L$1:$M$9,2)&"十"&VLOOKUP(MOD(COLUMN()*ROW(),10),$L$1:$M$10,2,FALSE)))

    请问,应该在表格的什么地方填入什么预设值,才能让 A1:I9 的内容变得有意义?

    提示:有 20 个单元格需要预设值。

  • BT Infinity speed tests

    这两天专注于测试 BT Infinity 访问国内外的网速,有了一个总结性呈辞。

    我发现三个较好的测试网站是:

    1. http://myspeedmeter.net/:它是众多带宽测速网站中唯一能测到我的 BT Infinite 满速(下行 76Mbps,上行 19Mbps)的网站。但这个测试结果只能在连接它的伦敦服务器时能达到,连接它在世界各地其他区域的服务器时仍有较大差距,可能瓶颈在海底光缆上。

      BT Infinity speed test result on Myspeedmeter
      BT Infinity speed test result on Myspeedmeter
    2. http://openspeedtest.com/:它用的是纯 HTML5 做测试,没有用到 Flash 或 Java。在你的各种插件都已崩溃或临近崩溃的浏览器里(当然要足够新版),或在手机上不想安装 app 就直接测试,都是很好的选择。但如前所述,它无法测得我的满速,可能我的带宽比它服务器的带宽还强。

      BT Infinity speed test result on Openspeedtest
      BT Infinity speed test result on Openspeedtest
    3. http://sh.189.cn/support/netreport/:它是中国电信搞的网速测试。如果在中国,对连接国外速度没有信心,也可以先测测国内的速度吧。当然我亲测的话,也是不可能满速的。

      BT Infinity speed test result on China Telecom
      BT Infinity speed test result on China Telecom

    至于其他两个名气更响的英国宽带网速测试网站,在我这里不推荐。

    1. http://speedtest.btwholesale.com/:它是 BT 公司嫡出的测试工具,但在测试 BT Infinite 时却无法象 myspeedmeter 那样获得满速的结果。

      BT Infinity speed test result on BT Wholesale
      BT Infinity speed test result on BT Wholesale
    2. http://www.broadbandspeedchecker.co.uk/:它在 Google 搜索 broadband speed test 时排名第一,自己也号称 “THE UK’s No.1 Broadband Speed Test”,也是我在 ADSL 时代用得最多的测网速的工具,但它也是无法满速,在 VDSL 时代中没有与时俱进。

      BT Infinity speed test result on Broadbandspeedchecker
      BT Infinity speed test result on Broadbandspeedchecker
  • First money back from price guarantee

    Asda price guarantee voucher
    Asda price guarantee voucher

    总是见商家讲自己的价格是最低的,如果不是,补你差价(有的甚至补差价的110%)。很久以前不知那位老师分析过,这种价格保证(Price Guarantee)的促销模型是很棒的,但我潜意识里不愿意被这种促销摆布。我认为商家有这个时间、精力搞价格保证,不如实实在在把价格降到最低;消费者有这个时间、精力去拿回这个差价,不如直接从最低售价的商家购买商品。

    但是,不久前有朋友告诉我,各大超市的价格保证并不是我想的那样,是实实在在的退差价,索偿过程在线自助完成,无需找经理,无需提供竞争对手的更低售价的证据。真是活到老、学到老,我真不知道这促销形式已经进化成这样了。我之前在超市购物,浪费了多少索偿机会啊!

    于是,我收集了最近在 ASDA 的四张购物凭证,上网去价格保证网站,输入交易号,竟有两张得到补偿,其中一单交易额为 £93,补偿高达 £14.49,大大出乎我意料。

    看来大超市已经把价格保证落到了实处,当然要享受价格保证有少许条件限制,这些条件并不高,很容易满足,有兴趣大家去读读各超市的条约。唯一例外的是 Waitrose,不务实,只声称它的价格与 Tesco 持平,不参与价格保证行动。

  • Google Story can be an artist

    Google Now 可以当个小蜜,但 Google Story 可以堪称一个艺术家。

    她能把非常稀松平常的照片修饰得别有韵味,还能把本不平常的照片装点得非常有气势。

    对比我们花大价钱请设计师设计宣传画册,得到的效果不过如此,而 Google 是机器生成的 Story 相册,竟能 PK 人类 50% 的设计师,不禁有些气馁。

    Google Story 1
    Google Story 1
    Google Story 2
    Google Story 2
    Google Story 3
    Google Story 3
    Google Story 4
    Google Story 4
    Google Story 5
    Google Story 5
    Google Story 6
    Google Story 6
    Google Story 7
    Google Story 7
    Google Story 8
    Google Story 8
  • Be reponsible for own content

    今天有朋友分享了以下两个图片,不知她是哪里看来的,总之她是晕了。

    Forged Libai Poem predicting Germany would win FIFA 2014
    Forged Libai Poem predicting Germany would win FIFA 2014
    Forged Libai Poem predicting Argentina would win FIFA 2014
    Forged Libai Poem predicting Argentina would win FIFA 2014

    本来我是准备一笑了之的,因为今年以来李白的各种预言诗已经看多了。但回想起昨天跟公司新员工交流,我讲到互联网以讹传讹的东西很多,而各种社交媒体让各种无节操的博主、群主们更容易为博取眼球(转化为IP、PV、粉丝数)无底线地骚动,直接导致很多真正有用的信息、权威的网站被湮没。这是我个人潜意识里排斥社交媒体的一个原因,但是如果我们不占领这个平台,会被更多的别有用心的人占领,是另一种层面的不进则退,非常无奈。但是我们控制不了人家的内容,我们所能做的惟有对自己的内容负责。我们的网站仿佛处于淤泥里,要让初访的用户知道我们是纯洁的、我们是权威的(其实也不要期待初访的用户会把我们定位得那么高,只要让他们知道我们是有节操的),有一点必须要做到的:不要出现错别字、注意各种细节,包括全半角的标点符号。这是以小见大,也是值得恒久关注的一件事。

    恰逢此时出现李白的诗,我觉得是很好的反面教材。但我又怕真的是我孤陋寡闻,以我的已知盖未知,不是科学的态度,最后让对方博主笑话,所以我专门花了半小时,考证了李白诗词全集,有979首诗词,里面既没有《赏雪杂感》,也没有《观山》,然后我再来写这篇文章。

    最后,我还是感谢互联网,瑕不掩瑜,没有她,我不可能在半小时内完成考证。这也说明另一个问题,权威(这里指的是李白诗词全集)不来自于社交媒体。要做权威,不要指望社交媒体。对社交媒体的使用方针是,要它为我们所用,而不要被它摆布(我指有些社交媒体的规则太复杂)。

  • Stupid Baidu

    Baidu rejects Gmail
    Baidu rejects Gmail

    要不是 Google Drive 在中国不好使,我是不屑于申请百度云盘的。申请了百度云盘,百度还要进行邮箱验证,我填了一个 Google Apps 的邮箱地址,百度竟然给我一个错误提示,叫我使用主流邮箱!

    为什么一定要逼企业邮箱用户混迹于国内的免费邮箱?难道目前还有比 Google Apps 更好的邮箱服务?就算有,也不要逼我去拿一个别的邮箱来申请百度账号啊!我觉得百度的这个逻辑有点蠢:可能是在中国相对封闭的互联网环境下养成的思维。

    拓开来讲,中国的互联网企业要和国际接轨还有很长的路要走。

  • No-IP becomes no IP today

    今年是 DDNS(动态域名)的多事之秋。5月初最早最出名的 DDNS 服务商 DynDNS 中止免费服务,所有服务项目开始收费。我在想,DynDNS 自信过了头,凭什么用户要交钱而不是直接离开 DynDNS?!

    总之,我是选择离开 DynDNS 改投 No-IP 的环抱。

    No-IP domains seized by microsoft
    No-IP domains seized by microsoft

    经过几个月观察,No-IP 还是很稳定的,直到今天,No-IP 塌了半边天。今天,我的IPPBX监控程序不停在提醒我,我家的 IP 地址和 No-IP DDNS 解析出来的 IP 不一致,这通常是在路由器掉线重拨,IP 地址刚发生改变才会收到的邮件,我不停收到几百封这样邮件,我还以为是宽带出问题了,直到吃晚饭时,收到 No-IP 发来的一封邮件:

    We want to update all our loyal customers about the service outages that many of you are experiencing today. This is NOT A TECHINCAL ISSUE WITH NO-IP.
    This morning, Microsoft served a federal court order and seized 22 of our most commonly used domains because they claimed that some of the subdomains have been abused by creators of malware. We were very surprised by this. We have a long history of proactively working with other companies when cases of alleged malicious activity have been reported to us. Unfortunately, Microsoft never contacted us or asked us to block any subdomains, even though we have an open line of communication with Microsoft corporate executives.

    We have been in contact with Microsoft today. They claim that their intent is to only filter out the known bad hostnames in each seized domain, while continuing to allow the good hostnames to resolve. However, this is not happening. Apparently, the Microsoft infrastructure is not able to handle the billions of queries from our customers. Millions of innocent users are experiencing outages to their services because of Microsoft’s attempt to remediate hostnames associated with a few bad actors.

    Had Microsoft contacted us, we could and would have taken immediate action. Microsoft now claims that it just wants to get us to clean up our act, but its draconian actions have affected millions of innocent Internet users.

    回家一测,果然是 noip.me 不解析任何子域名了。我在上面有三个子域名,全部中了躺枪。我赶紧按照 No-IP 的提示,将 DDNS 换用还未中枪的 onthewifi.com 子域名来解析。

    我只是没想通,No-IP 的域名怎么归着微软管?但这个事件说明:为了域名的健康,远离微软。小庆幸一下:我奉行的“尽量不用微软产品”的方针大致是正确的。

  • Watermelon is now available at Booker

    自从前年知道 Booker 卖西瓜,又大又甜又便宜,每年盼着买,一买就很多,找找小时候夏天床底下塞满西瓜的感觉。今年我从春夏之交就关注 Booker 西瓜啥时上市,今天终于等到了,就想去拉一车回家。

    Booker 无籽西瓜只卖夏季三个月左右,说明它不是反季或大棚种植,更符合纯天然概念。它个头中等,每个 6 KG 有强,售 £2.50/个,非常超值。

    Booker watermelon
    Booker watermelon

    按我原来的标准,西瓜再大,也无非芝麻小事,是难登博客大雅之堂的。但最近一期《非诚勿扰》有个男嘉宾专写这类没深度的文章,还能靠此周游世界。我想我是不是也可以将我的生活经验汇编成册,或许可以帮助到刚来英国的人。