Archive for the ‘TechNote’ Category

inline image with base64 & css

Tuesday, June 29th, 2010

今天看到一个有意思的CSS加载背景图的方法:
围观链接先:https://mail.google.com/tasks/android?source=mig&gl=us&hl=en&pli=1

.someimage {
background-image:url(data:image/png;base64,{BASE64 STRING}");
}

保存MSN聊天记录到邮箱

Monday, May 31st, 2010

打算折腾个小东西,保存MSN的聊天记录到Email里,就像Gtalk那样。
嗯。Mark一下。

[zz] Using Redis as a Xapian backend

Tuesday, May 25th, 2010

Xapian 是什么 : Open source search engine library written in C++, with bindings to allow use from other languages as well.
Redis 是什么 :A persistent key-value database with built-in net interface written in ANSI-C for Posix systems

Using Redis as a Xapian backend

MySQL Explain’s type

Friday, May 21st, 2010

Explain的type显示的是访问类型,是较为重要的一个指标,结果值从好到坏依次是:

system > const > eq_ref > ref > fulltext > ref_or_null > index_merge > unique_subquery > index_subquery > range > index > ALL

REF :
http://hi.baidu.com/thinkinginlamp/blog/item/eef0cd119239db17b8127b6f.html

隐藏HTTP头中的X-Powered-By

Thursday, May 13th, 2010

php.ini 设置 expose_php = Off

http://php.net/expose-php

Can’t reopen temporary table

Wednesday, May 12th, 2010

今天碰到MySQL的bug:Can’t reopen temporary table

http://bugs.mysql.com/bug.php?id=10343

再建一个临时表吧。

Rackspace Cloud Server

Monday, April 26th, 2010

转移数据到Amazon S3, 80G的小文件, 单独一个linode速度比较慢。
于是就开了一个Rackspace Cloud Server (256M/10G) . 两个机器一起弄。
出乎意料的好。相当的稳定。不会像linode那样动不动就杀我的转移脚本。。

有机房的缘故吧。
Rackspace Cloud Server 我分配到的ip 上海电信 ping在240ms左右,linode的Fremont机房在160ms左右。

最近用云用上瘾了。逢人就推荐。:)

ntp真是个重要的东西

Wednesday, April 21st, 2010

S3 时间不同步提示的错误:

Are you getting the problem:’The difference between the request time and the current time is too large?’

While logging on Amazon S3 or creating a bucket or uploading an object in a bucket , you might have faced a problem‘ The difference between the request time and the current time is too large ‘ .

The reason of this problem is that Amazon S3 allows only a small timestamp variation up to 15 minutes between the server and its requesting client (user pc). As Amazon is a big backup server of large number of users, security does matter a lot.

Synchronization of time between the server and the requesting client is very important to have an access to Amazon S3.To get rid of this problem you have to adjust the client’s timing so that there is maximum timestamp difference up to 15 minutes.To get rid of this problem set the standard timing and the zone for your system.

cloud

Sunday, April 18th, 2010

折腾了两天cloud,主要是在rackspace和aws两家。

0. cloudfiles 不支持 cname, 且还不支持子目录, 这点不知道是什么缘故, 翻看rackspace的blog, 去年10月份说cname支持正在开发, 半年了.
1. 建立s3 bucket的时候要在最经常操作s3的服务器上操作, 因为aws会根据建立bucket的ip来分配s3服务器.
2. cloudFront走http的话选择download, cloudfront支持cname这点很棒.

最终选择了aws, 80G的话一个月存储费用大概在12 USD, 算上传输的费用, 还是比租用独立服务器要便宜很多.
况且还有CloudFront 作 CDN.

期间搜了一些文档, 随便看看:
gslin大牛,gslin大牛
Comparing CDN Performance (Part 2)
Amazon CloudFront vs. Rackspace Cloud Files CDN Performance

Pingdom Tools : http://tools.pingdom.com/
反观国内, 这方面比国外落后很多。
当然这个只是我的直觉。
我知道的国内CDN服务提供商: chinacache,fastweb,chinanetcenter.
不过都没有做到像国外的那种pay as you go.

FreeBSD / resolv.conf

Thursday, April 15th, 2010

昨天刚拿到一台机器。
老外装的FreeBSD 7.2。
新建个普通用户,登陆发现无法解析域名。

一开始还以为是 限制用户使用系统资源 这个东东。
翻了一些文档没发现什么有价值的东西。

回头看resolve.conf文件的权限被设置root只读了。
囧。难怪不能解析。note一下。