Yong 的个人资料Lyrids' Sub-Space for Wi...日志列表网络 工具 帮助

Lyrids' Sub-Space for Windows

Simplicity Is Beauty
8月16日

MJHERO

I've beening working with the following
 
 
online Mahjong game site for 16 months. Drop in and enjoy it, it's totally free and full of fun, excitement and prizes. 
 
12月21日

Cleverness is the enemy of maintenance

Guess what the following line of code means:
 
$optimal_result = [$result1=>$result2]->[$result2<=$result1];
 
(Answer: $optimal_result is assigned to the  smaller value of $result1 and $result2.)
 
[$result1=>$result2] creates a reference to a list containing ( $result1, $result2),
and the -> de-reference the reference above, which leads to the list
$result2<=$result1 will be 0 if $result2 is bigger than $result1, and 1 otherwise, and thus
[$result2<=$result1] is either [0] or [1], So the whole expression is wither
($result1,$result2) [0] , when $result2 > $result1
or
($result1,$result2) [1], when $result2 <= $result1
 
!!!
Perl is a powerful language to write such cryptic code in such an elegant way. :)

Cool Perl modules (2)

Config::Std
Config::Tiny
Config::General
 
They're over than enough to handle INI and most other common configuration files.

Good Perl Modules

Regexp::Common - with the largest set of tests , 175000 !!!
IO:Prompt - does ont work on Windows
List::Utils - the first() function
Module::Starter - create module skeleton

Perl - the GetOpt::Clade package - so cool !

Getopt::Long is probably more than adequate for most developers' command-line processing needs. And while its feature set is still limited, those very limitations may actually be an advantage, as they tend to discourage the creation of "adventurous" interfaces. However, if your applications do have more advanced requirementssuch as mutually exclusive options (verbose vs taciturn), or options that can be used only with other options (-bak being valid only if insitu is in effect), or options that imply other options (garrulous implying verbose)then there are dozens of other Getopt:: modules on the CPAN to choose from[*].

[*] Literally. At last count there were at least 30 distinct Getopt:: modules on CPAN. Perl's secret shame!

 

One of the most powerful and adaptable of these is Getopt::Clade. With it, the command-line processing implemented in the previous examples could be implemented as in Example 14-4.

Example 14-4. Command-line parsing via Getopt::Clade

# Handle command lines of the form:

# # > orchestrate -in source.txt -o=dest.orc --verbose

# Specify and parse valid command-line arguments...

use Getopt::Clade q{

-i[n] [=] Specify input file [default: '-']

-o[ut] [=] Specify output file [default: '-']

-l[en] [=] Display length [default: 24 ]

-w[id] [=] Display width [default: 78 ]

-v Print all warnings --verbose [ditto]

};

# Report intended behaviour...

if ($ARGV{-v}) {

    print "Loading first $ARGV{'-l'} chunks of file: $ARGV{'-i'}\n"

 }

# etc.

To create an interface using Getopt::Clade, you simply load the module and pass it the usage message you'd like to see. It then extracts the various options you've specified, builds a parser for them, parses the command line, and then does any appropriate type-checking on what it finds. For example, the -i flag's slot is specified with the suffix :in, indicating that it's supposed to be an input file. So Getopt::Clade checks whether any string in that slot is the name of a readable file. Likewise, the :+int marker in -l causes the module to accept only a positive integer in that slot. Once the command line has been parsed and verified, the module fills in any missing defaults, and puts results in the standard %ARGV hash[*]. [*] Yes, that's a non-lexical variable. However, like its more famous siblings @ARGV and $ARGV, it has special status in a Perl program. Like the %ENV hash, it represents part of the external environment of the program, so the use of this global variable is acceptable under these guidelines. It doesn't even create problems under use strict. Notice that there are no specifications for help, usage, version, or man flags; they're always generated automatically. Likewise, there's no need for explicit error-handling code: if command-line parsing fails, Getopt::Clade generates the appropriate error message automatically, piecing together a full usage line from the options you specified. The module has many other features, and is definitely worth considering when implementing complex command-line interfaces.

4月25日

DV-Sub tools - finally I got YOU!!!

