2008年8月30日星期六

脚本语言现状 zz

曾经程序语言世界里的二等公民,脚本语言(也叫动态语言)正成为开发者的重要工具。Lynn Greiner总结了脚本语言的现状和未来的发展(包括PHP,Perl,Tcl,Python,Ruby,和Javascript),并与三年前的情况进行了对比。被调查的1200名开发者中有近70%的人使用Javascript,另外还有15%计划使用。PHP仅被三分之一的开发者使用,用Perl的占四分之一(Perl在北美较为流行,36%的人不时用到它)。 2005年以来的最大变化是富web应用的增长,在浏览器上它们中的多数是用JavaScript实现。这类应用的需要迫使开发者更多的学习和使用 JavaScript。对Ruby的兴趣也不小,Ruby on Rails的发布和成长推动了这种趋势。这些变化的结果是开发者对动态语言的感觉越来越好。

标签:


2008年8月29日星期五

在ubuntu8.04 x64上安装vmware6.04x64

安装顺利,运行时,打开一个虚拟机,报错
Unable to change virtual machine power state: Failed to connect to peer process.
原因是缺少兼容32的库
安装ia32-libs,ia32-libs-gtk,lib32z1,lib32gcc1
即可

此前在32位宿主机系统上安装RHEL5.1X64不成功,报错是cpu不支持long mode。
在ubuntu8.04 x64+vmware6.04 x64上安装RHEL5.1X64仍然报错cpu不支持long mode,同时提示cpu支持VT,但是bios没打开。打开bios的VT后可顺利安装RHEL5.1X64。安装全功能需要的installation number可以在网上找到。

在opensuse11 x64+vmware6.04 x64上安装RHEL5.1X64出现同样问题

标签:


Mozilla实验室推出Ubiquity,帮助自动操作Web界面 zz

Ubiquity对浏览器的作用类似于Quicksilver之于OS X,使用基于语言的指令控制方式,帮助浏览器用户快捷的启动多种Web应用,如Google Map,维基百科,Twitter,Google翻译等。Ubiquity利用现有开放的Web APIs,通过命令向多种网络服务发送和获取数据,用户可在它的帮助下写邮件,嵌入Google Map,执行搜索,或digg文章等等。Ubiquity只支持 Firefox 3.x,显然它对网络连接速度的要求较高,对于处于墙限制的我们可能帮助有限。

下面是tutorial的链接
https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_User_Tutorial

标签:


BGP协议漏洞

2008年8月8——10日,全球最大的黑客大会Defcon在美国拉斯维加斯举行。在大会的最后一天8月10日,两位安全专家演示了一种新技术,可以大范围地窃取Internet上的流量,这样大规模的Internet流量侦听以前只有情报机构才能做到。

该技术利用 Internet 路由协议 BGP(Border Gateway Protocol),让入侵者监视世界上任何地方的 Internet 数据流,甚至可以对数据包进行篡改。演示者成功地将目的地址为Defcon大会网络的流量重定向到纽约他们控制的一个系统上,然后又将其路由回大会网络。任何拥有 BGP 路由器的人(ISP 以及在运营商租赁了机房的公司)都可以截获数据,但本攻击只能截获流向目标地址的数据,而不是源地址,并且不能在网络间自由穿行。

这种技术由Pilosov发明,他并没有利用BGP协议的Bug或瑕疵,只是利用了BGP协议的正常模式。问题的存在因为BGP架构基于信任。举一个例子,一个在加利福尼亚的Sprint的客户给远在西班牙的Telefonica的用户发了一封Email。这两个运营商及沿途各运营商的网络通过BGP协议沟通,找出Email送达最快效率最高的路径。但是BGP协议工作是基于“一个路由器讲出它的最佳路径时说的是实话”的假设。这种易欺骗性使得偷听者容易欺骗路由器来截获数据。

让我们看看他是如何工作的:当一个用户在浏览器输入一个URL并最终点击“发送”来发送电子邮件,DNS服务器为目的地生成一个IP地址。在Email发送进行路由选择时,用户所在运营商的路由器询问BGP表最佳路由,该表基于运营商或其他自治系统(Autonomous System)发布的“advertisement”创建。该“advertisement”包括ip地址范围、IP前缀、向哪里转发流量等等。路由表从IP前缀中查找目的IP地址。如果两个自治系统都可以传送到目的地址,前缀更具体的自治系统将会赢得流量。举个例子,一个自治系统广告它可以传送到90,000组IP地址,而另外一个自治系统广告它可以传送到上面90,000组IP地址中的24,000组,如果目的IP地址同时落到两个自治系统的“广告”中,BGP将把数据发到更窄、更具体的自治系统。为了截获数据,偷听者只需以比其他网络更小的规模来广告它希望监听的IP地址段。这种广告可以在几分钟内向全世界传播,然后就可以实施监听。

Pilosov对该技术的革新在于将截获的数据转发回真实目的地址,避免数据中断的发生。通常,被截获数据再返回真实目的地址不应该发生,但是Pilosov和Kapela使用一种称为自治系统路径预先计划(AS path prepending)的方法,使一些被选中的BGP路由器拒绝他们欺骗性的广告,从而通过这些自治系统将数据转发到正确的接收者。

