fan 的个人资料searching for hope照片日志列表 工具 帮助

日志


11月3日

网络配置脚本NETSH DUMP

网络配置脚本NETSH DUMP

C:\Documents and Settings\jks>netsh dump >c:\netsh.txt

C:\Documents and Settings\jks>NETSH ?

用法: NETSH [-a AliasFile] [-c Context] [-r RemoteMachine]
             [Command | -f ScriptFile]

下列指令有效:

此上下文中的命令:
?              - 显示命令列表。
add            - 在项目列表上添加一个配置项目。
bridge         - 更改到 `netsh bridge' 上下文。
delete         - 在项目列表上删除一个配置项目。
diag           - 更改到 `netsh diag' 上下文。
dump           - 显示一个配置脚本。
exec           - 运行一个脚本文件。
firewall       - 更改到 `netsh firewall' 上下文。
help           - 显示命令列表。
interface      - 更改到 `netsh interface' 上下文。
ras            - 更改到 `netsh ras' 上下文。
routing        - 更改到 `netsh routing' 上下文。
set            - 更新配置设置。
show           - 显示信息
winsock        - 更改到 `netsh winsock' 上下文。

下列的子上下文可用:
 bridge diag firewall interface ras routing winsock

若需要命令的更多帮助信息,请键入命令,
后面跟 ?。

#========================
# 接口配置
#========================
pushd interface

reset all


popd
# 接口配置结束

#========================
# 接口配置
#========================
pushd interface ipv6

uninstall


popd
# 接口配置结束

 

# ----------------------------------
# ISATAP 配置
# ----------------------------------
pushd interface ipv6 isatap

 

popd
# ISATAP 配置结束

 

# ----------------------------------
# 6to4 配置
# ----------------------------------
pushd interface ipv6 6to4

reset

 

popd
# 6to4 配置结束

#=============
# 端口代理配置
#=============
pushd interface portproxy

reset


popd
# 端口代理配置结束

 

# ---------------------------------- 
# 接口 IP 配置         
# ---------------------------------- 
pushd interface ip


# "本地连接 4" 的接口 IP  配置

set address name="本地连接 4" source=dhcp 
set dns name="本地连接 4" source=dhcp register=PRIMARY
set wins name="本地连接 4" source=dhcp


popd
# 接口 IP 配置结束


                                            
# ----------------------------------------- 
# RAS 配置                         
# ----------------------------------------- 
pushd ras

set authmode mode = standard
delete authtype type = PAP
delete authtype type = SPAP
delete authtype type = MD5CHAP
delete authtype type = MSCHAP
delete authtype type = MSCHAPv2
delete authtype type = EAP
add authtype type = MSCHAP
add authtype type = MSCHAPv2
delete link type = SWC
delete link type = LCP
add link type = SWC
add link type = LCP
delete multilink type = MULTI
delete multilink type = BACP
add multilink type = MULTI
add multilink type = BACP


set tracing component = * state = disabled

popd

#  RAS 配置结束。                  
                                             
                                             

                                            
# ----------------------------------------- 
# 远程访问 AppleTalk 配置      
# ----------------------------------------- 
pushd ras appletalk

set negotiation mode = allow
set access mode = all

popd

# 远程访问 AppleTalk 配置结束。


                                            
# ----------------------------------------- 
# RAS IP 配置                      
# ----------------------------------------- 
pushd ras ip

delete pool

set negotiation mode = allow
set access mode = all
set addrreq mode = deny
set broadcastnameresolution mode = disabled
set addrassign method = auto

popd

# RAS IP 配置结束。               
                                             

                                            
# ----------------------------------------- 
# RAS IPX 配置                      
# ----------------------------------------- 
pushd ras ipx

set negotiation mode = allow
set access mode = all
set nodereq mode = allow
set netassign method = autosame

popd

# RAS IPX 配置结束。               
                                             
                                             

                                            
# ----------------------------------------- 
# RAS NBF 配置                      
# ----------------------------------------- 
pushd ras netbeui

set negotiation mode = allow
set access mode = all

popd

#  RAS NBF 配置结束。               
                                             
                                             

                                            
# ----------------------------------------- 
# RAS AAAA 配置                    
# ----------------------------------------- 
pushd ras aaaa

set authentication provider = windows
set accounting provider = windows

delete authserver name = *
delete acctserver name = *

 

popd

# RAS AAAA 配置结束。             
                                             
                                             
# 路由配置
pushd routing
reset
popd

#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#                                                         #
#   在运行这个脚本之前                                    #
#                                                         #
# 要恢复 IPX 路由器配置,您必须首先从                     #
# 网络连接文件夹中卸载 IPX 然后将其重                     #
# 新安装。                                                #
#                                                         #
#   这样会删除旧的 IPX 路由器配置                         #
#   并将 IPX 路由器配置复原为默认                         #
#   值                                                    #
#                                                         #
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#

#----------------------------------------------------------
# IPX 配置
#----------------------------------------------------------

pushd routing ipx

#----------------------------------------------------------
# IPX 接口配置
#----------------------------------------------------------


#----------------------------------------------------------
# IPX 传输筛选器配置
#----------------------------------------------------------


#----------------------------------------------------------
# IPX 静态路由配置
#----------------------------------------------------------


#----------------------------------------------------------
# IPX 静态服务器配置
#----------------------------------------------------------


popd

# IPX 配置完毕

#----------------------------------------------------------
# IPX RIP 配置
#----------------------------------------------------------

pushd routing ipx rip
popd


# End of IPX RIP 配置

#----------------------------------------------------------
# IPX SAP 配置
#----------------------------------------------------------

pushd routing ipx sap
popd


# IPX SAP 配置完毕

#----------------------------------------------------------
# IPX NETBIOS 配置
#----------------------------------------------------------

pushd routing ipx netbios
popd


# IPX NB 配置完毕
# IP 配置
pushd routing ip
reset
set loglevel error
add preferenceforprotocol proto=LOCAL preflevel=1
add preferenceforprotocol proto=NetMgmt preflevel=10
add preferenceforprotocol proto=STATIC preflevel=3
add preferenceforprotocol proto=NONDOD preflevel=5
add preferenceforprotocol proto=AUTOSTATIC preflevel=7
add preferenceforprotocol proto=OSPF preflevel=110
add preferenceforprotocol proto=RIP preflevel=120
add interface name="本地连接 4" state=enable
set filter name="本地连接 4" fragcheck=disable
add interface name="环回" state=enable
set filter name="环回" fragcheck=disable
add interface name="内部" state=enable
set filter name="内部" fragcheck=disable
popd
# IP 配置的尾端

 

# ---------------------------------- 
# DNS 代理配置            
# ---------------------------------- 
pushd routing ip dnsproxy
uninstall


popd
# DNS 代理配置结束

 

# ---------------------------------- 
# IGMP 配置                 
# ---------------------------------- 
pushd routing ip igmp
uninstall


popd
# IGMP 配置结束

 

# ---------------------------------- 
# NAT 配置                  
# ---------------------------------- 
pushd routing ip nat
uninstall


popd

 


# ---------------------------------- 
# OSPF 配置                 
# ---------------------------------- 

pushd routing ip ospf
uninstall

popd
# OSPF 配置结束

 


# ---------------------------------- 
# DHCP 中继代理配置    
# ---------------------------------- 
pushd routing ip relay
uninstall


popd
# DHCP 中继配置结束

 

# ---------------------------------- 
# RIP 配置                  
# ---------------------------------- 
pushd routing ip rip
uninstall


popd
# RIP 配置结束

 

# ---------------------------------- 
# 路由器探索配置     
# ---------------------------------- 
pushd routing ip routerdiscovery
uninstall
add interface name="本地连接 4" disc=disable minint=7 maxint=10 life=30 level=0
add interface name="环回" disc=disable minint=7 maxint=10 life=30 level=0
add interface name="内部" disc=disable minint=7 maxint=10 life=30 level=0


popd


# ---------------------------------- 
# DHCP 分配器配置       
# ---------------------------------- 
pushd routing ip autodhcp
uninstall


popd
# DHCP 分配器配置结束


# ------------------------------------
# 桥配置 (不支持)
# ------------------------------------

# ------------------------------------
# 桥配置结束
# ------------------------------------

8月20日

back to china 回国了

终于可以回国了,九月三日回国,将会在上海,广州,武汉停留。

(转)You Might Be A Ricer If…

You Might Be A Ricer If…
  • You have more exhaust decibels than your engine has horsepower.
  • You have aftermarket FRONT wheels for racing but stock rear wheels.
  • Your engine makes twice as much horsepower as torque.
  • 17" rims up front, 13" out back on your FWD.
  • You ever painted your wheels to match the same color of your car.
  • You put your automatic car in neutral at every stoplight in order to roll it back and try to fool other people into thinking you have a manual transmission
  • DuPont gave up trying to figure out the shade you were asking for.
  • Your mod list includes stereo equipment, shifter handle, MOMO steering wheel, PIA driving lights, exhaust tip, but no REAL engine parts.
  • A chameleon lizard undergoes fewer shade changes than your custom paint scheme.
  • Your rims and tires are so large, that you have to install the tire / wheel from underneath the car because it simply won't fit in the wheel well going in from the side.
  • The dealer laughs when you bring your car back in for service under warranty, and you've only had it 6 months...
  • Your tires / rims stick out from the lip of your car by more than 1."
  • Your paint job is from the WRONG end of the color spectrum.
  • You installed spacers on your STOCK wheels and tires to get them to stick out past the fender.
  • You see cars like yours in a Shriner's Parade for Children and clowns are driving them.
  • You bring an empty Maxwell House coffee can with you to compare size when you shop for an aftermarket exhaust system.
  • Your Eclipse GS-T hardtop has a "SPYDER" emblem on the rear...
  • Your sum knowledge of suspension is: "the more negative camber, the better the handling."
  • You push your car through the staging lanes.  That way, maybe you can break into the 16s by keeping the motor cool between runs.
  • You add a super tall rear wing, and a hundred pounds of aftermarket ground effects, neon and stereo yet you gut the interior and yank out the rear seat for weight savings.
  • Your rear wing AND your rear window have a third mount brake light...
  • The back lighting in the gauges in your A-pillar gauge pod work long before the actual gauges are hooked up.
  • You cut 4 coil springs and scrape the chassis on the ground. Sparks are cool when you corner at normal traffic speeds!
  • You have to find a way to drive AROUND speed bumps in a parking lot.
  • You install clear corner and brake lights.
  • You install colored bulbs in your aftermarket clear lenses.
  • You ever put neon on the bottom of your car, and then busted it on the first speed bump you went over.
  • You painted the UNDERBODY of your car to match
  • If your rear spoiler is taller then you are.
  • if you can fit fist fuck your exhaust tip
  • You have more stereo WATTS than engine TORQUE!
  • If your tailpipe extension is the most expensive mod you’ve done to your engine yet.
  • Your tailpipe extension fell off during a quarter mile race and you went three tenths of a second faster due to weight savings.
  • EVERY car in your class has a turbo pushing double digits worth of boost.
  • You spent $5,000 on the engine and you can not out run a stock Camaro, Firebird, or Mustang
  • You want the 'wastegate' sound, but don't want to install a turbocharger system.
  • You think Nitrous Oxide on your Hyundai Sonata puts you in the same performance league as the Chevy Corvette.
  • The automatic version of your car runs 2 seconds slower in the 1/4mile.
  • If the 1970 Plymouth Daytona Superbird has a smaller spoiler than your car does.
  • You think the Del Sol is a sports car...
  • A torque converter does NOTHING for your car.
  • You think a deep farty noise = the sound of high performance
  • If you think that horsepower is far more important than torque
  • If you have ever claimed that switching to a cone filter has given you more than 5 HP.
  • If you have ever considered installing more than one set of fog / driving lights.
  • If you claim that the aftermarket cold air intake system you just installed doubled your horsepower or took 2 or more seconds off of your E/T.
    • Your baseball cap is always on backwards when you drive (the first sign of mental retardation, wearing your clothes backwards... BE).
    • You spent all night on the Internet trying to find a company that makes a turbocharger system for your Hyundai...
    • If you removed your side view mirrors and put them at the TOP of the door / window frame.
    • If you think the Fugees are 'speed' music.
    • MOMO is 'absolutely required' to go fast.
    • Your four cylinder has a dual exhaust system installed.
    • Your four cylinder has four exhaust pipes ("Hey, one for each cylinder!")
    • The color of your interior upholstery hurts the cones and rods in other people's eyes.
    • If you cannot drive your car in snow as the ground effects create a plow effect.
    • If you have installed driving lights to compensate for headlight blackouts / tape.
    • If you think that 180 horsepower and 185 lb/ft of torque are impressive for a ‘mildly’ modified engine.
    • If you have stickers on your car for parts that you could not point out if asked where those parts are installed.
    • You think pushrods are a bad thing…
    • Your car has more decals than you do the quarter in seconds.
    • Every Honda you EVER owned, all the way back to your 1978 Accord was either a V-Tec or a TYPE-R.
    • You took your rear seat out and gutted your interior for weight savings but you installed 400 pounds of electronics, neon, DVD, Sony, etc.
    • If you gutted the interior to save weight on a car that you will never take to the track…
    • You lean your seat so far back when you are driving, that every time you hit a bump, its your back and not your butt that hurts.
    • You have hydraulics and sixteen switches on a car you claim runs low 10s on the street and corners better than a Porsche.
    • If you can estimate that your car makes more than 250 HP without ever running it at the track or getting a dyno reading.
    • You claim that you can get a titanium block for your engine.
    • If you have ever thought Hyundai and "performance" went hand in hand
    • If you've ever gone to a parts shop or speed warehouse and asked for a 1" to 6" exhaust adapter...
    • If you've ever contemplated adding "TYPE-R" stickers to your Sonata…
    • If you've removed more than 1/2 of the coils from your springs by cutting them yourself ...
    • If you have more neon lights on your car than a strip club...
    • You put Kanji on your Ford ZX2, Ford Probe, or Mercury Cougar ...
    • You own a "TYPE-R" Hyundai or Mazda.
    • You couldn't afford headlight masking, so you just painted them with flat black Krylon and it's peeling.  Badly.
    • You claim that polishing your intake gave you 5hp.
    • You own a V-TEC Hyundai or Mazda (especially a V-TEC rotary engined Mazda RX-7)
    • You have neon INSIDE your car or in your ENGINE compartment
    • You ever claimed that high gas mileage made your car superior in performance to V8s.
    • If it takes you 8000rpm to reach 30mph from a dead stop at WOT.
    • You think yellow plastic interior trim makes your car cool
    • You spend $500 for a giant hand welded tube for a muffler with the weld marks extremely visible
    • If you paint your drum brakes to simulate Hi-po calipers
    • If you install fake hi-po caliper / disc simulators
    • You have a front wing.
    • If you lower your car and add ground effects but retain the stock 14inch wheels with disc style wheel covers
    • If you equate the sound of performance with the sound of a Weed Eater™
    • If you think bolting a fake muffler to one side to simulate dual exhaust is cool
    • If you think colored head lights work better
    • Clear tail lights and turn signals. They’re colored for a REASON!
    • If you take mom's 4 door Honda accord and do any kind of mod to it
    • You drive a Ford Escort station wagon with Kanji, wide tires, and Limp Bizkit stickers on the rear hatch
    • You claim you lost the race because you had a passenger in the car.
    • You claim how if you went from a roll you would have beat him.
    • You claim you lost because you missed a shift... and your car is an automatic.
    • You claim you lost because he must have been on the juice..
    • Flying past the person who is 10 car lengths in front of you after they have put on their brakes.. and claim a victory.
    • after losing you flip your opponent off... rev your motor and fail to break the wheels loose even around a corner.
    • Tell everyone about how you lost the cop because of your "driving skills."
    • you are a white kid driving an import.. wear baggy pants/hat turned around, walk with a fake limp and end every sentence with "yew know wha I'm sayin?  Relate."
    • Your idea of aiming a handgun is raising your arm over your head, pointing the gun away from you, and then just letting your wrist fall to the side to where the gun is almost sideways ...
    • drive around in a $20,000 import with $10,000 in mods.. and still live with your parents.
    • You can relate to every line of the song "Pretty Fly For A White Guy" by the Offspring
    • you take offense when I say.. "your sister is like your car.. small, tight and hard to get into."
    • You are a skinny, backwards hat wearing, dog chain wallet, 2 ft wide pants leg, Limp Bizkit looking white boy fag with a badly applied peroxide hair color treatment  and temporary rub-on tattoos!
    6月25日

    迈克尔杰克逊 死了

    因为注射强效杜冷丁之后就昏死过去,然后心脏再也没有恢复跳动。
    我的偶像啊,最近他来多伦多开演唱会的时候还在犹豫挣扎要不要花几百块去看,谁知道竟然再也没有机会了。从马拉多纳到杰克逊,我的偶像都是被该死的毒品给摧毁了。
    伤感中。人生就是这样吧,虽然不顺利,起码我还健康的活着。


    5月1日

    网站问题

    按了BUY后Warning: Cannot modify header information - headers already sent by (output started at /home/bestinkc/public_html/includes/languages/english.php:641) in /home/bestinkc/public_html/includes/functions/general.php on line 33

    solution:
    The problem is that many editors seem to add additional blanks (spaces) and/or empty lines at the end of a file when you edit it.
    edit includes/languages/english.php, remove the blanks at the ending.
    4月24日

    养鱼了

    开始养鱼了,现在有15条宝莲灯,12条白云山,10条孔雀,两只小虾,一条大胡子清道夫和一条黄金清道夫。自己是完完全全的菜鸟,花了些时间了解了一下这些鱼,挺有意思的。现在每天回家时不时就看看它们,跟它们交流一下,希望它们慢慢适应新的环境。
    争取不死鱼!!!

    vista home install chinese package

    只有Ultimate(旗舰版)和Enterprise(企业版)的Windows Vista才支持安装MUI语言包、进行不同语言之间的转换。你的系统是家庭版,所以无法安装MUI语言包。不过你也不用灰心,已经有人想出了办法去掉 Windows Vista Home Basic(家庭普通版)、Home Premium(家庭高级版)、Business(商务版)无法安装MUI语言包的限制,具体方法如下。

    关闭Windows Vista的UAC功能。打开http://www.froggie.sk/download.html,下载去掉无法安装MUI语言包限制的工具 Vistalizator,以及MUI语言包。目前Windows Vista有RTM和SP1两种版本。如果你在使用Windows Vista SP1,请下载标注有“SP1”的MUI语言包。在MUI语言包下载完成之后,将Vistalizator的压缩包解压到一个文件夹中,运行 Vistalizator.exe。点击“Add Language”按钮找到你刚刚下载的MUI语言包,Vistalizator将会自动解压MUI语言包。等Vistalizator完成了对MUI语 言包的解压,就单击“Install”按钮。此时你将会看到你想安装的语言在Vistalizator的下拉菜单中,选择你想安装的语言,单击 “Change language”按钮然后重新启动电脑即大功告成。
    11月3日

    lost job, fight again

    最近不怎么顺心,刚上班的第一周,踢球被人从背后猛推,肩膀着地,胳膊脱臼。上了十一周的班,竟然,被开掉了,我顶他妈的肺!!!头一周的周四还告诉我项目的下一步该怎么改,这一周的周一就告诉我解除和我的合约。都说白人虚伪,我算是领教了。这帮鬼佬,平时笑眯眯的问你 r u ok? r u comfortable with this job? blah blah blah. 开起人来眼睛都不眨。 说我什么离要求有很大的gap。 我他妈的从对business一窍不通,对pepsi的了解仅限于可乐七喜,从没有搞过jsp, javascript到现在一切上正轨,用了11周,还包括第一周没有电脑和一整周在外边出差,这个速度还不行?开就开吧,大不了从头开始,加拿大就是这样的鬼地方,刚刚对生活有了一点希望,就把我再一次的推向深渊。
    下一步,学习,改简历,投简历,从entry level做起。 我还是一条好汉!

    tomcat configuration

    第一步:下载jdktomcatJDK下载  Tomcat下载
        最新的jdk1.6.10tomcat为6.0,建议jdk1.4以上,tomcat4.0以上
    第二步:安装和配置你的jdktomcat:执行jdktomcat的安装程序,然后设置按照路径进行安装即可。
    1.安装jdk以后,需要配置一下环境变量,在我的电脑->属性->高级->环境变量->系统变量中添加以下环境变量(假定你的jdk安装在C:\Program Files\Java): 
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10
    classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;.;一定不能少,因为它代表当前路径
    path=%JAVA_HOME%\bin 

     接着可以写一个简单的java程序来测试JDK是否已安装成功:

    public class Test{
    public static void main(String args[]){
    System.out.println("This is a test program.");
    }
    }

    将上面的这段程序保存为文件名为Test.java的文件。 
    然后打开命令提示符窗口,cd到你的Test.java所在目录,然后键入下面的命令  
    javac Test.java 
    java Test  
    此时如果看到打印出来This is a test program.的话说明安装成功了,如果没有打印出这句话,你需要仔细检查一下你的配置情况。 

    2.安装Tomcat后,在我的电脑->属性->高级->环境变量->系统变量中添加以下环境变量(假定你的tomcat安装在c:\tomcat): 
    CATALINA_HOMEc:\tomcat
    CATALINA_BASEc:\tomcat
    TOMCAT_HOME: C:\Tomcat
    然后修改环境变量中的classpath,把tomat安装目录下的common\lib下的servlet.jar追加到classpath中去,修改后的classpath如下: 
    classpath=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet-api.jar;
    【注意最新版本的Tomcat中可能没有common这个文件夹了。所以servlet-api.jar应该的路径为
    %CATALINA_HOME%\lib\servlet-api.jar;请根据自己的情况自己修改
    接着可以启动tomcat,在IE中访问http://localhost:8080,如果看到tomcat的欢迎页面的话说明安装成功了。 
    第三步:建立自己的jsp app目录 
    1.Tomcat的安装目录的webapps目录,可以看到ROOTexamples, tomcat-docs之类Tomcat自带的的目录; 
    2.webapps目录下新建一个目录,起名叫myapp 
    3.myapp下新建一个目录WEB-INF,注意,目录名称是区分大小写的; 
    4.WEB-INF下新建一个文件web.xml,内容如下:

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

    <web-app>
    <display-name>My Web Application</display-name>
    <description>
    A application for test.
    </description>
    </web-app>

    5.myapp下新建一个测试的jsp页面,文件名为index.jsp,文件内容如下: 

    <html>
    <body>
    <center>
    Now time is: <%=new java.util.Date()%>
    </center>
    </body>
    </html>

    6.重启Tomcat 
    7.打开浏览器,输入
    http://localhost:8080/myapp/index.jsp 看到当前时间的话说明就成功了。

    第四步:建立自己的Servlet:
    写入你的第一个Servlet:
    在你新建的Application myapp/WEB-INF/classes/test目录下新建HelloWorld.java

    package test;

    import java.io.*;
     import javax.servlet.*;
     import javax.servlet.http.*;
     public class HelloWorld extends HttpServlet
      {
        public void doGet(HttpServletRequest request,HttpServletResponse response)th
    rows ServletException,IOException
       {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<html><head><title>");
        out.println("This is my first Servlet");
        out.println("</title></head><body>");
        out.println("<h1>Hello,World!</h1>");
        out.println("</body></html>");
       
       }
       }

    然后照样用javac HelloWorld.java来编译这个文件,如果出现无法import javax.servl
    et.*
       那么就是应该把C:\Tomcat\common\lib里面的
    servlet-api.jar文件拷贝到C:\JDK\jre\lib\ext中,再次编译,就没有问题了!
       然后在Tomcat目录里面的C:\Tomcat\webapps\myapp里面按如下的文件结构:
       myapp\index.jsp
       myapp\WEB-INF\classes\test\HelloWorld.class(把上面生成的HelloWorld.class文件放在这个
    里面)
     然后在浏览器中输入
    http://localhost:8080/myapp/HelloWorld,于是Server众望所归的报错了:Error 404--Not Found
     怎么回事呢?
    Servlet必须使用C:\Tomcat\webapps\myapp\WEB-INF这个目录下面的web.xml文件进行注册,
    用EditPlus打开这个web.xml文件,
    在<web-app></web-app>添加下面这段程序:

    <servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class>test.HelloWorld</servlet-class>
     </servlet>
     <servlet-mapping>
        <servlet-name>HelloWorld</servlet-name>
        <url-pattern>/HelloWorld</url-pattern>
       </servlet-mapping>

     为什么呢?
     因为 这样的结构
       <servlet>
       <servlet-name>HelloWorld</servlet-name>
       <servlet-class>test.HelloWorld</servlet-class>//类的路径
       </servlet>
    表示指定包含的servlet类.
    而以下的结构
       <servlet-mapping>
         <servlet-name>HelloWorld</servlet-name>
        <url-pattern>/HelloWorld</url-pattern>
       </servlet-mapping>
     表示指定HelloServlet应当映射到哪一种URL模式。

    在修改web.xml完毕过后,重新启动Server,然后再输入http://localhost:8080/myapp/HelloWorld,,那么偌大一个Hello,World!等
    着你呢,恭喜你!

    第五步:建立自己java Bean

    1. 在你新建的Application myapp/WEB-INF/classes/test目录下新建TestBean.java

    package test;
    public class TestBean
    {
        private String name =null;
        public TestBean(String nameInit){
            this.name = nameInit;
        }
        public void setName(String newName){
            this.name=newName;
        }
        public String getName(){
            return this.name;
        }
    }

    然后照样用javac TestBean.java来编译这个文件。

    2.然后在你新建的应用程序目录myapp下新建一个新的jsp文件:testBean.jsp

    <%@ page import="test.TestBean" %>
    <html>
    <head>
    <title>Test Bean</title>
    </head>
    <body>
    <center>
    <%
       TestBean testBean = new TestBean("Http://yexin218.cublog.cn");
     %>
    Java Bean Test:
        The author's blog address is<%=testBean.getName()%>
    </center>
    </body>
    </html>

    好了,确定各个文件的位置:

    myapp\index.jsp
    myapp\testBean.jsp
    myapp\WEB-INF\web.xml
    myapp\WEB-INF\classes\test\HelloWorld.class
    myapp\WEB-INF\classes\test\TestBean.class

    3.重启Tomcat如果需要的话,在浏览器输入:http://localhost:8080/myapp/testBean.jsp 幸运的话就会看到:

    Java Bean Test: The author's blog address isHttp://yexin218.cublog.cn

    这样就完成了整个Tomcat下的jsp、servlet和javabean的配置。

    第六步:配置虚拟目录

    打开 Tomcat6.0\conf\server.xml 文件,在 <Host> 和 </Host> 之间加入

    <Context path="/myapp" docBase="D:\myapp" debug="0" reloadable="true" crossContext="true" />

    4月10日

    mad world

    看CSI第六季第二集听到这么首歌,喜欢上了 mad world
    ALEX PARKS
    Mad World
    (Orzabal)

    All around me are familiar faces
    Worn out places, worn out faces
    Bright and early for their daily races
    Going nowhere, going nowhere
    And their tears are filling up their glasses
    No expression, no expression
    Hide my head I want to drown my sorrow
    No tomorrow, no tomorrow

    And I find it kind of funny
    I find it kind of sad
    The dreams in which I'm dying
    Are the best I've ever had
    I find it hard to tell you
    'Cos I find it hard to take
    When people run in circles
    It's a very, very
    Mad World

    Children waiting for the day they feel good
    Happy Birthday, Happy Birthday
    Made to feel the way that every child should
    Sit and listen, sit and listen
    Went to school and I was very nervous
    No one knew me, no one knew me
    Hello teacher tell me what's my lesson
    Look right through me, look right through me
    10月1日

    赏枫叶

    每年的9月底到十月初是加拿大枫叶正红的时候,去年因为没有车,不方便出远门,一直计划着今年秋天一定要出去转转。
    在网上搜索赏枫叶的地点,找到了阿冈昆公园,300多公里,算下来一天来回时间太紧,朋友推荐了个近的地方, dorse lookout tower, 据说可以看到阿冈昆公园,找到地图,240公里,3个小时的车程,马上联系以前的房东,和他们一家人一起去。
    早上开车去到他家,他们煮了粥,顺便吃了点,设置好GPS,我们就上路了,发现自己没有带钱包(驾证在里面),只好绕了点路回去拿。上了401,东行,过了Ajax,到35号路北行。北美的路真的非常好,平坦,车少,80的限速,我们开到100,也感觉不到很快。本来打算走400高速的,看到网上说35号路的风景很好,就改路了。事实证明改路是正确的,南边一点树叶红的不多,点点红叶黄叶夹杂在绿色中间,也另有风味。
    随着不断北行,颜色也逐渐发生变化,红色黄色开始多起来了,远远望去,一片彩色的山岭。开了一个多小时,决定休息一下并且换我开车,到了一个小镇的加油站,买了杯咖啡,问了一下小店的人,原来这个小镇叫kevin, 跟我的英文名一样,真是巧。安省北边的湖非常多,基本走几步就看到一个,gps屏幕上也是这里一片蓝色,那里一片蓝色。到了一个湖边,我们临时停车,碧蓝的湖,陪衬着多彩的山岭,现在开始痛恨自己几乎为零的艺术细胞了。
    到了dorse,采纳了博物馆大妈的建议,我们爬上山,来这边还是第一次爬山,踩着疏松的落叶,在斑驳陆离的林间穿过,随意的聊天,感受轻松的气氛。到了山顶,看到了那个塔,说是塔,其实就是个铁架,以前用来观察森林火灾的,现在不用了,就开放给游人了。看着镂空的楼梯和矮矮的扶手,我的心提起来,OMG! 看到那么多人都爬上去,我鼓足勇气,上。越往上爬,腿越软,一边爬,我一边鼓励自己,60米的dropzone,我都上去了,这区区3-40米的塔算什么。战战兢兢上到塔顶,阿冈昆公园的部分风景尽收眼底,感觉到真的不虚此行。
    下来后,我们继续行驶,又去了白求恩故居,然后才意犹未尽的踏上回家的旅程。
    9月26日

    辛苦的卡车司机

    昨天被电话告知船运的货到了,马上联系了U-HUAL (租车公司)定了一台cargo van. 今天早上9点多去拿车,才知道cargo van 只有两个座位,我请了房东的儿子,一共就有3个人,只好租了个货车,办好手续,出来一看,倒,好大台车阿,虽然我现在开的是SUV,一比就成小个子了。出门,发现油没有提车时说得那么多,没办法,奸诈的商人,加油,上高速。最开始还有些紧张,车大,几乎占了满满一个车道,必须要考虑左右间距。开始还左顾右盼,后来感觉来了,也就不看了。
    开始去了货运代理公司拿报关材料,昨天联系的时候说,CERTIFIED CHEQUE可以接受,今天却说只接受公司的cheque,没办法,只好到楼下ATM机器去取,还花了我3元加币的手续费。拿到了材料,就去加拿大海关,检查各种证件,填写了一份表格,盖了几个章,搞定。虽然加拿大政府很官僚,但是他们决不会有意刁难,这一点比国内好多了。
    从海关出来后,天空飘起了细雨,去找WAREHOUSE的过程相当顺利,多亏了GPS,虽然报警电力不足,但是依然勤恳工作,直到耗尽。到了仓库,一辆叉车将一个大木箱运出来,这就是我们的行李。向仓库的人借了工具,开始暴力拆解木箱,撬的撬,砸的砸,忙得我们不亦乐乎。打开箱子,里面就全部是我们的行李了,我看到了我亲爱的山地车。500多公斤的东西说起来不多,搬起来可真是累死人,淋着雨,受了点轻伤,我们终于将一切东西包括箱子的残骸都 装上车(这边不能DUMPING, 否则要收我很多钱,我们只好另想办法)。
    回家的路就比较顺利,路上找个中国餐馆点了几个菜打了包,回到家,先吃饭。卸货的过程也是麻烦的事情,不过我们还是一口气搞定。垃圾嘛,最后还是倒在以前的APPARTMENT的垃圾场,看了看"DUMPING WILL BE FINED $5000" 的标志,没理它,做一回坏人吧。
    换车的时候,竟然说我车里的油不够,只好再开到附近的油站家多一点了。
    帐务:租车  19.95 保险 15 租了个推车 7 开了80 MILES 80 * 0.79 = 63 总共税前 105.15, 税后 119.88, 加上20+20+18的油钱, 唉, 真多啊。
    回到家,看到满地的包裹,心想,再也不能随便搬家了。
     
    9月5日

    stay together, live together

    Whenever, wherever, whatever, we will stay together and live together.
    I promise.
    6月5日

    SUV or sedan, it is a question

    Thank you, my sweet heart.
    Now I am searching for my first vehicle. There are so many kinds of vehicle in North America which make me confused. Sedan, hatchback, couple and SUV. Couple is not my current goal, maybe I will get one some years later. But now, a safe vehicle is what I am looking for. Sedan has better fule economy but less safety than SUV. Driving a SUV has a good vision and safety, especially in winter. But its disadvantage is obviously, oil tiger  :)    
    SUV or sedan, a big question.
    5月20日

    setup tomcat with eclipse

    download tomcat from http://www.sysdeo.com/eclipse/tomcatplugin
    setup in eclipse
    Window->Preferences
    version
    tomcat home
    tomcat base
    JVM settings -> classpath -> JAR/ZIP -> JAVA_HOME/lib/tools.jar
    'sudo echo $JAVA_HOME' check the home of java
    Tomcat Manager App -> setup username and password

    under /opt/tomcat/conf
    kavinke@pony:/opt/tomcat/conf$ sudo chmod +r server.xml
    kavinke@pony:/opt/tomcat/conf$ sudo chmod +r context.xml
    kavinke@pony:/opt/tomcat/conf$ sudo chmod +r web.xml
    kavinke@pony:/opt/tomcat/conf$ sudo chmod 664 tomcat-users.xml

    5月18日

    ubuntu tips


    install pidgin
    1. uninstall gaim
    sudo apt-get remove gaim gaim-data
    2. install tk8.4
    sudo apt-get install tk8.4
    3. install pidgin
    sudo dpkg -i pidgin_2.0.0-1_i386.deb

    install fakeroot
    sudo apt-get install fakeroot


    5月17日

    mysql usage

    1. login
    C:\Program Files\MySQL\MySQL Server 6.0\bin>mysql -u root -p mysql
    Enter password: ****
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 1
    Server version: 6.0.0-alpha-community-nt-debug MySQL Community Server (GPL)
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    2. the first command
    mysql> select version(),current_date();
    3. commands of database
    mysql> show databases;
    mysql> use database_name;
    mysql> create database database_name;
    mysql> drop database database_name;
    mysql> show tables;
    mysql> describe table_name;
    mysql> grant all privileges on mytest.* to kefan@localhost identified by "12344321";
    mysql> create table user_info (id int(8) primary key, name varchar(10),
        -> first_name varchar(10), last_name varchar(10),
        -> address1 varchar(30), address2 varchar(30),
        -> phone_home varchar(20), phone_cell varchar(20));
     
     
    5月7日

    I will never leave you, nor forsake you

    But we have this treasure, that the excellency of the power may be of God, and not of us. Troubled on every side, yet not distressed; perplexed, but not in despair; persecuted, but not forsaken; cast down, but not destroyed; always bearing about in the body the dying of the Lord Jesus, that the life of Jesus might also be made manifest in our body. For we which live are always delivered unto death for Jesus' sake, that the life of Jesus might also be made manifest in our mortal flesh.
    4月26日

    some abbr used in English BBS

    WTF : What the fxxk,   more,  WTFH - what the fxxking hell
    lol : Laugh out loud, it is used when you feel someone is humorous.
    omg : Oh my god,     more, omfg - oh my fxxking god
    lmao/rofl : laugh my ass off/roll the floor laughing
    qft : Quote for truth
    Imo : In my opinion,   more Imho - in my humble opinion
    FTW : for the win, used for cheer
    stfu : shut the fxxk up
    brt/brb/omw : be right there/be right back/on my way
    phat = fat, notice: fat is a bad word, especially for girl. Don't use it any more.
    Emo。这个词很有意思。美国有个乐队,叫做EMO,常常演一些伤感的歌。然后泡坛子的人就常常用这个词形容那些神经兮兮的家伙,比如整天乱嚷“My life sucks”的家伙。这种人别说,还真有,我一个学生就这样,上实验课之前常常拿着一本插图上画着王子和公主的书对我说,你看他们好幸福挖,我好羡慕挖,你觉得这是真的还是画的吗,等等。林黛玉当然也是标准的EMO了。
    BBQ。这词很棒。在OMFGBBQ里面,它只起到了强调的作用。BBQ一般指烧烤,Barbeque,这个大家都知道,但是它为什么能起强调的作用呢?因为这词代表了无数的缩写,better be quick, Bitch be quiet,等等,所以这个词就代表了对缩写的鄙视,说你这丫的乱缩写嘛。于是它也被赋予了表示强调的意义(美国人的联想“联用”能力真强……)
    ZOMG。这个词也要单列。因为有出典。为什么会出现“ZOMG”?因为OMG通常用全部大写表示语气强调。在书面语言里,全部大写是非常非常不礼貌的,但是为了表示强调,你全大写也可以。问题是,你大写出毛病了——大写要按“shift”键,你太激动了,结果按shift键同时按“o”的时候,连着shift键边上的z也按下去了……你看,这样来表示你的激动是不是超出寻常呢?这就是ZOMG的来由。
    Lame。这个词无法用中文翻译。我只举例了。LAME就是用来形容芙蓉姐姐、许纯美、大作家张斌、伟大的刘伟……等等一系列人物的专有名词……
    Chuck Norris。这个词不得不单列一条。Chuck Norris 非常 Lame。他是个武术家,演了一个电视连续剧,大约是《TEXAS RANGER》之类的名字罢,里面演一个美国式英雄。不幸的是,演的实在是太做作而失败了……结果有个好事者在网络上写了“100 TOP facts about Chuck Norris”,全面地讽刺了 Chuck Norris 的武术、霸气,还有性能力。这个东西在美国网络上引起了轰动效果,Chuck Norris 于是出名了……他就是美国的芙蓉姐姐……
    Freak/Hack/Darn。这三个词并列排出,它们分别是”Fxxk"/"Hell"/"Damn"的弱化/合理化用法。简单地说,一个老师在讲课,他不能讲脏话,但是他想用 “Fxxk”来表示强调和亲和力。这时他就用freak(音/frik/)来替换fxxk。英语里面Shit、Hell、Damn、F**k、Ass都属于Curse/swear,咒骂了,相当于是脏话,一般是不能讲的。但是美国是一个粗俗的国度,人们喜欢讲这些词,就好比说讲“他妈的”有时候已经不代表骂人而代表强调一样。于是他们使用Freak这些音相近的词语来替换这些词。使用这些词语的时候,表达的语气也没有用原词强烈。类似的中文用法,正是我们天天用的一个词:“靠!”
    Fo' shizzle my nizzle。这是正统的“市井用语”了。美国的市井用语主要是由于贫民区大都是黑人,因此讲的话都带有黑人口音而来的。说唱乐正是这种语言的音乐形式。这个短语代表的是市井语的一种口音,它原本是关在牢房里的黑人弟兄打电话,为了避免被人听懂而发明的,而由于Snoopy这个动画片而广泛传播开来。这种口音的特点是在每个词后面都加上“-izzle”来混淆口音。至于Fo' shizzle my nizzle,这个句子完全翻译过来是“for sure, my niggar”(当然了,我的兄弟)。Niggar是negger/negro的黑人口音变体,只用在黑人之间互相称呼中,表示“同为黑人的朋友”。如果白人用了这个词等于是种族歧视。
    Moron/Retarded。Silly大家都知道罢?Stupid大家都知道罢?Idiot大家都知道罢?一个意思。上次那个所谓“中国版泄露的1.11patch notes”里面,就有人评价说,上17173的都是morons。就是这个意思了。
    Epeen。 E-pennis的缩写。电动XX,意思是指,你其实已经不能勃起了,但是靠电动的来勃起。网络上是指你说不过别人了,然后说自己现实生活中其实很强,比如说NGA某些人常用的,说你现实中是个LOSER,老子本科毕业/研究生毕业/工作了,又或者我自己在开头炫耀自己GRE 1380 TOEFL 663。这个词被WOW的人用来讽刺PVE进度,称为“PVEPEEN”,意思是说你FD了BOSS有什么好炫耀的,PVP才是王道。