December 30, 2004

批处理的方式自动修改IP地址

我经常需要修改笔记本电脑的IP地址,在图形界面下修改IP地址很不方便,可不可以用批处理的方式自动修改IP地址呢?

climbmount答:你可以用netsh在命令行的方式下修改IP地址,也可以把它写成批处理,这样就简单多了。

D:\>netsh
netsh>ip
netsh>interface
netsh interface>ip
此上下文中的命令:
set address - 设置指定的接口的 IP 地址或默认网关。
set dns - 设置 DNS 服务器模式和地址。
set wins - 设置 WINS 服务器模式和地址。
netsh interface ip>set address

用法: set address [name=]
[[source=]dhcp |
[source=] static [addr=]IP address [mask=]IP subnet mask]
[[gateway=]|none [gwmetric=]integer]

参数:
标记 值
name - 接口名称。
source - 下列值之一:
dhcp: 对于指定接口,设置用 DHCP 配置 IP地址。
static: 设置使用本地静态配置设置IP地址。
gateway - 下列值之一:
: 您设置的 IP 地址的指定默认网关。
none: 不设置默认网关。
gwmetric - 默认网关的跃点数。如果网关设置为 'none',则不应设置此字段。
只有在 'source' 为 'static' 时才设置下列选项:
addr - 指定接口的 IP 地址。
mask - 指定 IP 地址的子网掩码。

示例: set address name="Local Area Connection" source=dhcp
set address local static 10.0.0.9 255.0.0.0 10.0.0.1 1

上面是用netsh一步步进入的,实际上你可以用一条命令直接在DOS修改IP地址,如:
Netsh interface ip set address local static 10.0.0.9 255.0.0.0 10.0.0.1 1
注意:上面的参数都不能省略,网关没有的话请写none,有网关是跃点数通常写1。

想想看,如果你因为移动的原因经常需要把笔记本的IP地址在两个IP之间改来改去,只需要做好两个批处理然后在需要的时候执行它们就可以了。

Posted by hufey at 03:35 PM | Comments (4)

December 28, 2004

收藏:新浪越野联盟路况分级标准

介都谁琢磨的呀
--------------------------------

新浪越野联盟路况分级标准
(由jeeprider编制,新浪网切大队2003年讨论通过,2004年正式施行)

第一级:铺装路面, 包括高速, 国道, 省道等 平坦相对少连续弯道;(4X2)

第二级:铺装路面, 连续盘山路面, 弯多, 过弯时无可视前方角度及平坦的土路, 碎石路面;(4X2)

第三级:土路, 碎石, 连续盘山路面,坡度10度,有20CM以下的硬底涉水,及冰雪覆盖的2级路面;(4X2)

第四级:冰雪覆盖的3级路面及较多10CM左右的凹凸, 石块,10CM深的长距离泥路,35CM的硬底涉水,坡度18度以下的非铺装路面,长距离软性沙地;(4X4或配有驾驶经验丰富的4X2车辆)

第五级:20CM积雪路面,20CM深的长距离泥路,坡度23以下碎石路面;(4X4)

第六级:道路很窄,有30cm高的石块,50CM的硬底涉水,有需要查看才能通过的泥潭,坡度25度以下碎石路面障碍,需要熟练的越野车驾驶水平,偶尔需要副驾驶员协助;(4X4)

第七级:道路极其狭窄,仅够车辆勉强通过,经常有30cm凹凸,30cm深的泥潭并且上坡,70cm的硬底涉水,需要熟练的越野车驾驶水平和丰富道路判断经验,需要副驾驶协助驾驶通过,有些风险,车辆需要适当改造;(4X4)

第八级:难度高于以上级别, 车辆需高可靠性的改装和携带辅助装置,及人为选择必须通过以上全部级别障碍的路面,需 要极其丰富的驾驶经验和必须依靠辅助驾驶员协助,风险比较大;(4X4)

Posted by hufey at 04:10 PM | Comments (0)

December 27, 2004

linux 2.6.10 released

usbdevfs改名叫usbfs了
害的我还得改/etc/rc.d/rc.sysinit
光区分2.4和2.6已经不够了
还要区分2.6.9以下和2.6.10以上
搞什么搞嘛

Posted by hufey at 01:05 PM | Comments (0)

December 23, 2004

俺工作的地方(雪后。窗外)

Posted by hufey at 08:46 PM | Comments (3)

December 18, 2004

收藏:系统安全:Linux 系统下的病毒发展及其分类

原文出处

系统安全:Linux 系统下的病毒发展及其分类