利用BGP协议进行网络窃听并不是新技术,BGP协议理论上一直存在弱点。L0pht黑客组织前成员 Peiter研究这个问题已经十几二十年,并向情报局,以及国家安全局讲述过这个问题。1998 年Peiter在国会作证的时候曾表示,他可以使用类似 BGP 攻击技术,在30分钟之内将 Internet 干掉,他还私下向政府机构透露如何使用 BGP进行窃听。BBT公司首席信息安全科学家Stephen Kent若干年前也已经私下向国防部和国土安全局演示过类似的BGP数据截获。

BGP协议劫持经常发生,但大多都是无意之间造成,并会导致拒绝服务攻击,或者中断,一个事例就是今年2月份巴基斯坦电信劫持YouTube的流量。PTCL是巴基斯坦最大的电信运营商,掌控着该国绝大多数网络基础设施。该公司的原意是在巴基斯坦国内屏蔽YouTube网站,这种操作一般被称为“黑洞法”(black holing)。在PTCL的网络上发出的指令本来只该在巴基斯坦国内的互联网生效,但却莫名其妙地开始在全球互联网上复制,并导致其他互联网服务提供商访问YouTube网站也开始出现问题。YouTube网站瘫痪是由PTCL对路由器的错误操作无意间导致的,根本原因在于巴基斯坦电信公司错误地告诉路由器它是发送Youtube流量的最佳路径,本来应该指向YouTube网络地址的链接被变更到了巴基斯坦,随后就断线了,在将近两个小时的时间里,Youtube的访客掉入巴基斯坦电信的黑洞。

对于VPN或者经过加密的流量,可以对截获的流量进行分析,从而产生对情报部门或者执法部门有价值的信息,比如说通信双方身份等等。

这些安全事件都显示了Internet 核心协议在安全方面的存在不足。Internet 核心协议多数开发于70年代,基于当时刚刚诞生的网络,人们假设网络上的节点都是可信的。如今这些假设正被一一击破,7月份,Dan Kaminsky 公布了 DNS 系统一个严重漏洞,而现在BGP协议的漏洞甚至更严重。

很多机构和公司已经在着手研究解决方案。有些机构专门收集BGP路由信息来监测BGP更新,这些更新会改变路由。但是很难区分是合法改变还是恶意劫持。流量突然从一条路径改变到另一条上传输是有理由的,比如分属不同自治系统的公司合并、自然灾害使一个网络失效,而其他自治域接管了它的流量。

如果运营商进行强制性过滤,仅允许通过认证的对端、特定的IP地址前缀从他们的路由器牵引流量,流量劫持可以被阻止。但是过滤是劳动密集型的,而且如果一家运营商拒绝参与,真个计划将无法实施。过滤同时需要运营商将地址空间透漏给客户,对竞争不利。
过滤不是唯一的解决方法。Kent和其他人发明了一种方法来认证IP Block的所属权,进而认证自治系统发送给路由器的“advertisement”,这样路由器不会简单的将数据发送到任何请求者。在该计划下,5个地区的Internet地址注册机构将给运营商签发证书来证实他们的地址空间和自治系统号码。自治系统也将签发授权就他们的地址空间来初始化路由器。如果自治系统为一个IP前缀广告了新的路由,将容易验证它是否有权利这样做。但是这种方案只能认证路由器的第一跳,来避免无意的劫持,像巴基斯坦电信一样,但是不能阻止偷听者劫持第二跳或第三跳。

正因为如此,Kent和BBN的工作人员研发了 SBGP,要求BGP路由器以私钥签名它要传播的前缀广告。运营商将给路由器发证书,授权其为它的流量提供路由。一个路由器的每个对端将签名一个路由器广告,将数据转发到下一授权跳。这将意味着没有人可以介入这个链,除非他们通过该路径前面的路由器认证。这样做的缺点是当前路由器缺乏生成和验证签名所必要的存储和处理能力。路由器制造商也会抵制升级,因为他们的客户——运营商们并没有提出这样的要求。

标签:


2008年8月24日星期日

升级delphi7的indy控件

1. 卸载自带indy控件。component—〉install packages—〉Internet Direct(Indy)—〉remove。

2. 安装LVK_Full。
LVK_D7D.dpk—〉compile—〉install.
复制LVK_Full\Source下的*.dcu到C:\Program Files\Borland\Delphi7\Lib

3. 安装indy。
indy9.0.18_source—〉dclIndy70.dpk—〉compile—〉install.
indy9.0.18_source—〉Indy70.dpk—〉compile—〉install.
复制indy9.0.18_source下*.pas到C:\Program Files\Borland\Delphi7\Source\Indy
复制indy9.0.18_source下*.dcu到C:\Program Files\Borland\Delphi7\Lib


安装TPerlRegEx组件
\TPerlRegEx\PerlRegExD7.dpk
复制\TPerlRegEx\下*.dcu到C:\Program Files\Borland\Delphi7\Lib

标签:


2008年8月21日星期四

Linux查看系统当前用户命令 zz

一, w命令
该命令用于显示登录到系统的用户情况,w命令功能强大,它不但可以显示有谁登录到系统,还可以显示出这些用户当前正在进行的工作,并且统计数据相对who命令来说更加详细和科学.
w命令的显示项目按以下顺序排列:当前时间,系统启动到现在的时间,登录用户的数目,系统在最近1秒、5秒和15秒的平均负载。然后是每个用户的各项数据,项目显示顺序如下:登录帐号、终端名称、远程主机名、登录时间、空闲时间、JCPU、PCPU、当前正在运行进程的命令行。
其中JCPU时间指的是和该终端(tty)连接的所有进程占用的时间。这个时间里并不包括过去的后台作业时间,但却包括当前正在运行的后台作业所占用的时间。而PCPU时间则是指当前进程(即在WHAT项中显示的进程)所占用的时间。下面介绍该命令的具体用法和参数。

