﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-xiaomage234-随笔分类-windows</title><link>http://www.blogjava.net/xiaomage234/category/35224.html</link><description>生命本就是一次凄美的漂流，记忆中放不下的，永远是孩提时代的那一份浪漫与纯真！</description><language>zh-cn</language><lastBuildDate>Wed, 06 Apr 2016 15:50:31 GMT</lastBuildDate><pubDate>Wed, 06 Apr 2016 15:50:31 GMT</pubDate><ttl>60</ttl><item><title>5 Unexpectedly Useful Command Line Tools You Might Overlook</title><link>http://www.blogjava.net/xiaomage234/archive/2016/04/06/429990.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 06 Apr 2016 07:08:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2016/04/06/429990.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/429990.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2016/04/06/429990.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/429990.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/429990.html</trackback:ping><description><![CDATA[<p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">from:<span style="font-family: verdana, 'courier new'; line-height: 21px;">http://zeroturnaround.com/rebellabs/5-unexpectedly-useful-command-line-tools-you-might-overlook/</span></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">My&nbsp;<a href="http://zeroturnaround.com/rebellabs/5-command-line-tools-you-should-be-using/" style="color: #5da6ce;">previous RebelLabs post</a>&nbsp;showed us that there still is a nice amount of interest among the developers in neat command line tools. This is great news as it means there are still lots of geeks reaching for their maximum l33t potential! This post will, as the title suggests, jump into 5 more tools that will hopefully tickle your fancy.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Whilst it is hard to find a set of tools relevant for every different command line professional or enthusiast, I can still wholly recommend glancing over these tools briefly. You never know when you&#8217;ll get stuck in a terminal only environment or will need to impress a friend with your exceptional command line skills. So without further ado, here are 5 more command line tools you should consider using!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="z" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h2>z</h2><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">1. Install it once<br />2. Forget it&#8217;s even there<br />3. Profit from its productivity:&nbsp;<a href="https://github.com/rupa/z" style="color: #5da6ce;">z</a>.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">OK, but what&#8217;s it all about? Well,&nbsp;<strong>z</strong>&nbsp;allows you to quickly jump from folder to folder, without having to bother writing the full absolute or relative paths. To achieve this, it simply records all the folders you visit, and then ranks them based on a combination of the frequency and time of last use. Now all you need to do is type&nbsp;<code>z part/of/path</code>&nbsp;and hit enter. With this, z will automagically guide you to the highest ranking match.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">To install z, download&nbsp;<a href="https://raw.githubusercontent.com/rupa/z/master/z.sh" style="color: #5da6ce;">z.sh</a>&nbsp;and source it in&nbsp;<em>~/.zshrc</em>&nbsp;or&nbsp;<em>~/.bashrc</em>, if you still haven&#8217;t made the inevitable jump to&nbsp;<em>ZSH</em>. Now go about your regular flow,&nbsp;<code>cd</code>-ing all over the place, and you are done!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Alternatively, if you use the&nbsp;<a href="http://ohmyz.sh/" style="color: #5da6ce;">oh-my-zsh</a>&nbsp;framework, simply add it in the plugins listing of&nbsp;<em>~/.zshrc</em>.</p><pre style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;"> $ vim ~/.zshrc  plugins=(brew git mercurial mvn osx sbt scala vi-mode z) </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">By default,&nbsp;<em>z</em>&nbsp;stores its data in&nbsp;<em>~/.z</em>, below are my contents after I cleared them and moved around a bit. After printing the data, you can see I moved to 2 different folders by specifying only a small part of the path, irrespective of the current folder. Take note that the directory name was matched mid-word in a case insensitive way &#8212; very handy!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">All in all I highly recommend this great tool to anyone that spends any amount of time at the command line, whatever your background, interest or use case may be.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img src="http://zeroturnaround.com/wp-content/uploads/2016/03/z-640x379.png" alt="z" width="640" height="379" size-large=""  wp-image-56288"="" srcset="/wp-content/uploads/2016/03/z-320x189.png 320w, /wp-content/uploads/2016/03/z-768x454.png 768w, /wp-content/uploads/2016/03/z-640x379.png 640w, /wp-content/uploads/2016/03/z.png 1460w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="youtube-dl" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h2>youtube-dl</h2><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">The second tool of this post is the excellent&nbsp;<a href="https://rg3.github.io/youtube-dl/" style="color: #5da6ce;">youtube-dl</a>. A cross-platform tool allowing you to, unsuprisingly, download&nbsp;<a href="http://youtube.com/" style="color: #5da6ce;">Youtube</a>&nbsp;videos. The easiest way to install is either via&nbsp;<strong>Homebrew</strong>&nbsp;or<strong>pip</strong>&nbsp;as shown below. Other download options can be found via the link above.</p><pre sql"="" style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;"> $ brew <span style="color: #5f9182;">install</span> youtube-dl  $ sudo pip <span style="color: #5f9182;">install</span> <span style="color: #6c6b5a;">--upgrade youtube_dl</span> </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">At times, for whatever reason, you may want to download a presentation for archiving&#8217;s purposes. Or better yet, imagine you spend the weekend in the Estonian countryside, devoid of internet, yet you really wanted to see the latest&nbsp;<a href="http://virtualjug.com/" style="color: #5da6ce;">Virtual JUG sessions</a>. A simple&nbsp;<code>youtube-dl https://youtu.be/PQPvZkA-6bg</code>&nbsp;suffices at this point.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img src="http://zeroturnaround.com/wp-content/uploads/2016/03/youtube-dl-640x378.png" alt="youtube-dl" width="640" height="378" size-large=""  wp-image-56287"="" srcset="/wp-content/uploads/2016/03/youtube-dl-320x189.png 320w, /wp-content/uploads/2016/03/youtube-dl-768x453.png 768w, /wp-content/uploads/2016/03/youtube-dl-640x378.png 640w, /wp-content/uploads/2016/03/youtube-dl-200x118.png 200w, /wp-content/uploads/2016/03/youtube-dl.png 1460w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Other nice things to take note of:<br /></p><ul style="list-style: none; padding: 0px; margin: 0px 0px 0px 1.2em; color: #5f5f5f; font-family: 'Open Sans', Verdana, sans-serif; line-height: normal; background-color: #ffffff;"><li style="margin: 0.5em 0px;">You are not limited to downloading from Youtube only, Vimeo for example is also supported.</li><li style="margin: 0.5em 0px;">Simply point to a Youtube playlist and youtube-dl will be smart enough to automatically download the full list.</li><li style="margin: 0.5em 0px;">As shown in the example image, youtube-dl will happily follow shortened URLs for you.</li><li style="margin: 0.5em 0px;">By default the highest quality video will be downloaded, however a simple&nbsp;<code>youtube-dl -f $FORMAT $LINK</code>&nbsp;will override this. You find available formats with the&nbsp;<em>-F</em>&nbsp;flag.</li><li style="margin: 0.5em 0px;">A veritable host of additional options are nicely documented and easily accessible via&nbsp;<code>man youtube-dl</code>.</li></ul><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="shellcheck" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h2>shellcheck</h2><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">I will assume that anyone spending significant some time at the command line will want to automate tasks using shell scripts. Bash itself is renowned for its many pitfalls, and even advanced scripters will from time to time bump into something unexpected. Unfortunately for us, a shell script has no undo button, and &#8220;unexpected&#8221; results may well be synonymous with &#8220;catastrophic&#8221; results.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Long intro short: we have a valuable tool on our side to guard ourselves against exactly this,<a href="https://github.com/koalaman/shellcheck" style="color: #5da6ce;">shellcheck</a>! In essence, it is a static analyser that will tell you where your script goes wrong.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Install shellcheck via your package manager of choice: Homebrew, Pacman, APT; build it from source, or run it&nbsp;<a href="http://www.shellcheck.net/" style="color: #5da6ce;">inside your browser</a>.</p><pre ruby"="" style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;"> $ brew install shellcheck  <span style="color: #6c6b5a;"># pacman -S shellcheck</span>  <span style="color: #6c6b5a;"># apt-get install shellcheck</span> </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a href="https://github.com/koalaman/shellcheck/blob/master/README.md#user-content-gallery-of-bad-code" style="color: #5da6ce;">This list</a>&nbsp;may be of particular interest to you as it describes code samples that shellcheck can protect you against. To run, simply execute&nbsp;<code>shellcheck my-script</code>, it will read the shebang (#!) directive to decide whether to analyse as&nbsp;<em>sh</em>,&nbsp;<em>bash</em>&nbsp;or&nbsp;<em>ksh</em>.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img src="http://zeroturnaround.com/wp-content/uploads/2016/03/shellcheck-640x396.png" alt="shellcheck" width="640" height="396" size-large=""  wp-image-56284"="" srcset="/wp-content/uploads/2016/03/shellcheck-320x198.png 320w, /wp-content/uploads/2016/03/shellcheck-768x476.png 768w, /wp-content/uploads/2016/03/shellcheck-640x396.png 640w, /wp-content/uploads/2016/03/shellcheck-200x124.png 200w, /wp-content/uploads/2016/03/shellcheck.png 1460w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">As shown in the example output above, there is one syntax error, it&#8217;s marked in red: spaces surrounding the assignment. However, shellcheck goes beyond that. In yellow markings is a warning of a potentially catastrophic event: what if&nbsp;<em>toDelete</em>&nbsp;is ever empty? Granted, the example is somewhat contrived, without&nbsp;<strong>&#8211;no-preserve-root</strong>&nbsp;there will be no damage should the statement resolve to /, but my point still stands! Finally, in green you will find general warnings on potential future mishaps that are best not to be ignored.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">As a closing remark on shellcheck: use the neat&nbsp;<a href="https://github.com/scrooloose/syntastic" style="color: #5da6ce;">Syntastic Vim plugin</a>&nbsp;to integrate the tool inside Vim itself, configuring when it should run, how it should behave, etc. The same script that generated the ouput above now looks like the following, from our favorite text editor.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img src="http://zeroturnaround.com/wp-content/uploads/2016/03/shellcheck-vim-640x396.png" alt="shellcheck-vim" width="640" height="396" size-large=""  wp-image-56283"="" srcset="/wp-content/uploads/2016/03/shellcheck-vim-320x198.png 320w, /wp-content/uploads/2016/03/shellcheck-vim-768x476.png 768w, /wp-content/uploads/2016/03/shellcheck-vim-640x396.png 640w, /wp-content/uploads/2016/03/shellcheck-vim-200x124.png 200w, /wp-content/uploads/2016/03/shellcheck-vim.png 1460w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="multitail" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h2>multitail</h2><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">For the sys-admins and dev-opses amongst us: stop using&nbsp;<code>tail -f</code>, and start using,&nbsp;<a href="https://www.vanheusden.com/multitail/" style="color: #5da6ce;">multitail</a>, tail on steroids! This ultimate log-viewer allows you to do a couple of really cool things that make it worth mentioning. Alternatively you could always either use&nbsp;<em>tmux</em>&nbsp;or&nbsp;<em>screen</em>&nbsp;to get in-shell multiplexing, or just use a modern terminal emulator allowing you to do the splitting like that, such as&nbsp;<em>iTerm2</em>&nbsp;or&nbsp;<em>Terminator</em>, however in these cases you may miss some of&nbsp;<a href="https://www.vanheusden.com/multitail/features.php" style="color: #5da6ce;">the features</a>&nbsp;below.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><ul style="list-style: none; padding: 0px; margin: 0px 0px 0px 1.2em; color: #5f5f5f; font-family: 'Open Sans', Verdana, sans-serif; line-height: normal; background-color: #ffffff;"><li style="margin: 0.5em 0px;">Show multiple windows at the same time, in the same shell using&nbsp;<em>ncurses</em>.</li><li style="margin: 0.5em 0px;">Merge multiple logs in the same window, for example the&nbsp;<strong>stdout</strong>&nbsp;and the&nbsp;<strong>stderr</strong>&nbsp;log of the same application.</li><li style="margin: 0.5em 0px;">Perform filtering dynamically via in-menu editable regexes.</li><li style="margin: 0.5em 0px;">Use the predefined color highlighters to make the logs more legible, or define your own, again with regular expressions.</li></ul><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">You know the drill how to install:</p><pre ruby"="" style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;"> $ brew install multitail  <span style="color: #6c6b5a;"># pacman -S multitail</span>  <span style="color: #6c6b5a;"># apt-get install multitail</span> </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">For an actual example, here is a screenshot of a window where I&#8217;m developing&nbsp;<a href="http://zeroturnaround.com/software/jrebel/" style="color: #5da6ce;">JRebel</a>&nbsp;by attaching it to Tomcat, running the infamous petclinic project. At that time I needed both Tomcat&#8217;s own output and the JRebel one. Take note of the&nbsp;<code>-CS</code>&nbsp;flag, signifying &#8220;use this color scheme for all subsequent files&#8221;, followed by the name of the scheme.<br />As both logs color nicely with the Apache rules, they are set, finally followed by the actual paths of the logfiles.</p><pre bash"="" style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;"> $ multitail -CS apache <span style="color: #7d9726;">"<span style="color: #ba6236;">$TOMCAT_HOME</span>/logs/catalina.out"</span> <span style="color: #7d9726;">"<span style="color: #ba6236;">$HOME</span>/.jrebel/jrebel.log"</span> </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img src="http://zeroturnaround.com/wp-content/uploads/2016/03/multitail-640x415.png" alt="multitail" width="640" height="415" size-large=""  wp-image-56282"="" srcset="/wp-content/uploads/2016/03/multitail-320x207.png 320w, /wp-content/uploads/2016/03/multitail-768x498.png 768w, /wp-content/uploads/2016/03/multitail-640x415.png 640w, /wp-content/uploads/2016/03/multitail-200x130.png 200w, /wp-content/uploads/2016/03/multitail.png 1460w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="tree" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h2>tree</h2><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Our final tool in this post is the essential&nbsp;<a href="http://mama.indstate.edu/users/ice/tree/" style="color: #5da6ce;">tree</a>&nbsp;utility. Tree prints a nice, structured, tree-view of your directories, allowing you to instantly get an idea about the structure of your data, without having to&nbsp;<em>ls</em>,&nbsp;<em>cd</em>&nbsp;or&nbsp;<em>z</em>&nbsp;all over the place. If it is not yet pre-installed in your favourite *NIX, then grab it via your favourite package manager.</p><pre ruby"="" style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;"> $ brew install tree  <span style="color: #6c6b5a;"># pacman -S tree</span>  <span style="color: #6c6b5a;"># apt-get install tree</span> </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">In its most basic form, you simply type&nbsp;<code>$ tree</code>&nbsp;to print the current folder&#8217;s structure.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img src="http://zeroturnaround.com/wp-content/uploads/2016/03/tree-640x396.png" alt="tree" width="640" height="396" size-large=""  wp-image-56286"="" srcset="/wp-content/uploads/2016/03/tree-320x198.png 320w, /wp-content/uploads/2016/03/tree-768x476.png 768w, /wp-content/uploads/2016/03/tree-640x396.png 640w, /wp-content/uploads/2016/03/tree-200x124.png 200w, /wp-content/uploads/2016/03/tree.png 1460w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Personally, I prefer to spice it up just a little bit, adding some flags to print human readable filesizes, hidden files, and a nice total sizecount:&nbsp;<code>$ tree -ah --du</code>.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img src="http://zeroturnaround.com/wp-content/uploads/2016/03/tree-fancy-640x396.png" alt="tree-fancy" width="640" height="396" size-large=""  wp-image-56285"="" srcset="/wp-content/uploads/2016/03/tree-fancy-320x198.png 320w, /wp-content/uploads/2016/03/tree-fancy-768x476.png 768w, /wp-content/uploads/2016/03/tree-fancy-640x396.png 640w, /wp-content/uploads/2016/03/tree-fancy-200x124.png 200w, /wp-content/uploads/2016/03/tree-fancy.png 1460w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">And that is about all I have to tell you about tree. It&#8217;s really convenient to grep its output, it gives you an awesome representation of the filesystem, and I&#8217;m sure you&#8217;ll love it from the first moment.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">That concludes my list of command line tools that you won&#8217;t think will change you live, but sure enough after some time you won&#8217;t imagine yourself not using them. In fact, you&#8217;ll likely curse every time you use a command-line-muggle&#8217;s computer without these great tools installed. What are the hidden gems of your command-line-fu? Share your favorite command line utilities in the comments below, I really would like to learn new tricks.</p><img src ="http://www.blogjava.net/xiaomage234/aggbug/429990.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2016-04-06 15:08 <a href="http://www.blogjava.net/xiaomage234/archive/2016/04/06/429990.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>5 command line tools you should be using</title><link>http://www.blogjava.net/xiaomage234/archive/2016/04/06/429988.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 06 Apr 2016 06:49:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2016/04/06/429988.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/429988.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2016/04/06/429988.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/429988.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/429988.html</trackback:ping><description><![CDATA[<p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><strong>from:</strong><span style="font-family: verdana, 'courier new'; line-height: 21px;">http://zeroturnaround.com/rebellabs/5-command-line-tools-you-should-be-using/</span></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><strong>Working on the command line will make you more productive, even on Windows!</strong></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">There&#8217;s an age-old discussion between the usability and friendliness of GUI programs, versus the simplicity and productivity of CLI ones. But this is not a holy war I intend to trigger or fuel. In the past, RebelLabs has discussed&nbsp;<a href="http://zeroturnaround.com/rebellabs/the-6-built-in-jdk-tools-the-average-developer-should-learn-to-use-more/" style="color: #5da6ce;">built-in JDK tools</a>&nbsp;and received amazing feedback, so I feel an urge to share more non-JDK command line tools which I simply couldn&#8217;t live without.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">I do firmly believe every developer who&#8217;s worth their salt should have at least some notion of how to work with the command line, if only because some tools only exist in CLI variants. Plus, because geek++!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">All other nuances that people pour words over, like the choice of operating system (OSX of course, they have beautiful aluminum cases), your favorite shell (really it should be ZSH), or the preference of Vim over Emacs (unless you have more fingers than usual) are much less relevant. OK, that was a little flamewar-like, but I promise that will be the last of it!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">So my advice would be that you should learn how to use tools at the command line, as it will have a positive impact on your happiness and productivity at least for half a century!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Anyway, in this post I want to share with you four-five lesser-known yet pretty awesome command line gems. As an added bonus I will also advise&nbsp;<strong>the proper way to use shell under Windows</strong>, which is a pretty valuable bit of knowledge in itself.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">The reason I wanted to write this post in the first place is because I really enjoy using these tools myself, and want to learn about other command line tools that I don&#8217;t yet know about. So please, awesome reader, leave me a comment with your favourite CLI tools &#8212; that&#8217;d be grand! Now, assuming we all have a nice, workable shell, let&#8217;s go over some neat command line tools that are worth hearing about.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="httpie" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h3>0. HTTPie</h3><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">&nbsp;</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">The first on my list is a tool called&nbsp;<a href="http://httpie.org/" style="color: #5da6ce;">HTTPie</a>. Fear not, this tool has nothing to do with Internet Explorer, fortunately. In essence HTTPie is a&nbsp;<a href="http://curl.haxx.se/" style="color: #5da6ce;">cURL</a>&nbsp;wrapper, the utility that performs HTTP requests from the command line. HTTPie adds nice features like auto-formatting and intelligent colour highlighting to the output making it much more readable and useful to the user. Additionally, it takes a very human-centric approach to its execution, not asking you to remember obscure flags and options. To perform an HTTP GET, you simply run&nbsp;<em>http</em>, to post you&nbsp;<em>http POST</em>, what can be easier or more beautiful?</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a href="http://zeroturnaround.com/wp-content/uploads/2015/08/sample-httpie-output.png" style="color: #5da6ce;"><img size-large=""  wp-image-53101"="" src="http://zeroturnaround.com/wp-content/uploads/2015/08/sample-httpie-output-640x528.png" alt="sample httpie output" width="640" height="528" srcset="/wp-content/uploads/2015/08/sample-httpie-output-320x264.png 320w, /wp-content/uploads/2015/08/sample-httpie-output-640x528.png 640w, /wp-content/uploads/2015/08/sample-httpie-output-200x165.png 200w, /wp-content/uploads/2015/08/sample-httpie-output.png 1364w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></a></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Almost all command line tools are conveniently packaged for installation. HTTPie is no exception, to install it, run the following command.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><ul style="list-style: none; padding: 0px; margin: 0px 0px 0px 1.2em; color: #5f5f5f; font-family: 'Open Sans', Verdana, sans-serif; line-height: normal; background-color: #ffffff;"><li style="margin: 0.5em 0px;">On OSX use&nbsp;<a href="http://brew.sh/" style="color: #5da6ce;">homebrew</a>, the best package manager to be found on OSX:&nbsp;<code>brew install httpie</code></li><li style="margin: 0.5em 0px;">All other platforms, using Python&#8217;s pip:&nbsp;<code>pip install --upgrade httpie</code></li></ul><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">I personally use HTTPie a lot when developing a REST API, as it allows me to very simply query the API, returning nicely structured, legible data. Without doubt this tool saves me serious work and frustration. Luckily the usage does not stop at just REST APIs. Generally speaking, all interactions over HTTP, whether it&#8217;s inputting or outputting data, can be done in a very human-readable format.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">I&#8217;d encourage you to take a look at the website, spend the 10 seconds it takes to install and give it a go yourself. Try to get the source of any website and be amazed by the output.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><img size-medium=""  wp-image-53105"="" src="http://zeroturnaround.com/wp-content/uploads/2015/08/unstoppable-320x320.jpg" alt="How unstoppable you can be with proper tools" width="320" height="320" srcset="/wp-content/uploads/2015/08/unstoppable-160x160.jpg 160w, /wp-content/uploads/2015/08/unstoppable-320x320.jpg 320w, /wp-content/uploads/2015/08/unstoppable-200x200.jpg 200w, /wp-content/uploads/2015/08/unstoppable-32x32.jpg 32w, /wp-content/uploads/2015/08/unstoppable-64x64.jpg 64w, /wp-content/uploads/2015/08/unstoppable-96x96.jpg 96w, /wp-content/uploads/2015/08/unstoppable-128x128.jpg 128w, /wp-content/uploads/2015/08/unstoppable.jpg 550w" sizes="(max-width: 320px) 100vw, 320px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><em>Protip:</em>&nbsp;Combine the HTTPie greatness with&nbsp;<a href="https://stedolan.github.io/jq" style="color: #5da6ce;">jq for command line JSON manipulation</a>&nbsp;or&nbsp;<a href="https://github.com/ericchiang/pup" style="color: #5da6ce;">pup for HTML parsing</a>&nbsp;and you&#8217;ll be unstoppable!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="icdiff" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h3>1. Icdiff</h3><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">&nbsp;</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">At ZeroTurnaround I am blessed to work with Mercurial, a very nice and easy to use VCS. On OSX the excellent GUI program&nbsp;<a href="https://www.sourcetreeapp.com/" style="color: #5da6ce;">SourceTree</a>&nbsp;makes working with Mercurial an absolute breeze, even with the more complex stuff. Unfortunately I like to keep the number of programs/tabs/windows I have open to an absolute minimum. Since I always have a terminal window opened it makes sense to use the CLI.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">All was fine and well apart from one single pitfall in my setup. This was a feature I could barely go without: side-by-side diffs. Introducing&nbsp;<a href="http://www.jefftk.com/icdiff" style="color: #5da6ce;">icdiff</a>. Of all the tools I use each day, this is the one I most appreciate. Let&#8217;s take a look at a screenshot:</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a href="http://zeroturnaround.com/wp-content/uploads/2015/08/example-of-icdiff-at-work.png" style="color: #5da6ce;"><img size-large=""  wp-image-53100"="" src="http://zeroturnaround.com/wp-content/uploads/2015/08/example-of-icdiff-at-work-640x528.png" alt="example of icdiff at work" width="640" height="528" srcset="/wp-content/uploads/2015/08/example-of-icdiff-at-work-320x264.png 320w, /wp-content/uploads/2015/08/example-of-icdiff-at-work-640x528.png 640w, /wp-content/uploads/2015/08/example-of-icdiff-at-work-200x165.png 200w, /wp-content/uploads/2015/08/example-of-icdiff-at-work.png 1364w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></a></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">By itself, icdiff is an intelligent Python script, smart at detecting which of the differences are modifications, additions or deletions. The excellent colour highlighting in the tool makes it easy to distinguish between the three types of differences mentioned.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">To get going with icdiff, do the following:</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><ul style="list-style: none; padding: 0px; margin: 0px 0px 0px 1.2em; color: #5f5f5f; font-family: 'Open Sans', Verdana, sans-serif; line-height: normal; background-color: #ffffff;"><li style="margin: 0.5em 0px;">Via homebrew once again:&nbsp;<code>brew install icdiff</code></li><li style="margin: 0.5em 0px;">Manually grab the Python script from the site above and put it in your PATH</li></ul><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">When you couple icdiff with a VCS such as Mercurial, you&#8217;ll see it really shine. To fully integrate it, you&#8217;ll need to complete two more configuration steps,&nbsp;<a href="http://ianobermiller.com/blog/2015/01/12/side-by-side-diffs-for-mercurial-hg/" style="color: #5da6ce;">already documented here</a>. The gist of the instructions is to first add a wrapping script that allows the one-by-one file diff of icdiff to operate on entire directories. Secondly you need to config your VCS to actually use icdiff. The link above shows the details of configuring it for Mercurial, but porting this to Git shouldn&#8217;t be so hard.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="pandoc" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h3>2. Pandoc</h3><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">&nbsp;</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">In the spirit of &#8220;practice what you preach&#8221; I set out to write this entire blogpost via a CLI. Most of the work was done using MacVim, in iTerm2 on OSX. All of the text was written and formatted using standard MarkDown syntax. The only issue to arise here is that it&#8217;s pretty difficult sometimes to accurately guess how your eventual text will come out.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">This is where the next tool comes in:&nbsp;<a href="http://pandoc.org/" style="color: #5da6ce;">Pandoc</a>. A program so powerful and versatile it&#8217;s a wonder it was GPL&#8217;d in the first place. Let&#8217;s take a look at how we might use it.</p><pre css"="" style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;"><span style="color: #5f9182;">pandoc</span> <span style="color: #5f9182;">-f</span> <span style="color: #5f9182;">markdown</span> <span style="color: #5f9182;">-t</span> <span style="color: #5f9182;">html</span> <span style="color: #5f9182;">blogpost</span><span style="color: #ba6236;">.md</span> &amp;<span style="color: #5f9182;">gt</span>; <span style="color: #5f9182;">blogpost</span><span style="color: #ba6236;">.html</span> </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Think of a markup format, any markup format. The chances are, Pandoc can convert it from one format to any other. For example, I&#8217;m writing this blogpost in Vim and use Pandoc to convert it from MarkDown into HTML, to actually see the final result. It&#8217;s a nice thing, needing only my terminal and a browser, rather than being tied to a particular online platform, fully standalone and offline.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Don&#8217;t let yourself be limited by simple formats like MarkDown though, give it some&nbsp;<em>docx</em>&nbsp;files, or perhaps some&nbsp;<em>LaTeX</em>. Export into&nbsp;<em>PDF</em>,&nbsp;<em>epub</em>, let it handle and format your citations. The possibilities are endless.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Once again&nbsp;<code>brew install pandoc</code>&nbsp;does the trick. Did I mention I really like Homebrew? Maybe that should have made my tool list! Anyway, you get the gist of what that does!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a name="moreutils" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h3>3. Moreutils</h3><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">&nbsp;</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">The next tool in this post is actually a collection of nifty tools that didn&#8217;t make it into coreutils:<a href="https://joeyh.name/code/moreutils/" style="color: #5da6ce;">Moreutils</a>. It should be obtainable under moreutils in about any distro you can think of. OSX users can get all this goodness by brewing it like I did throughout this post:</p><pre sql"="" style="overflow-x: auto; color: #5f5e4e; padding: 0.8em; line-height: 1.5em; background: #f3f3f3;">brew <span style="color: #5f9182;">install</span> moreutils </pre><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Here are a list of the included programs with short descriptions:</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><ul style="list-style: none; padding: 0px; margin: 0px 0px 0px 1.2em; color: #5f5f5f; font-family: 'Open Sans', Verdana, sans-serif; line-height: normal; background-color: #ffffff;"><li style="margin: 0.5em 0px;">chronic: runs a command quietly unless it fails</li><li style="margin: 0.5em 0px;">combine: combine the lines in two files using boolean operations</li><li style="margin: 0.5em 0px;">ifdata: get network interface info without parsing ifconfig output</li><li style="margin: 0.5em 0px;">ifne: run a program if the standard input is not empty</li><li style="margin: 0.5em 0px;">isutf8: check if a file or standard input is utf-8</li><li style="margin: 0.5em 0px;">lckdo: execute a program with a lock held</li><li style="margin: 0.5em 0px;">mispipe: pipe two commands, returning the exit status of the first</li><li style="margin: 0.5em 0px;">parallel: run multiple jobs at once</li><li style="margin: 0.5em 0px;">pee: tee standard input to pipes</li><li style="margin: 0.5em 0px;">sponge: soak up standard input and write to a file</li><li style="margin: 0.5em 0px;">ts: timestamp standard input</li><li style="margin: 0.5em 0px;">vidir: edit a directory in your text editor</li><li style="margin: 0.5em 0px;">vipe: insert a text editor into a pipe</li><li style="margin: 0.5em 0px;">zrun: automatically uncompress arguments to command</li></ul><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">As the maintainer hints himself&nbsp;<strong>sponge</strong>&nbsp;is perhaps the most useful tool, in that you can easily sponge up standard input into a file. However, it is not difficult to see the advantages of some of the other commands such as&nbsp;<strong>chronic</strong>,&nbsp;<strong>parallel</strong>&nbsp;and&nbsp;<strong>pee</strong>.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">My personal favourite though, and the ultimate reason to include this collection, is without doubt<strong>vipe</strong>.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">You can literally intercept your data as it moves from command to command through the pipe. Even though this is not a useful tool in your scripts, it can be extremely helpful when running commands interactively. Instead of giving you a useful example I will leave you with a modified fortune!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a href="http://zeroturnaround.com/wp-content/uploads/2015/08/sample-vipe-command1.png" style="color: #5da6ce;"><img size-large=""  wp-image-53117"="" src="http://zeroturnaround.com/wp-content/uploads/2015/08/sample-vipe-command1-640x512.png" alt="sample vipe command" width="640" height="512" srcset="/wp-content/uploads/2015/08/sample-vipe-command1-320x256.png 320w, /wp-content/uploads/2015/08/sample-vipe-command1-640x512.png 640w, /wp-content/uploads/2015/08/sample-vipe-command1-200x160.png 200w, /wp-content/uploads/2015/08/sample-vipe-command1.png 1174w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></a><br /><a name="babun" style="color: rgb(93, 166, 206); text-decoration: underline;"></a></p><h3>4. Babun</h3><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">&nbsp;</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">These days the Windows OS comes packaged with two different shells: its classic command line, and PowerShell. Let&#8217;s completely ignore those and have a look at the proper way or running command line tools under Windows:&nbsp;<a href="http://babun.github.io/" style="color: #5da6ce;">Babun</a>! The reason this project is amazingly awesome is because it actually brings all the goodness of the \*NIX command line into Windows in a completely pre-configured no-nonsense manner.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Moreover, its default shell is my beloved ZSH, though it can very easily be changed to use Bash, if that&#8217;s your cup of tea. With ZSH it also packages the highly popular&nbsp;<a href="https://github.com/robbyrussell/oh-my-zsh" style="color: #5da6ce;">oh-my-zsh framework</a>, which combines all the benefits of ZSH with no config whatsoever thanks to some very sane defaults and an impressive plugin system.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">By default Babun is loaded with more applications than any sane developer may ever need, and is thus a rather solid&nbsp;<strong>728 MBs</strong>(!) when expanded. In return you get essentials like Vim pre-installed and ready to go!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;"><a href="http://zeroturnaround.com/wp-content/uploads/2015/08/screenshot-of-babun.png" style="color: #5da6ce;"><img size-large=""  wp-image-53103"="" src="http://zeroturnaround.com/wp-content/uploads/2015/08/screenshot-of-babun-640x397.png" alt="screenshot of babun termina;" width="640" height="397" srcset="/wp-content/uploads/2015/08/screenshot-of-babun-320x199.png 320w, /wp-content/uploads/2015/08/screenshot-of-babun-640x397.png 640w, /wp-content/uploads/2015/08/screenshot-of-babun-200x124.png 200w, /wp-content/uploads/2015/08/screenshot-of-babun.png 1025w" sizes="(max-width: 640px) 100vw, 640px" style="border: 0px; vertical-align: top; display: block; margin: 0.5em auto;" /></a></p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Under the hood Babun is basically a fancy wrapper around Cygwin. If you already have a Cygwin install you can seamlessly re-use that one. Otherwise it will default to its own packaged Cygwin binaries, and supply you with access to those.</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">Some more points of interest are that Babun provides its own package manager, which again wraps around Cygwin&#8217;s, and an update mechanism both for itself and for oh-my-zsh. The best thing is that no actual installation is required, nor is the usual requirement of admin rights necessary, so for those people on a locked down PC this may be just the thing they need!</p><hr style="border: 0px; height: 1px; color: #5f5f5f; font-family: 'Open Sans', Verdana, sans-serif; line-height: normal; margin: 20px 0px !important; background: #ededed;" /><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">I hope this small selection of tools gave you at least one new cool toy to play with. As for me, it seems it is time to look at command line browsers before writing a following blogpost, to fully ditch the world of the GUI!</p><p style="line-height: 1.65; word-spacing: 0.15em; font-family: 'Open Sans', Verdana, sans-serif; background-color: #ffffff;">By all means fire up any comments or suggestions that you have, and let&#8217;s get some tool-sharing going on. If you just want to chat just ping RebelLabs on Twitter:&nbsp;<a href="http://twitter.com/ZeroTurnaround" style="color: #5da6ce;">@ZeroTurnaround</a>, they are pretty chatty, but great smart people.</p><img src ="http://www.blogjava.net/xiaomage234/aggbug/429988.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2016-04-06 14:49 <a href="http://www.blogjava.net/xiaomage234/archive/2016/04/06/429988.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DVD隐藏技术【人工光盘坏道】 如何查看 </title><link>http://www.blogjava.net/xiaomage234/archive/2014/10/27/419069.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Mon, 27 Oct 2014 01:45:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2014/10/27/419069.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/419069.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2014/10/27/419069.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/419069.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/419069.html</trackback:ping><description><![CDATA[<pre id="answer-content-763594552" accuse="aContent"  mb-10"="" style="margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace; white-space: pre-wrap; word-wrap: break-word; color: #333333; line-height: 24px; background-color: #ffffff;">人工光盘坏道 <br /><br />  目前最新的加密方法，原理是该VCD带防盗圈，这个圈的作用是在光头读盘到防盗圈处时是个坏道，从物理上让光驱读不过去，你会发现光盘可以显示容量，但打开目录却没有任何文件，市面上的无间道2、天地英雄、大块头有大智慧等最新VCD都是采用这种加密方法。 <br /><br />  破解方法： <br /><br />  步骤1：首先我们需要CloneCD这个软件，下载地址：天极网下载频道。注意不能使用NERO等其他光驱软件，因为NERO读不过坏道，可能造成死机的情况。 <br /><br />  首次运行在Language语言栏内选择SIMP.Chinese，界面显示为中文。点击&#8220;文件&#8594;读成映像文件&#8221;，在弹出的对话框中选择物理光驱的盘符，注意不能选择虚拟盘符。选择后CloneCD会对整个VCD进行扫描，由于制作的是视频镜像，所以选择multimedia audio cd，然后选择镜像文件保存目录，右面已经显示出扫描后光盘的容量、片断、轨道数等一些信息（图3）。  <br /><br />CloneCD将读取的整个光盘内容制作成镜像文件，中途在记录框中出现读取扇区失败的信息，同时光驱中会出现咔咔咔咔的响声音，这个是正常现象。cloneCD能制作镜像的原理就是能真实地按照1&#8758;1 全盘复制CD，不管是否有保护或加密之类，它都会跳过人为设置的坏道把有用部分镜像制作出来。  <br /><br />  跳过坏道大概用时两三分钟，视你的光驱读盘能力而定，在显示跳过伪扇区后经过十多分钟就可以把这个光盘制作成镜像文件，最后显示读取完成后在目录下会出现image.img等四个文件。 <br /><br />  步骤2：已经得到了的IMG镜像文件，还不能使用其他虚拟光驱工具来打开它，这时你会发现还是一无所获。接下来的工作是提取镜像文件中的视频文件，我们还需要IsoBuster这个工具，下载地址：天极网下载频道运行IsoBuster，点击&#8220;file&#8594;open image file&#8221;来打开image.img文件，在主界面中应该出现光盘的卷标和目录结构，在track 01上右击，选&#8220;extract track 01&#8594;treat as video onlyextract but filter only m2f2 mpeg video frames（.mpg）&#8221;，然后选择文件存放目录，最后经过几分钟的时间就得到了原始的MPG视频文件，用来复制VCD或在PC上观看就任君选择了。<br />如果以上方法还不能解决，说明加密的是最新的技术，暂时还没破解的方法</pre><img src ="http://www.blogjava.net/xiaomage234/aggbug/419069.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2014-10-27 09:45 <a href="http://www.blogjava.net/xiaomage234/archive/2014/10/27/419069.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>图文详解Keepass使用教程</title><link>http://www.blogjava.net/xiaomage234/archive/2013/04/18/398037.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Thu, 18 Apr 2013 08:45:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2013/04/18/398037.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/398037.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2013/04/18/398037.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/398037.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/398037.html</trackback:ping><description><![CDATA[<p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">KeePass Password Safe（以下简称KeePass）是一套类似数据库管理的密码管理软件，通过密码和密钥，它能够提供一个足够安全的密码存储空间。只要你记住这一个管理密码，妥善保管好密钥文件和数据库文件，基本上可以安枕无忧了。同时KeePass也有强大的密码生成功能，绝对比你自己想的要安全。它的操作方式也极为 简单，没有复杂的步骤。</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">一：下载及安装<br style="padding: 0px; margin: 0px;" />站长百科下载站最新版下载地址：http://down.zzbaike.com/download/KeePass&#8211;1257.html，下载安装包解压后双击安装文件根据安装向导就可以安装。<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/1.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/1-300x185.jpg" alt="" width="300" height="185" size-medium=""  wp-image-652"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a><br style="padding: 0px; margin: 0px;" />选择I accept意思也就是我同意，然后next（下一步），根据提示继续next就可以安装成功。<br style="padding: 0px; margin: 0px;" />软件是英文的，安装好之后我们看到界面仍旧都是英文的，我们可以去http://keepass.info/translations.html，中下载简体中文插件复制放到安装目录下，运行软件&#8220;KeePass&#8221;，点击&#8220;View&#8221;菜单中&#8220;Change Language&#8221;命令，选择&#8220;简体中文&#8221;重新启动程序即可。</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;"><a href="http://www.huluboke.com/wp-content/uploads/2011/08/2.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/2-300x221.jpg" alt="" width="300" height="221" size-medium=""  wp-image-653"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a><br style="padding: 0px; margin: 0px;" />二：使用软件<br style="padding: 0px; margin: 0px;" />经过上面的步骤，我们返回到桌面双击keepass的快捷键，就可以看到软件的语言已经变成中文的了<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/3.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/3-300x219.jpg" alt="" width="300" height="219" size-medium=""  wp-image-654"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a></p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">这样就可以方便我们的使用了。<br style="padding: 0px; margin: 0px;" />如果是第一次使用，我们首先的是要创建数据库，也就是存放密码的数据库，KeePass将会把你的所有密码存储在这个数据库中。<br style="padding: 0px; margin: 0px;" />单击菜单上的&#8220;文件&#8212;新建&#8221;，选择数据库存放的路径<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/4.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/4-300x228.jpg" alt="" width="300" height="228" size-medium=""  wp-image-655"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a><br style="padding: 0px; margin: 0px;" />选择一个路径来保存我们的数据库，然后点击保存，<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/5.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/5-300x255.jpg" alt="" width="300" height="255" size-medium=""  wp-image-656"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a></p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">这里需要填入数据库管理密码，并要确认密码，我们同时要勾选上密匙文件，并选择密钥的保存位置（可以选择不用密钥）。这样将来在开启数据库时就要&#8220;主密码&#8221;和&#8220;密钥文件&#8221;同时具备才行。输入完毕后点击&#8220;确定&#8221;然后点击创建<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/6.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/6-300x172.jpg" alt="" width="300" height="172" size-medium=""  wp-image-658"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a><br style="padding: 0px; margin: 0px;" />鼠标在黑色区域划过生成的密码位数在下方可以很清楚的看到，然后点击确定<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/7.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/7-300x230.jpg" alt="" width="300" height="230" size-medium=""  wp-image-659"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a></p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">在这里描述或者不描述都可以，点击确定后就进入主窗口并可以看到一条示例记录，点击示例记录在下方可以看到网址和密码并且也创建时间。<a href="http://www.huluboke.com/wp-content/uploads/2011/08/8.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/8-300x219.jpg" alt="" width="300" height="219" size-medium=""  wp-image-660"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a></p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">主窗口的左边是密码群组，各个群组又可建立子群组。右边是你的密码记录。密码记录收纳于不同的密码群组中。你可以使用Keepass默认的密码群组，或删除它们，创建自己的密码组。</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">在主窗口右边单击右键，选择&#8220;添加记录&#8230;&#8221;，就可以编辑你的记录了：记录标题，用户名，网址，密码，备注等。可以空着不填。确认后就完成了一条记录了，在主窗口右边的子窗口中看到刚才新增的密码条目。<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/9.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/9-300x214.jpg" alt="" width="300" height="214" size-medium=""  wp-image-661"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a></p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">当你再次使用这个文件时，选中该条记录，在记录上右击鼠标就可以真正使用它了。你可以将用户名拷贝后，就可以在其它的任何软件中粘贴了，还可以将用户名拖放到其它窗口中。最后，一定要记住保存密码，点击&#8220;文件-&gt;保存&#8221;，或工具栏上的保存按钮。</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">提示：随着数据库里的记录数目的逐步增多，通过&#8220;编辑&#8221;菜单中的&#8220;在数据库中查找&#8221;或&#8220;在此群组内查找&#8221;命令可以迅速的找到要查的信息。另外，我们可以把数据库导出为TXT、HTML、XML、CSV等格式，导入CSV、TXT、KeePass数据库等格式的文件。</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">三：数据库的配置</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">点击&#8220;文件-&gt;数据库设置&#8230;&#8221;，在弹出的窗口的选择&#8220;安全&#8221;按钮创建一个加密算法，并设置密钥的加密次数（如果选择生成密钥的话）。通常加密次数的数量级达到10万，也就足够了。<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/101.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/101-300x217.jpg" alt="" width="300" height="217" size-medium=""  wp-image-664"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a></p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">四：Keepass数据的备份<br style="padding: 0px; margin: 0px;" />首先要备份KeePass.exe所在目录中的KeePass.ini文件。其次，备份你所保存的密码数据库文件（*.kdb）。如果你生在了密钥，还要保存密钥文件。以上文件打包后，可以放入多动存储装置中，或放入网络空间。<br style="padding: 0px; margin: 0px;" />提示：如果用户的密码记录经常变动，那么相应的KeePass数据也要经常备份。保存好你的数据。尽管你有数不清的密码，但只需看好一个KeePass数据备份就可以了。<br style="padding: 0px; margin: 0px;" />五：密码生成器<br style="padding: 0px; margin: 0px;" />在添加记录时，我们可以利用密码生成器来生成复杂的密码，点击&#8220;密码&#8221;右侧的&#8220;生成&#8221;按钮，调出&#8220;密码生成器&#8221;属性框，然后，点击&#8220;确定&#8221;按钮即可自动生成随机密码。通过点击&#8220;***&#8221;按钮将密码明文显示，清楚的看到由生成器所产生的字符串。<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/11.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/11-300x176.jpg" alt="" width="300" height="176" size-medium=""  wp-image-665"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a></p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">六：Keepass常用设置</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">打开【工具】-&gt;【选项&#8230;】，就可以对Keepass作设置了。<br style="padding: 0px; margin: 0px;" /><a href="http://www.huluboke.com/wp-content/uploads/2011/08/12.jpg" style="padding: 0px; margin: 0px; color: #aa752a;"><img src="http://www.huluboke.com/wp-content/uploads/2011/08/12-300x221.jpg" alt="" width="300" height="221" size-medium=""  wp-image-666"="" style="padding: 3px; margin: 0px; max-width: 98%; border: 3px solid #dadbde;" /></a><br style="padding: 0px; margin: 0px;" />在&#8220;安全&#8221;选项卡中勾上：设定锁定主窗口时间：300（自己设置适合的时间）<br style="padding: 0px; margin: 0px;" />自动清空剪贴板时间，设置时间为3秒<br style="padding: 0px; margin: 0px;" />&#8220;高级&#8221;选项卡中根据需要勾上适合的选项。</p><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #eeeff1;">我们现在生活中各个方面都需要用到密码，网站，邮箱，论坛，银行卡等等，使用keepass可以方便的为我们服务记录各种不同的密码，使我们的操作更加省时高效，管理更方便安全。</p><div style="margin: 0px; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: normal; background-color: #eeeff1;"><p style="padding: 0px; margin: 0px 0px 0.7em; line-height: 1.6em;"><strong style="padding: 0px; margin: 0px;">版权申明：</strong>&nbsp;<a href="http://www.huluboke.com/" style="padding: 0px; margin: 0px; color: #aa752a;">葫芦博客</a>(www.huluboke.com )专栏作家原创<br style="padding: 0px; margin: 0px;" /><strong style="padding: 0px; margin: 0px;">原文地址</strong>&nbsp;<a href="http://www.huluboke.com/keepass-jiaocheng/" style="padding: 0px; margin: 0px; color: #aa752a;">http://www.huluboke.com/keepass-jiaocheng/</a>转载请保留本版权信息</p></div><img src ="http://www.blogjava.net/xiaomage234/aggbug/398037.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2013-04-18 16:45 <a href="http://www.blogjava.net/xiaomage234/archive/2013/04/18/398037.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>12306 订票助手 – 火车票自动订票 Chrome 扩展</title><link>http://www.blogjava.net/xiaomage234/archive/2012/09/18/388017.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Tue, 18 Sep 2012 10:42:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2012/09/18/388017.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/388017.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2012/09/18/388017.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/388017.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/388017.html</trackback:ping><description><![CDATA[<h2>12306 订票助手 &#8211; 火车票自动订票 Chrome 扩展</h2><div style="margin: 0px; position: absolute; right: 135px; top: 25px; font-family: Arial, &#930;���ź�, Georgia, sans-serif; font-size: 13px; line-height: 18px; background-color: #e8ddcb; "><img src="http://www.appinn.com/wp-content/plugins/wp-favorite-posts/img/heart.png" alt="Favorite" title="Favorite" style="border: 0px; vertical-align: middle; margin-right: 2px; " /><a href="http://www.appinn.com/12306-chrome-ticket/?wpfpaction=add&amp;postid=4792" title="收藏" rel="nofollow" style="text-decoration: none; color: #cc3300; ">收藏</a></div><a href="http://www.appinn.com/12306-chrome-ticket/#comments" title="post a comment" style="text-decoration: none; color: #777777; display: inline-block; width: 41px; height: 17px; font-size: 12px; line-height: 17px; font-family: Tahoma, Geneva, sans-serif; position: absolute; right: 0px; background-image: url(http://static-y.appinn.com/wp-content/themes/appinn_wp/images/sprites.png); background-color: #e8ddcb; text-align: center; top: 0px; background-position: 0px -200px; background-repeat: no-repeat no-repeat; ">54</a><div style="margin: 0px; position: absolute; right: 0px; top: 25px; font-family: Arial, &#930;���ź�, Georgia, sans-serif; font-size: 13px; line-height: 18px; background-color: #e8ddcb; "><div style="margin: 0px; "><ul data-post="4792" title="4.25 / 5" style="margin: 0px; padding: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; background-image: url(http://static-y.appinn.com/wp-content/plugins/post-ratings/star.png); background-color: transparent; height: 16px; float: left; width: 80px; background-position: initial initial; background-repeat: repeat no-repeat; "><li style="margin: 0px; padding: 0px; list-style: disc; position: absolute; display: block; background-image: url(http://static-y.appinn.com/wp-content/plugins/post-ratings/star.png); background-color: transparent; height: 16px; text-indent: -9999px; z-index: 1; width: 68px; background-position: 0% 50%; background-repeat: repeat no-repeat; ">4.25 / 5&nbsp;5</li><li style="margin: 0px; padding: 0px; list-style: disc; position: relative; display: block; "><a title="Give 1 out of 5 stars" style="color: #cc3300; position: absolute; cursor: pointer; left: 0px; top: 0px; display: block; width: 16px; height: 16px; text-indent: -9999px; z-index: 10; ">1 / 5</a></li><li style="margin: 0px; padding: 0px; list-style: disc; position: relative; display: block; "><a title="Give 2 out of 5 stars" style="color: #cc3300; position: absolute; cursor: pointer; left: 16px; top: 0px; display: block; width: 16px; height: 16px; text-indent: -9999px; z-index: 10; ">2 / 5</a></li><li style="margin: 0px; padding: 0px; list-style: disc; position: relative; display: block; "><a title="Give 3 out of 5 stars" style="color: #cc3300; position: absolute; cursor: pointer; left: 32px; top: 0px; display: block; width: 16px; height: 16px; text-indent: -9999px; z-index: 10; ">3 / 5</a></li><li style="margin: 0px; padding: 0px; list-style: disc; position: relative; display: block; "><a title="Give 4 out of 5 stars" style="color: #cc3300; position: absolute; cursor: pointer; left: 48px; top: 0px; display: block; width: 16px; height: 16px; text-indent: -9999px; z-index: 10; ">4 / 5</a></li><li style="margin: 0px; padding: 0px; list-style: disc; position: relative; display: block; "><a title="Give 5 out of 5 stars" style="color: #cc3300; position: absolute; cursor: pointer; left: 64px; top: 0px; display: block; width: 16px; height: 16px; text-indent: -9999px; z-index: 10; ">5 / 5</a></li></ul><div style="margin: 0px 0px 0px 5px; font-size: 11px; color: #999999; float: left; "><strong style="color: #666666; ">8</strong>&nbsp;votes</div></div></div><div style="margin: 0px 0px 15px; clear: both; color: #bbbbbb; width: 440px; font-size: 11px; font-family: Arial, &#930;���ź�, Georgia, sans-serif; line-height: 18px; background-color: #e8ddcb; "><strong><a href="http://www.appinn.com/author/scavin/" title="由 scavin 发布" rel="author" style="text-decoration: none; color: #cc3300; ">scavin</a></strong>&nbsp;on&nbsp;<cite>2012.01.10</cite>,&nbsp;<span style="color: #777777; ">标签:</span>&nbsp;<a href="http://www.appinn.com/tag/%e7%81%ab%e8%bd%a6%e7%a5%a8/" rel="tag" style="text-decoration: none; color: #cc3300; ">火车票</a>.</div><div style="margin: 0px; font-family: Arial, &#930;���ź�, Georgia, sans-serif; font-size: 13px; line-height: 18px; background-color: #e8ddcb; "><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; "><a href="http://www.appinn.com/12306-chrome-ticket/" style="text-decoration: none; color: #cc3300; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=); padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">12306 订票助手</a>&nbsp;是款 Chrome 扩展，用来对 12306.cn 网址进行自动登录，自动查询，自动重试订单。@Appinn</p><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; "><img src="http://img1.appinn.com/2012/01/2012-01-10-2.09.09.png" alt="12306 订票助手   火车票自动订票 Chrome 扩展[图] | 小众软件" title="12306 订票助手   火车票自动订票 Chrome 扩展[图] | 小众软件" style="border: none; " /></p><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; ">火车票四连发么，好久没发现程序员如此热情了&#8230;</p><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; ">这款工具就比较适合彻底的技术宅了，希望今天介绍还不算太晚，根据订票 12 天来看，目前（1月10日）已经可以订到1月21日的票了，距离春节仅一天，基本上是放假的开始的最后日子了。</p><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; "><strong>12306 订票助手</strong>&nbsp;使用前提：须使用&nbsp;<a href="http://www.appinn.com/tag/Chrome/" style="text-decoration: none; color: #cc3300; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=); padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">Chrome</a>&nbsp;浏览器，以及安装&nbsp;<a href="https://github.com/zzdhidden/12306/raw/master/12306BookingAssistant.user.js" style="text-decoration: none; color: #cc3300; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=); padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">UserScript</a>，然后打开 https://dynamic.12306.cn/otsweb/ 开始订票。</p><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; ">上图尝试登陆78次后成功，而下图则开始刷票&#8230;</p><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; "><img src="http://img1.appinn.com/2012/01/pic-201201103114.png" alt="12306 订票助手   火车票自动订票 Chrome 扩展[图] | 小众软件" title="12306 订票助手   火车票自动订票 Chrome 扩展[图] | 小众软件" style="border: none; " /></p><p style="margin: 0px 0px 15px; padding: 0px; word-wrap: break-word; word-break: normal; ">刷票成功会蓝色通知以及声音提示，此时点击预订按钮，就可以进入自动提交订单页面，请注意正确填写实名制火车票坐车人信息，自动提及后就直接到付款阶段，无确认选项。作者提供了详尽的步骤说明可以参考。</p></div><img title="点击右侧的链接下载本软件" src="http://www.appinn.com/wp-content/down.gif" alt="12306 订票助手   火车票自动订票 Chrome 扩展[图] | 小众软件" style="background-color: #e8ddcb; font-family: Arial, &#930;���ź�, Georgia, sans-serif; font-size: 13px; line-height: 18px; border: none; padding: 0px; margin: 0px 5px -9px 0px; " /><span style="background-color: #e8ddcb; font-family: Arial, &#930;���ź�, Georgia, sans-serif; font-size: 13px; line-height: 18px; ">&nbsp;</span><a href="https://github.com/zzdhidden/12306" style="background-color: #e8ddcb; font-family: Arial, &#930;���ź�, Georgia, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none; color: #cc3300; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=); padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">https://github.com/zzdhidden/12306</a>&nbsp;<img src ="http://www.blogjava.net/xiaomage234/aggbug/388017.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2012-09-18 18:42 <a href="http://www.blogjava.net/xiaomage234/archive/2012/09/18/388017.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>文件夹右键cmd进入该目录</title><link>http://www.blogjava.net/xiaomage234/archive/2012/04/12/373977.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Thu, 12 Apr 2012 08:01:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2012/04/12/373977.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/373977.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2012/04/12/373977.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/373977.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/373977.html</trackback:ping><description><![CDATA[<div>Windows Registry Editor Version 5.00<br />[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]<br />@="cmd.exe /k \"cd %L\""</div><br /><br />保存为 cmd.reg并双击即可生效。<img src ="http://www.blogjava.net/xiaomage234/aggbug/373977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2012-04-12 16:01 <a href="http://www.blogjava.net/xiaomage234/archive/2012/04/12/373977.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>升级到 Mac OS X Lion 之后你应该知道的九件事儿</title><link>http://www.blogjava.net/xiaomage234/archive/2012/02/15/370011.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 15 Feb 2012 03:30:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2012/02/15/370011.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/370011.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2012/02/15/370011.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/370011.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/370011.html</trackback:ping><description><![CDATA[<h5>22 JUL 2011 BY&nbsp;<a href="http://www.guomii.com/posts/author/eyon" title="由 Eyon 发布" rel="author" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-size: 13px; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; ">EYON</a>&nbsp;IN&nbsp;<a href="http://www.guomii.com/category/tips" title="查看 技巧&amp;教程 中的全部文章" rel="category tag" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-size: 13px; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; ">技巧&amp;教程</a></h5><div clearfix"="" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-family: arial, sans-serif; vertical-align: baseline; color: #595959; background-color: #ffffff; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/overview_launchpad.png" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/overview_launchpad-600x352.png" alt="" title="overview_launchpad" width="600" height="352" size-medium=""  wp-image-5501"="" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-align: center !important; display: block; " /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">雄狮已经出笼，想必绝大部分 Mac 用户都已经升级到 Lion 系统了，虽然用户以及各大媒体都对这款操作系统的评价很高，但不可能做到100％完美，至少不可能做到对每一个人来说都很完美，难免会有一些习惯性问题和自己不了解的功能。TechCrunch 的 GREG KUMPARAK 同学今天给我们<a href="http://techcrunch.com/2011/07/21/os-x-lion-new-features/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; ">整理了</a>Mac OS X Lion 中的九个你应该知道的东西，这里分享给大家：</p><h4>刚升级完系统的几个小时很慢，这是正常的</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/no-touch.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/no-touch-150x150.jpg" alt="" title="no-touch" width="150" height="150" size-thumbnail=""  wp-image-5502"="" style="margin-top: 10px !important; margin-right: 0px !important; margin-bottom: 10px !important; margin-left: 20px !important; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; float: right; display: block; " /></a>好多人都在反应这个问题，说刚升级完系统之后的几个小时卡的不行，而且发热也很严重，神奇的是过几个小时之后自己就好了。吭，你说这是为什么呢？原来，Lion 第一次启动之后就会自己重新索引你硬盘上的数据，以方便你以后在 Spotlight 里快速搜索。由于建立索引这项工作很耗资源，所以你会感觉又慢又热。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">大家不妨升级完 Lion 之后就出去休息一会儿，呼吸呼吸新鲜空气。</p><h4>在&#8220;预览&#8221;中给 PDF 文档添加亲手写的签名</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">这个功能真是帅的一塌糊涂，在 PDF 上竟然可以加上自己亲手写的签名，对于每天都要签很多字的领导来说非常有用。使用方法很简单：</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">随便打开一个 PDF 文档（用预览打开，默认），点击&#8220;显示注解工具栏&#8221;<img src="http://www.guomii.com/wp-content/uploads/2011/07/L34Nl.png" alt="显示注解工具栏" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; display: block; " />按钮，然后点击&#8220;签名&#8221;<img src="http://www.guomii.com/wp-content/uploads/2011/07/qG9j9.png" alt="签名" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; display: block; " />按钮，在下拉菜单中选择 创建来自&#8220;内建 iSight&#8221;的签名，之后你会发现摄像头已经开始拍你了。现在，将你的签名写在一张白纸上，对着摄像头，你会从右边看到摄像头自动识别你的签名，完成后点&#8220;接受&#8221;就可以了。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/PDF-Signing1.png" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/PDF-Signing1-600x293.png" alt="" title="PDF Signing" width="600" height="293" size-medium=""  wp-image-5512"="" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-align: center !important; display: block; " /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">要在 PDF 里插入签名的时候直接点击&#8220;签名&#8221;按钮，然后用鼠标选择你要插入的位置即可。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "></p><h4>鼠标/触摸板滚动方向是反的？如果不适应就调整一下吧</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/updown.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/updown-150x118.jpg" alt="" title="updown" width="150" height="118" size-thumbnail=""  wp-image-5505"="" style="margin-top: 10px !important; margin-right: 0px !important; margin-bottom: 10px !important; margin-left: 20px !important; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; float: right; display: block; " /></a>这一点我们在《<a href="http://www.guomii.com/posts/5493" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; ">解决 Lion 系统中鼠标/触摸板反向滚动的问题</a>》一文中已经说过了，就不多说了，其实苹果这个没反，只是咱们习惯用&#8220;反向&#8221;滚动了，Lion 中的滚动方向才是真正的&#8220;自然&#8221;滚动方向呢，和 iOS 里用手触摸的滚动方向一样。</p><h4>正在运行中的应用程序下面的白点怎么没了？</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">使用之前 Mac OS X 系统的同学都知道 Dock 栏的应用程序中，如果是正在运行的应用程序，那么它下面会有一个白点，其实升级到 Lion 之后也有。但有些同学发现没有这个白点了，神马情况呢？因为&#8212;&#8212;你是全新安装的 Lion（或者说是新买的一台直接预装了 Lion 的电脑，比如最新的 Macbook Air 以及 Mac Mini），而不是从10.6.8升级的。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/running.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/running.jpg" alt="" title="running" width="578" height="162" size-full=""  wp-image-5507"="" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-align: center !important; display: block; " /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">没有这个白点很不习惯，因为平时我们能够在 Dock 栏很方便看到有哪些程序在运行，现在不行了。那就自己动手把&#8220;白点&#8221;显示打开吧：系统偏好设置&#8212;&#8212;Dock&#8212;&#8212;显示已打开的应用程序指示灯。</p><h4>记得升级软件</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">虽然 Lion 系统是最新的，但你还是应该检查一下是否有其他应用程序更新，比如最近 iTunes、iLife、iWOrk 等都有专门针对 Mac OS X Lion 的更新，所以装完系统之后还是记的点一下左上角的符号&#8212;&#8212;软件更新，检查看看有没有需要更新的应用。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/software-update.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/software-update.jpg" alt="" title="software-update" width="403" height="164" size-full=""  wp-image-5508"="" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-align: center !important; display: block; " /></a></p><h4>在 Mission Control 中关闭 Dashboard</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">Lion 的 Mission Control 是一个很棒的功能，但是每次打开 Mission Control 左上角都显示的是 Dashboard，使用双指切换应用程序的时候，切换到最左边也会显示 Dashboard，也就是说 Dashboard 是占用一个单独 Space 的，但 Dashboard 上的那些小工具其实并不实用，不实用的东西我们当然要干掉它。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/dashboard.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/dashboard-600x230.jpg" alt="" title="dashboard" width="600" height="230" size-medium=""  wp-image-5509"="" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-align: center !important; display: block; " /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">方法很简单：系统偏好设置&#8212;&#8212;Mission Control&#8212;&#8212;去掉&#8220;将 Dashboard 显示为空间&#8221;前面的复选框。</p><h4>用 Filevault 加密你的文件</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/sorry.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/sorry.jpg" alt="" title="sorry" width="225" height="208" size-full=""  wp-image-5510"="" style="margin-top: 10px !important; margin-right: 0px !important; margin-bottom: 10px !important; margin-left: 20px !important; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; float: right; display: block; " /></a></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">Mac 很早之前就已经有了 Filevault 这一实时磁盘加密工具，但很不好用，稍微一有问题你的所有数据就没了。但在 Lion 中这一功能得到了完完全全的重新开发，基本上除了名字还和以前一样之外，功能、稳定性、速度、安全性等方面都比以前好的不是一点半点，如果你对数据的保密要求非常高的话，再给 Filevault 一次机会吧。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">系统偏好设置&#8212;&#8212;安全与隐私&#8212;&#8212;Filevault，你懂的。</p><h4>几个新手势</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; "><a href="http://www.guomii.com/wp-content/uploads/2011/07/gestures.png" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; text-decoration: none; color: #3399cc; "><img src="http://www.guomii.com/wp-content/uploads/2011/07/gestures.png" alt="" title="gestures" width="279" height="172" size-full=""  wp-image-5513"="" style="margin-top: 10px !important; margin-right: 0px !important; margin-bottom: 10px !important; margin-left: 20px !important; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; float: right; display: block; " /></a></p><ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 15px; margin-left: 18px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial; line-height: 22px; "><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; border-bottom-style: initial; border-bottom-color: initial; ">在页面之间切换（Safari中的前进后退）：双指左右滑动；</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; border-bottom-style: initial; border-bottom-color: initial; ">在全屏应用/桌面之间切换：三指左右滑动；</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; border-bottom-style: initial; border-bottom-color: initial; ">访问 Mission Control：大拇指、食指、中指、无名指自然弯曲放在触摸板上往上滑动；</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; border-bottom-style: initial; border-bottom-color: initial; ">显示 Launchpad：大拇指、食指、中指、无名指自然弯曲放在触摸板上再并拢；</li><li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 10px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; border-bottom-style: initial; border-bottom-color: initial; ">显示桌面：大拇指、食指、中指、无名指自然弯曲放在触摸板上再张开；</li></ul><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">大家可以直接打开&#8220;系统偏好设置&#8221;&#8212;&#8212;触摸板/鼠标学习这些新手势，或者修改手势的定义。</p><h4>关闭自动纠正</h4><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">从 iOS 上借鉴过来的一个功能，虽然理念很好，但仍然不好用，而且咱们都不是三岁小孩了，输错的情况还是很少出现（中文错别字又纠正不了），所以还是关了吧：系统偏好设置&#8212;&#8212;语言与文本&#8212;&#8212;文本，去掉&#8220;自动纠正拼写&#8221;前面的复选框。</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; font-style: inherit; font-family: inherit; vertical-align: baseline; ">相信你掌握以上9点之后，Mac OS X Lion 在你手中就会非常听话了，如果你还有什么可以分享给我们的，可以在文章评论区里贴出来。</p></div><img src ="http://www.blogjava.net/xiaomage234/aggbug/370011.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2012-02-15 11:30 <a href="http://www.blogjava.net/xiaomage234/archive/2012/02/15/370011.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>NPAPI开发详解，Windows版</title><link>http://www.blogjava.net/xiaomage234/archive/2011/08/03/355655.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 03 Aug 2011 04:01:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2011/08/03/355655.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/355655.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2011/08/03/355655.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/355655.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/355655.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1. 准备工作开发工具本例使用的是visual studio 2008 英文版，下图是关于信息&nbsp;Windows SDK本例使用Windows7操作系统&nbsp;这里下载SDKNPAPISDK本例使用的是Firefox4.0.1提供的SDK。首先，从这里下载mozilla源码。然后，解压firefox-4.0.1.source.tar.bz2文件。将 \firefox-4.0.1.sou...&nbsp;&nbsp;<a href='http://www.blogjava.net/xiaomage234/archive/2011/08/03/355655.html'>阅读全文</a><img src ="http://www.blogjava.net/xiaomage234/aggbug/355655.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2011-08-03 12:01 <a href="http://www.blogjava.net/xiaomage234/archive/2011/08/03/355655.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>cygwin安装使用经验: 在Windows下使用命令行之一</title><link>http://www.blogjava.net/xiaomage234/archive/2011/07/29/355350.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Fri, 29 Jul 2011 09:33:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2011/07/29/355350.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/355350.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2011/07/29/355350.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/355350.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/355350.html</trackback:ping><description><![CDATA[<div><span style="color: #333333; font-family: Arial, Helvetica, simsun, u5b8bu4f53; line-height: 22px; "><strong style="line-height: 22px; ">[目录]</strong>&nbsp;cygwin安装使用总结.txt (<a href="http://guoyoooping.blog.163.com/blog/static/1357051832009112910162389/" target="_blank" style="line-height: 22px; text-decoration: none; color: #556c88; ">created by TxtBrowser</a>)<br style="line-height: 22px; " />&nbsp; content<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 1. 什么是Cygwin?<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 2. 什么不是Cygwin?<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 3. Cygwin的下载与安装<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 4. cygwin下的一些应用<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp; 4.1 默认的应用--也是我选择cygwin的原因<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp; 4.2 可以自己安装一些好玩的东东<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp; 4.3 有一些应用需要额外的配置<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.3.1 ssh服务在cygwin上架设指南<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 5. cygwin的一些问题及解决<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp; 5.1 如何改变home目录<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp; 5.2 cygwin显示中文问题<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; .&nbsp;&nbsp; 5.3 cygwin下中文中现乱码问题<br style="line-height: 22px; " />&nbsp; figures<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; figure 1. patch for mplayer on cygwin<br style="line-height: 22px; " /><br style="line-height: 22px; " />对于留恋Linux命令行的用户, 对于那些不想在你的Windows系统上再安装一个Linux, 或者<br style="line-height: 22px; " />安装虚拟机, 再在虚拟机上安装Linux的用户来说, Cygwin应该是一个很好的选择. cygwin<br style="line-height: 22px; " />可以模拟Linux的工作环境, 命令, 工作方式都跟 Linux一样.<br style="line-height: 22px; " /><br style="line-height: 22px; " />Windows的命令行的确是不好用, cygwin除了可以执行Linux命令外, 还可以直接调用<br style="line-height: 22px; " />Windows的命令行, 不同的是界面更加友好. 如果再配合其它软件(如console2), 基本上可<br style="line-height: 22px; " />以做到类似Linux的 gnome-terminal的多tab了.<br style="line-height: 22px; " /><br style="line-height: 22px; " />所有的试验都是在cygwin1.5上做的, cygwin1.7尽管发布很久了, 但是个人感觉还有很多<br style="line-height: 22px; " />bug, 所以我在公司里用cygwin1.5, 回到家里用cygwin1.7, 这是个人的感受, 呵呵.<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">1. 什么是Cygwin?</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />Cygwin是一个在windows平台上运行的Linux模拟环境, 是Cygnus solutions公司开发的自<br style="line-height: 22px; " />由软件(该公司开发了很多好东西, 著名的还有eCos, 不过现已被Redhat收购). 它对于学<br style="line-height: 22px; " />习Unix/linux操作环境, 或者从unix到windows的应用程序移植, 或者进行某些特殊的开发<br style="line-height: 22px; " />工作, 尤其是使用gnu工具集在windows上进行嵌入式系统开发, 非常有用. [1]<br style="line-height: 22px; " /><br style="line-height: 22px; " />Cygwin是一个Windows上的Linux模拟环境, 它包括两个部分：<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;一个作为Linux API仿真层的DLL(Cygwin.dll), 它提供稳定的Linux API功能.&nbsp;<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;提供看起来且使用起来象Linux的工具集.&nbsp;<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">2. 什么不是Cygwin?</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />Cygwin不是一种在Windows下运行Linux应用程序的方式, 如果要做到这一点, 你必须重新<br style="line-height: 22px; " />在Windows上编译你的源程序.&nbsp;<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">3. Cygwin的下载与安装</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />首先你必须到http://www.cygwin.com先下载一个安装向导文件 setup.exe, 然后运行<br style="line-height: 22px; " />setup.exe, 依次会出现下面的对话框:<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp;&nbsp;(1)选择安装方式(选择Download Without Installing)<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;(2)选择本地存储路径<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;(3)选择连接方式<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;(4)选择下载站点(推荐两个: http://mirrors.kernel.org, ftp.ntu.edu.tw)<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp;&nbsp;(5)选择下载包的内容: 一共有四类. default只下载最小安装包, Install则下载所有<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 的包, 在1.7版本里， Reinstall在下载的时候好像没有什么用，不用选, Uninstall<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 是删除安装包吗? 没有试过. 至于窗口顶部那些&#8220;Keep&#8221;、&#8220;Prev&#8221;、&#8220;Curr&#8221;、&#8220;<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; Exp&#8221;等等选项 , 只是用来改变当前树结构的显示方式的, 对下载没有什么影响. 用<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp; 户可以用默认的&#8220;Exp&#8221;.&nbsp;<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp;&nbsp;(6)开始下载<br style="line-height: 22px; " /><br style="line-height: 22px; " />如果用户的运气足够好, 也许能够一次性的下载成功. 若真能这样, 恭喜恭喜！但如果你<br style="line-height: 22px; " />和我一样不幸, 下到一半网络断了,怎么办？难道要我全部重新来一遍？幸运的是,Cygwin<br style="line-height: 22px; " />的安装向导程序支持断点续传功能: 你可以按照上面的步骤再次运行setup.exe, 把上面的<br style="line-height: 22px; " />骤再执行一遍就行了, cygwin会记住上次下载的东东的(适用于cygwin1.7, 对于<br style="line-height: 22px; " />cygwin1.5, 貌似断点下载的第5步要选择Reinstall).<br style="line-height: 22px; " /><br style="line-height: 22px; " />在用户指定的本地存储路径内, 安装向导程序会生成类似这样的一个目录： http%3a%2f<br style="line-height: 22px; " />%2fmirrors.kernel.org%2fsources.redhat.com%2fcygwin, 这就是你下载文件的真正所在<br style="line-height: 22px; " />目录. 还会生成两个日志文件：setup.log和setup.log.full,&nbsp; 用户感兴趣的活, 可以打<br style="line-height: 22px; " />开来看看, 对了解Cygwin的下载机制有不少帮助.&nbsp;<br style="line-height: 22px; " /><br style="line-height: 22px; " />至于如何安装, 其实就是再运行一次setup.exe, 不同的是, 在上述的第1步里选择<br style="line-height: 22px; " />Install from local, 在第5步里, 四个选项有不同的含义, Install代表安装而不是下载<br style="line-height: 22px; " />, Reinstall代表重新安装而不是重新下载. 用户可以在这里选择要安装的包, 不过我还是<br style="line-height: 22px; " />建议选择安装所有的程序包, 免的以后麻烦.<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">4. cygwin下的一些应用</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">4.1 默认的应用--也是我选择cygwin的原因</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />之所以安装cygwin, 是因为习惯于linux下的一些应用, 在Windows上没有, 或者找不到合<br style="line-height: 22px; " />适的代替器, 所以在我的日常应用中, 基本上cygwin被当成是一台只有命令行的Linux操作<br style="line-height: 22px; " />系统使用. 而且因为运行在Windows上, 所以有时候少了和Windows通讯的烦恼.<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;　　　　* Gcc, Makefie, gdb: 这是最初接触cygwin的原因. 很多公司在Windows上编译<br style="line-height: 22px; " />　　　　Linux 的东东, 没有这个的确不行, 后来经常自己写一些验证性质的小程序, 也<br style="line-height: 22px; " />　　　　用这个.<br style="line-height: 22px; " />　　　　* Vim: vim提供了windows版本, 但是有时候还是习惯使用命令行版的Vim(不是<br style="line-height: 22px; " />　　　　gvim), 尽管windows版本的gvim用的也很多.<br style="line-height: 22px; " />　　　　* ls: 尽管Windows提供了类似的命令dir, 但是感觉还是ls信息论习惯和强大.<br style="line-height: 22px; " />　　　　* telnet, ssh: 很多人使用secuCRT登录设备, 个人感觉secuCRT有一项功能挺强<br style="line-height: 22px; " />　　　　的, 那就是记录log功能, 其它的挺弱的, 比不了cygwin. 再插上一句, 用cygwin<br style="line-height: 22px; " />　　　　telnet 登录 bbs还是比较好使的, 但是secuCRT和putty显示中文都会有问题. 没<br style="line-height: 22px; " />　　　　用过 CTerm以及 XTerm之类的bbs终端, 但是我发现cgywin能实现基本它们声称的<br style="line-height: 22px; " />　　　　大部分功能.<br style="line-height: 22px; " />　　　　* ftp, sftp, lftp, tftp等: 这个也有专门的软件来实现, 好用的如FileZilla<br style="line-height: 22px; " />　　　　FTP server和client版, 但是点鼠标点的我手疼, 还是习惯命令行, 而且最近研<br style="line-height: 22px; " />　　　　究了一些脚本, 对于经常到某个ftp上存取文件使用一个命令就可以实现, 不用再<br style="line-height: 22px; " />　　　　登录, 敲密码, 进入到指定路径, 上传下载了, 还是蛮方便的.<br style="line-height: 22px; " />　　　　* cvs: 有Windows版本的cvs工具wincvs, 貌似最初我用过好几年, 但是现在一个<br style="line-height: 22px; " />　　　　命令就能搞定的事情不愿意再开一个软件再点击好多次鼠标了.<br style="line-height: 22px; " />　　　　* diff和patch: 经常写代码和写文章的人用的着. Windows上暂时没有发现替代<br style="line-height: 22px; " />　　　　品.<br style="line-height: 22px; " />　　　　* 阅读一些命令的man page, 如man strcpy.<br style="line-height: 22px; " />　　　　* 其它常用的Linux命令, 如rm, ping, tar, gzip, cat, echo等.<br style="line-height: 22px; " />　　　　* Linux的重定向命令, 用过的人知道, 有时候这个还是很好用的, 呵呵<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">4.2 可以自己安装一些好玩的东东</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />上面的应用都是cygwin自带的, 装上就能用. 事实上如果你的cygwin是完全安装的话, 你<br style="line-height: 22px; " />对编程小有了解的话, 还可以自己编译一些好玩的东东, 下面是我实验过可以使用的:<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;*&nbsp;纯文本网页浏览器(lynx, w3m或者elinks), 在命令行里浏览网页.<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;*&nbsp;sdcv: 在命令行里查字典, 这个没有人移植到Windows上.<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;*&nbsp;asterisk: 一个众人皆知的voip server(这个需要修改的地方很多).<br style="line-height: 22px; " />&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;mplayer: 在命令行里听音乐, 貌似有人开发了一个叫cmmusic的东东, 可以同<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;步显示歌词, 编译的时候cwygin存在一个叫llrint的问题, 如果遇到这个问题<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;(undefined reference to `_llrint'), 下面的 patch可以解决这个问题:<br style="line-height: 22px; " /><br style="line-height: 22px; " />|<br style="line-height: 22px; " />|===================================================================<br style="line-height: 22px; " />|--- ffmpeg/libavcodec/i386/mathops.h&nbsp;&nbsp; (revision 6329)<br style="line-height: 22px; " />|+++ ffmpeg/libavcodec/i386/mathops.h&nbsp;&nbsp; (working copy)<br style="line-height: 22px; " />|@@ -37,3 +37,13 @@<br style="line-height: 22px; " />|&nbsp; asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb));\<br style="line-height: 22px; " />|&nbsp;&nbsp;rt; })<br style="line-height: 22px; " />|<br style="line-height: 22px; " />|+#ifndef llrint<br style="line-height: 22px; " />|+inline long long int llrint (double x)<br style="line-height: 22px; " />|+{<br style="line-height: 22px; " />|+&nbsp;&nbsp;&nbsp; long long int llrintres;<br style="line-height: 22px; " />|+&nbsp;&nbsp;&nbsp; asm<br style="line-height: 22px; " />|+&nbsp;&nbsp;&nbsp; ("fistpll %0"<br style="line-height: 22px; " />|+&nbsp;&nbsp;&nbsp; : "=m" (llrintres) : "t" (x) : "st");<br style="line-height: 22px; " />|+&nbsp;&nbsp;&nbsp; return llrintres;<br style="line-height: 22px; " />|+}<br style="line-height: 22px; " />|+#endif<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;figure 1. patch for mplayer on cygwin<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">4.3 有一些应用需要额外的配置</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />还有一些应用, 用到的时候需要一些些额外的配置, 一并总结一下:<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">4.3.1 ssh服务在cygwin上架设指南</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />sshd服务在cygwin上默认是不开启的, 可能是出于安全的需要. 但是有些服务可能需要<br style="line-height: 22px; " />cygwin作为一个sshd服务器. 这时你需要手动打开sshd服务.[4]<br style="line-height: 22px; " /><br style="line-height: 22px; " />1)&nbsp;先确认一下cygrunsrv.exe 已经安装.&nbsp;<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;whereis cygrunsrv<br style="line-height: 22px; " /><br style="line-height: 22px; " />2)&nbsp;生成ssh_config文件<br style="line-height: 22px; " /><br style="line-height: 22px; " />这时候并不能起动sshd服务的, 先运行ssh-host-config 会提示你一些信息, 照着做就是<br style="line-height: 22px; " />了, 多数是yes, 在选择是否加载为service的时候小心一点, 这里的service是指windows<br style="line-height: 22px; " />的service, 即使cygwin不启动, sshd也会在开机的时候启动起来.<br style="line-height: 22px; " /><br style="line-height: 22px; " />3)&nbsp;启动或停止sshd<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;net start sshd (cygrunsrv -S sshd)<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;net stop sshd<br style="line-height: 22px; " /><br style="line-height: 22px; " />4)&nbsp;实施过程<br style="line-height: 22px; " /><br style="line-height: 22px; " />打开cygwin控制台, 输入ssh-host-config, 一路yes, 提示CYGWIN值时, 输入netsec tty.<br style="line-height: 22px; " />启动sshd服务用: net start sshd 或 cygrunsrv --start sshd; 停止sshd服务用:net<br style="line-height: 22px; " />stop sshd 或 cygrunsrv --stop sshd<br style="line-height: 22px; " /><br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">5. cygwin的一些问题及解决</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">5.1 如何改变home目录</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />如果要改变home目录则要编辑cygwin.bat, 具体如下：在bash命令之前加入set HOME=&lt;用<br style="line-height: 22px; " />户目录&gt;, 比如:<br style="line-height: 22px; " /><br style="line-height: 22px; " />set HOME=/home/g<br style="line-height: 22px; " /><br style="line-height: 22px; " />此用户目录设置在/home/g.&nbsp;<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">5.2 cygwin显示中文问题</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />/etc/skel/.bashrc<br style="line-height: 22px; " />让bash命令行可以输入汉字, 编辑~/.inputrc, 添加：<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;set meta-flag on<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;set convert-meta off<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;set input-meta on<br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;set output-meta on<br style="line-height: 22px; " /><br style="line-height: 22px; " />让ls命令显示汉字, 在~\.bashrc中加入：<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;export LESSCHARSET=latin1<br style="line-height: 22px; " /><br style="line-height: 22px; " />让ls命令显示汉字文件和目录名, 在~\.bashrc中加入：<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;alias ls='ls -hF --show-control-chars --file-type'<br style="line-height: 22px; " /><br style="line-height: 22px; " />一般的HOME目录下第一次使用的时候没有.inputrc和.bashrc文件的, 你可以自己新建一个<br style="line-height: 22px; " />, 也可以从/etc/skel目录下拷由一个现成的, 稍加改动就可以了.<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">5.3 cygwin下中文中现乱码问题</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />在cygwin下用make编译程序, 往往会出现乱码. 这主要是因为cygwin对中文的支持不是很<br style="line-height: 22px; " />理想引起的. 解决的办法是将环境变量LANG设成UTF-8, 暂时不用中文, 在~/.bashrc文件<br style="line-height: 22px; " />中加入下面的一句话:<br style="line-height: 22px; " /><br style="line-height: 22px; " />&nbsp;&nbsp; &nbsp;export LANG=UTF-8<br style="line-height: 22px; " /><br style="line-height: 22px; " /><strong style="line-height: 22px; ">[参考资料]:</strong><br style="line-height: 22px; " /><br style="line-height: 22px; " />[1]Cygwin User's Guide, cygwin官方网站,<br style="line-height: 22px; " />http://cygwin.com/cygwin-ug-net/cygwin-ug-net.html<br style="line-height: 22px; " />[2] 大冬瓜的博客, Cygwin安装图记, http://lostu.blogbus.com/logs/10765519.html<br style="line-height: 22px; " />[3] OoNiceDream的博客, 如何配置cygwin,<br style="line-height: 22px; " />http://oonicedream.itpub.net/post/36905/457409<br style="line-height: 22px; " />[4] Cygwin上的ssh服务的putty自动登录问题, http://markli.javaeye.com/blog/39661<br style="line-height: 22px; " />[5] Cygwin上的ssh服务的putty自动登录问题,<br style="line-height: 22px; " />http://hi.baidu.com/%BB%D4%B8%E7/blog/item/51a7bf3ef17f1eff828b13aa.html<br style="line-height: 22px; " />[6] cygwin &amp; putty, http://blog.chinaunix.net/u/31756/showart_416440.html</span></div><img src ="http://www.blogjava.net/xiaomage234/aggbug/355350.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2011-07-29 17:33 <a href="http://www.blogjava.net/xiaomage234/archive/2011/07/29/355350.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHPUnit和Selenium</title><link>http://www.blogjava.net/xiaomage234/archive/2011/05/25/350990.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 25 May 2011 04:14:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2011/05/25/350990.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/350990.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2011/05/25/350990.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/350990.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/350990.html</trackback:ping><description><![CDATA[<div><span style="border-collapse: collapse; font-family: song, Verdana; font-size: 12px; line-height: normal; "><div xml:lang="en"><div><div><div><h2>Selenium RC</h2></div></div></div><p style="font: normal normal normal 12px/normal song, Verdana; "><a href="http://www.openqa.org/selenium-rc/" target="_top" style="text-decoration: underline; color: #0044b6; ">Selenium RC</a>是一款测试工具，允许你为web应用编写自动化的用户接口测试，支持任何程序设计语言、任何HTTP站点以及任何主流浏览器。它使用<a href="http://www.openqa.org/selenium/" target="_top" style="text-decoration: underline; color: #0044b6; ">Selenium Core</a>，这是个利用JavaScript执行自动浏览器任务的库。Selenium测试直接运行于浏览器中，就像真实做的那样。这些测试既可用于<em>验收测试</em>（通过在集成系统上执行更高级的测试而不是只独立地测试系统的各个单元），又可用于<em>浏览器兼容性测试</em>（通过测试不同操作系统和浏览器上的web应用）。</p><p style="font: normal normal normal 12px/normal song, Verdana; ">我看看下Selenium RC是如何安装的：</p><div><ol type="1"><li>下载一个<a href="http://www.openqa.org/selenium-rc/" target="_top" style="text-decoration: underline; color: #0044b6; ">Selenium RC</a>分发包存档。</li><li>分发包存档并拷贝<code>server/selenium-server.jar</code>至<code>/usr/local/bin</code>（例如）。</li><li>通过运行<strong><code>java -jar /usr/local/bin/selenium-server.jar</code></strong>启动Selenium RC服务器。</li></ol></div><p style="font: normal normal normal 12px/normal song, Verdana; ">现在我们可以利用它的客户/服务器协议向Selenium RC服务器发送命令了。</p></div><div xml:lang="en"><div><div><div><h2>PHPUnit_Extensions_SeleniumTestCase</h2></div></div></div><p style="font: normal normal normal 12px/normal song, Verdana; "><code>PHPUnit_Extensions_SeleniumTestCase</code>测试用例扩展将同Selenium RC通话的客户/服务器协议实现为专门用于web测试的断言方法。</p><p style="font: normal normal normal 12px/normal song, Verdana; "><a href="file:///F:/data2/PHPUnit_Pocket_Guide_-_v32/index_cn.html#selenium.seleniumtestcase.examples.WebTest.php" title="Example 19.1: Usage example for PHPUnit_Extensions_SeleniumTestCase" style="text-decoration: underline; color: #0044b6; ">范例 19.1</a>显示如何测试<code>http://www.example.com/</code>站点的<code>&lt;title&gt;</code>元素的内容。</p><div><p style="font: normal normal normal 12px/normal song, Verdana; "><strong>范例 19.1: PHPUnit_Extensions_SeleniumTestCase使用举例</strong></p><div><pre><code>&lt;?php<br style="font: normal normal normal 12px/normal song, Verdana; " />require_once&nbsp;'PHPUnit/Extensions/SeleniumTestCase.php';<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;<br style="font: normal normal normal 12px/normal song, Verdana; " />class&nbsp;WebTest&nbsp;extends&nbsp;PHPUnit_Extensions_SeleniumTestCase<br style="font: normal normal normal 12px/normal song, Verdana; " />{<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;function&nbsp;setUp()<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;{<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;setBrowser('*firefox&nbsp;/usr/lib/firefox/firefox-bin');<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;setBrowserUrl('http://www.example.com/');<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;}<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;testTitle()<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;{<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;open('http://www.example.com/');<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;assertTitleEquals('Example&nbsp;Web&nbsp;Page');<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;}<br style="font: normal normal normal 12px/normal song, Verdana; " />}<br style="font: normal normal normal 12px/normal song, Verdana; " />?&gt;<br style="font: normal normal normal 12px/normal song, Verdana; " /></code></pre></div></div><br style="font: normal normal normal 12px/normal song, Verdana; " /><p style="font: normal normal normal 12px/normal song, Verdana; ">不同于<code>PHPUnit_Framework_TestCase</code>类，扩展了<code>PHPUnit_Extensions_SeleniumTestCase</code>的测试用例类必须提供<code>setUp()</code>方法。该方法用于配置Selenium RC会话。可用于此的方法列表见<a href="file:///F:/data2/PHPUnit_Pocket_Guide_-_v32/index_cn.html#selenium.seleniumtestcase.tables.seleniumrc-api.setup" title="Table&nbsp;19.1.&nbsp;Selenium RC API: Setup" style="text-decoration: underline; color: #0044b6; ">表 19.1</a>。</p><div><p style="font: normal normal normal 12px/normal song, Verdana; "><strong>表 19.1. Selenium RC API：装配</strong></p><div><table summary="Selenium RC API: Setup" border="1"><colgroup><col><col></colgroup><thead><tr style="font: normal normal normal 12px/normal song, Verdana; "><th align="left">方法</th><th align="left">含义</th></tr></thead><tbody><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void setBrowser(string $browser)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">Selenium RC服务器使用的浏览器。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void setBrowserUrl(string $browserUrl)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">设置用于测试的基址URL。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void setHost(string $host)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">设置连接到Selenium RC服务器的主机名。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void setPort(int $port)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">设置连接到Selenium RC服务器的端口号。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void setTimeout(int $timeout)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">设置连接到Selenium RC服务器的超时时间。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void setSleep(int $seconds)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">设置Selenium RC客户端向Selenium RC服务器发送动作指令之间睡眠的秒数。</td></tr></tbody></table></div></div><br style="font: normal normal normal 12px/normal song, Verdana; " /><p style="font: normal normal normal 12px/normal song, Verdana; ">你也可以使用一组浏览器运行每一个测试：在你的测试用例类中声明一个名为<code>$browsers</code>的<code>public static</code>数组代替使用<code>setBrowser()</code>设置一个浏览器。该数组中的每一项都描述一个浏览器配置。这些浏览器中的每一个都能被不同的Selenium RC服务器接待：</p><div><p style="font: normal normal normal 12px/normal song, Verdana; "><strong>范例 19.2: 设置多浏览器配置</strong></p><div><pre><code>&lt;?php<br style="font: normal normal normal 12px/normal song, Verdana; " />require_once&nbsp;'PHPUnit/Extensions/SeleniumTestCase.php';<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;<br style="font: normal normal normal 12px/normal song, Verdana; " />class&nbsp;WebTest&nbsp;extends&nbsp;PHPUnit_Extensions_SeleniumTestCase<br style="font: normal normal normal 12px/normal song, Verdana; " />{<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;$browsers&nbsp;=&nbsp;array(<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'Firefox&nbsp;on&nbsp;Linux',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'browser'&nbsp;=&gt;&nbsp;'*firefox&nbsp;/usr/lib/firefox/firefox-bin',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'host'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'my.linux.box',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'port'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;4444,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'timeout'&nbsp;=&gt;&nbsp;30000,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'Safari&nbsp;on&nbsp;MacOS&nbsp;X',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'browser'&nbsp;=&gt;&nbsp;'*safari',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'host'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'my.macosx.box',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'port'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;4444,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'timeout'&nbsp;=&gt;&nbsp;30000,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'Safari&nbsp;on&nbsp;Windows&nbsp;XP',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'browser'&nbsp;=&gt;&nbsp;'*custom&nbsp;C:\Program&nbsp;Files\Safari\Safari.exe&nbsp;-url',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'host'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'my.windowsxp.box',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'port'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;4444,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'timeout'&nbsp;=&gt;&nbsp;30000,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;),<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'Internet&nbsp;Explorer&nbsp;on&nbsp;Windows&nbsp;XP',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'browser'&nbsp;=&gt;&nbsp;'*iexplore',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'host'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;'my.windowsxp.box',<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'port'&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;4444,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'timeout'&nbsp;=&gt;&nbsp;30000,<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;);<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;function&nbsp;setUp()<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;{<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;setBrowserUrl('http://www.example.com/');<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;}<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;testTitle()<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;{<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;open('http://www.example.com/');<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;assertTitleEquals('Example&nbsp;Web&nbsp;Page');<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;}<br style="font: normal normal normal 12px/normal song, Verdana; " />}<br style="font: normal normal normal 12px/normal song, Verdana; " />?&gt;<br style="font: normal normal normal 12px/normal song, Verdana; " /></code></pre></div></div><br style="font: normal normal normal 12px/normal song, Verdana; " /><p style="font: normal normal normal 12px/normal song, Verdana; "><code>PHPUnit_Extensions_SeleniumTestCase</code>能够收集测试经由Selenium运行时的代码覆盖率信息：</p><div><ol type="1"><li>拷贝<code>PHPUnit/Extensions/SeleniumTestCase/phpunit_coverage.php</code>到你的web服务器的文件根目录中。</li><li>在你的web服务器的<code>php.ini</code>配置文件中，配置<code>PHPUnit/Extensions/SeleniumTestCase/prepend.php</code>和<code>PHPUnit/Extensions/SeleniumTestCase/append.php</code>分别作为<code>auto_prepend_file</code>和<code>auto_append_file</code>。</li><li>在你的扩展了<code>PHPUnit_Extensions_SeleniumTestCase</code>的测试用例类中，使用<pre><code>protected $coverageScriptUrl = 'http://host/phpunit_coverage.php';</code></pre>配置用于<code>phpunit_coverage.php</code>脚本的URL。</li></ol></div><p style="font: normal normal normal 12px/normal song, Verdana; "><a href="file:///F:/data2/PHPUnit_Pocket_Guide_-_v32/index_cn.html#selenium.seleniumtestcase.tables.assertions" title="Table&nbsp;19.2.&nbsp;Assertions" style="text-decoration: underline; color: #0044b6; ">表 19.2</a>列出<code>PHPUnit_Extensions_SeleniumTestCase</code>提供的各种断言方法。</p><div><p style="font: normal normal normal 12px/normal song, Verdana; "><strong>表 19.2. 断言</strong></p><div><table summary="Assertions" border="1"><colgroup><col><col></colgroup><thead><tr style="font: normal normal normal 12px/normal song, Verdana; "><th align="left">断言</th><th align="left">含义</th></tr></thead><tbody><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertAlertPresent()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果不存在警告（对话框）则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNoAlertPresent()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果存在警告（对话框）则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertChecked(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素未选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNotChecked(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素被选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertConfirmationPresent()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果不存在确认（对话框）则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNoConfirmationPresent()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果存在确认（对话框）则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertEditable(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素不可编辑则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNotEditable(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素可编辑则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertElementValueEquals(string $locator, string $text)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素的值不等于给定的<code>$text</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertElementValueNotEquals(string $locator, string $text)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素的值等于给定的<code>$text</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertElementContainsText(string $locator, string $text)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素不含给定的<code>$text</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertElementNotContainsText(string $locator, string $text)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素包含给定的<code>$text</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertElementPresent(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素不存在则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertElementNotPresent(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素存在则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertLocationEquals(string $location)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果当前位置（location）不等于给定的<code>$location</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertLocationNotEquals(string $location)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果当前位置（location）等于给定的<code>$location</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertPromptPresent()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果不存在提示（对话框）则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNoPromptPresent()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果存在提示（对话框）则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertSelectHasOption(string $selectLocator, string $option)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的选项不可用则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertSelectNotHasOption(string $selectLocator, string $option)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的选项可用则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertSelected($selectLocator, $option)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的标签未选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNotSelected($selectLocator, $option)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的标签被选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertIsSelected(string $selectLocator, string $value)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的值未选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertIsNotSelected(string $selectLocator, string $value)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的值被选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertSomethingSelected(string $selectLocator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$selectLocator</code>标识的选项未选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNothingSelected(string $selectLocator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$selectLocator</code>标识的选项被选中则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertTextPresent(string $pattern)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的<code>$pattern</code>不存在则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertTextNotPresent(string $pattern)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果给定的<code>$pattern</code>存在则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertTitleEquals(string $title)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果当前标题不等于给定的<code>$title</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertTitleNotEquals(string $title)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果当前标题等于给定的<code>$title</code>则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertVisible(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素不可见则报错。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void assertNotVisible(string $locator)</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">如果<code>$locator</code>标识的元素可见则报错。</td></tr></tbody></table></div></div><br style="font: normal normal normal 12px/normal song, Verdana; " /><p style="font: normal normal normal 12px/normal song, Verdana; "><a href="file:///F:/data2/PHPUnit_Pocket_Guide_-_v32/index_cn.html#selenium.seleniumtestcase.tables.template-methods" title="Table&nbsp;19.3.&nbsp;Template Methods" style="text-decoration: underline; color: #0044b6; ">表 19.3</a>显示<code>PHPUnit_Extensions_SeleniumTestCase</code>的两个模板方法：</p><div><p style="font: normal normal normal 12px/normal song, Verdana; "><strong>表 19.3. 模板方法</strong></p><div><table summary="Template Methods" border="1"><colgroup><col><col></colgroup><thead><tr style="font: normal normal normal 12px/normal song, Verdana; "><th align="left">方法</th><th align="left">含义</th></tr></thead><tbody><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void defaultAssertions()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">重写以执行一个测试用例中的所有测试共享的断言。该方法在发送给Selenium RC服务器的每个命令之后被调用。</td></tr><tr style="font: normal normal normal 12px/normal song, Verdana; "><td align="left" style="font: normal normal normal 12px/normal song, Verdana; "><code>void sharedAssertions()</code></td><td align="left" style="font: normal normal normal 12px/normal song, Verdana; ">重写以执行一个测试用例中的所有测试共享的断言。该方法在一个测试执行结束之前被调用。</td></tr></tbody></table></div></div><br style="font: normal normal normal 12px/normal song, Verdana; " /><p style="font: normal normal normal 12px/normal song, Verdana; ">请查阅<a href="http://www.openqa.org/selenium-core/reference.html" target="_top" style="text-decoration: underline; color: #0044b6; ">Selenium Core的文档</a>获得关于可用的命令以及如何使用的参考。</p><p style="font: normal normal normal 12px/normal song, Verdana; ">利用<code>runSelenese($filename)</code>方法，你也能从它的Selenese/HTML规范运行一个Selenium测试。此外，利用静态属性<code>$seleneseDirectory</code>，你能从一个包含Selenese/HTML文件的目录自动地创建测试对象。指定的目录被递归地搜索预期包含Selenese/HTML的<code>.htm</code>文件。&nbsp;<a href="file:///F:/data2/PHPUnit_Pocket_Guide_-_v32/index_cn.html#selenium.seleniumtestcase.examples.WebTest3.php" title="Example 19.3: Use a directory of Selenese/HTML files as tests" style="text-decoration: underline; color: #0044b6; ">范例 19.3</a>显示一个例子。</p><div><p style="font: normal normal normal 12px/normal song, Verdana; "><strong>范例 19.3: 使用Selenese/HTML文件的目录作为测试</strong></p><div><pre><code>&lt;?php<br style="font: normal normal normal 12px/normal song, Verdana; " />require_once&nbsp;'PHPUnit/Extensions/SeleniumTestCase.php';<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;<br style="font: normal normal normal 12px/normal song, Verdana; " />class&nbsp;SeleneseTests&nbsp;extends&nbsp;PHPUnit_Extensions_SeleniumTestCase<br style="font: normal normal normal 12px/normal song, Verdana; " />{<br style="font: normal normal normal 12px/normal song, Verdana; " />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;$seleneseDirectory&nbsp;=&nbsp;'/path/to/files';<br style="font: normal normal normal 12px/normal song, Verdana; " />}<br style="font: normal normal normal 12px/normal song, Verdana; " />?&gt;</code></pre></div></div></div></span></div><img src ="http://www.blogjava.net/xiaomage234/aggbug/350990.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2011-05-25 12:14 <a href="http://www.blogjava.net/xiaomage234/archive/2011/05/25/350990.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解决修复：IE 7.0访问HTTPS网页显示-此网站出具的安全证书已过期或还未生效</title><link>http://www.blogjava.net/xiaomage234/archive/2011/05/24/350941.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Tue, 24 May 2011 09:04:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2011/05/24/350941.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/350941.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2011/05/24/350941.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/350941.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/350941.html</trackback:ping><description><![CDATA[<font size="2">这个问题一般是出现在<font color="#ff0000">Internetr Explorer 7.0</font>上面，<font color="#000000">这个是IE7阅览器提示，IE7浏</font>览器是伴随着Vista操作系统而诞生的，不过微软也发布了针对XP系统的IE7浏览器版本。不过不管是Vista系统还是XP系统下<font color="#000000">的IE7，由于它</font>的安全防范意识有很大提高，对于非法站点和安全加密站点的过滤都比较苛刻，所以在IE7下访问https这种通过SSL协议加密的网站都会出现故障。尤其为人熟知的在打开<font color="#0000ff">淘宝</font>、<font color="#0000ff">支付宝</font>网页的时候经常会出现，Https密码页面也会有这个提示。</font> 
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最容易被一些人搞错地方，就是时间设置问题，所以碰到这种情况，请首先检查你的电脑<font color="#3366ff">时间设置</font>是否正确，如果不正确将导致助理从你的电脑上取到的时候，已经不在服务器发送给助理的有效时间范围内，请你核对你的时间设置是否正确。将&#8220;<font color="#0000ff">自动与internet时间服务器同步</font>&#8221;取消后问题消失。如果还是不行，请看下面。</font></p>
<p><font color="#ffffff" size="2">========================================================================</font></p>
<p>&nbsp;</p>
<p><font color="#ff0000" size="4"><strong>一、XP系统下IE7.0 访问https站点故障排除：</strong></font></p>
<p><font size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 默认情况，XP系统下通过XP版本的IE 7 浏览器，访问https加密的站点都会出现这个提示，这个是IE7阅览器的提示，必须再次点&#8220;<font color="#3366ff">继续浏览此网站（不推荐）</font>&#8221;才能查看页面信息。</font><font size="2">每次访问Https站<font color="#000000">点都需要重复点击，</font>在操作上带来很大的麻烦。下面我们就通过安装证书步骤来解决此问题。 <br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第一步：当我们用IE7浏览Https站点后会在地址栏右边出现一个红色的&#8220;证书错误&#8221;的提示，我们点该红色按钮，然后选择&#8220;查看证书&#8221;。 </font></p>
<div forimg="1"><font size="2"><img class="blogimg" src="http://hiphotos.baidu.com/masoso/pic/item/a163e2d747c87bc7a044df07.jpg" border="0" small="0"  alt="" /></font></div>
<p><font size="2">第二步：在打开的&#8220;<font color="#3366ff">查看证书</font>&#8221;窗口中的&#8220;<font color="#3366ff">常规</font>&#8221;标签中点右下角的&#8220;<font color="#3366ff">安装证书</font>&#8221;按钮。 </font></p>
<div forimg="1"><font size="2"><img class="blogimg" src="http://hiphotos.baidu.com/masoso/pic/item/8b993b6276c009c7e6113a09.jpg" border="0" small="0"  alt="" /></font></div>
<p><font size="2">第三步：出现&#8220;<font color="#3366ff">证书导入向导</font>&#8221;后点&#8220;<font color="#3366ff">下一步</font>&#8221;按钮继续。</font></p>
<p><font size="2">第四步：选择证书存储的系统区域，通过&#8220;<font color="#3366ff">浏览</font>&#8221;按钮设置将证书保存为&#8220;<font color="#3366ff">受信任的根证书颁发机构</font>&#8221;。 </font></p>
<div forimg="1"><font size="2"><img class="blogimg" src="http://hiphotos.baidu.com/masoso/pic/item/d463bd43340b5e0b9213c615.jpg" border="0" small="0"  alt="" /></font></div>
<p><font size="2">第五步：之后在安全警告窗口中选择&#8220;<font color="#3366ff">是</font>&#8221;按钮来安装该证书。</font></p>
<p><font size="2">第六步：设置完毕后我们再次访问该https站点就不会出现任何问题，也不会再出现这个错误提示了。</font></p>
<p><font color="#ffffff" size="2">========================================================================</font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font color="#ff0000" size="4"><strong>　 二、Vista系统下IE7.0 访问https站点故障排除：</strong></font></p><font color="#ff0000">
<p><font color="#000000" size="2">　　在Vista系统下使用IE7浏览器访问https站点也会出现这个错误提示，但是他的解决步骤却和XP下IE7有很大区别。这是因为在Vista系统中IE7访问<a name="baidusnap0"></a><strong style="color: black; background-color: #ffff66">https证书</strong>查看里没有安装的提示，错误信息提示&#8220;由于CA根证书不在受信任的根证书颁发机构存储区中，所以他不受信任。</font></p>
<p><font color="#000000" size="2">　　那么该如何解决呢？我是至今还没有发现可以通过调整IE7浏览器的设置来解决此问题，不过可以通过证书导入来解决。</font></p>
<p><font color="#000000" size="2">　　第一步：首先打开IE7浏览器，然后通过&#8220;工具-&gt;internet选项&#8221;打开属性设置窗口，并选择&#8220;内容&#8221;标签，直接点&#8220;<font color="#3366ff">证书</font>&#8221;标签。</font></p>
<p><font color="#000000"><font size="2">　　第二步：选择要安装的证书类型时点&#8220;<font color="#3366ff">受信任的根证书颁发机构</font>&#8221;，接下来点左下角的&#8220;<font color="#3366ff">导入</font>&#8221;按钮。 </font></font></p>
<div forimg="1">
<p><font size="2"><img class="blogimg" src="http://hiphotos.baidu.com/masoso/pic/item/78655f3529e06f91a61e12f5.jpg" border="0" small="0"  alt="" /></font></p>
<p><font size="2"><font color="#000000">　　第三步：这时就需要我们在&#8220;<font color="#3366ff">要导入的文件</font>&#8221;设置窗口中找到该网站的证书文件。至于这个证书文件如何获得，笔者的方法是通过在别的浏览器（例如IE 6或XP系统IE 7）中将该网站对应的证书以文件的形式导出即可，接下来回到Vista系统中导入此文件即可。</font> </font></p>
<div forimg="1">
<p><font size="2"><img class="blogimg" src="http://hiphotos.baidu.com/masoso/pic/item/f7a16c8bba0045c9fd1f10f1.jpg" border="0" small="0"  alt="" /></font></p>
<p><font color="#000000" size="2">　　第四步：在证书存储设置处和上面介绍的方法一样，选择将所有的证书放入下列存储&#8212;&#8212;受信任的根证书颁发机构。</font></p>
<p><font color="#000000" size="2">　　第五步：在安装该证书的窗口中点&#8220;<font color="#3366ff">是</font>&#8221;按钮即可。</font></p>
<p><font color="#000000" size="2">　　第六步：所有工作完成后会出现导入成功的提示，以后我们再访问https加密的站点就不会出现上面的错误提示了。</font></p></div></div></font><img src ="http://www.blogjava.net/xiaomage234/aggbug/350941.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2011-05-24 17:04 <a href="http://www.blogjava.net/xiaomage234/archive/2011/05/24/350941.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何让你的Apache支持https</title><link>http://www.blogjava.net/xiaomage234/archive/2011/05/20/350663.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Fri, 20 May 2011 02:08:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2011/05/20/350663.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/350663.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2011/05/20/350663.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/350663.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/350663.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="word-spacing: 0px; font: medium Simsun; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><span class="Apple-style-span" style="font-size: 12px; color: rgb(51,51,51); line-height: 21px; font-family: Arial, Helvetica, sans-serif; text-align: left"> 
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">主要讲述在windows下apache配置<a style="color: rgb(51,51,51); word-break: break-all; line-height: normal! important; text-decoration: underline" onclick="javascript:tagshow(event, 'SSL');" href="javascript:;" target="_self"><u style="word-break: break-all; line-height: normal! important"><strong style="word-break: break-all; line-height: normal! important">SSL</strong></u></a>以实现http转换为<a style="color: rgb(51,51,51); word-break: break-all; line-height: normal! important; text-decoration: underline" onclick="javascript:tagshow(event, 'https');" href="javascript:;" target="_self"><u style="word-break: break-all; line-height: normal! important"><strong style="word-break: break-all; line-height: normal! important">https</strong></u></a></p>
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">SSL: SSl是为Http传输提供安全的协议，通过证书认证来确保客户端和网站服务器之间的数据是安全。也就是说在SSL下http传输是安全的，我们成为https.</p>
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">过程：</p>
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">步骤一：安装apache,使其支持SSL,并安装php<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp; 1.安装配有SSL模块的apache,apache_2.2.8-win32-x86-openssl-0.9.8g<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp; 2.配置apache以支持SSL:打开apache的配置文件conf/httpd.conf<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1)LoadModule ssl_module modules/mod_ssl.so<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Include conf/extra/httpd-ssl.conf<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 去掉两行前面的#<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2)注意修改httpd-ssl.conf 文件里的两个字段：<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSLCertificateFile "C:/Apache2.2/conf/server.crt"<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SSLCertificateKeyFile "C:/Apache2.2/conf/server.key"<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp; 3.安装php,整合apache和Php(略)&nbsp; //此步可以省略，如果你不需要PHP的话。<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 为下面你所生成的证书和密钥地址。</p>
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">步骤二：为网站服务器生成证书及私钥文件<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. 生成服务器的私钥<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 进入命令行:<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\local\apache2\bin\openssl genrsa -out<span class="Apple-converted-space">&nbsp;</span><a style="color: rgb(51,51,51); word-break: break-all; line-height: normal! important; text-decoration: underline" onclick="javascript:tagshow(event, 'server');" href="javascript:;" target="_self"><u style="word-break: break-all; line-height: normal! important"><strong style="word-break: break-all; line-height: normal! important">server</strong></u></a>.key 1024<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在当前目录下生成了一个server.key生成签署申请<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. 生成签署申请<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\local\apache2\bin&gt;openssl req -new &#8211;out server.csr -key server.key -config ..\conf\openssl.cnf<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 此时生成签署文件server.csr.</p>
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">步骤三：通过CA为网站服务器签署证书<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.生成CA私钥<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\local\apache2\bin\openssl genrsa&nbsp; -out ca.key 1024<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 多出ca.key文件<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.利用CA的私钥产生CA的自签署证书<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\local\apache2\bin\openssl req&nbsp; -new -x509 -days 365 -key ca.key -out ca.crt&nbsp; -config ..\conf\openssl.cnf<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 此时需要输入一些信息，注意Common Name为服务器域名，如果在本机，为本机IP。<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.CA为网站服务器签署证书<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; D:\local\apache2\bin\openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf<br style="word-break: break-all; line-height: normal! important" />但，此时会报错：<br style="word-break: break-all; line-height: normal! important" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 于是在在当前目录创建demoCA，里面创建以下文件，index.txt,serial内容为01，<a style="color: rgb(51,51,51); word-break: break-all; line-height: normal! important; text-decoration: underline" onclick="javascript:tagshow(event, '%C6%E4%CB%FB');" href="javascript:;" target="_self"><u style="word-break: break-all; line-height: normal! important"><strong style="word-break: break-all; line-height: normal! important">其他</strong></u></a>为空,以及文件夹newcert.再执行一遍，即可生成server.crt文件</p>
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">步骤四：然后将&nbsp; server.crt,server.key复制到apache的conf文件夹下，重启apache</p>
<p style="margin: 10px 0px; word-break: break-all; line-height: 1.8em! important">步骤五：访问<a style="color: rgb(51,51,51); word-break: break-all; line-height: normal! important; text-decoration: underline" href="http://localhost/">http://localhost</a>即支持https<br style="word-break: break-all; line-height: normal! important" />不过由于，我们的CA不是由第三方机构颁发的，而是我们自己颁发的，所以，IE访问的时候，会显示，这个证书不是由Trused CA Authenticator颁发，告诉我们可能有安全隐患</p></span></span><img src ="http://www.blogjava.net/xiaomage234/aggbug/350663.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2011-05-20 10:08 <a href="http://www.blogjava.net/xiaomage234/archive/2011/05/20/350663.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>设置windows 注册表默认打开浏览器</title><link>http://www.blogjava.net/xiaomage234/archive/2011/05/14/350249.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Sat, 14 May 2011 14:01:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2011/05/14/350249.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/350249.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2011/05/14/350249.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/350249.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/350249.html</trackback:ping><description><![CDATA[[HKEY_CLASSES_ROOT\Http\shell\open\command]<br />
@="\"D:\\Program Files\\GreenBrowser\\GreenBrowser.exe\" \"%1\""
<img src ="http://www.blogjava.net/xiaomage234/aggbug/350249.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2011-05-14 22:01 <a href="http://www.blogjava.net/xiaomage234/archive/2011/05/14/350249.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>右键菜单中添加“用记事本打开”和“打开dos”</title><link>http://www.blogjava.net/xiaomage234/archive/2009/10/27/299875.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Tue, 27 Oct 2009 01:42:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2009/10/27/299875.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/299875.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2009/10/27/299875.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/299875.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/299875.html</trackback:ping><description><![CDATA[<p>玩过一段时间电脑后，体会到经常会用&#8220;记事本&#8221;打开多种类型未知文件，以便查看编辑其中内容。所以直接在右键菜单中添加&#8220;用记事本打开&#8221;这一<br />
功能是比较省事方便的。通过修改注册表可以实现：</p>
<p>1、打开注册表，找到<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell 主键(项)（如果没有新建一个），<br />
2、单击shell这个主键，在下再新建一个名为 notepad 的主键，在右面的窗口中，把默认项的值改成：用记事本打开 或者其他你喜欢的字样。<br />
3、再在notepad主键下新建一个 command 主键。在右面的窗口中，把默认项的值改成：<br />
notepad %1 （注意notepad和%符号之间要空一格）关闭注册表。<br />
现在在任意一个文件上单击鼠标右键就有&#8220;用记事本打开&#8221;这一功能了。经体验是一个很好的方法。当然用其它软件也可添加这一功能。（收集学习）</p>
<p>另可以：打开注册表编辑器，找到下面的键值：HKEY_CLASSES_ROOT\*，接着新建一个名为 shell的子项，接着再它的下方新建名为&#8220;Notepad&#8221;，然后在右侧窗口中将其默认值改为&#8220;使用记事本打开&#8221;，最后在&#8220;Notepad&#8221;项下新建名为&#8220;command&#8221;的子项，在右侧窗口中将其值改为：notepad.exe %1就可以了。</p>
<p>保存一下内容为*.reg运行即可!</p>
<p>Windows Registry Editor Version 5.00<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell]<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\playboyjin]<br />
@="用记事本打开"<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\playboyjin\command]<br />
@="notepad.exe \"%1\"" </p>
<p>如何添加鼠标右键DOS命令<br />
A:(1)打开注册表编辑器。 (2)打开HKEY_LOCAL_MACHINE\Software\classes\directory\shell主键并选中它。在右侧窗口中新建一个项，命名为CommandPrompt，然后把它的数值数据改为command。 (3)在CommandPrompt下新建一个项，命名为command，改其数值数据为cmd /k cd %1，退出OK了。 (4)鼠标右键单击任何文件夹，在弹出的菜单中，你就可以选择command命令了。</p>
<p>B:保存下边的代码到一个记事本文件，并把扩展名改为&#8220;.bat&#8221;，执行一次这个文件（以后就没用了），找一个文件夹，打开鼠标右键看看吧！</p>
<p>reg add "HKCR\*\shell\ms-dos" /ve /d ms-dos /f<br />
reg add "HKCR\*\shell\ms-dos\command" /ve /d "cmd.exe /k cd %%1" /f<br />
reg add "HKCR\Folder\shell\ms-dos" /ve /d ms-dos /f<br />
reg add "HKCR\Folder\shell\ms-dos\command" /ve /d "cmd.exe /k cd %%1" /f </p>
<p><br />
本文来自CSDN博客，转载请标明出处：http://blog.csdn.net/bhsky/archive/2009/02/02/3858883.aspx</p>
<img src ="http://www.blogjava.net/xiaomage234/aggbug/299875.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2009-10-27 09:42 <a href="http://www.blogjava.net/xiaomage234/archive/2009/10/27/299875.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解决IE7自动打开http://runonce.msn.com/runonce3.aspx</title><link>http://www.blogjava.net/xiaomage234/archive/2009/07/07/285783.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Tue, 07 Jul 2009 04:13:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2009/07/07/285783.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/285783.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2009/07/07/285783.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/285783.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/285783.html</trackback:ping><description><![CDATA[修改注册表键值: <br />
<br />
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main] <br />
<br />
RunOnceComplete=dword:00000001 <br />
<br />
RunOnceHasShown=dword:00000001 <br />
以上查找没有这个注册表信息,你新建就可以了,添加上面这两个就可以修复了<br />
<img src ="http://www.blogjava.net/xiaomage234/aggbug/285783.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2009-07-07 12:13 <a href="http://www.blogjava.net/xiaomage234/archive/2009/07/07/285783.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Windows下BAT脚本实现自动修改hosts</title><link>http://www.blogjava.net/xiaomage234/archive/2008/12/15/246471.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Mon, 15 Dec 2008 10:22:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2008/12/15/246471.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/246471.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2008/12/15/246471.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/246471.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/246471.html</trackback:ping><description><![CDATA[进入测试环境：
<div style="margin: 5px 20px 20px">
<div class="smallfont" style="margin-bottom: 2px">代码:</div>
<pre class="alt2" dir="ltr" style="border-right: 1px inset; padding-right: 5px; border-top: 1px inset; padding-left: 5px; padding-bottom: 5px; margin: 0px; overflow: auto; border-left: 1px inset; width: 640px; padding-top: 5px; border-bottom: 1px inset; height: 498px; text-align: left">@echo off
echo proj 本地测试环境
echo.
c:
cd \
if not exist proj-test\con md proj-test
if exist proj-test\hosts.bak goto backup_exists
echo 正在创建备份&#8230;&#8230;
cd \windows\system32\drivers\etc
copy /y hosts \proj-test\hosts.bak &gt; null
echo 完成！
echo.
goto backup_start
:backup_exists
echo 备份文件已经存在，无需备份。
echo.
:backup_start
echo 正在写入测试数据&#8230;&#8230;
echo 127.0.0.1       localhost &gt; hosts
echo 192.168.3.170   proj.com &gt;&gt; hosts
echo 192.168.3.170   www.proj.com &gt;&gt; hosts
echo 192.168.3.170   pics.proj.com &gt;&gt; hosts
echo 192.168.3.170   files.proj.com &gt;&gt; hosts
echo 完成！
echo.
echo 建立 proj 本地测试环境完成。按任意键退出&#8230;&#8230;
pause &gt; null</pre>
</div>
退出测试环境：
<div style="margin: 5px 20px 20px">
<div class="smallfont" style="margin-bottom: 2px">代码:</div>
<pre class="alt2" dir="ltr" style="border-right: 1px inset; padding-right: 5px; border-top: 1px inset; padding-left: 5px; padding-bottom: 5px; margin: 0px; overflow: auto; border-left: 1px inset; width: 640px; padding-top: 5px; border-bottom: 1px inset; height: 466px; text-align: left">@echo off
echo proj 本地测试环境
echo.
c:
cd \
if not exist proj-test\hosts.bak goto backup_not_exists
echo 正在还原备份&#8230;&#8230;
copy /y \proj-test\hosts.bak \windows\system32\drivers\etc &gt; null
cd \windows\system32\drivers\etc
if exist hosts del /q hosts
ren hosts.bak hosts
echo 完成！
echo.
echo 正在移除备份&#8230;&#8230;
cd \
rmdir /s/q \proj-test\
echo 完成！
echo.
goto backup_done
:backup_not_exists
echo 备份文件不存在，无法恢复。
echo.
:backup_done
echo 退出 proj 本地测试环境完成。按任意键退出&#8230;&#8230;
pause &gt; null</pre>
</div>
  <img src ="http://www.blogjava.net/xiaomage234/aggbug/246471.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2008-12-15 18:22 <a href="http://www.blogjava.net/xiaomage234/archive/2008/12/15/246471.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>net命令[转自百度]</title><link>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234367.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 15 Oct 2008 01:48:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234367.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/234367.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234367.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/234367.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/234367.html</trackback:ping><description><![CDATA[net命令是功能强大的以命令行方式执行的工具。它包含了管理网络环境、服务、用户、登陆等Windows 98/NT/2000 中大部分重要的管理功能。使用它可以轻松的管理本地或者远程计算机的网络环境，以及各种服务程序的运行和配置。或者进行用户管理和登陆管理等。<br />
