一直一来,自己使用公司的台式机+自己的笔记本,资料管理都比较混乱。特别是最近这几年笔记本玩的比较勤,从之前的T23到R50p,再到T43,再到T60,每次重装系统,数据的迁移都是一个很大的过程,而且之前一直偷懒,都是全量copy备份,再有选择的恢复,导致数据更是有些乱和重复。


两年前有过一次硬盘异常,做了一些数据备份,之后也没有特意坚持和继续,今天同事的笔记本硬盘从维修商那里拿回来,坏掉的500G硬盘没能恢复出任何数据,丢失了很多资料,文档和邮件,比较可惜,这个也提醒我,要做好数据备份拉。

备份之前,先将大概的数据文件进行了分类整理,花了2个多小时,但还没能整理好,还是有些乱,但还是整理好了几个大的可以备份同步的目录,接下来就是使用GoodSync同步了4个目录到移动硬盘上,整体的数量在12G左右,还有大量的文档因为笔记本上也不是最新的,所以没有同步备份。

另外今天也记起来公司使用的台式机也已经使用了快4年,得赶紧申请换机器,做好数据备份,不然那里的东西更多,所有的邮件都在那里保存,没有任何备份呢。

接下来的工作:将笔记本上的资料进一步整理优化分类,删掉或者打包过时的文档,尽量提供文档的使用率。台式机上的数据也要做一些分类和整理,做好备份。



现状:T60


电脑型号  LENOVO 20077JU
计算机系统  Microsoft Windows 7 旗舰版  (32位)
CPU  (英特尔)Intel(R) Core(TM)2 CPU         T7400  @ 2.16GHz(2167 MHz)
主板  LENOVO 20077JU
内存  3GB(   )
主硬盘  500 GB (西部数据 WDC WD5000BEVT-22ZAT0 已使用时间: 2467小时)
显卡  ATI Mobility Radeon X1400 (128 MB)
显示器  联想 LEN4043 32位真彩色 60Hz
声卡  High Definition Audio 设备
网卡  Intel(R) PRO/1000 PL Network Connection

根据资料,硬盘接口是SATA1,上Intel的X25-M会有点浪费了,接口限速:(
所以现在还是先观察一下T60的主板情况,然后再考虑升级。

GoodSync安装折腾

By 谷多 on | Life / Soft

之前曾经在一篇日志中记录了一个好用的同步软件GoodSync,但新使用T60之后这个软件没有安装。一晃一年多过去了,这个软件的版本突飞猛进,已经到版本8.5.1.1了,体积也从之前的1M多膨胀到了5M多。


每次使用Google找GoodSync,居然都会被墙,本来想找最新版本的,但破解实在不好找,浪费了我2个小时也没能搞定。最后找出了以前下载的老版本7.2.2安装,这才算搞定。当然安装老版本之前,需要把之前的相关License文件删除,用Everything查找GoodSync就很方便的找到了,注册表信息不用清理。然后,再升级安装新版本,目前来看一切正常。

这个新的版本已经支持sftp,可以试试网络备份了。

修改了网站样式

By 谷多 on | Work / MT|WP
借用dbanotes.net,修改了如下CSS:
/styles.css,内容如下:

@import url(/mt-static/themes-base/blog.css);
@import url(/mt-static/themes/unity-blue/screen.css);

看起来清爽了不少,再次感谢 Fenng。

同时,也针对 Entry Summary 模板,加了如下信息:

<p>--<acronym title="End of File">EOF</acronym>--</p>

学习~

MT的Design->Themes功能慎用

By 谷多 on | Work / MT|WP

如果调整,则之前自定义的模板会全部丢失,恢复非常麻烦,估计只能通过数据库进行恢复。


今天闲着蛋疼,手工调整了一下,悲剧了,通过调整数据库才恢复之前的模板,这里的操作过程后续会完整的再来整理一下。

现在的进展情况:直接使用了之前的备份DB,目前功能正常,下一步我想想如何做到只恢复做这个改动影响的相关数据库表。


相关操作,xxx为数据库名,新的数据库需要到cPanel后台去新建一个。

1)导入原有数据到新库:

mysql -uxx -p xxx < xxx.dump.20101211

2)修改gi-bin/mt/mt-config.cgi到新的库
ObjectDriver DBI::mysql
Database yimutian_xxx

3)测试上述是否升级正常恢复到原来的模板设置


备份新库和老库:
mysqldump -uxxx -p xxx > dump.20101212.new
mysqldump -uxxx -p xxx > dump.20101212.old.bad