二, who命令 该命令主要用于查看当前在线上的用户情况。这个命令非常有用。如果用户想和其他用户建立即时通讯,比如使用talk命令,那么首先要确定的就是该用户确实在线上,不然talk进程就无法建立起来。又如,系统管理员希望监视每个登录的用户此时此刻的所作所为,也要使用who命令。

login name:登录用户名;
terminal line:使用终端设备;
login time:登录到系统的时间。

下面对who命令的常用参数进行说明。
-m 它的效果同who am i显示出自己在系统中的用户名,登录终端,登录时间
-q 只显示用户的登录帐号和登录用户的数量
-s 忽略,它同于who
-r 可以查看当前系统的运行级别 run-level 3 Apr 21 09:37 last=S
-H,--heading 显示一行列标题。

三, whoami 只显示出自己在系统中的用户名

四, logname 可以显示自己登录到系统中的用户名

五, last 可以查看上次自己登录的时间,当然root可以查看其他用户登录的情况。 last -n user 可以看user前n次登录的情况

六, tty 可以使用tty来报告所连接的设备或终端。

标签:


fedora8中的GPG key

在fedora下用yum从linux镜像站点升级或者安装软件包时,为了防止第三方篡改,GPG key用来对软件包进行签名,以确保下载的软件包的可靠性。

在fedora8下,GPG key存在于/etc/pki/rpm-gpg,对于各个软件库,有相对应的GPG key。

用命令 yum update升级系统时,如果没有GPG key,会有提示

You have enabled checking of packages via GPG keys. This is a good thing.However, you do not have any GPG public keys installed. You need to downloadthe keys for packages you wish to install and install them.You can do that by running the command:
rpm --import public.gpg.key
For more information contact your distribution or package provider.

所以先要安装GPG key,如下
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*

这样就没问题了

标签:


2008年8月20日星期三

kernel-x.x.x.src.rpm与kernel-devel-x.x.x.rpm包的区别

kernel-devel包只包含用于内核开发环境所需的内核头文件以及Makefile,而kernel-souce包含所有内核源代码。如果仅仅是用于你自己编写的模块开发的话,因为只需引用相应的内核头文件,所以只有devel包即可,如果你要修改现有的内核源代码并重新编译,那必须是kernel-souce。kernel-souce在RH某些版本之后不再附带在发行版中了,必须自己在网上找。

标签:


2008年8月19日星期二

Debian诞生15周年 zz

2008年8月16日,世界上最流行和最稳定的GNU/Linux发行版Debian走过了15周年。在过去的15年里,Debian确立了自身最稳定操作系统的定位,很多GNU/Linux发行版如Ubuntu和Knoppix都是基于Debian。Debian身上有许多趣事,根据维基百科的介绍: Debian于1993年8月16日由当时的普渡大学学生、现在的Sun开发者社区副总裁Ian Murdock首次发布。Debian的名称是由他女友(现在为其妻子)Debra和Ian Murdock自己的名字合并而成,所以Debian一词是根据这两个名字在美国英语的发音而读作/'dɛbiːjən/。Debian所有版本的名称都来自电影《玩具总动员》。Debian主要分三个版本:稳定版本(stable)、测试版本(testing)、不稳定版本(unstable),目前一共发布了4个稳定版,第5个稳定版Lenny将在今年推出。不稳定版又叫Debian sid,其中sid为《玩具总动员》中主角隔壁家的男孩,一位总是破坏玩具的玩具终结者。

标签:


2008年8月18日星期一

OpenSuse自动更新

1. 以root身份运行yast2
2. 在Software——>Software Repositories,add
3.
protocol:http
Repository Name:为该repository命名
Edit parts of the url
Server Name:download.opensuse.org
Directory on Server:/update/11.0/
选择Anonymous
4. 升级有几种方式
a. Software Management——upgrades,选择要升级的(可多选),点击右下方的upgrade,然后apply,除了能升级之外,Software Management还可以安装新软件。
b. Online Updates同于Software中的upgrades。

标签:


2008年8月15日星期五

redhat9.0中initrd的linuxrc完成工作

环境:redhat9.0
内核:2.4.20-8
#vi linuxrc
#!/bin/nash

echo "Loading scsi_mod.o module"
insmod /lib/scsi_mod.o
加载scsi模块

echo "Loading sd_mod.o module"
insmod /lib/sd_mod.o
加载scsi硬盘模块

echo "Loading BusLogic.o module"
insmod /lib/BusLogic.o
加载BusLogic SCSI模块

echo "Loading jbd.o module"
insmod /lib/jbd.o
加载JBD模块

echo "Loading ext3.o module"
insmod /lib/ext3.o
加载ext3模块

echo Mounting /proc filesystem
mount -t proc /proc /proc
挂载proc文件系统

echo Creating block devices
mkdevices /dev
创建块设备

echo Creating root device
mkrootdev /dev/root
创建root设备

echo 0x0100 > /proc/sys/kernel/real-root-dev
写入0x0100 到 /proc/sys/kernel/real-root-dev,改变真实的根设备