Long I've been planning converting all the 20plus DV tapes into high resolution DivX files. But until 3 days ago, when I found the great tool - DVSubMaker, I did not start seriously, for concerning about the loss of precious timecode/date information during the DV capturing.

It's really a shame that Adobe Premiere , and MS MovieMaker does not explicitly support extracting the timecode track information, though aparently they support timecode.

DVSubMaker is a freeware written by Mike Laba (aka Krong) in 2002. If you need it, google it.

3月28日

3COM DABS无盘启动GHOST

3COM DABS无盘启动GHOST--解放你的网管(附视频下载)

为了这个,让我找了不少时间,今晚终于搞定它了,兴奋之余,写出来和朋友们共同分享。

现在不知道GHOST的人可能是外星人了,但真正用过GHOST企业版来网络克隆的人就不多了,至少目前我还没见到除了我公司之外的人也在用,原因是我们太封闭了

网络克隆软件或硬件一般都是利用多播服务来实现的,这些软件有好多,GHOST企业版应该是属于老大了,国产也有几个,但用得人似乎也不多,还原卡里自带的网络克隆挺好,但购买的人太少了,破解的又不能用。

要实现网络客户机的安装维护,网络克隆应该是个非常好的方法,不仅是初始安装还是日后维修维护,都不需要拆机,但没有软驱、光驱几乎是每一个网吧都这样,公司也并不一定都会有的,特别是一些人手一台且人很多的,BOSS都知道如何去省下这笔银子。

以前在维护学校的有盘网时,曾作过RPL无盘启动,但当时没有GHOST网络版,所以都是一台台克隆,当同时克隆5、6台时,明显速度慢了许多,且容易掉线,不能适应多台机器同时操作,当然现在有了企业版,但又想到要支持RPL无盘启动,似乎叙述起来,会有更多人不理解,没有一定的网络基础的人可能会感觉和天书一样难,特别是RPL有一点很是头疼的地方,一个网络里如果有不同的网卡MAC(前六位数),就需要为之配置不同的配置,能作到这点的人更少了,每个网卡还要为它指定配置,更不要说网络里有不同品牌芯片的网卡了。三年前我曾为配置四种网卡的RPL无盘,花了我一通宵,那时还没有一些小软件让你方便的添加不同网卡。

所以这篇文章我想讲得尽是简单些,让不懂无盘的朋友一样可以快速的上手,但要实现这个功能牵涉的软件还挺多,请朋友们耐心读完此文,并且保证每个人都可以自己测试(这次无需我提供测试了,真轻松)。

好吧,请朋友们准备一些软件:
1. 3com dabs (提供TFTP无盘启动)
2. ghost 7.5/8.0企业版,为方便英文不好的朋友,在此使用7.5中文版
3. vmware虚拟PC的软件,不要用VIRTUAL PC,它不支持PXE ROM,此软件不是必需,是用来提供虚拟客户,相信很多朋友不会有二台以上机器的。
4. 操作系统,要NT以上的SERVER版,提供DHCP服务,好象XP PRO也有,不记得了。
这次要讲几个软件了,挺辛苦的。

所需硬件:
1. 一台电脑应该是需要了,作为服务器。
4. 客户机,要有支持PXE启动的ROM,写在主板里也可,此文不讲如何去写,如朋友有兴趣,我以后再贴。如果是网吧或公司那就正好了,够你玩得了。这才是实用的,并非测试了。




安装步骤:

这里可能要分三步来完成了,
一、软件安装;
二、服务器设置;
三,软件测试及使用。



先来讲一下预先需安装的软件:

一、VMWARE WORKSTATION 4.5.1是一个虚拟PC的软件,可以让你一下子多出一个或N个电脑。很多情况下我们要测试系统或者玩黑客软件时及不想搞乱自己的系统来测试软件的,都用到这类软件,之所以选择它,是因其速度还可以,且支持PXE ROM启动,但其需要内存大,如果内存小的朋友请建虚拟机时把内存调小一点,否则启动不了虚拟机。