导如新库数据到原DB:
mysql -uxxx -p xxx < dump.20101212.new
恢复mt-config.cgi



参考了 MySQL Performance Blog 上的很多内容,同时浏览了 High Performance MySQL, Second Edition 这本书中部分内容,对MySQL索引的使用和优化有了一些新的认识。

主要有几点:
1)充分利用聚集索引和覆盖索引的优势,另外注意使用的场景和条件。
2)书中对Optimizing Sorts和Optimizing LIMIT and OFFSET分别放在了2个不同的章节,但说的有一个共同点。


InnoDB 索引
聚集索引 - InnoDB,MyISAM不是
Clustered Index
非聚集索引
non-clustered indexes (Secondary Indexes)

其它概念
联合索引(组合索引)
composite indexes
Multiple-Column Indexes
覆盖索引
Covering Indexes

MySQL高效使用索引
Using index to find rows
The main purpose of the index is to find rows quickly - without scanning whole data set.
Using Index to Sort Data
Another great benefit of BTREE index is - it allows to retrieve data in sorted form hence avoiding external sort process for executing of queries which require sorting.

MySQL高效使用索引
Using index to read data
Some storage engines (MyISAM and Innodb included) can also use index to read the data, hence avoiding to read the row data itself.
If MySQL is only reading index and not accessing rows you will see "using index" in EXPLAIN output.

让MySQL使用正确的索引
有索引就使用"最好"的索引,除非优化器认为使用表扫描更有效。
是否使用扫描取决于是否"最好"的索引跨越超过(30%)的表。
其它因素:例如表大小、行数和I/O块大小,固定比例不再决定选择使用索引还是扫描。

有时MySQL不使用索引,即使有可用的索引。一种情形是当优化器估计到使用索引将需要MySQL访问表中的大部分行时。
(在这种情况下,表扫描可能会更快些,因为需要的搜索要少)。然而,如果此类查询使用LIMIT只搜索部分行,MySQL则使用索引,因为它可以更快地找到几行并在结果中返回。

OPTIMIZE
ANALYZ
USE/Force INDEX
IGNORE INDEX
Negate use of PRIMARY KEY
Make MySQL think the problem is harder than it really is


MySQL如何优化排序
在某些情况中,MySQL可以使用一个索引来满足ORDER BY子句,而不需要额外的排序。
即使ORDER BY不确切匹配索引,只要WHERE子句中的所有未使用的索引部分和所有额外的ORDER BY 列为常数,就可以使用索引。

索引的问题
增加了写操作的开销
非序列增长主键带来的开销

理想
只有一个聚集索引
查询只根据主键来进行
插入数据主键顺序递增
使用合适的最小类型
...
->Sphinx

==============================================================

Optimizing Sorts

The last issue we want to cover in this case study is sorting. Sorting small result sets
with filesorts is fast, but what if millions of rows match a query? For example, what if
only sex is specified in the WHERE clause?
We can add special indexes for sorting these low-selectivity cases. For example, an
index on (sex,rating) can be used for the following query:
mysql> SELECT <cols> FROM profiles WHERE sex='M' ORDER BY rating LIMIT 10;
This query has both ORDER BY and LIMIT clauses, and it would be very slow without
the index.
Even with the index, the query can be slow if the user interface is paginated and
someone requests a page that's not near the beginning. This case creates a bad com-
bination of ORDER BY and LIMIT with an offset:
mysql> SELECT <cols> FROM profiles WHERE sex='M' ORDER BY rating LIMIT 100000, 10;
Such queries can be a serious problem no matter how they're indexed, because the
high offset requires them to spend most of their time scanning a lot of data that they
will then throw away. Denormalizing, precomputing, and caching are likely to be the
only strategies that work for queries like this one. An even better strategy is to limit
the number of pages you let the user view. This is unlikely to impact the user's expe-
rience, because no one really cares about the 10,000th page of search results.
Another good strategy for optimizing such queries is to use a covering index to
retrieve just the primary key columns of the rows you'll eventually retrieve. You can
then join this back to the table to retrieve all desired columns. This helps minimize
the amount of work MySQL must do gathering data that it will only throw away.
Here's an example that requires an index on (sex, rating) to work efficiently:

mysql> SELECT <cols> FROM profiles INNER JOIN (
    -> SELECT <primary key cols> FROM profiles
    -> WHERE x.sex='M' ORDER BY rating LIMIT 100000, 10
    -> ) AS x USING(<primary key cols>);



Optimizing LIMIT and OFFSET