1996年的Staog是Linux系统下的第一个病毒,它出自澳大利亚一个叫VLAD的组织(Windows 95下的第一个病毒程序Boza也系该组织所为)。Staog病毒是用汇编语言编写,专门感染二进制文件,并通过三种方式去尝试得到root权限。 Staog病毒并不会对系统有什么实质性的损坏。它应该算是一个演示版。它向世人揭示了Linux可能被病毒感染的潜在危险。Linux系统上第二个被发现的病毒是Bliss病毒,它是一个不小心被释放出来的实验性病毒。与其它病毒不同的是,Bliss本身带有免疫程序,只要在运行该程序时加上 “disinfect-files-please”选项,即可恢复系统。  

  如果说刚开始时Linux病毒向人们展示的仅仅是一个概念,那么,在2001年发现的Ramen病毒,则已经开始引起很多人的担心。Ramen病毒可以自动传播,无需人工干预,所以和1988年曾使人们大受其苦的 Morris蠕虫非常相似。它只感染Red Hat 6.2和7.0版使用匿名FTP服务的服务器,它通过两个普通的漏洞RPC.statd和wu-FTP感染系统。  

  表面看来,这不是一个危险的病毒。它很容易被发现,且不会对服务器做出任何有破坏性的事情。但是当它开始扫描时,将消耗大量的网络带宽。  

  从1996年至今,新的Linux病毒屈指可数,这说明Linux是一个健壮的具有先天病毒免疫能力的操作系统。当然,出现这种情况,除了其自身设计优秀外,还有其它的原因。  

  首先,Linux早期的使用者一般都是专业人士,就算是今天,虽然其使用者激增,但典型的使用者仍为那些有着很好的电脑背景且愿意帮助他人的人, Linux 高手更倾向于鼓励新手支持这样一种文化精神。正因为如此,Linux使用群中一种倾向就是以安全的经验尽量避免感染病毒。其次,年轻,也是Linux很少受到病毒攻击的原因之一。事实上,所有的操作系统(包括DOS和Windows)在其产生之初,也很少受到各种病毒的侵扰  

  然而, 2001年3月,美国SANS学院的全球事故分析中心(Global Incident Analysis Center——GIAC)发现,一种新的针对使用Linux系统的计算机的蠕虫病毒正通过互联网迅速蔓延,它将有可能对用户的电脑系统造成严重破坏。这种蠕虫病毒被命名为“狮子”病毒,与Ramen蠕虫病毒非常相似。但是,这种病毒的危险性更大,“狮子”病毒能通过电子邮件把一些密码和配置文件发送到一个位于china.com的域名上。Dartmouth学院安全技术研究所工程师威廉·斯蒂恩斯说:“攻击者在把这些文件发回去之后就可以通过第一次突破时的缺口再次进入整个系统。这就是它与Ramen蠕虫病毒的不同之处。事实上,Ramen病毒是一种比较友善的病毒,它在侵入系统后会自动关闭其中的漏洞,而这个病毒却让那些漏洞敞开并开辟新的漏洞。以至于如果你的系统感染了这个病毒,我们不能百分之百确信这个系统有挽救的价值,更加合理的选择很有可能是转移你的数据并且重新格式化硬盘。”  

  一旦计算机被彻底感染,“狮子”病毒就会强迫电脑开始在互联网上搜寻别的受害者。不过,感染“狮子”病毒的系统少于感染Ramen病毒的系统,但是它所造成的损失却比后者大得多。  

  随着Klez病毒在Linux平台上的传染,防毒软件厂商开始提醒我们微软的操作系统不再是唯一易受病毒攻击的操作系统了。即使Linux和其他一些主流 UNIX平台的用户可能不是微软捆绑应用软件的大用户,不可能通过这些软件造成病毒的泛滥,Linux和UNIX仍然有它们自身并不引人注目的脆弱点。除了Klez以外,其他Linux/UNIX平台的主要威胁有:Lion.worm、OSF.8759病毒、Slapper、Scalper、 Linux.Svat和BoxPoison病毒,这些都很少被提及。  

  病毒的制造者是一些精通编写代码的黑客,他们远比那些胡乱涂改网站却对编写病毒知之甚少的黑客要危险。一个被黑掉的网站可以很快修好,而病毒却更加隐蔽,会带来潜在的安全隐患,它会一直潜伏,直到给系统带来不可挽回的损害。  

  另外,越多的Linux系统连接到局域网和广域网,就会有越多受攻击的可能,这是因为很多Linux病毒正在快速地扩散着。使用WINE的 Linux/UNIX系统特别容易受到病毒的攻击。WINE是一个公开源代码的兼容软件包,能让Linux平台运行Windows应用软件。 WINE系统特别容易遭受病毒的攻击,因为它们会使无论是对Linux的还是对 Windows的病毒、蠕虫和木马都能对系统产生威胁。  

  Linux平台下的病毒分类  

  可执行文件型病毒:可执行文件型病毒是指能够寄生在文件中的,以文件为主要感染对象的病毒。病毒制造者们无论使用什么武器,汇编或者C,要感染ELF 文件都是轻而易举的事情。这方面的病毒如Lindose,当其发现一个ELF文件时,它将检查被感染的机器类型是否为Intel 80386,如果是,则查找该文件中是否有一部分的大小大于 2,784字节(或十六进制AEO),如果满足这些条件,病毒将用自身代码覆盖它并添加宿主文件的相应部分的代码,同时将宿主文件的入口点指向病毒代码部分。一个名为Alexander Bartolich的学生发表了一篇名为《如何编写一个Linux的病毒》的文章,详细描述了如何制作一个感染在Linux/i386的ELF可执行文件的寄生文件病毒。有了这样具启发性的、在网上发布的文档,基于Linux的病毒数量只会增长的更快,特别是自Linux的应用越来越广泛之后。  

  蠕虫(worm)病毒:1988年Morris蠕虫爆发后,Eugene H. Spafford 为了区分蠕虫和病毒,给出了蠕虫的技术角度的定义,“计算机蠕虫可以独立运行,并能把自身的一个包含所有功能的版本传播到另外的计算机上。” (worm is a program that can run by itself and can propagate a fully working version of itself to other machines. )。在Linux平台下,蠕虫病毒极为猖獗,像利用系统漏洞进行传播的ramen,lion,Slapper……这些臭名远播的家伙每一个都感染了大量的 Linux系统,造成了巨大的损失。它们就是开放原代码世界的nimda,红色代码。在未来,这种蠕虫病毒仍然会愈演愈烈,Linux系统应用越广泛,蠕虫的传播程度和破坏能力也会随之增加。  

  脚本病毒:目前出现比较多的是使用shell脚本语言编写的病毒。此类病毒编写较为简单,但是破坏力同样惊人。我们知道,Linux系统中有许多的以.sh结尾的脚本文件,而一个短短十数行的shell脚本就可以在短时间内遍历整个硬盘中的所有脚本文件,进行感染。因此病毒制造者不需要具有很高深的知识,就可以轻易编写出这样的病毒,对系统进行破坏,其破坏性可以是删除文件,破坏系统正常运行,甚至下载一个木马到系统中等等。  

  后门程序:在广义的病毒定义概念中,后门也已经纳入了病毒的范畴。活跃在Windows系统中的后门这一入侵者的利器在Linux平台下同样极为活跃。从增加系统超级用户账号的简单后门,到利用系统服务加载,共享库文件注射,rootkit工具包,甚至可装载内核模块(LKM),Linux平台下的后门技术发展非常成熟,隐蔽性强,难以清除。是Linux系统管理员极为头疼的问题。  

  病毒、蠕虫和木马基本上意味着自动化的黑客行为,也许被病毒攻击比被黑客攻击更可能发生。直接的黑客攻击目标一般是服务器,而病毒是等机会的麻烦制造者。如果你的网络包含了Linux系统,特别危险的是服务器,不要在作出反应之前等待寻找Linux病毒、蠕虫和木马是否存在。做一些调查然后选择一个适合你系统的防毒产品,它们能帮你防止病毒的传播。至于Linux平台病毒在未来的发展,一切皆有可能。Windows下的病毒发展史,也有可能在 Linux上重演,这取决于Linux的发展。