下载这个软件,直接点那个安装文件即可以了。出现安装向导,点“NEXT”,当出现是否禁用光驱自动运行是,默认“是”,一般选“否”就行了,这样不会导致以后光驱不能自动播放。后面就按默认值安装就行了,安装结束后会多出二个虚拟的网卡出来,不用管它。

至此,VMWARE安装好了。

二、第二个需要安装的软件是GHOST7.5企业版了,这可是我舍不得拿出来的宝贝,不过可惜只能管理10个客户端,但大多数人都用不完它,也很少用到它。如果谁有更多客户端的注册码,8.0的注册码也行,能给我将十分感谢!
很多人都从网上下载了GHOST网络版,实际上只是企业版的一个组件,但已经表现出它强大的功能了,我想有很多人得益不少吧。
为什么要安装它,如果不是为了要作软盘启动盘或3COM启动盘的话,我也懒得拿出来了,因为即便拿出,也不见得有多少人识货。当然它支持的网卡再多也有限,但只要有驱动还是可以添加的,如果谁不会添加启动盘,可和我再联系。
安装这个软件当然也得下载了。

双击setup.exe文件安装,然后“下一步”,许可协议等就不必我说了,在安装类型下选择“控制台”,这个包括了所有组件,功能强大,我也没去深究,它的PDF文件差不多有上千页,不能完全搞透,嘿。在随后的“用户信息”里填写压缩包里SN.TXT里的注册信息,然后就是一路“下一步”了,直到安装结束。
第一次启动Ghost 控制台最好注册一下,见图。

三、安装3com dabs,不用管它是什么软件了,反正它能提供TFTP服务,下载这个软件并安装它(真是费话)。双击“dabs101_install.exe”安装,“NEXT”,然后需要输入注册码,输入SN里的数字“0111151111111111”,然后再“NEXT”,在选择安装类型时选“SERVER”,然后一直“NEXT”到“FINISH”。

四、安装DHCP服务,进入“控制面板”,然后再进入“添加/删除程序”,再点“安装WINDOWS组件”,在“网络服务”里找到“动态主机配置协议(DHCP)”,选中它,然后确定,一直到安装结束。

好了,第一步骤完成,还仅仅完成了1/3,如果不是为了多数人的话,这些都成了费话中的费话了。


现在该设置服务器了。

服务器设置:

一、设置DHCP:

1、建立IP作用域:
打开“管理工具”的DHCP,新建的是不会有作用域的,所以我们先来建个作用域,右键单击你的服务器,选择“新建作用域”,然后在“名称”及“描述”里随便填就行了,好记就行,在“ip地址范围”里填写合法的起始IP和结束IP,再下一步,“添加排除”里不用填它,下一步,一直到“配置DHCP选项”,选择“否,我想稍后配置这些选项”,因为后面那些关于上网的设置已经不用了,下一步完成即可,一个作用域建立好了,但目前还没激活,右键单击“作用域”,然后选择“激活”。

2、添加作用域选项:
右键单击“作用域选项”,选择“配置选项”,在“可用选项”里选中“067 启动文件名”,字符串值里输入“mba.pxe”,点确定后完成如图。

3、设置作用域属性:
右键单击作用域选择属性,然后在高级里选择“两者”,默认只启用了DHCP。确定即DHCP服务就设置好了。


二、生成无盘启动所需的软件镜象文件:
1、在你的硬盘上新建个目录,我在D盘建了个TFTP目录;
2、启动“Ghost 启动向导”,然后选择最后一个“TCP/IP网络启动映像”,下一步,在下面的列表框里有很多网卡的驱动,如果用RTL8139网卡的话,选择其中的“Kingston KNE120TX Fast EtheRx 10-100”作就行,此处为了测试,配合VMWARE虚拟机,我们需要选择的是“AMD PCNET Family”网卡,点4次下一步,然后选择映像文件存放的目录,请选择上面所建立的TFTP目录,文件名取“ghost.sys”,点二次下一步,再点完成,映像文件生成。