Queries with LIMITs and OFFSETs are common in systems that do pagination, nearly
always in conjunction with an ORDER BY clause. It's helpful to have an index that sup-
ports the ordering; otherwise, the server has to do a lot of filesorts.
A frequent problem is having a high value for the offset. If your query looks like
LIMIT 10000, 20, it is generating 10,020 rows and throwing away the first 10,000 of
them, which is very expensive. Assuming all pages are accessed with equal fre-
quency, such queries scan half the table on average. To optimize them, you can
either limit how many pages are permitted in a pagination view, or try to make the
high offsets more efficient.
One simple technique to improve efficiency is to do the offset on a covering index,
rather than the full rows. You can then join the result to the full row and retrieve the
additional columns you need. This can be much more efficient. Consider the follow-
ing query:
mysql> SELECT film_id, description FROM sakila.film ORDER BY title LIMIT 50, 5;
If the table is very large, this query is better written as follows:
mysql> SELECT film.film_id, film.description
    -> FROM sakila.film
    ->    INNER JOIN (
    ->       SELECT film_id FROM sakila.film
    ->       ORDER BY title LIMIT 50, 5
    ->    ) AS lim USING(film_id);
This works because it lets the server examine as little data as possible in an index
without accessing rows, and then, once the desired rows are found, join them against
the full table to retrieve the other columns from the row. A similar technique applies
to joins with LIMIT clauses.

==============================================================

1.FastDomain的工作人员的效率还是非常高,提交Ticket之后几分钟就收到了QQ Mail中的回信。

2.备份,升级过程非常顺利,实际只是升级MT的Professional Pack。
3.简单修改了一下模板,将评论部分去掉了。
4.针对类目的模版页,本来想修改一下,将默认的最近10个Post扩大一下,但发现这个和首页好像也是使用同一个变量,还是算了。

好久没ssh进去了,今天准备做数据备份和做MT5.04 升级却发现无法登录,相关信息如下:

Your shell account is NOT enabled.

Please FAX the following message to +1 (801) 765-1992:

=====================================================
From: xxx@xxx.com
Subject: ENABLE SHELL xxx@guduo.net

+-------------------------+
|                         |
|                         |
|   BLOW UP OF PHOTO ID   |
|                         |
|                         |
+-------------------------+


Or, submit a ticket to our helpdesk at:
http://helpdesk.fastdomain.com/

Or scan and send your PHOTO ID as an email attachment.

现在都感觉有些担心了?为啥需要我提供这个信息?

不过比较奇怪的一点是,plink居然还是可以正常访问做ssh tunnel的。

"媒体"的悲哀

By 谷多 on | Life / IT

缺乏基本的公正性,中立性,专靠标题吓唬人,误导人,断章取义,打击竞争对手,似乎成为今日中国所谓的主流媒体的摇钱树。


需要给公关费的新闻刊发,需要给好处费的新闻下架,需要给赞助费的新闻头条,所有的这一切,都在中国这个神奇的土地上不停的发生,而这其中最大的毒瘤,就是所谓的不知廉耻的三大门户:新浪,搜狐,网易。

希望有一天,这些恶人能自食其果,被时代所抛弃,被人民所抛弃,这个世界,不应该只有你们这些喉舌的发嗲和呻吟。

为了迎接即将到来的亚运盛事,在11月和12月期间,作为亚运高级合作伙伴的广东移动将会为广大市民提供免费WLAN上网业务,市民和游客只需到广东移动WLAN热点所覆盖的区域即可免费享用无线上网。

(亚运期间免费)短信方式:

办理:发送KTWLAN发送至10086(深圳客户编写短息"SQWLAN"发送到10086开通业务)

取消:发送QXWLAN至10086

修改WLAN密码:发送XGWLANMM#原密码#新密码至10086

重置WLAN密码:发送CZWLANMM至10086

帮助:发送HWLAN至10086
WAP方式:wap.gd.10086.cn


http://221.179.9.18:8080/bpss/jsp/intro_Wlan.jsp

亚运期间,WLAN上网全程免费啦!广东省内外的中国移动客户、国际漫游来访客户在广东省移动WLAN覆盖区域内均可享用免费WLAN服务!
服务时间:2010年11月1日-2010年12月31日

服务对象:中国移动客户、国际漫游来访客户、中国联通和中国电信客户(仅限广州市移动WLAN覆盖区域)