发布人:snow 来自:eNet硅谷动力

Posted by hufey at 03:26 PM | Comments (1)

December 17, 2004

echoshadow妹子给俺地


笑死俺咧

Posted by hufey at 11:30 AM | Comments (0)

December 13, 2004

Hacking the iPod

Posted by hufey at 02:50 PM | Comments (0)

December 10, 2004

继续5

pc100609.jpg

Posted by hufey at 02:50 PM | Comments (0)

继续4

pc100608.jpg

Posted by hufey at 02:49 PM | Comments (0)

继续3

pc100607.jpg

Posted by hufey at 02:48 PM | Comments (0)

继续2

pc100606.jpg

Posted by hufey at 02:46 PM | Comments (0)

其他的图片都上传到别的服务器,这个就放paowang吧

pc100604.jpg

Posted by hufey at 02:44 PM | Comments (0)

December 06, 2004

FireFox的几个小技巧(提高浏览速度)

CSDN - 文档中心 - 其他 阅读:72 评论: 0 参与评论

标题 FireFox的几个小技巧(提高浏览速度) 选择自 ycool1984 的 Blog
关键字 FireFox的几个小技巧(提高浏览速度)
出处
1. Enalbe IPv6。大部分网站使用IPv4协议,在FF里IPv6默认是disabled的,所以打开IPv6,对支持IPv6的网站会提高浏览速度。 具体步骤: a. 在FF地址栏里输入:about:config; b. 然后找到Network.dns.disableIPv6,双击后,其键值由"false"变为"true"; c. 重启FF后生效。 2. 另外如下设置也会提高浏览速度:具体步骤同上。 network.http.max-connections: 48 network.http.max-connections-per-server: 24 network.http.max-persistent-connections-per-proxy: 12 network.http.max-persistent-connections-per-server: 6 network.http.pipelining: true network.http.pipelining.maxrequests: 32 network.http.proxy.pipelining: true 3。地址栏自动填入完成。 FF虽然也能记忆以前输入的地址,但只是在下拉菜单里,并不直接把最相近的地址显示在地址栏里。如下设置会完成此功能: a. 在FF地址栏里输入:about:config; b. 右击任何空白处,选new->boolean,然后输入browser.urlbar.autoFill,设置成"true"; c. 同上步骤建立browser.urlbar.autocomplete.enabled d. 重启FF后生效。
作者Blog:http://blog.csdn.net/ycool1984/