　　需要注意的地方： <br />
　　1、 虽然Windows 98，Windows NT/2000都内置了NET命令,但Windows98的NET命令和Windows NT/2000的NET命令有所不同。而且Windows 98的NET命令中有一些参数不能在DOS-WIN中使用，只能在纯DOS环境（即：开机时按F8选择命令行方式，或者通过开始菜单&gt;关闭系统&gt;重新启动计算机并切换到MS-DOS方式）中使用。 .<br />
　　2、 Windows98不提供NET命令在图形方式下的帮助，只能在命令行方式下输入NET /? | more 或NET HELP | more得到它的功能(COMMAND)列表， 然后通过NET COMMAND /HELP | more或NET HELP COMMAND | more 或NET COMMAND/?命令得到相应功能的帮助信息。 <br />
　　3、 有一些命令是马上产生作用并永久保存的,使用的时候要慎重。并且所有net命令接受选项/yes和/no(可缩写为/y和/n)。/y 选项向命令产生的任何交互式提示自动回答"是"，而 /n 回答"否"。例如，net stop server 通常提示您确认要停止基于"服务器"服务的所有服务；而 net stop server /y 对该提示自动回答"是"，然后"服务器"服务关闭。 <br />
　　下文将结合实例对NET命令的不同参数的基本应用做一些初步的介绍。希望能对大家学习net命令的使用有所帮助。<br />
　　一、 net accounts <br />
　　功能：将用户帐户数据库升级并修改所有帐户的密码和登录请求。 <br />
　　格式：net accounts [/forcelogoff:{minutes | no}] [/minpwlen:length]<br />
　　[/maxpwage:{days|unlimited}][/minpwage:days] [/uniquepw:number] [/sync] [/domain] <br />
　　参数： <br />
　　（1）无：即键入不带参数的net accounts，命令显示密码、登录限制和域信息的当前配置。 <br />
　　（2）/forcelogoff:{minutes | no}<br />
　　设置当用户帐户或有效登录时间到期时在结束用户与服务器的会话前要等待的分钟数。no 选项防止强制注销。默认设置是 no。<br />
　　指定了 /forcelogoff:minutes 选项后，系统在强制用户离开网络的 minutes 分钟前发送警告。如果任何文件被打开，系统将警告用户。如果 minutes 少于 2，系统将警告用户立即从网络注销。 <br />
　　（3）/minpwlen:length<br />
　　设置用户帐户密码的最少字符数。范围是 0-127 个字符，默认是 6 个字符。<br />
　　实例:设置不少于 10 个字符的用户密码<br />
　　net accounts /minpwlen:10 <br />
　　（4）/maxpwage:{days | unlimited}<br />
　　设置用户帐户密码有效天数的最大值。　<br />
　　/maxpwage:unlimited 设置帐户密码永远有效。<br />
　　/maxpwage 选项必须大于 /minpwage，（也就是如果以前设置了/minpwlen:30，那么days取值必须大于30）范围是 1-49,710 天（无限），默认是 90 天。 <br />
　　（5）/minpwage:days<br />
　　设置在用户可以更改新密码前的最小天数。数值 0 设置无限短时间。范围是 0-49,710 天，默认值是 0 天。 <br />
　　（6）/uniquepw:number<br />
　　要求用户不对 number 次密码更改重复相同的密码。范围是 0-24 次密码更改，默认值是 5 次密码更改。<br />
　　实例:防止用户每少于3天更改一次密码，强制用户每15天更改一次密码，并在登录时间到期后用2分钟警告强制用户注销。<br />
　　net accounts /forcelogoff:2 /minpwage:3　/maxpwage:15 <br />
　　（7）/sync<br />
　　更新所有成员服务服务器的用户帐户数据库。当在主域控制器上使用时，使域中的所有备份域控制器同步。当在备份域控制器上使用时，使备份域控制器只与主域控制器同步。该命令只适用于 Windows NT/2000 Server 域成员计算机。 <br />
　　（8）/domain<br />
　　对当前域的主域控制器执行操作。否则，操作在本地计算机上执行。<br />
　　该参数只适用于属 Windows NT/2000 Server 域成员的 Windows 2000 Workstation / Professional 计算机。默认情况下，Windows NT/2000 Server 计算机在主域控制器上执行操作。 <br />
　　二、 net computer <br />
　　功能：从域数据库中添加或删除计算机，所有计算机的添加和删除都会转发到主域控制器。 <br />
　　格式：net computer \\computername {/add | /del} <br />
　　参数： <br />
　　（1）\\computername<br />
　　指定要从域中添加或删除的计算机名。 <br />
　　（2）/add<br />
　　将特定的计算机添加到域中。<br />
　　实例：将计算机bb添加到登录的域中。<br />
　　net computer \\bb /add <br />
　　（3）/del<br />
　　从域中删除指定的计算机。<br />
　　实例：将计算机bb从登录的域中删除。<br />
　　net computer \\bb /del <br />
　　三、 net config <br />
　　功能：显示当前运行的可配置服务，或显示并更改某项服务的设置。更改立即生效并且是永久的 <br />
　　格式：net config [service [options] <br />
　　参数： <br />
　　（1）无<br />
　　键入不带参数的 net config 命令显示可配置服务的列表。 <br />
　　（2）service<br />
　　通过net config命令进行配置的服务(server或workstation) <br />
　　（3）options<br />
　　服务的特定选项。 <br />
　　四、 net config server （ 只能在Windows NT/2000 中使用 ） <br />
　　功能：更改可配置"服务器"服务参数。更改立即生效，并且永久保持。但是并非所有的"服务器"服务的参数都能使用 net config Server 命令进行更改，net config server 显示可包含其他信息，包括以下关于服务器的信息：<br />
　　1．服务器的计算机名、描述注释和软件版本。<br />
　　2．网络描述。<br />
　　3．服务器的隐藏设置。<br />
　　4．可以使用服务器的共享资源的最多用户数。<br />
　　5．可以打开的服务器文件的最大数量。<br />
　　6．空闲会话时间设置。 <br />
　　格式：net config server [/autodisconnect:time] [/srvcomment:"text "] [/hidden:{yes | no}] <br />
　　参数： <br />
　　（1）无<br />
　　键入 net config server 命令显示"服务器"服务的当前配置 <br />
　　（2）/autodisconnect:time<br />
　　设置在断开连接前用户会话可以不活动的最大分钟数。可以指定-1不断开连接。范围从-1到65535分钟，默认值是15分钟。<br />
　　实例：在10分钟的非活动状态后断开用户连接。<br />
　　net config server /autodisconnect:10 <br />
　　（3）/srvcomment:"text"<br />
　　用net view命令，为在屏幕上显示出来的服务器添加注释。注释可以包含多达48个字符（24个汉字）。给文本加上引号。 <br />
　　（4）/hidden:{yes | no}<br />
　　指定服务器的计算机名是否在服务器显示列表上显示。注意隐藏的服务器将不会改变服务器上的权限。默认设置是 no。<br />
　　实例：从可用服务器列表中隐藏服务器的计算机名。<br />
　　net config server /hidden:yes <br />
　　五、 net config workstation <br />
　　功能：显示更改可配置工作站服务参数。更改立即生效，并且永久保持。<br />
　　并非所有的工作站服务参数都能使用 net config workstation 命令进行更改。其他参数可以在配置注册表时修改。 <br />
　　格式：net config workstation [/charcount:bytes] [/chartime:msec] [/charwait:sec] <br />
　　参数： <br />
　　（1）无<br />
　　键入 net config workstation 命令显示本地计算机的当前配置。 <br />
　　（2）/charcount:bytes<br />
　　指定在将数据发送到通讯设备之前Windows 收集的数据量。如果还设置了 /chartime:msec，Windows 将执行第一个满足的<br />
　　选项。范围从0到-65535字节，默认值是16字节。 <br />
　　（3）/chartime:msec<br />
　　设置 Windows在将数据发送到通讯设备前收集数据的毫秒数。如果还设置了 /charcount:bytes，Windows 2000 将执行第<br />
　　一个满足的选项。范围从0到65535000毫秒，默认是250毫秒。 <br />
　　（4）/charwait:sec<br />
　　将Windows等待通讯设备的秒数设置为可用。范围从0到65535秒，默认值是3600秒。<br />
　　实例：要设置在将数据发送到最大1000毫秒的通讯设备之前Windows等待。<br />
　　net config workstation /chartime:1000 <br />
　　六、Net Continue <br />
　　功能：重新激活挂起的服务<br />
　　格式：net continue service <br />
　　参数 <br />
　　　　service <br />
　　　　能够继续运行的服务，包括： file server for macintosh（该服务仅限于 Windows NT Se<br />
　　　　rver）, ftp publishing service, lpdsvc, net logon, network dde，network dde dsdm<br />
　　　　，nt lm security support provider，remoteboot（该服务仅限于 Windows NT Server），<br />
　　　　remote access server, schedule，server，simple tcp/ip services 及 workstation <br />
　　七、Net File <br />
　　功能：显示某服务器上所有打开的共享文件名及锁定文件数。该命令也可以关闭个别文件并取消文 <br />
　　　　件锁定。 <br />
　　格式：net file [id [/close]] <br />
　　参数 <br />
　　　　（1）无 <br />
　　　　键入不带参数的 net file 可获得服务器上打开文件的列表。 <br />
　　　　id <br />
　　　　文件标识号。 <br />
　　　　（2）/close <br />
　　　　关闭打开的文件并释放锁定记录。请从共享文件的服务器中键入该命令。 <br />
　　八、Net Group <br />
　　功能：在 Windows NT Server 域中添加、显示或更改全局组。该命令仅在 Windows NT Server 域<br />
　　　　 中可用。 <br />
　　格式：net group [groupname [/comment:"text "]] [/domain] <br />
　　　　 net group groupname {/add [/comment:"text "] | /delete} [/domain] <br />
　　　　 net group groupname username [ ...] {/add | /delete} [/domain] <br />
　　参数 <br />
　　　　（1）无 <br />
　　　　键入不带参数的 net group 可以显示服务器名称及服务器的组名称。 <br />
　　　　groupname <br />
　　　　要添加、扩展或删除的组。仅提供某个组名便可查看组中的用户列表。 <br />
　　　　（2）/comment:"text " <br />
　　　　为新建组或现有组添加注释。注释最多可以是 48 个字符，并用引号将注释文字引住。 <br />
　　　　（3）/domain <br />
　　　　在当前域的主域控制器中执行该操作，否则在本地计算机上执行操作。 <br />
　　　　该参数仅用于作为 Windows NT Server 域成员的 Windows NT Workstation 计算机。Windo<br />
　　　　ws NT Server 计算机默认为在主域控制器中操作。 <br />
　　　　username[ ...] <br />
　　　　列表显示要添加到组或从组中删除的一个或多个用户。使用空格分隔多个用户名称项。 <br />
　　　　（4）/add <br />
　　　　添加组或在组中添加用户名。必须使用该命令为添加到组中的用户建立帐号。 <br />
　　　　（5）/delete <br />
　　　　删除组或从组中删除用户名。 <br />
　　九、Net Help<br />
　　功能：提供网络命令列表及帮助主题，或提供指定命令或主题的帮助。可用网络命令列于 N 下面的<br />
　　　　 &#8220;命令参考&#8221;中&#8220;命令&#8221;窗口内。<br />
　　格式：net help [command] <br />
　　　　 net command {/help | /?} <br />
　　参数 <br />
　　　　（1）无 <br />
　　　　键入不带参数的 net help 显示能够获得帮助的命令列表和帮助主题。 <br />
　　　　command <br />
　　　　需要其帮助的命令，不要将 net 作为 command 的一部分。 <br />
　　　　（2）/help <br />
　　　　提供显示帮助文本方式选择。 <br />
　　　　（3）/? <br />
　　　　显示命令的正确语法。 <br />
　　十、Net Helpmsg <br />
　　功能：提供 Windows NT 错误信息的帮助。<br />
　　格式：net helpmsg message#<br />
　　参数 <br />
　　　　message# <br />
　　　　需要其帮助的 Windows NT 消息的四位代码。 <br />
　　十一、Net Localgroup <br />
　　功能：添加、显示或更改本地组。 <br />
　　格式：net localgroup [groupname [/comment:"text "]] [/domain] <br />
　　　　 net localgroup groupname {/add [/comment:"text "] | /delete} [/domain] <br />
　　　　 net localgroup groupname name [ ...] {/add | /delete} [/domain] <br />
　　参数 <br />
　　　　（1）无 <br />
　　　　键入不带参数的 net localgroup 将显示服务器名称和计算机的本地组名称。 <br />
　　　　groupname <br />
　　　　要添加、扩充或删除的本地组名称。只提供 groupname 即可查看用户列表或本地组中的全局<br />
　　　　组。 <br />
　　　　（2）/comment: "text " <br />
　　　　为新建或现有组添加注释。注释文字的最大长度是 48 个字符，并用引号引住。 <br />
　　（3）/domain <br />
　　在当前域的主域控制器中执行操作，否则仅在本地计算机上执行操作。 <br />
　　该参数仅应用于 Windows NT Server 域中的 Windows NT Workstation 计算机。Windows NT Server 计算机默认为在主域<br />
　　控制器中操作。 <br />
　　name [ ...] <br />
　　列出要添加到本地组或从本地组中删除的一个或多个用户名或组名，多个用户名或组名之间以空格分隔。可以是本地<br />
　　用户、其他域用户或全局组，但不能是其他本地组。如果是其他域的用户，要在用户名前加域名（例如SALESRALPHR）。 <br />
　　（4）/add <br />
　　将全局组名或用户名添加到本地组中。在使用该命令将用户或全局组添加到本地组之前，必须为其建立帐号。 <br />
　　（5）/delete <br />
　　从本地组中删除组名或用户名。 <br />
　　十二、Net Name <br />
　　功能：添加或删除消息名（有时也称别名），或显示计算机接收消息的名称列表。要使用 net name 命令，计算机中必须运行信使服务。 <br />
　　格式：net name [name [/add | /delete]] <br />
　　参数： <br />
　　无 <br />
　　键入不带参数的 net name 将列出当前使用的名称。<br />
　　name <br />
　　指定接收消息的名称。名称最多为 15 个字符。 <br />
　　/add <br />
　　将名称添加到计算机中。 /add 是可选项，键入 net name name 与键入 net name name /add 相同。<br />
　　/delete <br />
　　从计算机中删除名称。 <br />
　　Net Pause <br />
　　暂停正在运行的服务。<br />
　　十三、net pause service <br />
　　参数 <br />
　　service <br />
　　指下列服务： file server for macintosh（仅限于 Windows NT Server）、ftp publishing service、lpdsvc、net logon、network dde、network dde dsdm、nt lm security support provider、remoteboot（仅限于 Windows NT Server）、remote access server、schedule、server、simple tcp/ip services 或 workstation 。 <br />
　　十四、Net Print <br />
　　功能：显示或控制打印作业及打印队列。 <br />
　　格式：net print \computername sharename <br />
　　net print [\computername ] job# [/hold | /release | /delete] <br />
　　参数： <br />
　　computername <br />
　　共享打印机队列的计算机名。 <br />
　　sharename <br />
　　打印队列名称。当包含 computername 与 sharename 时，使用反斜杠 () 将它们分开。 <br />
　　job# <br />
　　在打印机队列中分配给打印作业的标识号。有一个或多个打印机队列的计算机为每个打印作业分配唯一标识号。如果某个作业号用于共享打印机队列中，则不能指定给其他作业，也不能分配给其他打印机队列中的作业。 <br />
　　/hold <br />
　　使用 job# 时，在打印机队列中使打印作业等待。打印作业停留在打印机队列中，并且其他打印作业只能等到释放该作业之后才能进入。<br />
　　/release <br />
　　释放保留的打印作业。 <br />
　　/delete <br />
　　从打印机队列中删除打印作业。 <br />
　　十五、Net Send <br />
　　功能：向网络的其他用户、计算机或通信名发送消息。要接收消息必须运行信使服务。 <br />
　　格式：net send {name | * | /domain[:name] | /users} message <br />
　　参数 ：<br />
　　name <br />
　　要接收发送消息的用户名、计算机名或通信名。如果计算机名包含空字符，则要将其用引号(" ") 引住。 <br />
　　* <br />
　　将消息发送到组中所有名称。 <br />
　　/domain[:name] <br />
　　将消息发送到计算机域中的所有名称。如果指定 name，则消息将发送到指定域或组中的所有名称。 <br />
　　/users <br />
　　将消息发送到与服务器连接的所有用户。 <br />
　　message <br />
　　作为消息发送的文本。 <br />
　　十六、Net Session <br />
　　功能：列出或断开本地计算机和与之连接的客户端的会话。 <br />
　　格式：net session [\computername] [/delete] <br />
　　参数： <br />
　　无 <br />
　　键入不带参数的 net session 可以显示所有与本地计算机的会话的信息。 <br />
　　\computername <br />
　　标识要列出或断开会话的计算机。 <br />
　　/delete <br />
　　结束与 \computername 计算机会话并关闭本次会话期间计算机的所有打开文件。如果省略\computername 参数，将取消与本地计算机的所有会话。 <br />
　　十七、Net Share <br />
　　功能：创建、删除或显示共享资源。 <br />
　　格式：net share sharename <br />
　　net share sharename=drive:path [/users:number | /unlimited] [/remark:"text"] <br />
　　net share sharename [/users:number | unlimited] [/remark:"text"] <br />
　　net share {sharename | drive:path} /delete <br />
　　参数： <br />
　　无 <br />
　　键入不带参数的 net share 将显示本地计算机上所有共享资源的信息。 <br />
　　sharename <br />
　　是共享资源的网络名称。键入带 sharename 的 net share 命令，只显示该共享信息。 <br />
　　drive:path <br />
　　指定共享目录的绝对路径。 <br />
　　/users:number <br />
　　设置可同时访问共享资源的最大用户数。 <br />
　　/unlimited <br />
　　不限制同时访问共享资源的用户数。 <br />
　　/remark:"text " <br />
　　添加关于资源的注释，注释文字用引号引住。 <br />
　　/delete <br />
　　停止共享资源。 <br />
　　十八、Net Start <br />
　　功能：启动服务，或显示已启动服务的列表。如果服务名是两个或两个以上的词，如 Net Logon 或Computer Browser，则必须用引号 (") 引住。. <br />
　　格式：net start [service] <br />
　　参数： <br />
　　无 <br />
　　键入不带参数的 net start 则显示运行服务的列表。 <br />
　　service <br />
　　包括下列服务： alerter、client service for netware、clipbook server、computer browser、dhcp client 、directory replicator 、eventlog 、ftp publishing service 、lpdsvc、messenger 、net logon 、network dde 、network dde dsdm 、network monitoring agent 、nt lm security support provider 、ole 、remote access connection manager 、remote access isnsap service 、remote access server 、remote procedure call (rpc) locator 、remote procedure call (rpc) service 、schedule 、server 、simple tcp/ip services 、snmp、spooler 、tcp/ip netbios helper 、ups 及 workstation。 <br />
　　下列服务仅在 Windows NT Server 下可用：file server for macintosh、gateway service for netware、microsoft dhcp server、print server for macintosh、remoteboot、windows internet name service 。 <br />
　　十九、Net Statistics <br />
　　功能：显示本地工作站或服务器服务的统计记录。 <br />
　　格式：net statistics [workstation | server] <br />
　　参数 ：<br />
　　无 <br />
　　键入不带参数的 net statistics 将列出其统计信息可用的运行服务。 <br />
　　workstation <br />
　　显示本地工作站服务的统计信息。 <br />
　　server <br />
　　显示本地服务器服务的统计信息。 <br />
　　二十、Net Stop <br />
　　功能：停止 Windows NT 网络服务。 <br />
　　格式：net stop service <br />
　　参数 ：<br />
　　service <br />
　　包括下列服务： alerter（警报）、client service for netware（Netware 客户端服务）、clipbook server（剪贴簿服务器）、computer browser（计算机浏览器）、directory replicator（目录复制器）、ftp publishing service (ftp )（ftp 发行服务）、lpdsvc、messenger（信使）、net logon（网络登录）、network dde（网络 dde）、network dde dsdm（网络 dde dsdm）、network monitor agent（网络监控代理）、nt lm security support provider（NT LM 安全性支持提供）、ole（对象链接与嵌入）、remote access connection manager（远程访问连接管理器）、remote access isnsap service（远程访问 isnsap 服务）、remote access server（远程访问服务器）、remote procedure call (rpc) locator（远程过程调用定位器）、remote procedure call (rpc) service（远程过程调用服务）、schedule（调度）、server（服务器）、simple tcp/ip services（简单 TCP/IP 服务）、snmp、spooler（后台打印程序）、tcp/ip netbios helper（TCP/IP NETBIOS 辅助工具）、ups 及 workstation（工作站）。 <br />
　　下列服务仅在 Windows NT Server 中可用： file server for macintosh、gateway service for netware、microsoft dhcp server、print server for macintosh、remoteboot、windows internet name service。 <br />
　　二十一、Net Time <br />
　　功能：使计算机的时钟与另一台计算机或域的时间同步。不带 /set 参数使用时，将显示另一台计算机或域的时间。 <br />
　　格式：net time [\computername | /domain[:name]] [/set] <br />
　　参数： <br />
　　\computername <br />
　　要检查或同步的服务器名。 <br />
　　/domain[:name] <br />
　　指定要与其时间同步的域。 <br />
　　/set <br />
　　使本计算机时钟与指定计算机或域的时钟同步。 <br />
　　二十二：Net Use <br />
　　功能：连接计算机或断开计算机与共享资源的连接，或显示计算机的连接信息。该命令也控制永久网络连接。 <br />
　　格式：net use [devicename | *] [\computernamesharename[volume]] [password | *]] [/user<br />
　　:[domainname]username] [[/delete] | [/persistent:{yes | no}]] <br />
　　net use devicename [/home[password | *]] [/delete:{yes | no}] <br />
　　net use [/persistent:{yes | no}] <br />
　　参数 ：<br />
　　无 <br />
　　键入不带参数的 net use 将列出网络连接。 <br />
　　devicename <br />
　　指定要连接到的资源名称或要断开的设备名称。有两类设备名：磁盘驱动器（D: 到 Z:）和打印机（LPT1: 到 LPT3）。若键入星号而不是指定设备名将分配下一个可用设备名。 <br />
　　\computernamesharename <br />
　　服务器及共享资源的名称。如果计算机名包含空白字符，要用引号 (" ") 将双反斜线及计算机名引住。计算机名长度可以是 1-15 个字符。 <br />
　　volume <br />
　　指定服务器上的 NetWare 卷。要连接到 NetWare 服务器，必须安装并运行 NetWare 客户机服务 (Windows NT Workstation) 或 NetWare 网关服务 (Windows NT Server)。 <br />
　　password <br />
　　访问共享资源的密码。 <br />
　　* <br />
　　提示键入密码。在密码提示行中键入密码时，将不显示该密码。 <br />
　　/user <br />
　　指定进行连接的另外一个用户。 <br />
　　domainname <br />
　　指定另一个域。例如 net use d: \servershare /user:adminmariel 连接用户 mariel，如同从 admin 域连接一样。如果省略域，将使用当前登录域。 <br />
　　username <br />
　　指定登录的用户名。 <br />
　　/home <br />
　　将用户连接到其宿主目录。 <br />
　　/delete <br />
　　取消指定网络连接。如果用户以星号指定连接，则取消所有网络连接。 <br />
　　/persistent <br />
　　控制永久网络连接的使用。默认为上次使用的设置。无设备的连接不是永久的。 <br />
　　yes <br />
　　保存建立的所有连接，并在下次登录时还原。 <br />
　　no <br />
　　不保存建立的连接和继发连接，并在下次登录时还原现有连接。使用 /delete 开关项取消永久连接。 <br />
　　二十三、Net User <br />
　　功能：添加或更改用户帐号或显示用户帐号信息。 <br />
　　格式：net user [username [password | *] [options]] [/domain] <br />
　　net user username {password | *} /add [options] [/domain] <br />
　　net user username [/delete] [/domain] <br />
　　参数 ：<br />
　　无 <br />
　　键入不带参数的 net user 将查看计算机上的用户帐号列表。 <br />
　　username <br />
　　添加、删除、更改或查看用户帐号名。用户帐号名最多可以有 20 个字符。 <br />
　　password <br />
　　为用户帐号分配或更改密码。密码必须满足在 net accounts 命令 /minpwlen 选项中设置的最小参数。最多是 14 个字符。 <br />
　　* <br />
　　提示输入密码。在密码提示行中键入密码时，将不显示该密码。 <br />
　　/domain <br />
　　在计算机主域的主域控制器中执行操作。 <br />
　　该参数仅在 Windows NT Server 域成员的 Windows NT Workstation 计算机上可用。默认情况下，Windows NT Server 计算机在主域控制器中执行操作。 <br />
　　注意：在计算机主域的主域控制器发生该动作。它可能不是登录域。<br />
　　/add <br />
　　将用户帐号添加到用户帐号数据库。 <br />
　　/delete <br />
　　从用户帐号数据库中删除用户帐号。 <br />
　　选项如下所示： <br />
　　/active:{no | yes} <br />
　　启用或禁止用户帐号。如果不激活用户帐号，用户就不能访问计算机上的资源。默认值是 yes （激活）。<br />
　　例：net user guest /active:yes 启用guest用户帐号<br />
　　net user guest /active:no 禁止guest用户帐号<br />
　　/comment:"text" <br />
　　提供用户帐号的注释。该注释最多可以有 48 个字符，文字用引号引住。 <br />
　　/countrycode:nnn <br />
　　使用操作系统的国家代码以便为用户帮助和错误信息文件提供指定语言文件。0 值表示默认国家代码。<br />
　　/expires:{date | never} <br />
　　如果设置 date，将导致用户帐号过期，never 不对用户帐号设置时间限制。过期日期根据/countrycode 值可以是下列格式： mm/dd/yy、dd/mm/yy 或 mmm, dd, yy。注意帐号在指定日期开始时过期。月份可以是数字、全名或三个字母的简拼。年可以是两位或四位数，使用逗号或斜线（不要用空格） 区分日期的各部分。如果省略 yy ，则使用该日期下一次到来的年份（根据计算机的时钟）。例如如果在 1994 年 1 月 10 日到 1995 年 1 月 8 日之间输入下列日期项，那它们相同：<br />
　　jan,91/9/95 <br />
　　january,9,19951/9 <br />
　　/fullname:"name" <br />
　　指定用户全名而不是用户名。用引号将名字引住。 <br />
　　/homedir:path <br />
　　设置用户宿主目录的路径。该路径必须存在。 <br />
　　/homedirreq:{yes | no} <br />
　　设置是否需要宿主目录。 <br />
　　/passwordchg:{yes | no} <br />
　　指定用户是否能改变自己的密码。默认值是 yes。 <br />
　　/passwordreq:{yes | no} <br />
　　指定用户帐号是否需要密码，默认值是 yes。 <br />
　　/profilepath:[path] <br />
　　设置用户登录配置文件的路径。该路径名指向注册表配置文件。 <br />
　　/scriptpath:path <br />
　　为用户登录脚本设置路径。Path 不能是绝对路径；path 是相对于 %systemroot%SYSTEM32REPLIMPORTSCRIPTS 的相对路径：。 <br />
　　/times:{times | all} <br />
　　指定允许用户使用计算机的时间。times 值表示为 day[-day][, day[-day]] , time[-time][, time[-time]], 增量限制为一小时。Days 可以是全名或简写（M、T、W、Th、F、Sa、Su）。Hours 可以是 12 小时制或 24 小时制。对于 12 小时值，使用 AM、PM 或 A.M、P.M。all 表示用户总可以登录。空值表示用户永远不能登录。用逗号分隔日期和时间，分隔时间和日期的单位用分号（例如 M,4AM-5PM; T,1PM-3PM）。指定 /times 时不要使用空格。 <br />
　　/usercomment:"text " <br />
　　让管理员添加或更改帐号的&#8220;用户注释&#8221;。用引号引住文字。 <br />
　　/workstations:{computername[,...] | *} <br />
　　列出最多八个用户可以登录到网络的工作站。用逗号分隔列表中的多个项。如果 /workstations 没有列表，或如果列表是星号&#8220;*&#8221;，则用户可以从任何一台计算机登录。 <br />
　　二十四：Net View <br />
　　功能：显示域列表、计算机列表或指定计算机的共享资源列表。 <br />
　　格式：net view [\computername | /domain[:domainname]] <br />
　　net view /network:nw [\computername] <br />
　　参数： <br />
　　无 <br />
　　键入不带参数的 net view 将显示当前域的计算机列表。 <br />
　　\computername <br />
　　指定要查看其共享资源的计算机。 <br />
　　/domain[:domainname] <br />
　　指定要查看其可用计算机的域。如果省略 domainname ，则显示网络的所有域。 <br />
　　/network:nw <br />
　　显示 NetWare 网络中所有可用的服务器。如果指定计算机名，则显示 NetWare 网络中该计算机的可用资源。也可以用此开关指定添加到系统中的其他网络。
<img src ="http://www.blogjava.net/xiaomage234/aggbug/234367.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2008-10-15 09:48 <a href="http://www.blogjava.net/xiaomage234/archive/2008/10/15/234367.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SC命令[转自百度]</title><link>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234365.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 15 Oct 2008 01:46:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234365.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/234365.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234365.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/234365.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/234365.html</trackback:ping><description><![CDATA[编辑本段SC命令功能<br />
　　SC命令是XP系统中功能强大的DOS命令,SC命令能与&#8220;服务控制器&#8221;和已安装设备进行通讯。SC命令的功能有<br />
　　1、SC可以 检索和设置有关服务的控制信息。可以使用 SC.exe 来测试和调试服务程序。<br />
　　2、可以设置存储在注册表中的服务属性，以控制如何在启动时启动服务应用程序，以及如何将其作为后台程序运行。即更改服务的启动状态。<br />
　　3、SC 命令还可以用来删除系统中的无用的服务。（除非对自己电脑中的软硬件所需的服务比较清楚，否则不建议删除任何系统服务，尤其是基础服务）<br />
　　4、SC命令 的参数可以配置指定的服务，检索当前服务的状态，也可以停止和启动服务（功能上类似NET STOP/START命令，但SC速度更快且能停止更多的服务）。<br />
　　5、可以创建批处理文件来调用不同的 SC 命令，以自动启动或关闭服务序列。<br />
　　SC.exe 提供的功能类似于&#8220;控制面板&#8221;中&#8220;管理工具&#8221;项中的&#8220;服务&#8221;。<br />
编辑本段SC命令列表及格式<br />
　　SC命令不能单独使用,必须和其它的命令结合起来一起使用。一共有24个，如下所示<br />
　　sc boot　sc config　sc continue　sc control　sc create　sc delete　sc descrīption　sc enumdepend<br />
　　sc failure　sc getdisplayname　sc getkeyname　sc interrogate　sc lock　sc pause　sc qc<br />
　　sc qdescrīption　sc qfailure　sc query　sc queryex　sc querylock　sc sdset sc sdshow<br />
　　sc　start　sc stop<br />
　　在命令行中直接输入SC会显示SC命令的帮助信息，直接输入以上24个命令除sc query 和 sc queryex之外都将显示该SC命令的帮助信息。（输入sc query和sc queryex会显示当前系统中正在运行的所有服务的详细信息，但sc queryex比sc query显示的信息多出来两项:PID和FLAGS）<br />
　　SC命令的格式：SC [Servername] command Servicename [Optionname= Optionvalues]<br />
　　Servername：指定服务所在的远程服务器的名称。名称必须采用通用命名约定 (UNC) 格式（&#8220;\\myserver&#8221;）。要在本地运行SC.exe，请忽略此参数。<br />
　　command ：即以上提到的那24个命令（SC后面的那个，如query,start,stop,create,config等）<br />
　　Servicename：服务名，也就是要配置的那个服务的名字，例如你要启动一个服务你就输入sc start +你要启动的服务名。（注意这里的服务名不是服务的显示名称，而是服务名称，这个服务名称可以在系统管理工具下的服务中可以看到，例如在服务中双击DHCP Client可以看到其服务名称是Dhcp，而那个DHCP Client是显示名称，可以用sc命令来更改一个服务的显示名称）<br />
　　Optionname= Optionvalues：是选项名和选项的值。<br />
　　例如你要在开机是系统自动加载themes服务，你可以使用sc config themes start= auto，后面的start就是选项，auto是选项的值。（注意=号后面有个空格，所有的使用选项的在=号后面都要加个空格再加上选项值）<br />
编辑本段SC命令的用法<br />
　　下面给出每个命令详细的用法<br />
　　1、sc boot<br />
　　表明最近的启动是否应该保存为上次已知的正确配置。<br />
　　语法<br />
　　Sc [ServerName] boot [{bad | OK}]<br />
　　参数<br />
　　ServerName：上面已经介绍，在此不在累述（下同）<br />
　　[{bad | OK}] <br />
　　指定最近的启动是否错误或它是否应该保存为上次已知的正确启动配置。<br />
　　下面的示例显示了如何使用 sc boot 命令：<br />
　　sc boot ok <br />
　　sc boot bad<br />
　　2、sc config<br />
　　修改注册表和&#8220;服务控制管理器&#8221;数据库中服务项目的值。<br />
　　语法<br />
　　Sc [ServerName] config [ServiceName] [type= {own | share | kernel | filesys | rec | adapt | interacttype= {own | share}}] [start= {boot | system | auto | demand | disabled}] [error= {normal | severe | critical | ignore}] [binpath= BinaryPathName] [group= LoadOrderGroup] [tag= {yes | no}] [depend= dependencies] [obj= {AccountName | ObjectName}] [displayname= DisplayName] [password= Password]<br />
　　ServiceName<br />
　　指定要操作的服务名。（上面也已经介绍，下文不在累述）<br />
　　type= {own | share | kernel | filesys | rec | adapt | interacttype= {own | share}} <br />
　　指定服务类型。<br />
　　own<br />
　　服务以其自身的进程运行。不与其他服务共享可执行文件。这是默认值。<br />
　　share<br />
　　服务作为共享进程运行。与其他服务共享可执行文件。<br />
　　kernel<br />
　　驱动程序。<br />
　　filesys<br />
　　文件系统驱动程序。<br />
　　rec<br />
　　文件系统识别驱动程序（标识计算机上使用的文件系统）。<br />
　　adapt<br />
　　适配器驱动程序（标识键盘、鼠标、磁盘驱动器这样的硬件项）。<br />
　　interact<br />
　　服务可以与桌面交互，接收用户的输入。交互服务必须在 LocalSystem 帐户下运行。该类型必须与 type= own 或 type= shared（例如，type= interact type= own）结合使用。自身使用 type= interact 将会产生参数无效的错误。<br />
　　start= {boot | system | auto | demand | disabled} <br />
　　指定服务的启动类型。 <br />
　　boot<br />
　　由启动加载程序加载的设备驱动程序。<br />
　　system<br />
　　在核心初始化过程中启动的设备驱动程序。<br />
　　auto<br />
　　每次计算机重新启动时都会自动启动、并且即使无人登录到计算机也能正常运行的服务。<br />
　　demand<br />
　　必须手动启动的服务。如果没有指定 start=，则此项即为默认值。<br />
　　disabled<br />
　　不能启动的服务。要启动禁用的服务，应将启动类型更改为其他值。<br />
　　error= {normal | severe | critical | ignore} <br />
　　如果在启动过程中，服务启动失败，则指定错误的严重性。<br />
　　normal<br />
　　将记录错误，并且显示消息对话框，通知用户服务启动失败。启动将继续。这是默认设置。<br />
　　severe<br />
　　记录错误（如果存在）。计算机尝试以最新的有效配置重新启动。这可能导致计算机能够重新启动，但服务却仍然无法运行。<br />
　　critical<br />
　　记录错误（如果存在）。计算机尝试以最新的有效配置重新启动。如果上次已知正确的配置失败，启动也将失败，启动进程将以停止错误而中止。<br />
　　ignore<br />
　　错误已记录，启动继续。记录错误超出在事件ri志的范围，不再给用户作出提示。 <br />
　　binpath= BinaryPathName<br />
　　指定指向服务二进制文件的路径。 <br />
　　group= LoadOrderGroup<br />
　　指定该服务所属组的名称。组列表存储在注册表的 HKLM\System\CurrentControlSet\Control\ServiceGroupOrder 子项中。默认设置为空值。<br />
　　tag= {yes | no} <br />
　　指定是否在 CreateService 调用中获得 TagID。标记仅用于引导启动或系统启动驱动程序。<br />
　　depend= dependencies<br />
　　指定必须在此项服务之前启动的服务或组的名称。名称以正斜杠 (/) 分隔。<br />
　　obj= {AccountName | ObjectName} <br />
　　指定运行服务将使用的帐户名，或指定运行驱动程序将使用的 Windows 驱动程序对象名。默认设置为 LocalSystem。<br />
　　displayname= DisplayName<br />
　　指定一个可以在用户界面程序中用于为用户标识服务的友好的、有意义的名称。例如，一项服务的子项名是对用户毫无意义的 wuauserv，而显示的名称是&#8220;自动更新&#8221;。<br />
　　password= Password<br />
　　指定一个密码。如果使用了非 LocalSystem 的帐户，则此项是必需的。<br />
　　备注<br />
　　如果参数及其值之间没有空格，（例如，是 type= own，而不是 type=own），则操作会失败。<br />
　　示例<br />
　　下面的示例显示了如何使用 sc config 命令：<br />
　　sc config NewService binpath= "ntsd -d c:\windows\system32\NewServ.exe"<br />
　　３、sc continue<br />
　　为了恢复暂停的服务，要给服务发送一个 CONTINUE 控制请求。<br />
　　语法<br />
　　Sc [ServerName] continue [ServiceName]<br />
　　参数<br />
　　ServerName：略<br />
　　ServiceName：略<br />
　　备注<br />
　　使用 continue 操作来恢复暂停的服务。 <br />
　　下面的示例显示了如何使用 sc continue 命令：<br />
　　sc continue tapisrv<br />
　　４、sc control<br />
　　向服务发送 CONTROL 。<br />
　　语法<br />
　　sc [ServerName] control [ServiceName] [{paramchange | netbindadd | netbindremove | netbindenable | netbinddisable | UserDefinedControlB}]<br />
　　参数<br />
　　{paramchange | netbindadd | netbindremove | netbindenable | netbinddisable | UserDefinedControlB} <br />
　　指定要发送到服务的控制。<br />
　　５、sc create<br />
　　在注册表和&#8220;服务控制管理器&#8221;中为服务创建子项和项目。<br />
　　语法<br />
　　Sc [ServerName] create [ServiceName] [type= {own | share | kernel | filesys | rec | adapt | interacttype= {own | share}}] [start= {boot | system | auto | demand | disabled}] [error= {normal | severe | critical | ignore}] [binpath= BinaryPathName] [group= LoadOrderGroup] [tag= {yes | no}] [depend= dependencies] [obj= {AccountName | ObjectName}] [displayname= DisplayName] [password= Password]<br />
　　参数：各个参数的作用参见sc config 命令<br />
　　下面的示例显示了如何使用 sc create 命令：<br />
　　sc \\myserver create NewService binpath= c:\windows\system32\NewServ.exe<br />
　　sc create NewService binpath= c:\windows\system32\NewServ.exe type= share start= auto depend= "+TDI Netbios"<br />
　　６、sc delete<br />
　　从注册表中删除服务子项。如果服务正在运行或者另一个进程有一个该服务的打开句柄，那么此服务将标记为删除。<br />
　　语法<br />
　　Sc [ServerName] delete [ServiceName]<br />
　　参数：略<br />
　　备注<br />
　　使用&#8220;添加或删除程序&#8221;删除 DHCP、DNS 或任何其他内置的操作系统服务。&#8220;添加或删除程序&#8221;不仅会删除该服务的注册表子项，而且还会卸载该服务并删除其所有的快捷方式。 <br />
　　下面的示例显示了如何使用 sc delete 命令：<br />
　　sc delete newserv<br />
　　７、sc descrīption<br />
　　设置服务的描述字符串。<br />
　　语法<br />
　　Sc [ServerName] descrīption [ServiceName] [Descrīption]<br />
　　参数：略<br />
　　描述<br />
　　为指定服务指定描述。这个描述的内容可以在控制面板－管理工具－服务里通过查看该服务的属性看到。如果没有指定字符串，则不会修改该服务的描述。不限制服务描述中可包含的字符数。<br />
　　示例<br />
　　下面的示例显示了如何使用 sc descrīption 命令：<br />
　　sc descrīption newserv "Runs quality of service control."<br />
　　８、sc enumdepend<br />
　　枚举依赖此服务的系统组件，这也可以从控制面板－管理工具－服务里通过查看该服务的属性中的依存关系选项卡看到（&#8220;下面的系统组件依赖此服务&#8221;下面的部分）<br />
　　语法<br />
　　Sc [ServerName] enumdepend [ServiceName] [BufferSize]<br />
　　参数<br />
　　BufferSize<br />
　　以字节为单位指定枚举缓冲区的大小。默认值为 1024 字节。<br />
　　备注<br />
　　如果缓冲区不够大，enumdepend 操作只会部分输出依存关系，并指定输出所有依存关系所需的额外缓冲区大小。如果输出被截断，请重新运行该操作并指定更大的缓冲区大小。<br />
　　下面的示例显示了如何使用 sc enumdepend 命令：<br />
　　sc enumdepend rpcss 5690<br />
　　sc enumdepend tapisrv<br />
　　９、sc failure<br />
　　指定服务失败时要采取的措施。<br />
　　语法<br />
　　Sc [ServerName] failure [ServiceName] [reset= ErrorFreePeriod] [reboot= BroadcastMessage] [command= CommandLine] [actions= FailureActionsAndDelayTime]<br />
　　参数<br />
　　reset= ErrorFreePeriod<br />
　　指定没有失败的周期长度（单位为秒），此后失败计数应该重置为 0。这个参数必须与 actions= 参数结合使用。<br />
　　reboot= BroadcastMessage<br />
　　指定服务失败时要广播的消息。<br />
　　command= CommandLine<br />
　　指定服务失败时要运行的命令行。有关在失败时如何运行批处理或 VBS 文件的详细信息，请参阅&#8220;注释&#8221;。<br />
　　actions= FailureActionsAndDelayTime<br />
　　指定失败操作及其延迟时间（单位为毫秒），以正斜杠 (/) 隔开。以下操作均有效：run、restart 和 reboot。此参数必须与 reset= 参数结合使用。失败后不采取任何操作时，请使用 actions= ""。<br />
　　备注<br />
　　并非所有服务都允许更改其失败选项。其中一些作为服务集的一部分运行。<br />
　　要在失败时运行批处理文件，请指定 cmd.exeDrive:\FileName.bat 为 command= 参数，其中 Drive:\FileName.bat 是批处理文件的完全合格的名称。<br />
　　要在失败时运行 VBS 文件，请指定 cscrīpt drive:\myscrīpt.vbs 为 command= 参数，其中 Drive:\myscrīpt.vbs 是脚本文件完全合格的名称。<br />
　　可以将三种不同的操作指定为 actions= 参数，它们将会在服务的第一次、第二次、第三次失败时使用。<br />
　　如果参数及其值之间没有空格，（例如，是 type= own，而不是 type=own），则操作会失败。<br />
　　下面的示例显示了如何使用 sc failure 命令：<br />
　　sc failure msftpsvc reset= 30 actions= restart/5000<br />
　　sc failure dfs reset= 60 command= c:\windows\services\restart_dfs.exe actions= run/5000<br />
　　sc failure dfs reset= 60 actions= reboot/30000<br />
　　sc failure dfs reset= 60 reboot= "The Distributed File System service has failed.Because of this, the computer will reboot in 30 seconds." actions= reboot/30000<br />
　　sc failure myservice reset= 3600 reboot= "MyService crashed -- rebooting machine" command= "%windir%\MyServiceRecovery.exe" actions= restart/5000/run/10000/reboot/60000<br />
　　１０、sc getdisplayname<br />
　　获得与特定服务关联的显示名称。<br />
　　语法<br />
　　Sc [ServerName] getdisplayname [ServiceName] [BufferSize]<br />
　　参数<br />
　　BufferSize<br />
　　指定缓冲区大小（以字节为单位）。默认值为 1024 字节。<br />
　　下面的示例显示了如何使用 sc getdisplayname 命令：<br />
　　sc getdisplayname clipsrv<br />
　　sc getdisplayname tapisrv<br />
　　sc getdisplayname sharedaccess<br />
　　１１、sc getkeyname<br />
　　使用特定服务的显示名称作为输入的内容会获得与其相关联的项名。<br />
　　语法<br />
　　sc [ServerName] getkeyname [ServiceDisplayName] [BufferSize]<br />
　　参数<br />
　　ServiceDisplayName<br />
　　指定服务的显示名称。<br />
　　BufferSize<br />
　　指定缓冲区大小（以字节为单位）。默认值为 1024 字节。<br />
　　备注<br />
　　如果 ServiceDisplayName 包含空格，请使用引号将文本引起来（例如，"Service Display Name"）。<br />
　　下面的示例显示了如何使用 sc getkeyname 命令：<br />
　　sc getkeyname "remote procedure call (rpc)"<br />
　　sc getkeyname "internet connection sharing"<br />
　　sc getkeyname clipbook<br />
　　１２、sc interrogate<br />
　　向服务发送一个 INTERROGATE 控制请求。<br />
　　语法<br />
　　Sc [ServerName] interrogate [ServiceName]<br />
　　参数：略<br />
　　备注<br />
　　向服务发送 INTERROGATE 会导致该服务使用&#8220;服务控制管理器&#8221;更新其状态。<br />
　　下面的示例显示了如何使用 sc interrogate 命令：<br />
　　sc interrogate sharedaccess<br />
　　sc interrogate rpcss<br />
　　１３、sc lock<br />
　　锁定&#8220;服务控制管理器&#8221;的数据库。<br />
　　语法<br />
　　sc [ServerName] lock<br />
　　参数：略<br />
　　备注<br />
　　锁定&#8220;服务控制管理器&#8221;的数据库会阻止启动任何服务。如果要确保服务在停止之后不会启动，请使用这个命令。这可以使您不受干扰地进行一些操作（例如，删除服务）。<br />
　　使用 lock 操作锁定&#8220;服务控制管理器&#8221;的数据库，然后通过键入 u 来使数据库解锁。也可停止锁定数据库的进程。<br />
　　下面的示例显示了如何使用 sc lock 命令：<br />
　　sc lock<br />
　　１４、sc pause<br />
　　向服务发送 PAUSE 控制请求。<br />
　　语法<br />
　　Sc [ServerName] pause [ServiceName]<br />
　　参数：略<br />
　　备注<br />
　　在终止服务之前使用 pause 操作来暂停它。<br />
　　并非所有服务都能够被暂停。<br />
　　在暂停时并非所有服务都执行同样的操作。一些服务继续为现有客户端服务，但拒绝接受新的客户端。其他的会终止对现有客户端的服务，同时也会拒绝接受新的客户端。<br />
　　下面的示例显示了如何使用 sc pause 命令：<br />
　　sc pause tapisrv<br />
　　１５、sc qc<br />
　　查询服务的配置信息。<br />
　　语法<br />
　　Sc [ServerName] qc [ServiceName] [BufferSize]<br />
　　参数<br />
　　BufferSize<br />
　　指定缓冲区大小（以字节为单位）。默认值为 1024 字节。<br />
　　备注<br />
　　qc 操作可以显示有关服务的下列信息：<br />
　　SERVICE_NAME（服务的注册表子项名称）、TYPE、ERROR_CONTROL、BINARY_PATH_NAME、LOAD_ORDER_GROUP、TAG、DISPLAY_NAME、DEPENDENCIES 和 SERVICE_START_NAME。<br />
　　管理员可以使用 SC 来确定任一服务的二进制名称，并查明它是否与其他服务共享一个进程，在命令行下键入下列命令：<br />
　　sc qc ServiceName<br />
　　SC 有助于将 Microsoft 管理控制台 (MMC) 的服务节点中的服务与&#8220;系统监视器&#8221;中的进程进行匹配。如果二进制名称是 Services.exe，那么服务共享&#8220;服务控制器&#8221;进程。<br />
　　Services.exe 启动所有的服务。为节约系统资源，几个为 Windows 开发的 Win32 服务被编写为共享 Services.exe 进程。这些服务不作为独立的进程列在&#8220;系统监视器&#8221;或&#8220;任务管理器&#8221;之中。Svchost.exe 也是如此，它是许多操作服务共享的服务主机进程。<br />
　　因为第三方 Win32 服务也可以配置为共享进程，所以不可能为每一个 Win32 服务创建一个进程。SC 可以用来获得这些服务的配置信息。但是，如果一项服务不与其他服务共享其进程，那么在服务运行时，&#8220;系统监视器&#8221;中会出现其进程。<br />
　　因为 SC 与包含在 Windows 中的 Services.exe 相比，提供了有关服务的更为详细和准确的信息，所以对于服务开发人员来说，SC 更有用处。Services.exe 可以确定服务是正在运行、已停止还是已暂停。尽管这些工具对于正在平稳运行的已调试应用程序已经足够，但它们提供的有关正开发的服务的信息却会使人误解。例如，正在启动的服务不管其实际运行与否都显示为已启动。<br />
　　SC 可执行对所有 Windows 服务控制应用编程接口 (API) 函数的调用。通过在命令行下指定这些函数来设置其参数。<br />
　　使用 SC，可以查询服务状态，检索存储在状态结构字段中的值。Services.exe 不能提供服务的完整状态，但 SC 可以显示精确的服务状态，以及最新的检查点号码和等待提示。可以将检查点用作调试工具，原因在于它表明了在程序停止响应之前初始化进行的程度。SC 也可以用来指定远程计算机名，以便于在远程计算机上调用服务 API 函数或查看服务状态结构。<br />
　　下面的示例显示了如何使用 sc qc 命令：<br />
　　sc qc \\myserver newsrvice<br />
　　sc qc rpcss 248<br />
　　１６、sc qdescrīption<br />
　　显示服务的描述字符串。<br />
　　语法<br />
　　Sc [ServerName] qdescrīption [ServiceName] [BufferSize]<br />
　　参数<br />
　　BufferSize<br />
　　指定缓冲区大小（以字节为单位）。默认值为 1024 字节。<br />
　　下面的示例显示了如何使用 sc qdescrīption 命令：<br />
　　sc qdescrīption rpcss<br />
　　sc qdescrīption rpcss 138<br />
　　１７、sc qfailure<br />
　　显示指定服务失败时要执行的操作。<br />
　　语法<br />
　　Sc [ServerName] qfailure [ServiceName] [BufferSize]<br />
　　参数<br />
　　BufferSize<br />
　　指定缓冲区大小（以字节为单位）。默认值为 1024 字节。<br />
　　备注<br />
　　qfailure 操作可以显示有关服务的下列信息：SERVICE_NAME（服务的注册表子项名）、RESET_PERIOD、REBOOT_MESSAGE、COMMAND_LINE 和 FAILURE_ACTIONS。<br />
　　下面的示例显示了如何使用 sc qfailure 命令：<br />
　　sc qfailure rpcss<br />
　　sc qfailure rpcss 20<br />
　　１８、sc query<br />
　　获得和显示关于指定的服务、驱动程序、服务类型或驱动程序类型的信息。<br />
　　语法<br />
　　Sc [ServerName] query [ServiceName] [type= {driver | service | all}] [type= {own | share | interact | kernel | filesys | rec | adapt}] [state= {active | inactive | all}] [bufsize= BufferSize] [ri= ResumeIndex] [group= GroupName]<br />
　　参数<br />
　　ServiceName<br />
　　指定由 getkeyname 操作返回的服务名。此 query 参数不与其他的 query 参数结合使用（除了 ServerName）。<br />
　　type= {driver | service | all} <br />
　　指定需要枚举的内容。默认类型为 service。<br />
　　driver<br />
　　指定仅枚举驱动程序。<br />
　　service<br />
　　指定仅枚举服务。<br />
　　all<br />
　　指定同时枚举驱动程序和服务。<br />
　　type= {own | share | interact | kernel | filesys | rec | adapt} <br />
　　指定要枚举的服务类型或驱动程序类型。<br />
　　own<br />
　　服务以其自身的进程运行。不与其他服务共享可执行文件。这是默认值。<br />
　　share<br />
　　服务作为共享进程运行。与其他服务共享可执行文件。<br />
　　interact<br />
　　服务可以与桌面交互，接收用户的输入。交互服务必须在 LocalSystem 帐户下运行。<br />
　　kernel<br />
　　驱动程序。<br />
　　filesys<br />
　　文件系统驱动程序。<br />
　　state= {active | inactive | all} <br />
　　指定要枚举的服务的已开始状态。默认状态是 active。<br />
　　active<br />
　　指定所有的活动服务。<br />
　　inactive<br />
　　指定所有暂停或停止的服务。<br />
　　all<br />
　　指定所有服务。<br />
　　bufsize= BufferSize<br />
　　以字节为单位指定枚举缓冲区的大小。默认大小为 1024 字节。当从查询返回的显示结果超过 1024 个字节时，增加枚举缓冲区的大小。<br />
　　ri= ResumeIndex<br />
　　指定开始或继续枚举的索引号。默认值为 0。 在查询返回的信息超过默认缓冲区能够显示的大小时，请与 bufsize= 参数结合使用这个参数。<br />
　　group= GroupName<br />
　　指定要枚举的服务组。默认设置为所有组。<br />
　　备注<br />
　　如果参数及其值之间没有空格，（例如，是 type= own，而不是 type=own），则操作会失败。<br />
　　query 操作可以显示有关服务的下列信息：SERVICE_NAME（服务的注册表子项名）、TYPE、STATE（以及不可用的状态）、WIN32_EXIT_B、SERVICE_EXIT_B、CHECKPOINT 和 WAIT_HINT。<br />
　　在某些情况下，type= 参数可以使用两次。type= 参数的第一次出现指定是否查询服务、驱动器或所有这些项。type= 参数的第二次出现指定一个由 create 操作进一步缩小查询范围的类型。<br />
　　当 query 命令的显示结果超过了枚举缓冲区的大小时，显示类似于以下内容的消息： <br />
　　Enum: more data, need 1822 bytes start resume at index 79<br />
　　要显示剩余的 query 信息，请重新运行 query，将 bufsize= 设置为所需的字节数，并将 ri= 设置为指定的索引。例如，在命令行键入下面的指令会显示剩余的输出：<br />
　　sc query bufsize= 1822 ri= 79<br />
　　下面的示例显示了如何使用 sc query 命令：<br />
　　sc query<br />
　　sc query messenger<br />
　　sc query type= driver<br />
　　sc query type= service<br />
　　sc query state= all<br />
　　sc query bufsize= 50<br />
　　sc query ri= 14<br />
　　sc query type= service type= interact<br />
　　sc query type= driver group= ndis<br />
　　１９、sc queryex<br />
　　获得和显示关于指定的服务、驱动程序、服务类型或驱动程序类型的扩展信息。<br />
　　语法<br />
　　Sc [ServerName] queryex [type= {driver | service | all}] [type= {own | share | interact | kernel | filesys | rec | adapt}] [state= {active | inactive | all}] [bufsize= BufferSize] [ri= ResumeIndex][group= GroupName]<br />
　　参数<br />
　　ServiceName<br />
　　指定由 getkeyname 操作返回的服务名。此 queryex 参数不与 ServerName 之外的任何其他 queryex 参数结合使用。<br />
　　type= {driver | service | all} <br />
　　指定需要枚举的内容。默认类型为 service。<br />
　　driver<br />
　　指定仅枚举驱动程序。<br />
　　service<br />
　　指定仅枚举服务。<br />
　　all<br />
　　指定同时枚举驱动程序和服务。<br />
　　type= {own | share | interact | kernel | filesys | rec | adapt} <br />
　　指定要枚举的服务类型或驱动程序类型。<br />
　　own<br />
　　服务以其自身的进程运行。不与其他服务共享可执行文件。这是默认值。<br />
　　share<br />
　　服务作为共享进程运行。与其他服务共享可执行文件。<br />
　　interact<br />
　　服务可以与桌面交互，接收用户的输入。交互服务必须在 LocalSystem 帐户下运行。<br />
　　kernel<br />
　　驱动程序。<br />
　　filesys<br />
　　文件系统驱动程序。<br />
　　state= {active | inactive | all} <br />
　　指定要枚举的服务的已开始状态。默认状态是 active。 <br />
　　active<br />
　　指定所有的活动服务。<br />
　　inactive<br />
　　指定所有暂停或停止的服务。<br />
　　all<br />
　　指定所有服务。<br />
　　bufsize= BufferSize<br />
　　以字节为单位指定枚举缓冲区的大小。默认大小为 1024 字节。<br />
　　ri= ResumeIndex<br />
　　指定开始或继续枚举的索引号。默认值为 0。<br />
　　group= GroupName<br />
　　指定要枚举的服务组。默认设置为所有组。<br />
　　备注<br />
　　如果参数及其值之间没有空格，（例如，是 type= own，而不是 type=own），则操作会失败。<br />
　　queryex 操作可以显示有关服务的下列信息：SERVICE_NAME（服务的注册表子项名）、TYPE、STATE（以及不可用的状态）、WIN32_EXIT_B、SERVICE_EXIT_B、CHECKPOINT、WAIT_HINT、PID 和 FLAGS。<br />
　　在某些情况下，type= 参数可以使用两次。type= 参数的第一次出现指定是否查询服务、驱动器或所有这些项。type= 参数的第二次出现指定一个由 create 操作进一步缩小查询范围的类型。<br />
　　当 queryex 命令的显示结果超过了枚举缓冲区的大小时，显示类似于以下内容的消息： <br />
　　Enum: more data, need 2130 bytes start resume at index 75<br />
　　要显示剩余的 queryex 信息，请重新运行 queryex，将 bufsize= 设置为所需的字节数，并将 ri= 设置为指定的索引。例如，在命令行键入下面的指令会显示剩余的输出：<br />
　　sc queryex bufsize= 2130 ri= 75<br />
　　下面的示例显示了如何使用 sc queryex 命令：<br />
　　sc queryex messenger<br />
　　sc queryex group= ""<br />
　　２０、sc querylock<br />
　　查询和显示&#8220;服务控制管理器&#8221;数据库的锁定信息。<br />
　　语法<br />
　　Sc [ServerName] querylock<br />
　　参数：略<br />
　　２１、sc sdset<br />
　　使用&#8220;服务描述符定义语言 (SDDL)&#8221;来设置服务的安全描述符。<br />
　　语法<br />
　　Sc [ServerName] sdset ServiceName ServiceSecurityDescrīptor<br />
　　参数<br />
　　ServiceSecurityDescrīptor<br />
　　在 SDDL 中指定服务描述符。<br />
　　备注<br />
　　有关 SDDL 的详细信息，请参阅 Microsoft 网站上的 Security Descrīptor Definition Language（安全描述符定义语言）。 <br />
　　２２、sc sdshow<br />
　　使用 SDDL 显示服务的安全描述符。<br />
　　语法<br />
　　Sc [ServerName] sdshow ServiceName<br />
　　参数：略<br />
　　备注<br />
　　有关 SDDL 的详细信息，请参阅 Microsoft 网站上的 Security Descrīptor Definition Language（安全描述符定义语言）。 <br />
　　示例<br />
　　sc sdshow rpcss<br />
　　２３、sc start<br />
　　启动正在运行的服务。<br />
　　语法<br />
　　Sc [ServerName] start ServiceName [ServiceArguments]<br />
　　参数<br />
　　ServiceArguments<br />
　　指定传递给要启动的服务的服务参数。<br />
　　下面的示例显示了如何使用 sc start 命令：<br />
　　sc start tapisrv<br />
　　２４、sc stop<br />
　　向服务发送 STOP 控制请求。<br />
　　语法<br />
　　Sc [ServerName] stop ServiceName<br />
　　参数：略<br />
　　备注<br />
　　并非所有服务都能够被停止。<br />
　　下面的示例显示了如何使用 sc stop 命令：<br />
　　sc stop tapisrv<br />
 <img src ="http://www.blogjava.net/xiaomage234/aggbug/234365.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2008-10-15 09:46 <a href="http://www.blogjava.net/xiaomage234/archive/2008/10/15/234365.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>xp安装，卸载服务</title><link>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234364.html</link><dc:creator>小马歌</dc:creator><author>小马歌</author><pubDate>Wed, 15 Oct 2008 01:39:00 GMT</pubDate><guid>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234364.html</guid><wfw:comment>http://www.blogjava.net/xiaomage234/comments/234364.html</wfw:comment><comments>http://www.blogjava.net/xiaomage234/archive/2008/10/15/234364.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xiaomage234/comments/commentRss/234364.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xiaomage234/services/trackbacks/234364.html</trackback:ping><description><![CDATA[<p>SC命令是XP系统中功能强大的DOS命令,SC命令能与&#8220;服务控制器&#8221;和已安装设备进行通讯。<br />
安装服务：sc create serviceName binPath= "D:\server.exe"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [注意binPath= 之后有一个空格，必须有]</p>
<p>卸载服务：sc delete serviceName</p>
<p>or check HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices </p>
<p>以上修改要重起机器才能生效<br />
<br />
另：<br />
启动服务：net start serviceName 或sc start serviceName <br />
停止服务：net stop serviceName 或sc stop serviceName <br />
<br />
[SC命令 的参数可以配置指定的服务，检索当前服务的状态，也可以停止和启动服务（功能上类似NET STOP/START命令，但SC速度更快且能停止更多的服务）。]<br />
</p>
<img src ="http://www.blogjava.net/xiaomage234/aggbug/234364.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xiaomage234/" target="_blank">小马歌</a> 2008-10-15 09:39 <a href="http://www.blogjava.net/xiaomage234/archive/2008/10/15/234364.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>