服务范围:广东省内所有WLAN热点区域
中国移动广东公司客户如何使用?
广东省内客户无需申请,使用原手机号码和密码登录即可享受免费WLAN服务。
中国移动非广东公司客户如何使用?
·中国移动非广东公司客户使用移动手机号可申请一个免费账号使用WLAN服务;
·每个手机号码只绑定一个免费账号;
·客户申请的免费帐号仅在活动期间有效。
注:中国移动非广东公司客户只能通过免费帐号方式享受免费WLAN服务,若使用原手机号码登录会产生WLAN服务费用;
中国联通、中国电信客户如何使用? (仅限广州市内移动WLAN覆盖区域)
·中国联通、中国电信客户,可申请免费账号,在广州市内移动WLAN覆盖区域免费使用WLAN服务;
·每个手机号码只绑定一个免费账号;
·客户申请的免费帐号仅在活动期间有效。
How to use the WLAN(Wi-Fi) service? 国际漫游来访客户如何使用?
During the 16th Asian Games (from 1st November 2010 to 31st December 2010),International roaming visitors can enjoy free
WLAN(Wi-Fi) service in Guangdong province. You can login the WLAN service with your mobile number and free WLAN password.
Free WLAN service is only available when the user registers onto CMCC mobile network.
Phone number: e.g. the area code is "1" and the mobile number is "325370xxxx", the phone number shall be "001325370xxxx". (Note: "00" is required)
Free WLAN(Wi-Fi) Password: Select CMCC mobile network and send *139# on the mobile phone to obtain the free WLAN
password.(type *139# on your mobile phone and press the call button)
·国际漫游来访客户使用原手机号码和免费密码登录,即可免费使用WLAN。
·关于手机号码:如,美国用户的手机号为325-370-XXXX,美国的国际区号为001,则登录WLAN时应使用"001325370xxxx"作为登录账号
 登录,必须以"00"开头;
·关于免费密码:客户入境时选择中国移动网络漫游,发送*139#申请免费密码(在手机键盘键入 *139# 后按通话键)。
·中国移动免费WLAN服务仅在客户登记在中国移动网络时有效


WLAN办理方式
    使用WLAN上网需通过WLAN登陆界面验证(包括免费热点),验证需要提供WLAN帐号及登陆密码,WLAN账号为用户的手机号码,登陆密码可以是业务密码或动态密码。系统验证方式为:手机号码+业务密码或手机号码+动态密码。动态密码在WLAN认证界面选择动态密码方式,点击"获取动态密码"获取。业务密码在客户开通WLAN业务时获取,客户可通过发送短信或拨打10086等方式开通WLAN。 

业务密码申请方式
1、短信方式
1)申请密码:编写短信"KTWLAN"发送至10086。

2)修改密码:编写短信"XGWLANMM□原密码□新密码"发送至10086。(密码区分大小写,长度为6,□表示空格)。

3)重置密码:编写短信"CZWLANMM"发送至10086。

以申请密码为例,发送短信"KTWLAN"到10086,业务密码以短信形式下发至用户手机。

注:以上拼音字母大小写均可,发送到10086的短信免费。

2、10086方式
用户拨打归属地的10086申请WLAN上网密码,密码以短信形式下发给用户手机。


WLAN套餐办理
在未办理WLAN套餐的情况下,使用WLAN上网按照实际上网时长收费,全国统一标准资费为0.05元/分钟,计费时长按分钟取整。除正常资费外,客户可以选择办理WLAN套餐,超出套餐部分均按0.05元/分钟计费。办理WLAN套餐前须先开通WLAN功能,发送KTWLAN到10086申请。选择办理WLAN套餐,超出套餐部分均按0.05元/分钟计费。办理WLAN套餐前须先开通WLAN功能,发送KTWLAN到10086申请。

WLAN套餐资费:(全国统一套餐资费)
仅面向中国移动客户开放,客户名为中国移动手机号码。
月基本费 包含WLAN时长 超过套餐后的WLAN资费 备注
30元 15小时/月 0.05/分钟 可全国漫游使用
50元 40小时/月
100元 200小时/月
套餐办理方式
1)30元套餐: 编写短信"KTWLAN15"发送至10086。
2)50元套餐: 编写短信"KTWLAN40"发送至10086。
3)100元套餐: 编写短信"KTWLAN200"发送至10086。
套餐办理方式
已办理30元套餐的客户,如需变更为50元套餐,则直接发送KTWLAN40到10086即可将30元套餐变更为50元套餐,其它套餐依次类推。
套餐取消方式
取消WLAN套餐,统一编写短信"QXWLAN"发送至10086
套餐生效规则
1)全球通、随e行和3G客户当月办理开通,24小时内生效。本月变更或取消WLAN套餐,次月1日生效。
2)动感地带和神州行客户办理WLAN套餐24小时内生效;套餐变更和取消下个月结日生效。


注:以上拼音字母大小写均可,发送到10086的短信免费。