Posted by hufey at 03:34 PM | Comments (0)

December 03, 2004

安装Pike 7.6.24

一直想找一个好的命令行下载软件
找啊找,找啊找
终于在freshmeat.net找到了一个pcp
而且是个script,更激发了我的兴趣
结果连不上
只好用gaim呼叫爱红大兄弟帮我搞下来
下崽完一看,果然是script,不过是pike的script
这个pike倒没搞过
再下pike,也下不下来
再呼叫爱红大兄弟,把pike下崽下来
解开后倒简单,直接make就把./configure都做了又编译出来binary
安装却说啥啥不对
放狗找了半天也没找到有价值的东西
只好cd src去查
原来./configure的时候需要指定安装目录
再./configure
再make,倒不费时间
再make install,就弄得了
再pcp,爽!!!

Posted by hufey at 01:50 PM | Comments (1)

December 02, 2004

Python 2.4


What's new in Python 2.4

Here are the (subjective) highlights of what's new in Python 2.4.
Faster

A number of modules that were added in Python 2.3 (such as sets and heapq) have been recoded in C. In addition, there's been a number of other speedups to the interpreter. (See section 8.1, Optimizations, of the "What's New" document for more).
New language features

* multi-line imports - when using imports in the form from foo import bar, baz, bing, bang, you can surround the imported names with brackets, and they can be split across lines. This is part of PEP 328.
* Farewell to OverflowWarning - as documented in PEP 237, Python no longer generates OverflowWarnings.
* function/method decorators - function and method decorators, first described in PEP 318, have been added to the language, using 'pie-decorator' syntax. Decorators are on the line before the 'def', and prefixed with an '@' sign. (PEP 318)
* Assigning to None - the compiler now treats assigning to None as a SyntaxError.
* Failed import cleanup - when a module import failed, versions of Python prior to 2.4a2 would leave a broken module in sys.modules - subsequent attempts to import the failing module would silently succeed, but use the broken module object. The import machinery now removes the failing module from sys.modules if the import fails.
* The -m command line option - python -m modulename will find a module in the standard library, and invoke it. For example, python -m pdb is equivalent to python /usr/lib/python2.4/pdb.py

New or upgraded built-ins

* built-in sets - the sets module, introduced in 2.3, has now been implemented in C, and the set and frozenset types are available as built-in types (PEP 218)
* unification of integers and long integers - an operation that would return a number too big for an integer will automatically return a long integer. (PEP 237)
* generator expressions - generator expressions are similar to a list comprehension, but instead of creating the entire list of results they create a generator that returns the results one by one. This allows for efficient handling of very large lists. (PEP 289)
* reversed() - a new builtin that takes a sequence and returns an iterator that loops over the elements of the sequence in reverse order (PEP 322)
* new sort() keyword arguments - sort() now accepts keyword arguments cmp, key and reverse
* sorted() - a new builtin sorted() acts like an in-place list.sort() but can be used in expressions, as it returns a copy of the sequence, sorted.
* string methods - strings gained an rsplit() method, and the string methods ljust(), rjust() and center() accept an argument to specify the fill character.
* eval() now accepts any form of object that acts as a mapping as its argument for locals, rather than only accepting a dictionary. There's all sorts of new and shiny evil possible thanks to this little change.