echo Mounting root filesystem
mount -o defaults --ro -t ext3 /dev/root /sysroot
pivot_root /sysroot /sysroot/initrd
挂载根文件系统,并改变跟文件系统

umount /initrd/proc
卸载/initrd/proc

标签:


2008年8月14日星期四

黑帽安全大会创始人 Jeff Moss 接受VentureBeat采访实录 zz

Jeff “The Dark Tangent” Moss is the founder of the Black Hat and Defcon security conferences which just concluded in Las Vegas. Moss ran an early social network for computer and phone hackers out of Canada and he founded Defcon (named after “defense condition 1” for imminent war in the hacker film “War Games”) as a gathering for hackers in 1993. He started Black Hat in 1997 as an education and research-oriented show for security professionals and law enforcement. Still a security consultant, Moss works in Seattle and tests computer systems for vulnerabilities. In 2005, he sold Black Hat to CMP Media for an estimated $14 million. But Defcon, the cash-only show for the masses of hackers now in its 16th year, is still Dark Tangent’s baby. I caught up with him while he was playing with a homemade toy gun made of PVC pipe that shoots marshmallows.


VB: How do you explain to outsiders what this conference is like? There are serious subjects here and goofy things too.
JM: There is the social side and the technical content. People come to learn and share knowledge. Then there is the need to make new friends. I try to grow both sides. If you grew up in the hacking scene in the early days, with no video cameras and web chat, you formed your opinion of them based on what they did. People accepted each other for what they did or what they knew. You see people here with blue hair, dreadlocks or business suits. They’ll be sitting around a table having a conversation because they have something in common and have moved past what you look like. That’s a big success.


VB: What’s the contrast between Defcon and Black Hat?
JM: Black Hat is like college and Defcon is the fraternity party. We also have really great content. At Defcon, it’s what I want to see. I want to learn about hacking Xboxes, satellite systems, and lockpicking. Weird conspiracies. That content doesn’t make sense at Black Hat where there is more of a corporate focus.


VB: How concerned are you about how the show looks to the rest of the world — about whether it’s on the right side of the law or responsible behavior?
JM: I don’t really care what the rest of the world thinks.


VB: How do you stay on the right side?
JM: You have to set an example and hope people follow it. I can’t control what they do. If they want to be criminals, they will be criminals. I try to show them there are alternatives. You shouldn’t be ordered what to do. If you find a new bug, there is a big debate about what you should do. Should you disclose it responsibly? Tell it to the whole world? Responsible disclosure, full disclosure, partial disclosure? I believe in the responsible disclosure model, where you tell the party about the bug and give them time to fix it before you disclose it to the world. I select speakers that I think are ethical and create contests that are legal and hope people will follow the lead.


VB: You have federal agents coming in to give their own talks.
JM: Since the very first Defcon. Well, we had a state prosecutor come in and talk. In the audience was someone who was being prosecuted by her. We’ve tried to have different viewpoints.

VB: So it’s almost like a neutral ground?
JM: That’s what I’ve created it to be. Originally, there was no Internet or Amazon.com. If you wanted information, you had to get it from the horse’s mouth. It was about getting the experts in the room to dispel myths that came from word of mouth. I knew federal agents would show up. I invited the FBI, Secret Service and others to come from the very beginning. Everyone thought I was absolutely insane because nobody had done that. I called the Secret Service about it. They said, “We are aware of your activities.”


VB: They haven’t arrested anyone here?

JM: The FBI arrested one speaker, Dmitri Sklyarov, in his hotel room after Defcon [in 2001]. That was because the Russian company Dmitri worked for was in a dispute with Adobe. Dmitri was kind of a hostage because they couldn’t go after the company in Russia.

VB: There are a lot of controversies every year. The Massachusetts Bay Transit Authority sued to stop three of your speakers from proceeding with a talk. How do you deal with that every year?
JM: It sucks. In certain circumstances, it might be the right thing to pull a talk. But it seems most of the time it’s overreactions by security vendors who don’t understand. It’s a disservice for the whole community. How can businesses make informed risk decisions if they never get to hear real-world information? They only get to read press announcements and product literature. There are bigger implications for every conference. If everyone is afraid to speak, who will do and talk about interesting research? We’ll just lose that edge.

VB: Have you had fun doing personal hacks?
JM: I have older hacks I’m really proud of but not lately. I manage the Defcon network and configure them. I watch them withstand millions of attacks. I’m fairly proud that no one has broken into me yet. But I’m smart enough to know it can’t stay like that forever. That’s where I put my creative energy.

VB: Where did your handle, “The Dark Tangent” come from?
JM: There was a comic book produced by one of my favorite artists. It was D’Arc Tangent. It was about an intelligent robot that got infused with a personality. Only one issue was ever produced. It was about what does it mean to be human. I wrote for a magazine and used it as a pen name.

VB: One of the government panelists said that after he leaves this show, he never feels really good. It’s that scary feeling that security vulnerabilities are everywhere and you have a whole lot more work to do to improve security.
JM: It’s a common reaction. You see five or six talks and wonder how we function as a society. We’re so dependent on technology and it’s so half-assed and jury-rigged. You poke any bit and it comes tumbling down. Automobiles aren’t like that. We put engineering thought into buildings and airplanes. But technology is really shaky. It energizes people who see there is so much more work to do. It’s not an area where everything is sorted out. You can explore and experiment with new ideas. The creative high keeps me going for months.

