如果找到了对您有用的资料,烦请点击右手边的Google广告支持我继续共享知识,谢谢! http://dengpeng.spaces.live.com/

2008年2月29日星期五

Panic: CPU too old for this kernel

Keywords: Ubuntu, VirtualBox, CPU, old, kernel

This Problem has been solved, please install the latest Virtual Box!

Host OS: Windows XP SP2

VirtualBox 1.5.6

Guest OS: ubuntu-7.10-server-i386.iso

Error: Panic: CPU too old for this kernal.

Solution:

1. Boot up from ubuntu-7.10-server-i386.iso again,

2. Choose Rescue a broken system

3. Next steps until execute shell

4. Execute apt-get install linux-generic

5. Reboot

2008年2月27日星期三

Wireless Sensor Networks: An Information Processing Approach

Wireless Sensor Networks: An Information Processing Approach
Feng Zhao and Leonidas Guibas

http://www.mediafire.com/?vebjji4ymwv

2007年10月29日星期一

ISP如何检测控制多机共享ADSL连接

ADSL给大家上网带来的极大地方便,许多家庭都有好几台计算机,通过ADSL共享上网的方式可以各自上网,互不干扰,可最近很多朋友告诉我,如果只有一台机子访问互联网,一切正常,若两台机子都要访问互联网,则都打不开网页,打听来的消息说,电信新装网络硬件:网络尖兵。
  上网查了一下关于网络尖兵的资料,只提到了实现的功能,没有提到实现原理,要想解决不能共享上网必须摸清它的工作原理,ADSL共享上网有两种方式,一种是代理,一种是地址翻译(NAT),大家常说的路由方式其实就是NAT方式,其实路由和NAT的原理还是有区别的,这里不作讨论,现在的ADSL猫一般都有 NAT的功能,用它本身的功能实现共享上网是比经济方便,本文主要讨论这种方式。
  要想阻断一台以上的计算机上网必须能发现共享后边的机器是否多于一台,NAT的工作原理如图一所示,经过NAT转换后访问外网的内网的计算机的地址都变成了192.168.0.1而且MAC地址也转换成了ADSL的MAC地址,也就是说,从原理上讲,直接在ADSL出口抓经过NAT转换的包是不能发现到底有几台机器在上网。那是如何发现的呢?

一、分析原因
  首先用superscan对ADSL猫进行扫描,发现开着161端口,161是SNMP(简单网络管理协议)的服务端口,难道是通过SNMP协议发现的主机数量,用xscan对猫进行了漏洞扫描,果然有默认密码,登陆到猫的管理界面但是找不到关闭SNMP服务的地方,看来是留的后门,由此基本可断定是通过SNMP协议发现的主机数。为了进一步证实,用SNMP的一个管理软件ActiveSNMP查看ADSL猫的连接情况,如图二所示,可以清楚地看出通过SNMP协议可以发现同时上网的主机数量。

 

二、解决方法
  解决的方法就是屏蔽SNMP协议。有以下几个思路。
  1、 猫中没有任何关闭SNMP协议的地方,可以换一个能关闭该协议的猫。
  2、 修改配置文件,可以将配置转换成一个文件,用二进制编辑工具修改默认密码,然后再加载到猫中,这只是一种思路,没有试过。
  3、 买一个ADSL路由器,例如TP-LINK TL-R400,放到如图三所示的地方,在该路由器中再做一个NAT服务,这样进到ADSL猫中的就是一个地址,这样就解决了共享上网。注意在路由器中要关闭SNMP协议。

 

2007年10月14日星期日

比较一下java写文本文件文件的性能

最近对以前开发的一个通用数据迁移的软件进行优化。除了用JDK5.0的多线程技术进行的改进之外,也比较了一下java写文件的性能。
    在java写文件中,通常会使用FileOutputStream和FileWriter,FileWriter只能写文本文件。 FileOutputStream也经常结合BufferedOutputStream。因为实际应用中写文本文件的情况占了大多数。所以下面测试用不同的方式生成一个相同行数、大小相同的文件的三种不同方式。

import java.io.File;
import java.io.FileOutputStream;
import java.io.*;
 
public class FileTest {
    public FileTest() {
    }
 
