sed删除文件最后一行的语句方法0+

18,140 views / 2011.02.22 / 11:11 下午

linux下先测试:
sed ‘$d’ filename
输出结果符合要求。
怎么回写到源文件呢?用重定向?实验结果失败,会把文件置为空。
正确的方法是加-i参数

sed ‘$d’ -i filename

具体原因请自查手册

Categories: 感悟 Tags:

环境:win7 IE8

今天下午测试一个功能,给图片添加一个链接,点击链接后,跳转到另外一个页面b.php进行数据处理,意外的发现数据竟然被处理了两次。几经排查才发现是中午刚安装的QQ电脑管家导致的问题。关闭了QQ电脑管家的网页防火墙后,问题解决。

安装并开启网页防火墙的后果:

1.网上交易数据重复提交,造成资金损失。

2.数据库查询多次进行

3.造成网站流量浪费。

QQ电脑管家目前略显山寨,建议大家慎用。

Categories: 感悟 Tags:

刚才试用了Amazon Web Services–免费1年EC2云VPS0+

8,448 views / 2010.12.11 / 11:11 下午

Amazon Web Services(AWS)是从今年11月1日起正式推出免费1年的云VPS,基于XEN、613M内存(支持32和64位平台)、10G存储容量、30G月流量、1G容量SimpleDB数据库等等,其实提供的服务和限制写的很详细的,但是感觉规则太复杂了,搞不好什么地方没搞明白就要被扣费,因为申请的时候要绑定信用卡。

这是免费声明:

New AWS customers will receive the following EC2 services each month for one year. Usage is calculated each month across all regions and automatically applied to your bill – unused monthly usage will not roll over. Restrictions apply; see offer terms for more details.

  • 750 hours of Amazon EC2 running Linux/Unix Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) – enough hours to run steady state each month
  • 750 hours of Elastic Load Balancing plus 15 GB data processing
  • 10 GB of Amazon Elastic Block Storage (EBS) plus 1 million IOs, 1 GB snapshot storage, 10,000 snapshot Get Requests and 1,000 snapshot Put Requests
  • 15 GB of bandwidth in and 15 GB of bandwidth out aggregated across all AWS services

2010-12-12补充:愤怒,刚才看账单,莫名其妙被Amazon扣除了2.4$.

Categories: 感悟 Tags:

js模拟php的shuffle函数,用来打乱一维数组3+

8,050 views / 2010.12.09 / 6:06 下午
Array.prototype.shuffle = function() {
for(var j, x, i = this.length; i; j = parseInt(Math.random() * i), x = this[--i], this[i] = this[j], this[j] = x);
return this;
};
 
非原创,纯分享
Categories: 分享 Tags: ,

新版 MSN 2011 移除广告 两个用户同时登录 补丁3+

12,987 views / 2010.11.19 / 12:12 下午

上个月刚发布的   Windows Live Essentials 2011 不知道你是不是也更新了呢?大多数的朋友都说新版2011狠难用,少数人觉得还好,反正迟早也是要适应。无论你使用的是新版或是旧版,都可以通过这个小工具来移除广告以及破解多用户同时登录限制,使用上非常简单喔!如果你有这个需要,不妨试试看本篇文章。

A-Patch updated for Windows Live Messenger 2011 (15.4.3502.0922)

Praise be to God.

Added 6 new options! At the moment this build is only available in English but will be available in more languages shortly, God-Willing, as soon as the new options have been translated.

Changelog (1.43 build 11)

New: Disable Nudge Shake (thanks digitaldj).
New: Remove Nudge Delay (thanks digitaldj).
New: Remove the top of the Contact List.
New: Remove Search Bar.
New: Remove the “Connected to…” bar.
New: Accept more than 3 files (transfers at a time) (thanks digitaldj).
Fix: Fixed graphical glitch when removing text ad banner in the conversation window.

Note: To remove the image ad banner in the conversation window, untick the “Show expanded footer in conversation windows” option under the Tools > Options > Messages window in the Windows Live Messenger options.

Changelog (1.43 build 10):

New: Ad Banner completely removed! Thanks to a brainstorming session with user bedrock, I was able to completely remove the ad banner from the contact list.

Feature: Remove advertisement from main window.
Feature: Remove text advertisement in the IM window.
Feature: Polygamy – open more than one Messenger at once.
Feature: Remove the “See More Offerings” items in the file menus.
Feature: Remove “Featured” section from the Emoticons “more” dialog box.

Download A-Patch for Windows Live Messenger 2011 (15.4.3502.0922)

Categories: 分享 Tags: ,