VB: Where did traditions such as the “wall of sheep” come from? (Where you post the passwords and usernames of laptop users who aren’t careful on the wireless network).
JM: It just started one year where people wrote them down on paper plates and put them up on the wall. The wireless network is like a free-for-all combat zone where you take your own risks. The No. 1 offender this year is the iPhone. The iPhone wants to auto-associate with any wireless network that it finds.

VB: Your badges are electronic gadgets. And there is the press badge and the “human” badge, as if the press were not human? And there are strict guidelines for the press.
JM: That’s right. The press behavior has been sporadic. The guidelines wouldn’t be there if they behaved. We had to kick out G4 this year for violating the rules. They panned through the room without getting permission from people they shot, as the guidelines say. It’s always the TV cameras that violate the rules. They just want to get great shots. They want the green hair or the pierced faces for their 15-second sound bites. We get better stories from writers.

VB: Is there a connection between physical security and cyber security? You have lockpickers here.
JM: It’s more that physical and computer security are interesting to the type of people we draw. They are interested in how things work. They take things apart. It’s using a different part of your brain for hands-on work. They like to do the unconventional.

VB: How are security start-ups doing now?
JM: The VCs are smarter now. They ask better questions. From what I hear, they are interested in investing in sure things or things they can cash out in a few years. They aren’t interested in things that are harder to describe with longer time horizons.

VB: It seems like security as a career path is a good move still.
JM: There was a lot of excitement when there were movies about it. Fresh blood was coming into the scene. Now, it’s not as sexy. That has shifted to things like forensics because of Crime Scene Investigation. But the culture will have plenty of demand for people with knowledge of computer security.VB: Some independent security researchers can make more money now because they can sell the bugs they find to companies that buy them.
JM: If you have the skills to find those kinds of bugs, then people will hire you. Some people work for security companies by day, and then at night they will find bugs to make extra income. If people stop talking about the bugs they find, and they sell them instead, and only the companies that buy them know about them, then you have a situation of the information have and have-nots. Will we just get second-tier information at this conference because all of the valuable stuff has been sold? We have a good line-up this year and so it hasn’t happened yet.

VB: Do you worry that some of the sensational events here overshadow the real news on some kind of important crypto attack?
JM: Well, the crypto people would notice. Information finds its own place. I’ve long since given up on directing where the press should focus itself. Some of the sensational stories can be understood by larger audiences.

标签:


2008年8月13日星期三

Top10开源软件 zz

1. Mozilla Firefox (Web browser)

Crikey, another Firefox plug! Yeah, we love the 'fox, and we'll keep talking about it until EVERY SINGLE ONE OF YOU USES IT. It really just doesn't get any better when it comes to a cross-platform, open source web browser.

2. Mozilla Thunderbird (Email client)

Firefox's much less celebrated little brother is one helluva email client. We especially like its customizable message filters, built-in adaptive Junk mail filter and ability to install useful add-ons (like Firefox).

3. Open Office (Office suite)

Used to be that anyone who wanted to open a Word document had to drop a few Benjamins on Microsoft Office or risk pirating it. No more - Open Office is a free alternative to M$ Office for students, freelancers and poor people just wanting to save their spreadsheet as an .xls.

4. Gaim (Instant messenger)

Chat on any service you'd like - AIM, Yahoo! Messenger, MSN, Jabber, ICQ - with this multi-platform, tabbed IM client.

5. ClamWin (Antivirus)

Norton bugging you again to break out the credit card and subscribe? Uninstall! ClamWin is free anti-virus software with automatic updates and scheduled scans, no credit card required.

6. VLC Media Player (Audio/video player)

Got a video or audio file Windows Media Player or Quicktime can't play? Betcha VLC can.

7. KeePass (Password manager)

Another app you really don't hear a lot about, but for anyone with more than 6 different passwords, KeePass is indispensable. Check out my previous feature, Securely track your passwords for more on using KeePass.

8. Cygwin (Unix command line emulator)

That DOS command line just doesn't cut it. Wanna turn into a CLI ninja on your PC? You need Cygwin. (For more on using Cygwin, check out these previously-posted Cygwin tutorials part 1, part 2 and part 3.)

9. Eraser (Data deletion utility)

Before you donate, sell or trash your hard drive, you want to make sure there are no traces of your naughty private data on it. Eraser uses the same algorithm the government uses to wipe your hard drive clean.

10. TrueCrypt (File encryption utility)

You've got a folder full of files you don't want anyone to access but you. Lock it (or an entire thumb drive) up with the free TrueCrypt software. Check out the previously-posted Encrypt your data article for more on using TrueCrypt.

标签:


2008年8月11日星期一

在USB移动介质建立Fedora8 Live系统

环境:

操作系统:fedora8

usb移动介质:/dev/sdb1 /media/disk

fedora8 live iso:Fedora-8-Live-i686.iso



1. 安装livecd-tools

yum install livecd-tools



2. 拷贝live image到usb移动介质

livecd-iso-to-disk /path/to/Fedora-8-Live-i686.iso /dev/sdb1

'Verifying image...

Fedora-8-Live-i686.iso: 17d675e98a44754d41ba0d93f485ffa3

Fragment sums: 7dba468e8adf87c776ae4a15a871426ba74dba1187adb2a6807c1e124a34

Fragment count: 20

Percent complete: 100.0% Fragment[20/20] -> OK

100.0

The media check is complete, the result is: PASS.