三、建立PXE目录启动文件:
1、运行3COM工具里的“3COM Boot Image Edito”,第一次启动有些需要回答的,点下一步,然后在网络里去掉“NETWARE”,现在很少人用它了,再下一步,出现多个菜单,选择第三个“Create a PXE menu boot file...”;
2、点“Add”添加一个文件,在image file里选择D:\FTFT\ghost.SYS文件,点“OK”;
3、然后点“SAVE”,保存在D:\TFTP目录下,文件名取“MBA.PXE”,和前面DHCP里的配置选项对应,切记;


四、设置TFTP SERVER:
1、运行3COM工具里的“TFTP SERVER”,在网络适配器里选择你的本地网卡,“OK”;
2、点菜单上的“OPTIONS”,选择“Setting...”,然后在标签“File Transfer”里勾选“Transmit secure mod”,然后点旁边的“Browse”,目录选择刚才的D:\TFTP,确定设置完毕退出。


五、运行“services.msc”,然后在服务里找到“3Com TFTP”服务,启动它,如果你想下次不必再手动了,可改为自动。


到此为止,我们离成功只差一点点了,不要睡着哦。虽然这不算太简单,但也不太难啊,我还没人教我呢,不应在这里放弃吧。打起精神,该测试成果了!

测试过程:
1、启动刚才安装的VMWARE WORKGROUP软件,建立一个虚拟机,什么?还是不会,我还是讲彻底些。
2、在VMWARE里点“文件”,选择“新建虚拟机”,出现向导,在“选择适当的配置”里选择“自定义”,如果选择“典型”可能会占用你的最大内存,导致虚拟机提示内存不足不能启动;在操作系统里选择你想建立的系统,这个名字无所谓的,可以随便,不一定就是你安装的系统;“位置”里规划一个目录好些,方便以后管理和调用,放在其它盘,即便重装系统也可以用这个文件。在“内存”里选择一个合适的,如果内存够大,选256M也没人管。硬盘最好选“IDE”,“SCSI”可能导致GHOST不认,磁盘尺寸里建个你想用的容量,这个容量按默认选项建的话是个动态改变的,实际用多少就产生多大文件,所以不必担心它真的用去了你那么大容量,好了,其它都选默认项吧,到此虚拟机建好了。
3、启动虚拟机,右键点刚才新建的虚拟机,选择“开机”,然后你就可以看到它启动了,如果你按照我说的,上面没有作错并且中间绝无出错提示的话,你应该看到无盘启动直接到GHOST了;
4、这个GHOST和平时有什么不一样吗?仔细看看,多了“PEER TO PEER”(点到点),和“GHOSTCAST”(GHOST多播服务器了,我们就需要它了),到了这步,您已经完全成功了!
5、在服务器上运行SYMANTEC GHOST中的GHOSTCAST服务器,然后你想备份还是恢复就由自己掌握了,你可以同时克隆253台机器(理论上),因为这是个C类IP,没有测试过B类子网能否克得更多,我觉得这个已经足够了,毕竟还是广播,达到这个值我认为网络已经很难想象了。


实际应用:
实际应用只是把上面的测试过程中的虚拟机换成你的客户机,其它的都完全相同。
好了,好累了,晚上加班把这个搞出来,真的挺困的,明天还得加班。

About embedded Linux (in Chinese)

http://csdn.net/subject/LinuxEmbed/

嵌入式linux项目介绍

MiniGUI 这个项目是自由软件领域鼎鼎大名的魏永明先生创建的,后来他创建了飞漫软件公司做MiniGUI的商业化工作。MiniGUI 是 100% 按照 GPL 条款发布的自由软件,能 100% 遵守 GPL 许可证条款的开发者无需支付任何授权费用。

TuxMobil 一个致力于把linux运行到笔记本、PDA、移动电话和其他移动计算机上的项目。

intimate 一个很有意思的项目,发起者的目的就是要把linux安装到Compaq iPAQ这样的Pocket PC上,有点像那些hack微软XBOX的人们做的事情。

uClibc 嵌入式Linux的C语言开发库项目,它比GNU C Library小很多。支持的处理器有:alpha, ARM, cris, i386, i960, h8300, m68k, mips/mipsel, PowerPC, SH, SPARC, v850。

ThinLinux 这个项目的目的是做一些最小化的 Linux 分发版,用于专用的相机服务器、X-10 控制器、MP3 播放器以及其它一些类似的嵌入式应用。