    public static void main(String[] args) {
        FileOutputStream out = null;
        FileOutputStream outSTr = null;
        BufferedOutputStream Buff=null;
        FileWriter fw = null;
        int count=1000;//写文件行数
        try {
            out = new FileOutputStream(new File("C:/add.txt"));
            long begin = System.currentTimeMillis();
            for (int i = 0; i < count; i++) {
                out.write("测试java 文件操作\r\n".getBytes());
            }
            out.close();
            long end = System.currentTimeMillis();
            System.out.println("FileOutputStream执行耗时:" + (end - begin) + " 豪秒");
 
            outSTr = new FileOutputStream(new File("C:/add0.txt"));
             Buff=new BufferedOutputStream(outSTr);
            long begin0 = System.currentTimeMillis();
            for (int i = 0; i < count; i++) {
                Buff.write("测试java 文件操作\r\n".getBytes());
            }
            Buff.flush();
            Buff.close();
            long end0 = System.currentTimeMillis();
            System.out.println("BufferedOutputStream执行耗时:" + (end0 - begin0) + " 豪秒");
 
 
            fw = new FileWriter("C:/add2.txt");
            long begin3 = System.currentTimeMillis();
            for (int i = 0; i < count; i++) {
                fw.write("测试java 文件操作\r\n");
            }
                        fw.close();
            long end3 = System.currentTimeMillis();
            System.out.println("FileWriter执行耗时:" + (end3 - begin3) + " 豪秒");
 
        } catch (Exception e) {
            e.printStackTrace();
        }
        finally {
            try {
                fw.close();
                Buff.close();
                outSTr.close();
                out.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}    

以下结果经过多次执行,取常出现的数据,由于只是简单比较,不做详细统计。

1.当count=1000的,即写文件1000行的时候,写出的文件大小为18.5KB:
FileOutputStream执行耗时:46 豪秒
BufferedOutputStream执行耗时:31 豪秒
FileWriter执行耗时:15 豪秒

2.当count=10000的,即写文件10000行的时候,写出的文件大小为185KB:
FileOutputStream执行耗时:188 豪秒
BufferedOutputStream执行耗时:32 豪秒
FileWriter执行耗时:16 豪秒

3.当count=100000的,即写文件100000行的时候,写出的文件大小为1856KB:
FileOutputStream执行耗时:1266 豪秒
BufferedOutputStream执行耗时:125 豪秒
FileWriter执行耗时:93 豪秒

4.当count=1000000的,即写文件1000000行的时候,写出的文件大小为18555KB:
FileOutputStream执行耗时:12063 豪秒
BufferedOutputStream执行耗时:1484 豪秒
FileWriter执行耗时:969 豪秒

    由以上数据可以看到,如果不用缓冲流BufferedOutputStream,FileOutputStream写文件的鲁棒性是很不好的。当写 1000000行的文件的时候,FileOutputStream比FileWriter要慢11094毫秒(11秒), BufferedOutputStream比FileWriter慢515毫秒。
    不要小看这几秒的时间。当操作的数据量很大的时候,这点性能的差距就会很大了。在通用数据迁移工具导出数据库2千万条记录生成sql脚本文件的时候,性能性能相差10分钟以上。
    下次有时间再写单线程和多线程对性能的影响。

本文摘自:http://b-qiufeng.javaeye.com/blog/72120

2007年10月6日星期六

惊呼!金正日:“我是一位互联网专家”

中文版:

汉城,韩国-朝鲜领导人金正日在与韩国总统卢武铉在周五的韩朝高峰会谈期间自称是一个"网络专家".
金正日的这番话引起了卢武铉的兴趣,它有意让韩国的通信公司进入朝鲜一些城市开展公众互联网业务.
朝鲜是世界上最封闭的国家之一,除了严密控制信息外,并没有容忍异议的空间.收音机和电视机在北韩只能得到国家广播,百姓都不得使用手机,更遑论上网.但该国的统治精英似乎都经常通过互联网等渠道获取外界信息.

金正日在2000年的时候还向美国前国务卿奥尔布赖特要过电子邮件地址,还称他们有部队有信息相关人员,并且据说还颇有“斩获”...

英文版(美联社报道):

Kim Jong Il: I'm an Internet expert

SEOUL, South Korea (AP) -- North Korean leader Kim Jong Il called himself an "Internet expert" during summit talks with South Korea's president this week, a news report said Friday.

The reclusive leader made the remark after South Korean President Roh Moo-hyun asked that South Korean companies operating at an industrial park in the North Korean city of Kaesong be allowed to use the Internet, Yonhap news agency reported, without citing any source.

"I'm an Internet expert too. It's all right to wire the industrial zone only, but there are many problems if other regions of the North are wired," Kim told Roh, according to Yonhap.

"If that problem is addressed, there is no reason not to open" the Internet, Kim said.

This week's summit - the second-ever such meeting between the two Koreas - produced a wide-ranging reconciliation pact that calls for establishing a new special economic zone in North Korea and expanding the Kaesong factory park.

North Korea is one of the world's most closed nations, with the totalitarian regime tightly controlling outside information and tolerating no dissent. Radios and TV sets in North Korea can only receive state broadcasts and ordinary people are banned from using mobile phones, let alone the Internet.

However, the country's ruling elite appear to have regular access to outside information.

Kim reportedly asked former Secretary of State Madeleine Albright for her e-mail address when she visited Pyongyang in 2000. A North Korean general cracked a joke about President Bush during high-level military talks with the South earlier this year, saying he read it on the Internet.

The North's leader is also a big fan of South Korean movies and TV dramas, and Roh gave him a bookcase of South Korean DVDs as a gift this week.

 

转载自:http://hosted.ap.org/dynamic/stories/N/NKOREA_KIM_INTERNET?SITE=NCAGW&SECTION=HOME&TEMPLATE=DEFAULT

真实的笑话,金胖子太搞笑了,不愧是国家级别的!