It is OK to use this media.

Copying live image to USB stick

Updating boot config file

Installing boot loader

USB stick set up as live image!



3. 重启动,设置usb启动.

ok!

标签:


2008年8月10日星期日

无国界广播电台在北京秘密发声 zz

"无国界记者组织承认,在北京奥运会开幕式当天 2008 年 8 月 8 日当地时间上午 8 时,无国界记者成员在北京以 FM104.4 兆赫的频段秘密播放了 "无国界广播电台" 的节目。 无国界记者组织透露,他们通过使用小型广播发射器和移动天线成功地播放了广播节目。"在反对媒体控制的精神指引下,无国界记者组织实施了这次行动。" 节目的内容包括三种本届奥运会官方语言,这次秘密广播已经被放入无国界记者的网站和 Blog: http://www.rsf.org/ 及 http://jeuxolympiques.rsfblog.org/。"

美国警告奥运会游客小心网络间谍 zz

美国情报机构发出强烈警告,提醒北京奥运会的游客注意个人的电子信息被偷,警告称“所有以电子方式发送的信息——传真机,PDA,电脑和电话——都可能被截取”。美国政府的网络安全官员在采访中督促所有的美国人将电子设备留在家中。中国是世界上最大的以美国为目标的网络间谍国家,已经给美国造成数十亿美元损失。

2008年8月8日星期五

锻炼不仅可强健体魄,还可让大脑更聪明 zz

研究发现,锻炼不仅仅可以强健体魄,还可以让大脑更聪明。本月初出版的一项研究报告指出,平衡饮食和固定的锻炼可以保护大脑,远离精神疾病。锻炼能够让人学得更快,记忆更深,思考更清晰,大脑受损后更容易恢复原状。但是为什么无意义的半小时脚踏车能影响大脑? 锻炼,就像饥饿,是对身体的压力。UCLA的Fernando Gomez-Pinilla说“有时,压力是有好处的。”因为锻炼要燃烧大量卡路里,有氧锻炼将威胁到身体的能量储存,因此身体会行动起来保护最精密的,能量要求最高的器官:大脑。此外锻炼还能诱发产生更多的生长因子。对神经元而言,生长因子就如上帝赐予的食物,可让神经元变得更强,更健康,改进它们的学习能力。

标签:


2008年8月5日星期二

windows2003搭建vpn服务器


如上图,
环境:

vpn网关服务器:windows2003 Sp1,210.43.23.3/24(外网), 192.168.1.100(内网)
客户机:windows Xp Sp3,192.168.1.46


2003 上的vpn服务器安装步骤:

1. 管理工具——〉路由与远程访问,打开“路由与远程访问”控制台。
2. 如果是禁用状态,鼠标右击服务器图标,单击“配置启用路由和远程访问”启动“路由和远程访问服务器安装向导”,单击“下一步”继续。
3. 单击“远程访问(拨号或 VPN)”选项,以允许远程客户端通过拨号或安全的虚拟专用网络连接到此服务器。
4. 选择“vpn”,下一步。
5. 配置远程访问服务器外网连接地址。在出现的向导对话框的“网络接口”窗口中,选择连接到 Internet 的网络接口,如本例中名称是“本地连接-外”、IP地址为210.43.23.3的网络接口连接着外网。
6. 配置远程访问服务器内网连接地址。为VPN服务器所连接的内部网络指派一个接口。在“网络连接”窗口中,单击连接到内部网络的接口,如本例中名称是“本地连接-内”、IP地址为192.168.0.1的网络接口连接着内网。
7. 对远程客户指派IP地址。如果要使用 DHCP 服务器给远程客户端分配地址,在 IP 地址指定设置对话框中选择“自动”;如果给远程客户端分配静态IP地址,选择“来自一个指定的地址范围”。采用DHCP管理分配IP地址更简单方便,但若网络中没有安装DHCP服务,则必须指定一个地址范围。单击“下一步”继续。
8. 如果选择了“来自一个指定的地址范围”,出现地址范围分配对话框。单击“新建”按钮,指定“起始 IP 地址”和“结束 IP 地址”。Windows 将自动计算地址的数目。单击“确定”以返回到地址范围分配窗口,本例中为远程访问客户分配了从192.168.0.1至192.168.0.20共20个IP地址。远程访问客户在VPN客户端设置时,可以选择该范围中的任何一个IP地址分配。
9. 在出现的身份验证模式对话框中,选择默认选项“否,使用路由和远程访问对连接请求进行身份验证”,此时远程访问用户使用本服务器中管理的用户账号连接本VPN服务器,并且该账号已经授予远程访问权限。如果网络中存在RADIUS服务器,可以集成该服务器验证远程访问客户。然后单击“下一步”继续。
10. 远程vpn网关服务器安装完毕。


2003vpn网关服务器远程访问策略配置