New or upgraded modules and packages

* a new subprocess module for spawning processes in a platform-independent way (see PEP 324)
* decimal - a new numeric type that allows for the accurate representation of floating point numbers (avoiding the problems of binary floating point) (PEP 327)
* os.urandom() has been added for systems that support a source of random data (entropy)
* The mpz, rotor and xreadlines modules have been removed.
* The difflib module now includes an HtmlDiff class that creates an HTML table showing a side by side comparison of two versions of a text.
* The socket module gained the socketpair() function, on systems that support it.
* os.path.lexists(), which tests whether the path is a symlink.
* The doctest module has been massively refactored, with many new features added, and many new hooks for customizing behavior.
* Non-blocking SSL sockets work again.
* time.strptime() can now infer the date using %U or %W (week of the year) when the day of the week and year are also specified.
* The optparse module was updated to Optik 1.5a1.
* The new module cookielib supports client-side HTTP cookies. urllib2 gained a new class HTTPCookieProcessor that uses this new module.
* The CJKCodecs collection of East Asian codecs, maintained by Hye-Shik Chang, was integrated into 2.4.
* The email package's Parser was completely rewritten to better handle malformed email messages. It should now never fail to parse a message and will annotate the parsed message to indicate what problems were found during the parsing. There is also a new FeedParser that allows messages to be fed into the parser as they are read in.
* The bisect module now has an underlying C implementation for improved performance.
* There is a new collections module for various specialized collection datatypes. Currently it contains just one type, deque, a double-ended queue that supports efficiently adding and removing elements from either end.
* The asyncore module's loop() now has a count parameter that lets you perform a limited number of passes through the polling loop. The default is still to loop forever.
* The curses module now supports the ncurses extension use_default_colors(). On platforms where the terminal supports transparency, this makes it possible to use a transparent background.
* imaplib now supports the IMAP THREAD command
* heapq has two new functions nlargest() and nsmallest() to find the N largest or smallest values in a dataset.
* itertools has a new function groupby() that acts a little like an SQL "GROUP BY" statement. It also gained a function tee() that returns N independent iterators that replicate the iterator passed as an argument.
* A new function basicConfig() was added to the logging package to simplify setup for logging. There is also a new TimedRotatingLogFileHandler which automatically rotates log files at a fixed interval.
* The operator module gained functions attrgetter() and itemgetter()
* The posix module (available as os) has a new function getsid()
* poplib supports POP over SSL
* profile can now profile C extension functions
* random has a new method getrandbits(N) to return a random integer N bits long.
* The re module was extended to allow simple conditional expressions in regular expressions. In addition, the underlying SRE engine is now non-recursive (previously, certain types of regular expression would run into troubles with recursion).
* The weakref module now supports a wider variety of Python objects includes Python functions, class instances, sets, frozensets, deques, arrays, files, sockets and regular expression objects. In addition, the weakref type is now a new-style object which can be subclassed.
* xmlrpclib now supports a multi-call extension for transmitting multiple XML-RPC calls in a single HTTP operation.
* The base64 module now supports Base64, Base32 and Base16 encoding and decoding, and more complete support for RFC 3548.

Posted by hufey at 06:08 PM | Comments (0)

美军装备了机枪的机器人


还可以配rocket launcher

一个美国SB在slashdot上说
Good News in War Against China (Score:1, Funny)
by Anonymous Coward on Wednesday December 01, @10:14PM (#10970704)
The Chinese have low regard for human life [phrusa.org] and would be willing to throw millions of soldiers to their death against the Americans in any war. The scenario would be like a human wave, and the idea is for the wave to overwhelm our forces.

These machine-gun robots is the perfect answer to a Chinese wave attack. I could imagine them being amphibious. On a fine morning like 2006 December 7, millions of them would rise up out of the ocean tide and onto the beaches of China. They would march relentless across China, killing all the Chinese soldiers.

The final destination would be Tibet.

As that old Negro spiritual goes, "[Tibet,]free at last! [Buddha] all mighty! Free at last!"

另一个比较幽默:
Re:Good News in War Against China (Score:2, Funny)
by Guncrazy (633221) on Wednesday December 01, @11:55PM (#10971452)
Shh...not so loud! The military is probably planning to outsource the manufacture of these robots to China.

Posted by hufey at 01:46 PM | Comments (1)

December 01, 2004

青梅期待的OCR手机问世了


青梅期待的OCR手机问世了

Posted by hufey at 12:16 PM | Comments (0)