英文资源

handhelds.org致力于把Linux/Unix移植到移动设备上一个组织的站点。
iPaqLinux 研究如何把linux移植到惠普iPaq上的一个网站,很有意思。
linuxdevices 研究Linux嵌入式设备的网站。

中文资源

微码科技 这个网站的论坛里有比较丰富的嵌入式linux资源。
中国linux公社 关于linux的自由软件社区。
飞漫嵌入式linux论坛 这里有大量的嵌入式linux的相关内容。
机器人发烧友 一群自己做机器人的小伙子建立的站点。他们使用实时Linux做控制。

嵌入式Linux论文

这里给出的是一篇研究生毕业论文,作者是杨立峰。论文主要介绍嵌入式实时Linux方面的内容,包括数据结构、中断调度、进程间通信和与之相关的应用程序设计。对入门的开发者有很好的参考意义。

Linux嵌入式实时操作系统开发与设计(一)
Linux嵌入式实时操作系统开发与设计(二)
Linux嵌入式实时操作系统开发与设计(三)

Linux嵌入式实时操作系统开发与设计(四)
Linux嵌入式实时操作系统开发与设计(五)
更多......

3月21日

The Mobile Phone I'm looking for or waiting for

After comparison between mobile phones from Nokia, Motorola & Ericsson, I sketch out a Wish-To-Have feature for my next mobile phone as follows,

  1. QVGA 262K color Screen (240x320)
  2. Symbian OS or MS PocketPC/SmartPhone/Embedd Linux
  3. J2ME ready
  4. Memory Expansion (SC,MMC,...)
  5. Internal Camera no less than 300K pixels resolution
  6. Bluetooth
  7. Infrared interface
  8. GPRS Class 8 or Class 10 (or better)
  9. ...

Current in the scope of my radar:

  • Nokia (?)
  • SE P910i/910c (except for screen resolution, slightly ...)
  • M E680 (except for color depth)
  • M A780

Strategy:

  • Watch out for the enhancement models from vendors above
3月18日

VW FAQ

A personal website which contains some very interesting and first-hand informaiton about VW Jetta IV (aka Bora in China & Europe)

http://www.abella.net/

Source: 单眼皮 (http://www.bora-vw.com/bbs)

The birth of my home-made KWP Protocol Sniffer

Great tools make a master. I always have my faith in it.

I've spent a couple of months developing a software talking KWP1281 protocol with my VW Bora 1.8T (YM2003) car to make some magic with it:

  • Lock the ECU by tweaking vital parameters to make the engine won't run
  • Talking the HELLA slang to remotely raise & lower the power windw and sunroof (without use VAS1552 or VAG Diagnose)
  • Design a puer software multiply display meter showing engine speed, wheel speed, oil pressure & temperature, Turbo boost, air flow, ... and the likes on the laptop screen
  • ...
  • Last but not the least, porting the above stuff to my Palm Vx or probably to a Symbian 7 based mobile phone

I was very lucky to find the famous VAGINFO page and got the very base of proprietary KWP1281 protocol. After that I quickly sketched out a piece of program and it talked with my engine ECU ! It was an amazing moment... my Bora turns out to be my big big toy :)

Going further I found I won't go any further without a tool... a tool by which I can analyse other powerful tools like Revo Lemmiwinks and, of course, the famous VAG-COM.

An idea came across to my mind about a month ago when discussing with my Dad about sniffing the VAG diagnose cable for the purpose of protocol analysis... (hacking) and we quickly worked out 1 experimental devices.

(to be continued)

Software for calculation of the power and matching of parts in a car

This company markets Virtual Engine, a set of software toosl for car parts matching. The pciture -> http://www.virtualengine2000.com/images/DynoSt6.jpg

URL --> http://www.virtualengine2000.com/DynoStandardOverview.htm

The Virtual Engine Calculator is free for downloading. Worth a try.

 

Magic Boulevard

I got this song from Liuman-All mailing list (by yeung). It's quite moving. Will upload it to somewhere to share with the folks.

 
尚未添加列表。
尚未添加列表。

Liu Yong