1. 单击“开始”/“程序”/“管理工具”,运行“路由和远程访问”应用程序。
2. 在出现窗口中,选择本地远程访问服务器,单击“远程访问策略”,在右边窗口中鼠标右击“到Microsoft路由选择和远程访问服务器的连接”,单击“属性”菜单项。
3. 在出现的“属性”对话框中,我们可以对远端客户端的远程访问权限进行设置,如果允许远程客户端通过Internet访问该服务器,则选择“授予远程访问权限”;反之,选择“拒绝远程访问权限”。如果还需要对配置文件进行设置,单击“编辑配置文件”按钮,出现“编辑拨入配置文件”对话框。
4. 在“编辑拨入配置文件”对话框中单击IP选项卡,根据需要选择IP地址的分配。共有四种选择,其含义如下:
(1)选择“服务器必须提供一个IP地址”选项,则需要在用户“属性”对话框中给远程登录用户配置一个静态的IP地址,用户属性配置参见用户管理。
(2)选择“客户端可以请求一个IP地址”选项,VPN客户可以设置使用VPN服务器地址池中的任意IP地址,此时VPN用户拥有固定的内网IP地址。
(3)选择“服务器设定IP地址分配”选项,VPN客户端无需配置内部网络IP地址,VPN客户端软件连接VPN服务器时,自动从VPN服务器的IP地址池中获取一个内部IP地址。
(4)选择“分配一个静态IP地址”选项,VPN服务器只为VPN客户端提供一个固定的IP地址,因此,一个时刻只允许远端一台客户机登录VPN服务器。
对上述内容设置完成后单击“确定”,完成对“远程访问策略”的设置。


配置用户的属性

对于允许远程连接的客户账户必须设定其“允许远程访问”,具体步骤如下:
1. 选择“开始”/“控制面板”/“管理工具”/“计算机管理”,打开“计算机管理”窗口,选择“本地用户和组”,单击“用户”。
2. 在用户窗口中选择要设置的用户,鼠标右击用户选择“属性”菜单项。
3. 在出现的“属性”窗口中单击“拨入”选项,然后在出现的如图16-19所示窗口中,选择“允许访问”或“通过远程访问策略控制访问”,则该用户具有远程连接权力。反之,不允许用户远程访问该服务器。若选择“通过远程访问策略控制访问”,则需要按上面配置“远程访问控制策略”。点击“确定”按钮完成设置。


基本配置完成
注意在建立到vpn的连接后,该连接属性->网络->tcp/ip->高级->在远程网络上使用默认网关,如果勾选,则本地网关自动失效。


标签:


2008年8月1日星期五

软件工程师不可不知的10个概念 zz

出色的软件工程师善用设计模式,勤于代码重构,编写单元测试,并对简单有宗教般的追求。除了这些,优秀的软件工程师还要通晓10个概念,这10个概念超越了编程语言与设计模式,软件工程师应当从更广的范围内明白这些道理(全文阅读):

接口 (Interfaces )
惯例与模板 (Conventions and Templates)
分层 (Layering )
算法的复杂性 (Algorithmic Complexity)
散列法 (Hashing )
缓存 (Caching )
并发 (Concurrency )
云计算(Cloud Computing )
安全(Security )
关系数据库 (Relational Databases )

关系数据库 (Relational Databases)

关系数据库因为在大规模 Web 服务上缺乏可扩充性而颇受微词,然而,关系数据库仍然是近20年来计算机技术中最伟大的成就。关系数据库对处理订单,公司数据方面有着出色的表现。

关系数据库的核心是以记录表示数据,记录存放在数据库表,数据库使用查询语言(SQL)对数据进行搜索与查询,同时,数据库对各个数据表进行关联。

数据库的标准化技术(normalization)讲的是使用正确的方式对数据进行分存以降低冗余,并加快存取速度。

9. 安全 (Security)

随着黑客的崛起与数据敏感性的上升,安全变得非常重要。安全是个广义的概念,涉及验证,授权与信息传输。

验证是对用户的身份进行检查,如要求用户输入密码。验证通常需要结合 SSL (secure socket layer)进行;授权在公司业务系统中非常重要,尤其是一些工作流系统。最近开发的 OAuth 协议可以帮助 Web 服务将相应信息向相应用户开放。Flickr 便使用这种方式管理私人照片和数据的访问权限。

另外一个安全领域是网络设防,这关系到操作系统,配置与监控。不仅网络危险重重,任何软件都是。Firefox 被称为最安全的浏览器,仍然需要频频发布安全补丁。要为你的系统编写安全代码就需要明白各种潜在的问题。

8. 云计算 (Cloud Computing)

RWW 最近的关于云计算的文章 Reaching For The Sky Through Compute Clouds 讲到了云计算如何改变大规模 Web 应用的发布。大规模的并行,低成本,与快速投入市场。

并行算法发明以来,首先迎来的是网格计算,网格计算是借助空闲的桌面计算机资源进行并行计算。最著名的例子是 Berkley 大学的 SETI@home 计划,该计划使用空闲的 CPU 资源分析太空数据。金融机构也大规模实施网格计算进行风险分析。空闲的资源,加上 J2EE 平台的崛起,迎来了云计算的概念:应用服务虚拟化。就是应用按需运行,并可以随着时间和用户规模而实时改变。

云计算最生动的例子是 Amazon 的 Web 服务,一组可以通过 API 进行调用的应用,如云服务(EC2),一个用来存储大型媒体文件的数据库(S3),索引服务(SimpleDB),序列服务(SQS)。

7. 并发 (Concurrency)

并发是软件工程师最容易犯错的地方,这可以理解,因为我们一直遵从线形思维,然而并发在现代系统中非常重要。

并发是程序中的并行处理,多数现代编程语言包含内置的并发能力,在 Java,指的是线程。关于并发,最经典的例子是“生产/消费”模式,生产方生产数据和任务,并放入工作线程消费或执行。并发的复杂性在于,线程需要经常访问共同数据,每个线程都有自己的执行顺序,但需要访问共同数据。Doug Lea 曾写过一个最复杂的并发类,现在是 core Java 的一部分。

6. 缓存(Caching)

缓存对现代 Web 程序不可或缺,缓存是从数据库取回,并存放在内存中的数据。因为数据库直接存取的代价非常高,将数据从数据库取回并放在缓存中访问就变得十分必要。比如,你有一个网站,要显示上周的畅销书,你可以从数据将畅销书榜一次性取回放在缓存中,而不必在每次访问时都去数据库读数据。

缓存需要代价,只有最常用的内容才可以放入缓存。很多现代程序,包括 Facebook,依靠一种叫做 Memcached 的分布式缓存系统,该系统是 Brad Firzpatrick 在工作于 LiveJournal 项目时开发的,Memcached 使用网络中空闲的内存资源建立缓存机制,Memcached 类库在很多流行编程语言,包括 Java 和 PHP 中都有。

5. 散列法(Hashing)

Hashing 的目的是加速访问速度。如果数据是序列存储的,从中查询一个项的时间取决于数据列的大小。而散列法对每一个项计算一个数字作为索引,在一个好的 Hashing 算法下,数据查找的速度是一样的。

除了存储数据,散列法对分布式系统也很重要。统一散列法(uniform hash )用来在云数据库环境下,在不同计算机之间分存数据。Google 的索引服务就是这种方法的体现,每一个 URL 都被散列分布到特定计算机。

散列函数非常复杂,但现代类库中都有现成的类,重要的是,如何对散列法进行细调以获得最好的性能。

4. 算法的复杂性 (Algorithmic Complexity)

关于算法的复杂性,软件工程师需要理解这样几件事。第一,大O标记法(big O notation);第二,你永远都不应该使用嵌套式循环(循环里面套循环),你应该使用 Hash 表,数组或单一循环;第三,如今优秀类库比比皆是,我们不必过分纠缠于这些库的效能的差别,我们以后还有机会进行细调;最后,不要忽视算法的优雅及性能,编写紧凑的,可读的代码可以让你的算法更简单,更干净。

3. 分层 (Layering)

用分层来讨论软件架构是最容易的。John Lakos 曾出版过一本关于大型 C++ 系统的书。Lakos 认为软件包含了层,书中介绍了层的概念,方法是,对每个软件组件,数一下它所依赖的组件数目就可以知道它的复杂程度。

Lakos 认为,一个好的软件拥有金字塔结构,就是说,软件组件拥有层层积累的复杂度,但每个组件本身必须简单,一个优秀的软件包含很多小的,可重复使用的模块,每个模块有自己的职责。一个好的系统中,组件之间的依赖性不可交叉,整个系统是各种各样的组件堆积起来,形成一个金字塔。

Lakos 在软件工程的很多方面都是先驱,最著名的是 Refactoring (代码重构)。代码重构指的是,在编程过程中需要不断地对代码进行改造以保证其结构的健壮与灵活。

2. 惯例与模板 (Conventions and Templates)

命名惯例和基础模板在编程模式中常被忽视,然而它可能是最强大的方法。命名惯例使软件自动化成为可能,如,Java Beans 框架在 getter 和 setter 方法中,使用简单的命名惯例。del.icio.us 网站的 URL 命名也使用统一的格式,如 http://del.icio.us/tag/software 会将用户带到所有标签为 software 的页。

很多社会网络均使用简单命名,如,你的名字是 johnsmith ,那你的头像可能命名为 johnsmith.jpg,而你的 rss 聚合文件的命名很可能是 johnsmith.xml 。

命名惯例还用于单元测试,如,JUnit 单元测试工具会辨认所有以 test 开头的类。

我们这里说的模板(templates )指的并不是 C++ 或 Java 语言中的 constructs,我们说的是一些包含变量的模板文件,用户可以替换变量并输出最终结果。

Cold Fusion 是最先使用模板的程序之一,后来,Java 使用 JSP 实现模板功能。Apache 近来为 Java 开发了非常好用的通用模板, Velocity。PHP 本身就是基于模板的,因为它支持 eval 函数。

1. 接口(Interfaces)

软件工程中最重要的概念是界面。任何软件都是一个真实系统的模型。如何使用简单的用户界面进行模型化至关重要。很多软件系统走这样的极端,缺乏抽象的冗长代码,或者过分设计而导致无谓的复杂。

在众多软件工程书籍中,Robert Martin 写的《敏捷编程》值得一读。

关于模型化,以下方法对你会有帮助。首先,去掉那些只有在将来才可能用得着的方法,代码越精练越好。第二,不要总认为以前的东西是对的,要善于改变。第三,要有耐心并享受过程。

标签:


SourceForge宣布2008年度社区选择奖

最佳项目、最佳企业项目和最佳教育项目皆为OpenOffice.org;
最有可能成为下个10亿美元收购项目:phpMyAdmin;
最佳多媒体项目:VLC;
最佳游戏项目:XBMC;
最可能改变世界的项目:Linux;
最佳新项目:Magento;
最有可能被起诉侵犯专利的项目:Wine Is Not an Emulator;
最有可能让用户被过时的行业协会为保护死亡的商业模式起诉的项目:eMule;
最佳系统管理工具:phpMyAdmin;
最佳开发者工具:Notepad++。

标签:


This page is powered by Blogger. Isn't yours?

订阅 博文 [Atom]