﻿<?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-X-Spirit</title><link>http://www.blogjava.net/zhangwei217245/</link><description>Always Beyond the Time</description><language>zh-cn</language><lastBuildDate>Thu, 30 Apr 2026 06:23:13 GMT</lastBuildDate><pubDate>Thu, 30 Apr 2026 06:23:13 GMT</pubDate><ttl>60</ttl><item><title>【Math's History】什么是罗素悖论</title><link>http://www.blogjava.net/zhangwei217245/archive/2014/09/25/418250.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Wed, 24 Sep 2014 16:57:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2014/09/25/418250.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/418250.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2014/09/25/418250.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/418250.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/418250.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;<a href='http://www.blogjava.net/zhangwei217245/archive/2014/09/25/418250.html'>阅读全文</a><img src ="http://www.blogjava.net/zhangwei217245/aggbug/418250.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2014-09-25 00:57 <a href="http://www.blogjava.net/zhangwei217245/archive/2014/09/25/418250.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【Effective】IntelliJ IDEA  MAC  IDE config files</title><link>http://www.blogjava.net/zhangwei217245/archive/2014/03/16/411109.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Sun, 16 Mar 2014 15:03:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2014/03/16/411109.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/411109.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2014/03/16/411109.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/411109.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/411109.html</trackback:ping><description><![CDATA[@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
<div><code style="line-height: normal;"><dl style="margin: 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;"><dt style="margin: 0px; padding: 0px;">
<h2 style="margin: 15px 0px 5px; padding: 0px; font-size: 14px; color: #444444; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc;">IDE Settings</h2>
<p style="margin: 10px 0px; padding: 0px;"><span class="keyword" style="font-family: 'Courier New', Courier, monospace; font-weight: bold; font-size: 12px; color: #666666;">IDE settings</span>&nbsp;are stored in the dedicated directories under the product home directory, depending on the platform. The product home directory name is composed of the product name and version.</p>
<p style="margin: 10px 0px; padding: 0px;">For IntelliJ IDEA Community edition the folder name is&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">.IdeaICXX</span>.</p>
<p style="margin: 10px 0px; padding: 0px;">For example:</p>
<dl style="margin: 0px; padding: 0px;"><dt style="margin: 0px; padding: 0px;">Windows</dt><dd style="margin: 0px 0px 5px 30px; padding: 0px; color: #666666;">
<ul style="margin: 0px 0px 0px 10px; padding: 0px; list-style-position: inside; list-style-image: initial;">
    <li style="margin: 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">&lt;User home&gt;\.IntelliJIdeaXX\config</span>&nbsp;that contains user-specific settings.</li>
    <li style="margin: 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">&lt;User home&gt;\.IntelliJIdeaXX\system</span>&nbsp;that stores IntelliJ IDEA data caches.</li>
</ul>
<p style="margin: 10px 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">&lt;User home&gt;</span>&nbsp;in WindowsXP is&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">C:\Documents and Settings\&lt;User name&gt;\</span>; in Windows Vista it is&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">C:\Users\&lt;User name&gt;\</span></p>
</dd><dt style="margin: 0px; padding: 0px;">Linux</dt><dd style="margin: 0px 0px 5px 30px; padding: 0px; color: #666666;">
<ul style="margin: 0px 0px 0px 10px; padding: 0px; list-style-position: inside; list-style-image: initial;">
    <li style="margin: 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/.IntelliJIdeaXX/config</span>&nbsp;that contains user-specific settings.</li>
    <li style="margin: 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/.IntelliJIdeaXX/system</span>&nbsp;that stores IntelliJ IDEA data caches.</li>
</ul>
</dd></dl></dt><dt style="margin: 0px; padding: 0px;"><br />
</dt><dt style="margin: 0px; padding: 0px;">Mac OS</dt><dd style="margin: 0px 0px 5px 30px; padding: 0px; color: #666666;">
<ul style="margin: 0px 0px 0px 10px; padding: 0px; list-style-position: inside; list-style-image: initial;">
    <li style="margin: 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/Library/Application Support/IntelliJIdeaXX</span>&nbsp;contains the catalog with plugins.</li>
    <li style="margin: 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/Library/Preferences/IntelliJIdeaXX</span>&nbsp;contains the rest of the configuration settings.</li>
    <li style="margin: 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/Library/Caches/IntelliJIdeaXX</span>&nbsp;contains data caches, logs, local history, etc. These files can be quite significant in size.</li>
    <li style="margin: 0px; padding: 0px;"><a name="logs" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a><span class="sinceversiondif" style="font-size: 9px; margin-right: 5px; color: #888888;">9.0+</span><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/Library/Logs/IntelliJIdeaXX</span>&nbsp;contains logs</li>
</ul>
</dd></dl>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">The&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">config</span>&nbsp;directory has several subfolders that contain xml files with your personal settings. You can easily share your preferred keymaps, color schemes, etc. by copying these files into the corresponding folders on another IntelliJ IDEA installation. Prior to copying, make sure that IntelliJ IDEA is not running, because it can erase the newly transferred files before shutting down.</p>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">The following is the list of some of the subfolders under the&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">config</span>&nbsp;folder, and the settings contained therein.</p>
<table class="ijTable" width="100%" style="border-collapse: collapse; color: #000000; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">
    <thead>
        <tr class="ijRowHead">
            <th style="margin: 0px; padding: 0px; font-weight: normal;">Folder name</th><th style="margin: 0px; padding: 0px; font-weight: normal;">User Settings</th>
        </tr>
    </thead>
    <tbody>
        <tr class="ijRowOdd">
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">codestyles</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;">Contains&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/configuring-code-style.html" style="color: #800080; cursor: pointer;">code style schemes</a>.</td>
        </tr>
        <tr class="ijRowEven">
            <td style="margin: 0px; padding: 5px; vertical-align: top;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">colors</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top;">Contains&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/configuring-colors-and-fonts.html" style="color: #800080; cursor: pointer;">editor colors and fonts</a>&nbsp;customization schemes.</td>
        </tr>
        <tr class="ijRowOdd">
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">filetypes</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;">Contains user-defined&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/creating-and-registering-file-types.html" style="color: #800080; cursor: pointer;">file types</a>.</td>
        </tr>
        <tr class="ijRowEven">
            <td style="margin: 0px; padding: 5px; vertical-align: top;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">inspection</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top;">Contains&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/code-inspection.html" style="color: #800080; cursor: pointer;">code inspection profiles</a>.</td>
        </tr>
        <tr class="ijRowOdd">
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">keymaps</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;">Contains IntelliJ IDEA&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/configuring-keyboard-shortcuts.html" style="color: #800080; cursor: pointer;">keyboard shortcuts</a>&nbsp;customizations.</td>
        </tr>
        <tr class="ijRowEven">
            <td style="margin: 0px; padding: 5px; vertical-align: top;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">options</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top;">Contains various options, for example, feature usage statistics and macros.</td>
        </tr>
        <tr class="ijRowOdd">
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">templates</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;">Contains user-defined&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/live-templates.html" style="color: #800080; cursor: pointer;">live templates</a>.</td>
        </tr>
        <tr class="ijRowEven">
            <td style="margin: 0px; padding: 5px; vertical-align: top;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">tools</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top;">Contains configuration files for the&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/configuring-third-party-tools.html" style="color: #800080; cursor: pointer;">user-defined external tools</a>.</td>
        </tr>
        <tr class="ijRowOdd">
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">shelf</span></td>
            <td style="margin: 0px; padding: 5px; vertical-align: top; background-color: #eeeeee;">Contains&nbsp;<a href="https://www.jetbrains.com/idea/webhelp/shelved-changes.html" style="color: #800080; cursor: pointer;">shelved changes</a>.</td>
        </tr>
    </tbody>
</table>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">Locations of the Config, System, and Plugins directories can be modified in&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">IntelliJ IDEA_home\bin\idea.properties</span>&nbsp;file.</p>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">You will need to adjust the following parameters:</p>
<ul style="margin: 0px; padding: 0px; list-style-position: inside; list-style-image: initial; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">
    <li style="margin: 0px; padding: 0px;">idea.config.path</li>
    <li style="margin: 0px; padding: 0px;">idea.system.path</li>
    <li style="margin: 0px; padding: 0px;">idea.plugins.path</li>
</ul>
</code></div>
<code style="line-height: normal;">
<div><code style="line-height: normal;"><br />
</code></div>
<div><code style="line-height: normal;"><br />
</code></div>
<div><code style="line-height: normal;">
<h2 style="margin: 15px 0px 5px; padding: 0px; font-size: 14px; color: #444444; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: verdana, arial, helvetica, sans-serif; line-height: 18px; background-color: #ffffff;">Increasing productivity</h2>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">To increase productivity of IntelliJ IDEA, you can change settings that reside in the following locations (depending on your operating system):</p>
<ul style="margin: 0px; padding: 0px; list-style-position: inside; list-style-image: initial; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">
    <li style="margin: 0px; padding: 0px;">On Windows systems:
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">&lt;IntelliJ IDEA installation folder&gt;/bin/idea.exe.vmoptions
    </pre>
    </div>
    or
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">&lt;IntelliJ IDEA installation folder&gt;/bin/idea64.exe.vmoptions
    </pre>
    </div>
    </li>
    <li style="margin: 0px; padding: 0px;">On *NIX systems:
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">&lt;IntelliJ IDEA installation folder&gt;/bin/idea.vmoptions
    </pre>
    </div>
    or
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">&lt;IntelliJ IDEA installation folder&gt;/bin/idea64.vmoptions
    </pre>
    </div>
    </li>
    <li style="margin: 0px; padding: 0px;">On Mac OS:
    <p style="margin: 10px 0px; padding: 0px;"><a name="heapsize" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a>Since version 12:<br />
    The file&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">/Applications/IntelliJ IDEA.app/bin/idea.vmoptions</span>&nbsp;should be copied to</p>
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">~/Library/Preferences/IntelliJIdeaXX/idea.vmoptions</pre>
    </div>
    </li>
</ul>
<a name="d415153e203" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a>
<h3 style="margin: 15px 0px 5px; padding: 0px; font-size: 13px; color: #444444; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: verdana, arial, helvetica, sans-serif; line-height: 18px; background-color: #ffffff;">Example. increasing heap size</h3>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">For example, to increase IntelliJ IDEA heap size, you should copy the original .vmoptions file from&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">/Applications/IntelliJ IDEA.app/bin/idea.vmoptions</span>&nbsp;to<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/Library/Preferences/IntelliJIdeaXX/idea.vmoptions</span>, then modify the -Xmx setting.</p>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">For the older versions, the settings are stored in:</p>
<div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace; font-size: 11px; line-height: 18px;">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">                    /Applications/IntelliJ IDEA.app/Contents/Info.plist
</pre>
</div>
<a name="d415153e222" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a>
<h2 style="margin: 15px 0px 5px; padding: 0px; font-size: 14px; color: #444444; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #cccccc; font-family: verdana, arial, helvetica, sans-serif; line-height: 18px; background-color: #ffffff;">Managing case of unicode literals</h2>
<a name="unicode" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a>
<div class="sinceversiondif" style="margin: 0px 5px 0px 0px; font-size: 9px; color: #888888; font-family: verdana, arial, helvetica, sans-serif; line-height: 18px; background-color: #ffffff;">11.1+</div>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">IntelliJ IDEA allows defining whether non-ascii characters should use literals like&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">'\u00AB'</span>&nbsp;or&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">'\00ab'</span>.</p>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">This behavior is controlled by the system property&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">idea.native2ascii.lowercase</span>. By default, upper case characters are used.</p>
<p style="margin: 10px 0px; padding: 0px; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">If it is desirable to use lower case characters, do the following (depending on your platform)</p>
<ul style="margin: 0px; padding: 0px; list-style-position: inside; list-style-image: initial; font-family: verdana, arial, helvetica, sans-serif; font-size: 11px; line-height: 18px; background-color: #ffffff;">
    <li style="margin: 0px; padding: 0px;"><a name="unicode1" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a><span class="sinceversiondif" style="font-size: 9px; margin-right: 5px; color: #888888;">12.0+</span>On Windows and *NIX: add the line
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">    idea.native2ascii.lowercase=true
    </pre>
    </div>
    <p style="margin: 10px 0px; padding: 0px;">to the&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">bin/idea.properties</span>&nbsp;file, located under the product installation.</p>
    </li>
    <li style="margin: 0px; padding: 0px;"><a name="unicode2" style="width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a>&nbsp;On Mac OS:
    <p style="margin: 10px 0px; padding: 0px;">Copy the file&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">/Applications/IntelliJ IDEA.app/bin/idea.properties</span>&nbsp;to&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">~/Library/Preferences/IntelliJIdeaXX/</span>, open it for editing, and add the line</p>
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">    idea.native2ascii.lowercase=true
    </pre>
    </div>
    <p style="margin: 10px 0px; padding: 0px;"></p>
    <p style="margin: 10px 0px; padding: 0px;">It is essential to create a copy, since the settings are replaced rather than added.</p>
    <p style="margin: 10px 0px; padding: 0px;">For the older versions of IntelliJ IDEA, open for editing the file&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">/Applications/IntelliJ IDEA.app/Contents/Info.plist</span>, and add the following code:</p>
    <div class="codeEx" style="margin: 0px; padding: 5px 10px; background-color: #f3f3f3; border-left-color: #cccccc; font-family: 'Courier New', Courier, monospace;">
    <pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px;">    &lt;key&gt;idea.native2ascii.lowercase&lt;/key&gt;
    &lt;string&gt;true&lt;/string&gt;
    </pre>
    </div>
    <p style="margin: 10px 0px; padding: 0px;">to the section&nbsp;<span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;">&lt;key&gt;Properties&lt;/key&gt; &lt;dict&gt; ... &lt;dict&gt;</span></p>
    <p style="margin: 10px 0px; padding: 0px;"><span class="ijInlineCode" style="font-family: 'Courier New', Courier, monospace; font-size: 12px;"><br />
    </span></p>
    </li>
</ul>
</code></div>
<div>To change IDEA running JDK, set &lt;<code>JVMVersion&gt;&nbsp;</code><span style="font-family: Times; font-size: medium;">&nbsp;to&nbsp;</span><code>1.7*</code><span style="font-family: Times; font-size: medium;">&nbsp;in&nbsp;</span><span style="font-family: verdana, 'courier new';">/Applications/IntelliJ IDEA 13.app/Contents/</span><span style="font-family: verdana, 'courier new';">Info.plist</span></div>
<div><code><br />
</code></div>
<div><code><br />
</code></div>
<div><code>VM arguments settings:</code></div>
<div><code><br />
</code></div>
<div><code><br />
</code></div>
<div><code>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-Xms512m&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-Xmx512m&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-Xmn164m&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-XX:MaxPermSize=250m&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-XX:ReservedCodeCacheSize=64m&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-Xverify:none&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-Xnoclassgc&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-XX:+UseParNewGC&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-XX:+UseConcMarkSweepGC&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-XX:CMSInitiatingOccupancyFraction=<span class="number" style="color: #c00000;">85</span>&nbsp;&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;">-ea&nbsp;</span></li>
<li style="font-size: 12px; margin: 0px 0px 0px 38px; padding: 0px 0px 0px 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; color: #2b91af; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace;"><span style="color: black;"><br />
</span></li>
</code></div>
</code><img src ="http://www.blogjava.net/zhangwei217245/aggbug/411109.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2014-03-16 23:03 <a href="http://www.blogjava.net/zhangwei217245/archive/2014/03/16/411109.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>5 Ways To Burn Out Programming</title><link>http://www.blogjava.net/zhangwei217245/archive/2014/02/12/409792.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Wed, 12 Feb 2014 15:38:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2014/02/12/409792.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/409792.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2014/02/12/409792.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/409792.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/409792.html</trackback:ping><description><![CDATA[<a href="http://blog.braegger.pw/5-ways-to-burn-out-programming/">from： http://blog.braegger.pw/5-ways-to-burn-out-programming/</a> <div><h1><br /></h1>          <section>             <p>I've only recently come out of my burnout, despite it  happening years ago.  It sucks.  It sucks bad.  But looking back, I can  see many of the causes crystal clearly, that weren't so apparent at the  time.  Here's a list:</p>  <h3>1. Think about your project and only the project</h3>  <p>Let's face it.  Business wants you to make the best product you can  "for our customers".  You put off fun features for the sake of missing a  deadline.  You plan and analyze and break a project into sets of  deliverables that then must be coded by a monkey (you).  You demo it,  gather feedback, iterate.  All without thinking anything for yourself.</p>  <p>But newsflash: you started programming because you thought it was  fun, why not keep programming because it's fun?  Take that little extra  time to put in a feature you want.  Challenge yourself a little bit in  doing something you didn't think you could.  Show it to everyone you  know, and don't just ask for feedback, but brag about what you've done.</p>  <h3>2. Have a negative attitude toward everything.</h3>  <p>You know Docker? It sucks.  Who would trust their production  environment to a new, unstable, toy. Go? Do I look like I want to write  every library myself? Everything I need is already in PyPI. This project  I'm working on is so caught up in office politics, it's never going to  work. Jenkins? 2008 wants their tech back.</p>  <p>It's really easy to fall into the "being critical" trap. It's easy to  tell other people what the "wrong" choice is. I imagine it's because as  software engineers, our job is so find faults in our applications and  fix them.  And if we don't find them, someone else finds them for us.</p>  <p>But I don't think we need to be negative about our job, decisions  that are being made (even if it's not our decision) and what we're  working on. Some of the best projects I've worked on worked out that way  because we had a great, positive team. <strong>We enjoyed showing up every day  to work, told each other when we did awesome things, held back  heavy-handed criticism and phrased it in a productive manner.</strong></p>  <h3>3. Use the tools you know, because you're faster that way</h3>  <p>So you're an uber expert in Java + Spring + Hibernate.  Nobody can  touch your python skillz.  Every personal project you do should be in  these, because all that matters is the business side of things, right?</p>  <p>Wrong.</p>  <p>While it definitely makes good business sense, you should prototype,  play around, and become an expert in new tech, even if it's unvetted.   While this might seem like obvious advice (it's repeated alllll the  time), it becomes a lot harder to do as you grow more experienced.</p>  <h3>4. Switch jobs often</h3>  <p>Otherwise known as "chasing butterflies".  Getting bored with what  you're working on?  Have an itch? Time to dust off that resume!</p>  <p>This is bad, bad, bad.</p>  <p>When you have several short employments, it can usually help boost your salary quite a bit, but you are robbing yourself of:</p>  <ol><li>Growing in the company (developer -&gt; manager -&gt; director)  </li><li>Gaining an expertise in a specific area.  Considering it takes 4-6  years for a PhD student to get their PhD, that's a lot of time you need  for learnin.  </li><li>You are having to start from scratch often.  </li><li>If you are a good developer, you have to "prove" yourself (people listen to you) all over again.</li></ol>  <p>So how do these contribute to burnout? Your career stagnates, you  don't develop your skills as deeply (only breadth), people dont trust  you'll stay employed for a while, and you're constantly having to prove  yourself.</p>  <h3>5. Work long hours, ignore your life</h3>  <p>"You don't have to work a lot of hours, but some people choose to."  You want to impress your boss.  Hell, you want to impress yourself. So  you go die-hard to meet an impossible deadline. You delivered the  project on time, with all the extra features you wanted. You are the  hero. High fives all around. And if you're lucky, you'll get that bonus.</p>  <p>That's great the first time. But how about the second. And the third. It's a bomb, and you dont know how short the fuse is.</p>  <h3>Summary</h3>  <p>In short, it's easy to burnout. Do these 5 things, and you can burnout too.</p>         </section></div><img src ="http://www.blogjava.net/zhangwei217245/aggbug/409792.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2014-02-12 23:38 <a href="http://www.blogjava.net/zhangwei217245/archive/2014/02/12/409792.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【Efficiency】快速配置ubuntu桌面环境之Java环境配置[全软件源安装]</title><link>http://www.blogjava.net/zhangwei217245/archive/2014/01/11/409716.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Sat, 11 Jan 2014 03:42:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2014/01/11/409716.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/409716.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2014/01/11/409716.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/409716.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/409716.html</trackback:ping><description><![CDATA[<br />
<div>0.  安装一系列支持工具<br />
<br />
网络工具wget、curl、axel等<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;wget&nbsp;curl&nbsp;axel</span></div>
</div>
<br />
其他常见工具<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;subversion&nbsp;git&nbsp;sysstat&nbsp;linux</span><span style="color: #000000; ">-</span><span style="color: #000000; ">base&nbsp;linux</span><span style="color: #000000; ">-</span><span style="color: #000000; ">tools-generic build-essential vim&nbsp;emacs&nbsp;unrar&nbsp;p7zip&nbsp;synaptic</span></div>
</div>
<br />
安装常用数据库和NoSQL<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;mysql</span><span style="color: #000000; ">-</span><span style="color: #000000; ">client&nbsp;mysql</span><span style="color: #000000; ">-</span><span style="color: #000000; ">server&nbsp;mysql</span><span style="color: #000000; ">-</span><span style="color: #000000; ">workbench&nbsp;memcached&nbsp;redis</span><span style="color: #000000; ">-</span><span style="color: #000000; ">server</span></div>
</div>
<br />
<br />
1.  首先添加webupd8的java源：<br />
<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">sudo&nbsp;add</span><span style="color: #000000; ">-</span><span style="color: #000000; ">apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">repository&nbsp;ppa</span><span style="color: #000000; ">:</span><span style="color: #000000; ">webupd8team</span><span style="color: #000000; ">/</span><span style="color: #000000; ">java</span></div>
</div>
<br />
<br />
2.  更新源中的软件数据：<br />
<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;update</span></div>
</div>
<br />
<br />
3.  安装java6或者java7, 当然也可以两者都装<br />
<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;oracle</span><span style="color: #000000; ">-</span><span style="color: #000000; ">java8</span><span style="color: #000000; ">-</span><span style="color: #000000; ">installer<br />
sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;oracle</span><span style="color: #000000; ">-</span><span style="color: #000000; ">java9</span><span style="color: #000000; ">-</span><span style="color: #000000; ">installer</span></div>
</div>
<br />
<br />
4.  安装maven和ant<br />
<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;maven&nbsp;ant</span></div>
</div>
<br />
本方法在UBUNTU 13.04版本中默认安装的是maven 3.0.4版本和ant 1.8版本。如有特殊版本嗜好，请自行到apache.org下载安装。<br />
<br />
5.  配置Maven<br />
<br />
功夫网内用户可参照下面的链接进行配置：<br />
<br />
<a href="http://maven.oschina.net/help.html">http://maven.oschina.net/help.html</a><br />
<br />
其他地区用户可自行到股沟上问百度。<br />
<br />
6. 下载安装一种主流 JAVA IDE。&nbsp;</div>
<div><br />
</div>
<div>（1） 下载安装 IntelliJ IDEA</div>
<div><br />
</div>
<div>访问， 根据需要选择版本。推荐选择Free 30-day trial的Ultimate版本，至于激活码嘛，问度娘，你懂的~</div>
<div><br />
</div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->axel&nbsp;-n&nbsp;<span style="color: #800000; ">10</span>&nbsp;<span style="font-weight: bold;">"</span><span style="font-weight: bold;">http://download.jetbrains.com/idea/ideaIU-14.1.3.tar.gz</span><span style="font-weight: bold;">"</span><br />
<br />
tar&nbsp;xzvf&nbsp;ideaIU-<span style="color: #800000; ">14.1</span>.<span style="color: #800000; ">3</span>.tar.gz<br />
<br />
cd&nbsp;idea-IU-<span style="color: #800000; ">141.1010</span>.<span style="color: #800000; ">3</span>/bin<br />
<br />
sh&nbsp;idea.sh<br />
<br />
</div>
</div>
<div>最后要提醒一句。对于在校学生，拥有.edu邮箱的朋友，可以用你们的.edu邮箱获取一年的jetbrains旗下所有IDE产品的一年免费使用权。详见</div>
<div>https://www.jetbrains.com/student/</div>
<div>一年过后，只要你的邮箱还能用，可以再次申请。</div>
<div><br />
</div>
<div><br />
（2） 下载安装eclipse IDE。（alternative step）<br />
<br />
访问http://www.eclipse.org/downloads/，根据需要选择IDE版本。推荐选择Eclipse IDE for Java EE Developers版本。可以根据系统情况选择安装32位或者64位<br />
这里以下载64位为例<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; "></span><span style="color: #000000; "><br /></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">axel&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">n&nbsp;</span><span style="color: #800000; ">10</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; font-weight: bold; ">"</span><span style="color: #000000; font-weight: bold; ">http://ftp.daum.net/eclipse//technology/epp/downloads/release/mars/R/eclipse-jee-mars-R-linux-gtk-x86_64.tar.gz</span><span style="color: #000000; font-weight: bold; ">"</span></div><span style="color: #000000; ">tar&nbsp;</span><span style="color: #000000; ">-</span>zxvf&nbsp;</div><div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><span style="color: #000000; "><div><strong>&nbsp;eclipse-jee-luna-SR2-linux-gtk-x86_64.tar.gz</strong></div></span></div>
</div>
<br />
<br />
然后就是自己创建快捷方式到桌面之类的。<br />
<br />
（3） 下载netbeans IDE. （alternative step）<br />
<br />
访问www.netbeans.org，然后找到下载地址。<br />
这里以下载8.0.2版本为例：<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">axel&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">n&nbsp;</span><span style="color: #800000; ">10</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; font-weight: bold; ">"</span><strong>http://dlc-cdn.sun.com/netbeans/8.0.2/final/bundles/netbeans-8.0.2-linux.sh</strong><span style="color: #000000; font-weight: bold; ">"</span><span style="color: #000000; "><br />
sh&nbsp;</span>netbeans-8.0.2-linux.sh</div>
</div>
<br />
<br />
把netbeans配置为全屏反锯齿模式：<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">cp&nbsp;netbeans</span><span style="color: #000000; ">.</span><span style="color: #000000; ">conf&nbsp;netbeans</span><span style="color: #000000; ">.</span><span style="color: #000000; ">conf</span><span style="color: #000000; ">.</span><span style="color: #000000; ">bak;&nbsp;awk&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">F</span><span style="color: #000000; font-weight: bold; ">'</span><span style="color: #000000; font-weight: bold; ">=</span><span style="color: #000000; font-weight: bold; ">'</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; font-weight: bold; ">'</span><span style="color: #000000; font-weight: bold; ">{if($1=="netbeans_default_options"){print&nbsp;index($0,"useSystemAAFontSettings")?$0:substr($0,0,length($0))"&nbsp;-J-Dawt.useSystemAAFontSettings=on\""}else{print&nbsp;$0}}</span><span style="color: #000000; font-weight: bold; ">'</span><span style="color: #000000; ">&nbsp;netbeans</span><span style="color: #000000; ">.</span><span style="color: #000000; ">conf</span><span style="color: #000000; ">.</span><span style="color: #000000; ">bak&nbsp;</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">&nbsp;netbeans</span><span style="color: #000000; ">.</span><span style="color: #000000; ">conf</span></div>
</div>
<br />
<br />
<br />
<br />
7.  如果想做快速原型或者玩一玩的话，也可以安装一下nodejs。很有意思。<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">sudo&nbsp;curl&nbsp;</span><span style="color: #000000; ">--</span><span style="color: #000000; ">silent&nbsp;</span><span style="color: #000000; ">--</span><span style="color: #000000; ">location&nbsp;https</span><span style="color: #000000; ">://</span><span style="color: #000000; ">deb</span><span style="color: #000000; ">.</span><span style="color: #000000; ">nodesource</span><span style="color: #000000; ">.</span><span style="color: #000000; ">com</span><span style="color: #000000; ">/</span><span style="color: #000000; ">setup_0</span><span style="color: #000000; ">.</span><span style="color: #800000; ">12</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">|</span><span style="color: #000000; ">&nbsp;sudo&nbsp;bash&nbsp;</span><span style="color: #000000; ">-</span></div><span style="color: #000000; "><br />sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;nodejs</span></div>
</div>
<br />
<br />
8.  GraphDB 最近很火。装个neo4j试试看。<br />
<div><strong>代码:</strong></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000; ">wget&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">O&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; ">&nbsp;http</span><span style="color: #000000; ">://</span><span style="color: #000000; ">debian</span><span style="color: #000000; ">.</span><span style="color: #000000; ">neo4j</span><span style="color: #000000; ">.</span><span style="color: #000000; ">org</span><span style="color: #000000; ">/</span><span style="color: #000000; ">neotechnology</span><span style="color: #000000; ">.</span><span style="color: #000000; ">gpg</span><span style="color: #000000; ">.</span><span style="color: #000000; ">key&nbsp;</span><span style="color: #000000; ">|</span><span style="color: #000000; ">&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">key&nbsp;add&nbsp;</span><span style="color: #000000; ">-</span><span style="color: #000000; "><br />
sudo echo&nbsp;</span><span style="color: #000000; font-weight: bold; ">'</span><span style="color: #000000; font-weight: bold; ">deb&nbsp;http://debian.neo4j.org/repo&nbsp;stable/</span><span style="color: #000000; font-weight: bold; ">'</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">&nbsp;</span><span style="color: #000000; ">/</span><span style="color: #000000; ">etc</span><span style="color: #000000; ">/</span><span style="color: #000000; ">apt</span><span style="color: #000000; ">/</span><span style="color: #000000; ">sources</span><span style="color: #000000; ">.</span><span style="color: #000000; ">list</span><span style="color: #000000; ">.</span><span style="color: #000000; ">d</span><span style="color: #000000; ">/</span><span style="color: #000000; ">neo4j</span><span style="color: #000000; ">.</span><span style="color: #000000; ">list<br />
sudo apt-get update<br />
sudo&nbsp;apt</span><span style="color: #000000; ">-</span><span style="color: #000000; ">get&nbsp;install&nbsp;neo4j</span></div>
</div>
</div><img src ="http://www.blogjava.net/zhangwei217245/aggbug/409716.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2014-01-11 11:42 <a href="http://www.blogjava.net/zhangwei217245/archive/2014/01/11/409716.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【Efficiency】MAC下使用设定可以从mission control中启动的eclipse.app。</title><link>http://www.blogjava.net/zhangwei217245/archive/2013/02/25/410286.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Mon, 25 Feb 2013 06:53:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2013/02/25/410286.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/410286.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2013/02/25/410286.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/410286.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/410286.html</trackback:ping><description><![CDATA[@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&amp;file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">eclipse官方是有标准的mac版下载的，随便copy到一个目录就可以直接启动了(当然必须安装java运行环境)。但是，假如我们想把应用放到mac的标准目录下(也就是finder里的应用程序目录下)，就必须自己手动来做了，方法如下：</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">1.在finder下，copy eclipse目录下的Eclipse.app(在finder里是看不到app这个后缀名的，必须用Command+i，才能看到这个后缀名)文件到&#8220;应用程序&#8221;</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">2.然后，点击右键，选择&#8220;显示包内容&#8221;</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;"><img src="" alt="" style="border: none; max-width: 100%;" /><img src="http://img.blog.csdn.net/20130914220143781?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2FuZ2ppYW41NzQ4/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" style="border: none; max-width: 100%;" /><br />
</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">3.修改eclipse.ini文件</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;"><img src="http://img.blog.csdn.net/20130914220153250?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd2FuZ2ppYW41NzQ4/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" style="border: none; max-width: 100%;" /><br />
</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;"><img src="" alt="" style="border: none; max-width: 100%;" /><br />
</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">修改文件的开头部分</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">原始内容为：</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">-startup&nbsp;../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar<br />
--launcher.library&nbsp;../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20130521-0416<br />
</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">修改后的内容为：</p>
<span style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">-startup /Users/johnny/work/eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar</span>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">--launcher.library&nbsp;/Users/johnny/work/eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20130521-0416<br />
</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">我mac的用户名johnny，在我的用户名下有个work目录，我把eclipse的原始目录放在work下面。</p>
<p style="color: #362e2b; font-family: Arial; line-height: 26px; background-color: #ffffff;">这样就可以在&#8220;应用程序&#8221;下，启动eclipse了</p>
@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&amp;file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);<img src ="http://www.blogjava.net/zhangwei217245/aggbug/410286.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2013-02-25 14:53 <a href="http://www.blogjava.net/zhangwei217245/archive/2013/02/25/410286.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【Effective】如何迁移git仓库</title><link>http://www.blogjava.net/zhangwei217245/archive/2012/11/12/409785.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Mon, 12 Nov 2012 10:58:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2012/11/12/409785.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/409785.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2012/11/12/409785.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/409785.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/409785.html</trackback:ping><description><![CDATA[<div><div post-content"="">                     <p>from:&nbsp; </p><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://segmentfault.com/q/1010000000124379</div><br /><p>&nbsp;</p><p><br /></p><p>如果你想从别的 Git 托管服务那里复制一份源代码到新的 Git 托管服务器上的话，可以通过以下步骤来操作。</p><p>1). 从原地址克隆一份裸版本库，比如原本托管于 GitHub。</p><p>git clone --bare git://github.com/username/project.git</p><p>2). 然后到新的 Git 服务器上创建一个新项目，比如 GitCafe。</p><p>3). 以镜像推送的方式上传代码到 GitCafe 服务器上。</p><p>cd project.git</p><p>git push --mirror git@gitcafe.com/username/newproject.git</p><p>4). 删除本地代码</p><p>cd ..</p><p>rm -rf project.git</p><p>5). 到新服务器 GitCafe 上找到 Clone 地址，直接 Clone 到本地就可以了。</p><p>git clone git@gitcafe.com/username/newproject.git</p><p>这种方式可以保留原版本库中的所有内容。</p>                </div></div><br /><div></div><img src ="http://www.blogjava.net/zhangwei217245/aggbug/409785.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2012-11-12 18:58 <a href="http://www.blogjava.net/zhangwei217245/archive/2012/11/12/409785.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【转】阅读我们的学科——计算机专业学习浅谈</title><link>http://www.blogjava.net/zhangwei217245/archive/2012/10/04/389041.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Thu, 04 Oct 2012 13:54:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2012/10/04/389041.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/389041.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2012/10/04/389041.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/389041.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/389041.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;&nbsp;<a href='http://www.blogjava.net/zhangwei217245/archive/2012/10/04/389041.html'>阅读全文</a><img src ="http://www.blogjava.net/zhangwei217245/aggbug/389041.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2012-10-04 21:54 <a href="http://www.blogjava.net/zhangwei217245/archive/2012/10/04/389041.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【Tech Details】【转】有关Java SPI机制</title><link>http://www.blogjava.net/zhangwei217245/archive/2012/03/03/410530.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Sat, 03 Mar 2012 03:34:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2012/03/03/410530.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/410530.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2012/03/03/410530.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/410530.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/410530.html</trackback:ping><description><![CDATA[@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
<div><span style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</span></div>
<span style="font-family: Arial; line-height: 26px; background-color: #ffffff;">
<div>转自：http://blog.csdn.net/fenglibing/article/details/7083071</div>
<div><span style="font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</span></div>
一个服务(service)通常指的是已知的接口或者抽象类，服务提供方就是对这个接口或者抽象类的实现，然后按spi标准存放到资源路径META-INF/services目录下，文件的命名为该服务接口的全限定名。如有一个服务接口com.test.Service，其服务实现类为com.test.ChildService，那此时需要在META-INF/services中放置文件com.test.Service，其中的内容就为该实现类的全限定名com.test.ChildService，有多个服务实现，每一行写一个服务实现，#后面的内容为注释，并且该文件只能够是以UTF-8编码。</span><br style="font-family: Arial; line-height: 26px; background-color: #ffffff;" />
<span style="font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 这种实现方式，感觉和我们通常的开发方式差不多，都是定义一个接口，然后子类实现父类中定义的方法，为什么要搞这么一套标准以及单独搞一个配置文件？这种方式主要是针对不同的服务提供厂商，对不同场景的提供不同的解决方案制定的一套标准，举个简单的例子，如现在的JDK中有支持音乐播放，假设只支持mp3的播放，有些厂商想在这个基础之上支持mp4的播放，有的想支持mp5，而这些厂商都是第三方厂商，如果没有提供SPI这种实现标准，那就只有修改JAVA的源代码了，那这个弊端也是显而易见的，也就是不能够随着JDK的升级而升级现在的应用了，而有了SPI标准，SUN公司只需要提供一个播放接口，在实现播放的功能上通过ServiceLoad的方式加载服务，那么第三方只需要实现这个播放接口，再按SPI标准进行打包成jar，再放到classpath下面就OK了，没有一点代码的侵入性。</span><br style="font-family: Arial; line-height: 26px; background-color: #ffffff;" />
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 以下是找到的几篇文章：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 1、<a href="http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html" target="_blank" style="color: #ca0000; text-decoration: none;">http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html</a>，这个是官方的文档，有对service的详细介绍，包括规范以及一个简单的示例，这个是学习SPI必须看的文档；</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 注：<a href="http://docs.oracle.com/javase/1.4.2/docs/guide/jar/jar.html#Service%20Provider" style="color: #ca0000; text-decoration: none;">http://docs.oracle.com/javase/1.4.2/docs/guide/jar/jar.html#Service%20Provider</a>，这个是1.4中对Service Provider的介绍，加载服务是通过sun.misc.Service进行加载的，这个也有相应的示例，照做就OK；</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 2、Java的SPI机制：<a href="http://www.2cto.com/kf/201012/79868.html" target="_blank" style="color: #ca0000; text-decoration: none;">http://www.2cto.com/kf/201012/79868.html</a>，这个是国人写的一篇示例文章，也挺不错，里面也有一个简单的示例；</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 3、Developing a Service Provider using Java API(Service Provider Interface)：<a href="http://blog.csdn.net/fenglibing/article/details/7083526" style="color: #ca0000; text-decoration: none;">http://blog.csdn.net/fenglibing/article/details/7083526</a>，这篇文章是转的alexa发表在blogspot上面的，也是一个开发SPI的示例，有兴趣的也可以看看；</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 4、Add Mp3 capabilities to Java Sound with SPI：<a href="http://www.javaworld.com/javaworld/jw-11-2000/jw-1103-mp3.html" target="_blank" style="color: #ca0000; text-decoration: none;">http://www.javaworld.com/javaworld/jw-11-2000/jw-1103-mp3.html</a>，这是一个比较老的例子，基于jdk1.3的，因为在jdk1.3的时候还没有支持mp3格式，只支持AU, AIF, MIDI, and WAV等格式，也是一个值得参考的示例。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">&nbsp; &nbsp; 我这边也写了一个简单得不能够再简单的示例，源码可以这里下载：<a href="http://download.csdn.net/detail/fenglibing/3939882" style="color: #ca0000; text-decoration: none;">http://download.csdn.net/detail/fenglibing/3939882</a></p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">最后很重要一点：</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">如果想要覆盖某个Provider，可以在对应的META-INF/services的配置文件中加上新service的一行，或者也可以写在另一个有依赖关系的jar包中，只要和原来的Provider命名不同即可。加载顺序上可以考虑使用@Priority注解来调整加载的优先级。</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</p>
<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br />
</p>
@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&amp;file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);<img src ="http://www.blogjava.net/zhangwei217245/aggbug/410530.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2012-03-03 11:34 <a href="http://www.blogjava.net/zhangwei217245/archive/2012/03/03/410530.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【Efficiency】 监控 Linux 性能的 18 个命令行工具</title><link>http://www.blogjava.net/zhangwei217245/archive/2012/02/19/410062.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Sun, 19 Feb 2012 14:16:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2012/02/19/410062.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/410062.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2012/02/19/410062.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/410062.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/410062.html</trackback:ping><description><![CDATA[<div><div> <p>转自：</p><div>http://blog.jobbole.com/59790/</div><br /><p>&nbsp;</p><p><br /></p><p>对于系统和网络管理员来说每天监控和调试Linux系统的性能问题是一项繁重的工作。在IT领域作为一名Linux系统的管理员工作5年后，我逐渐  认识到监控和保持系统启动并运行是多么的不容易。基于此原因，我们已编写了最常使用的18个命令行工具列表，这些工具将有助于每个Linux/Unix   系统管理员的工作。这些命令行工具可以在各种Linux系统下使用，可以用于监控和查找产生性能问题的原因。这个命令行工具列表提供了足够的工具，您可以  挑选适用于您的监控场景的工具。</p> <h2>1.Top-Linux进程监控</h2> <p>Linux下的Top命令是一个性能监控程序，许多系统管理员常常用它来监控Linux性能，在许多<strong>Linux或者类Unix</strong>操作系统里都有这个命令。Top命令用于按一定的顺序显示所有正在运行而且处于活动状态的实时进程，而且会定期更新显示结果。这条命令显示了<strong>CPU的使用率、内存使用率、交换内存使用大小、高速缓存使用大小、缓冲区使用大小，进程PID、所使用命令</strong>以及其他。它还可以显示正在运行进程的内存和CPU占用多的情况。对系统管理员来说，top命令式是一个非常有用的，它可用于监控系统并在需要的时候采取正确的处理动作。让我们看看实际中的top命令。</p> <pre>#&nbsp;top</pre> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/8c4c78b47cb9e489308352f7e0743c78.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img wp-image-59800"="" alt="13115558_AIkI" src="http://jbcdn2.b0.upaiyun.com/2014/02/8c4c78b47cb9e489308352f7e0743c78.jpg" height="387" width="567" /></a><br /> Top命令举例<br /> <strong>有关Top命令更多的例子，请阅读</strong> <a href="http://www.tecmint.com/12-top-command-examples-in-linux/" target="_blank" rel="nofollow">:Linux下12个使用Top命令的例子</a>。</p> <h3>2. VmStat &#8211; 虚拟内存统计</h3> <p>Linux 的&nbsp;<strong>VmStat</strong>&nbsp;命令用于显示<strong>虚拟内存</strong>、<strong>内核线程</strong>、<strong>磁盘</strong>、<strong>系统进程</strong>、<strong>I/O 块</strong>、<strong>中断</strong>、<strong>CPU 活动</strong> 等的统计信息。缺省情况下， vmstat 命令在 Linux 系统下不可用，你需要安装一个包含了 vmstat 程序的&nbsp;<strong>sysstat</strong>&nbsp;软件包。命令格式的常见用法是：</p> <div><div id="highlighter_618773" notranslate=""  text"=""><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0=""  alt2"="">1</div><div number2="" index1=""  alt1"="">2</div><div number3="" index2=""  alt2"="">3</div><div number4="" index3=""  alt1"="">4</div></td><td><div><div number1="" index0=""  alt2"=""><code plain"="">#&nbsp;vmstat</code></div><div number2="" index1=""  alt1"=""><code plain"="">procs&nbsp;-----------memory----------&nbsp;---swap--&nbsp;-----io----&nbsp;--system--&nbsp;-----cpu-----</code></div><div number3="" index2=""  alt2"=""><code spaces"="">&nbsp;</code><code plain"="">r&nbsp;&nbsp;b&nbsp;&nbsp;&nbsp;swpd&nbsp;&nbsp;&nbsp;free&nbsp;&nbsp;inact&nbsp;active&nbsp;&nbsp;&nbsp;si&nbsp;&nbsp;&nbsp;so&nbsp;&nbsp;&nbsp;&nbsp;bi&nbsp;&nbsp;&nbsp;&nbsp;bo&nbsp;&nbsp;&nbsp;in&nbsp;&nbsp;&nbsp;cs&nbsp;us&nbsp;sy&nbsp;id&nbsp;wa&nbsp;st</code></div><div number4="" index3=""  alt1"=""><code spaces"="">&nbsp;</code><code plain"="">1&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;810420&nbsp;&nbsp;97380&nbsp;&nbsp;70628&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;89&nbsp;&nbsp;&nbsp;79&nbsp;&nbsp;1&nbsp;&nbsp;6&nbsp;90&nbsp;&nbsp;3&nbsp;&nbsp;0</code></div></div></td></tr></tbody></table></div></div> <p><strong>更多的 vmstat 例子，请阅读 :</strong> <a href="http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/" target="_blank" rel="nofollow">6 Linux 下的 Vmstat 命令实例</a></p> <h2>3.Lsof-列出打开的文件</h2> <p>在许多Linux或者类Unix系统里都有lsof命令，它常用于以列表的形式显示所有打开的文件和进程。打开的文件包括<strong>磁盘文件、网络套接字、管道、设备和进程</strong>。使用这条命令的主要情形之一就是在无法挂载磁盘和显示正在使用或者打开某个文件的错误信息的时候。使用这条命令，你可以很容易地看到正在使用哪个文件。这条命令最常用的格式如下：</p> <div><div id="highlighter_516830" notranslate=""  text"=""><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0=""  alt2"="">1</div><div number2="" index1=""  alt1"="">2</div><div number3="" index2=""  alt2"="">3</div><div number4="" index3=""  alt1"="">4</div><div number5="" index4=""  alt2"="">5</div><div number6="" index5=""  alt1"="">6</div><div number7="" index6=""  alt2"="">7</div><div number8="" index7=""  alt1"="">8</div><div number9="" index8=""  alt2"="">9</div><div number10="" index9=""  alt1"="">10</div><div number11="" index10=""  alt2"="">11</div></td><td><div><div number1="" index0=""  alt2"=""><code plain"="">#&nbsp;lsof</code></div><div number2="" index1=""  alt1"=""><code plain"="">COMMAND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;USER&nbsp;&nbsp;&nbsp;FD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DEVICE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NODE&nbsp;NAME</code></div><div number3="" index2=""  alt2"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;cwd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;/</code></div><div number4="" index3=""  alt1"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;rtd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DIR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;/</code></div><div number5="" index4=""  alt2"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;&nbsp;&nbsp;38652&nbsp;&nbsp;&nbsp;17710339&nbsp;/sbin/init</code></div><div number6="" index5=""  alt1"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;mem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;&nbsp;129900&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;196453&nbsp;/lib/ld-2.5.so</code></div><div number7="" index6=""  alt2"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;mem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;1693812&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;196454&nbsp;/lib/libc-2.5.so</code></div><div number8="" index7=""  alt1"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;mem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;&nbsp;&nbsp;20668&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;196479&nbsp;/lib/libdl-2.5.so</code></div><div number9="" index8=""  alt2"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;mem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;&nbsp;245376&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;196419&nbsp;/lib/libsepol.so.1</code></div><div number10="" index9=""  alt1"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;mem&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;104,2&nbsp;&nbsp;&nbsp;&nbsp;93508&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;196431&nbsp;/lib/libselinux.so.1</code></div><div number11="" index10=""  alt2"=""><code plain"="">init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;10u&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FIFO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0,17&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;953&nbsp;/dev/initctl</code></div></div></td></tr></tbody></table></div></div> <p><strong>有关lsof命令的用法和例子的更多信息，请参考</strong>： <a href="http://www.tecmint.com/10-lsof-command-examples-in-linux/" target="_blank" rel="nofollow">Linux下10个使用lsof命令的例子</a>。</p> <h2>4.Tcpdump-网络包分析器</h2> <p><strong>Tcpdump</strong>是最广泛使用的<strong>网络包分析器或者包监控程序</strong>之一，它用于捕捉或者过滤网络上指定接口上接收或者传输的<strong>TCP/IP</strong>包。它还有一个选项用于把捕捉到的包保存到文件里，以便以后进行分析。在几乎所有主要的Linux发布里，tcpdump都可以使用。</p> <div><div id="highlighter_610664" notranslate=""  text"=""><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0=""  alt2"="">1</div><div number2="" index1=""  alt1"="">2</div><div number3="" index2=""  alt2"="">3</div><div number4="" index3=""  alt1"="">4</div><div number5="" index4=""  alt2"="">5</div></td><td><div><div number1="" index0=""  alt2"=""><code plain"="">#&nbsp;tcpdump&nbsp;-i&nbsp;eth0tcpdump:&nbsp;verbose&nbsp;output&nbsp;suppressed,&nbsp;use&nbsp;-v&nbsp;or&nbsp;-vv&nbsp;for&nbsp;full&nbsp;protocol&nbsp;decode</code></div><div number2="" index1=""  alt1"=""><code plain"="">listening&nbsp;on&nbsp;eth0,&nbsp;link-type&nbsp;EN10MB&nbsp;(Ethernet),&nbsp;capture&nbsp;size&nbsp;96&nbsp;bytes</code></div><div number3="" index2=""  alt2"=""><code plain"="">22:08:59.617628&nbsp;IP&nbsp;tecmint.com.ssh&nbsp;&gt;&nbsp;115.113.134.3.static-mumbai.vsnl.net.in.28472:&nbsp;P&nbsp;2532133365:2532133481(116)&nbsp;ack&nbsp;3561562349&nbsp;win&nbsp;9648</code></div><div number4="" index3=""  alt1"=""><code plain"="">22:09:07.653466&nbsp;IP&nbsp;tecmint.com.ssh&nbsp;&gt;&nbsp;115.113.134.3.static-mumbai.vsnl.net.in.28472:&nbsp;P&nbsp;116:232(116)&nbsp;ack&nbsp;1&nbsp;win&nbsp;9648</code></div><div number5="" index4=""  alt2"=""><code plain"="">22:08:59.617916&nbsp;IP&nbsp;115.113.134.3.static-mumbai.vsnl.net.in.28472&nbsp;&gt;&nbsp;tecmint.com.ssh:&nbsp;.&nbsp;ack&nbsp;116&nbsp;win&nbsp;64347</code></div></div></td></tr></tbody></table></div></div> <p><strong>要想获得更多有关tcpdump用法的信息，请参阅</strong>： <a href="http://www.tecmint.com/12-tcpdump-commands-a-network-sniffer-tool/" target="_blank" rel="nofollow">Linux下12个使用Tcpdump命令的例子。</a></p> <h2>5.Netstat-网络状态统计</h2> <p>Netstat是一个用于监控<strong>进出网络</strong>的包和网络接口统计的命令行工具。它是一个非常有用的工具，系统管理员可以用来监控网络性能，定位并解决网络相关问题。</p> <div><div id="highlighter_722394" notranslate=""  text"=""><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0=""  alt2"="">1</div><div number2="" index1=""  alt1"="">2</div><div number3="" index2=""  alt2"="">3</div><div number4="" index3=""  alt1"="">4</div><div number5="" index4=""  alt2"="">5</div><div number6="" index5=""  alt1"="">6</div><div number7="" index6=""  alt2"="">7</div><div number8="" index7=""  alt1"="">8</div><div number9="" index8=""  alt2"="">9</div><div number10="" index9=""  alt1"="">10</div><div number11="" index10=""  alt2"="">11</div><div number12="" index11=""  alt1"="">12</div><div number13="" index12=""  alt2"="">13</div></td><td><div><div number1="" index0=""  alt2"=""><code plain"="">#&nbsp;netstat&nbsp;-a&nbsp;|&nbsp;moreActive&nbsp;Internet&nbsp;connections&nbsp;(servers&nbsp;and&nbsp;established)</code></div><div number2="" index1=""  alt1"=""><code plain"="">Proto&nbsp;Recv-Q&nbsp;Send-Q&nbsp;Local&nbsp;Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Foreign&nbsp;Address&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;State</code></div><div number3="" index2=""  alt2"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:mysql&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number4="" index3=""  alt1"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:sunrpc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number5="" index4=""  alt2"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:realm-rusd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number6="" index5=""  alt1"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:ftp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number7="" index6=""  alt2"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;localhost.localdomain:ipp&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number8="" index7=""  alt1"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;localhost.localdomain:smtp&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number9="" index8=""  alt2"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;localhost.localdomain:smtp&nbsp;&nbsp;localhost.localdomain:42709&nbsp;TIME_WAIT</code></div><div number10="" index9=""  alt1"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;localhost.localdomain:smtp&nbsp;&nbsp;localhost.localdomain:42710&nbsp;TIME_WAIT</code></div><div number11="" index10=""  alt2"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:http&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number12="" index11=""  alt1"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:ssh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div><div number13="" index12=""  alt2"=""><code plain"="">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:https&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN</code></div></div></td></tr></tbody></table></div></div> <p><strong>有关Netstat更多的例子，请参阅</strong>: <a href="http://www.tecmint.com/20-netstat-commands-for-linux-network-management/" target="_blank" rel="nofollow">Linux下20个使用Netstat命令的例子。</a></p> <h3>6. Htop &#8211; Linux进程监控</h3> <p><strong>Htop</strong>&nbsp;是一个非常高级的交互式的实时linux进程监控工具。  它和top命令十分相似，但是它具有更丰富的特性，例如用户可以友好地管理进程，快捷键，垂直和水平方式显示进程等等。  Htop是一个第三方工具，它不包含在linux系统中，你需要使用YUM包管理工具去安装它。 关于安装的更多信息，请阅读下文.</p> <pre>#&nbsp;htop</pre> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/924653ed9558ba162ebdb8ae25551fe9.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img size-full=""  wp-image-59799"="" alt="13115601_fiol" src="http://jbcdn2.b0.upaiyun.com/2014/02/924653ed9558ba162ebdb8ae25551fe9.jpg" /></a></p> <p>Htop 命令示例截图</p> <p><strong>对于Htop的安装，请读&nbsp;: <a href="http://www.tecmint.com/install-htop-linux-process-monitoring-for-rhel-centos-fedora/" target="_blank" rel="nofollow">在Linux安装Htop(Linux进程监控)</a></strong></p> <h2><strong>7.Iotop-监控Linux磁盘I/O</strong></h2> <p><strong>Iotop</strong>命令同样也非常类似于<strong>top</strong><strong>命令</strong>和<strong>Htop程序</strong>，不过它具有监控并显示实时<strong>磁盘I/O和进程</strong>的统计功能。在查找具体进程和大量使用磁盘读写进程的时候，这个工具就非常有用。</p> <pre>#&nbsp;iotop</pre> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/f6ad31e4bfc1f4f2af2de600a9c77012.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img wp-image-59798"="" alt="13115602_F9DG" src="http://jbcdn2.b0.upaiyun.com/2014/02/f6ad31e4bfc1f4f2af2de600a9c77012.jpg" height="378" width="567" /></a>&nbsp;Iotop命令举例的截图<br /> <strong>有关如何安装和使用iotop的信息，请阅读</strong>： <a href="http://www.tecmint.com/install-iotop-monitor-linux-disk-io-in-rhel-centos-and-fedora/" target="_blank" rel="nofollow">在Linux下安装Iotop。</a></p> <h2>8.Iostat-输入/输出统计</h2> <p><strong>Iostat</strong>是一个用于收集显示系统存储设备<strong>输入和输出</strong>状态统计的简单工具。这个工具常常用来追踪存储设备的性能问题，其中存储设备包括<strong>设备、本地磁盘，以及诸如使用NFS等的远端磁盘</strong>。</p> <div><div id="highlighter_781274" notranslate=""  text"=""><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0=""  alt2"="">1</div><div number2="" index1=""  alt1"="">2</div><div number3="" index2=""  alt2"="">3</div><div number4="" index3=""  alt1"="">4</div><div number5="" index4=""  alt2"="">5</div><div number6="" index5=""  alt1"="">6</div><div number7="" index6=""  alt2"="">7</div><div number8="" index7=""  alt1"="">8</div><div number9="" index8=""  alt2"="">9</div><div number10="" index9=""  alt1"="">10</div><div number11="" index10=""  alt2"="">11</div><div number12="" index11=""  alt1"="">12</div><div number13="" index12=""  alt2"="">13</div><div number14="" index13=""  alt1"="">14</div></td><td><div><div number1="" index0=""  alt2"=""><code plain"="">#&nbsp;iostat</code></div><div number2="" index1=""  alt1"=""><code plain"="">Linux&nbsp;2.6.18-238.9.1.el5&nbsp;(tecmint.com)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;09/13/2012</code></div><div number3="" index2=""  alt2"="">&nbsp;</div><div number4="" index3=""  alt1"=""><code plain"="">avg-cpu:&nbsp;&nbsp;%user&nbsp;&nbsp;&nbsp;%nice&nbsp;%system&nbsp;%iowait&nbsp;&nbsp;%steal&nbsp;&nbsp;&nbsp;%idle</code></div><div number5="" index4=""  alt2"=""><code spaces"="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</code><code plain"="">2.60&nbsp;&nbsp;&nbsp;&nbsp;3.65&nbsp;&nbsp;&nbsp;&nbsp;1.04&nbsp;&nbsp;&nbsp;&nbsp;4.29&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;88.42</code></div><div number6="" index5=""  alt1"="">&nbsp;</div><div number7="" index6=""  alt2"=""><code plain"="">Device:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tps&nbsp;&nbsp;&nbsp;Blk_read/s&nbsp;&nbsp;&nbsp;Blk_wrtn/s&nbsp;&nbsp;&nbsp;Blk_read&nbsp;&nbsp;&nbsp;Blk_wrtn</code></div><div number8="" index7=""  alt1"=""><code plain"="">cciss/c0d0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;17.79&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;545.80&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256.52&nbsp;&nbsp;855159769&nbsp;&nbsp;401914750</code></div><div number9="" index8=""  alt2"=""><code plain"="">cciss/c0d0p1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5459&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3518</code></div><div number10="" index9=""  alt1"=""><code plain"="">cciss/c0d0p2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;16.45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;533.97&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;245.18&nbsp;&nbsp;836631746&nbsp;&nbsp;384153384</code></div><div number11="" index10=""  alt2"=""><code plain"="">cciss/c0d0p3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.58&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.97&nbsp;&nbsp;&nbsp;&nbsp;8737650&nbsp;&nbsp;&nbsp;&nbsp;6215544</code></div><div number12="" index11=""  alt1"=""><code plain"="">cciss/c0d0p4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0</code></div><div number13="" index12=""  alt2"=""><code plain"="">cciss/c0d0p5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.79&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.03&nbsp;&nbsp;&nbsp;&nbsp;5936778&nbsp;&nbsp;&nbsp;&nbsp;7882528</code></div><div number14="" index13=""  alt1"=""><code plain"="">cciss/c0d0p6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.08&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.46&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.34&nbsp;&nbsp;&nbsp;&nbsp;3847771&nbsp;&nbsp;&nbsp;&nbsp;3659776</code></div></div></td></tr></tbody></table></div></div> <p><strong>有关iostat用法和举例的更多信息，请访问</strong>: <a href="http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/" target="_blank" rel="nofollow">Linux下6个使用iostat命令的例子</a>。</p> <h2>9.IPTraf-实时局域网IP监控</h2> <p><strong>IPTraf</strong>是一个在<strong>Linux</strong>控制台运行的、开放源代码的实时网络（<strong>局域网</strong>）监控应用。它采集了大量信息，比如通过网络的IP流量监控，包括TCP标记、ICMP详细信息、TCP/UDP流量分离、TCP连接包和字节数。同时还采集有关接口状态的常见信息和详细信息：TCP、UDP、IP、ICMP、非IP，IP校验和错误，接口活动等。</p> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/e2332a1abdaeb4453d825810d6977593.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img size-full=""  wp-image-59797"="" alt="420140219110741" src="http://jbcdn2.b0.upaiyun.com/2014/02/e2332a1abdaeb4453d825810d6977593.jpg" /></a></p> <p>IP流量监控<br /> <strong>有关IPTraf工具用法以及其他更多信息，请访问：</strong> <a href="http://www.tecmint.com/real-time-interactive-ip-lan-monitoring-with-iptraf-tool/" target="_blank" rel="nofollow">IPTraf网络监控工具</a>。</p> <h2>10. psacct 或者 acct &#8211; 监视用户活动</h2> <p>psacct或者acct工具用于监视系统里每个用户的活动状况。这两个服务进程运行在后台，它们对系统上运行的每个用户的所有活动进行近距离监视，同时还监视这些活动所使用的资源情况。</p> <p>系统管理员可以使用这两个工具跟踪每个用户的活动，比如用户正在做什么，他们提交了那些命令，他们使用了多少资源，他们在系统上持续了多长时间等等。</p> <p>有关这些命令的安装和用法举例信息，请参阅文章：<a href="http://www.tecmint.com/how-to-monitor-user-activity-with-psacct-or-acct-tools/" target="_blank" rel="nofollow">使用psacct或者acct监视用户活动</a>。</p> <h3>11.Monit &#8211; Linux进程和服务监控工具</h3> <p>Monit是一个免费的开源软件，也是一个基于网络的进程监控工具。它能自动监控和管理系统进程，程序，文件，文件夹，权限，总和验证码和文件系统。</p> <p>这个软件能监控像Apache, MySQL, Mail, FTP, ProFTP, Nginx, SSH这样的服务。你可以通过命令行或者这个软件提供的网络借口来查看系统状态。</p> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/32f061ca57df83777d52e03e37d21832.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img size-full=""  wp-image-59796"="" alt="13115605_Gvjb" src="http://jbcdn2.b0.upaiyun.com/2014/02/32f061ca57df83777d52e03e37d21832.jpg" /></a></p> <p>Monit Linux系统监控</p> <p>更多内容请参阅：<a href="http://www.tecmint.com/how-to-install-and-setup-monit-linux-process-and-services-monitoring-program/" target="_blank" rel="nofollow">用Monit监控Linux进程</a></p> <h2>12.NetHogs-监视每个进程使用的网络带宽</h2> <p><strong>NetHogs</strong>是一个开放源源代码的很小程序（与Linux下的<strong>top命令</strong>很相似），它密切监视着系统上每个进程的网络活动。同时还追踪着每个程序或者应用所使用的实时网络带宽。</p> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/3d8264c45e9377b458f28b6b1ac2e21a.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img size-full=""  wp-image-59795"="" alt="13115606_C06o" src="http://jbcdn2.b0.upaiyun.com/2014/02/3d8264c45e9377b458f28b6b1ac2e21a.jpg" /></a></p> <p>NetHogs：Linux下的带宽监视<br /> <strong>更多信息请参阅：</strong> <a href="http://www.tecmint.com/nethogs-monitor-per-process-network-bandwidth-usage-in-real-time/" target="_blank" rel="nofollow">使用NetHogs监视Linux的网络带宽使用状况。</a></p> <h2>13.iftop-监视网络带宽</h2> <p><strong>iftop</strong>是另一个在控制台运行的开放源代码系统监控应用，它显示了系统上通过网络接口的应用网络带宽使用（源主机或者目的主机）的列表，这个列表定期更新。iftop用于监视网络的使用情况，而<strong>&#8216;top&#8217;</strong>用于监视CPU的使用情况。iftop是<strong>&#8216;top&#8217;</strong>工具系列中的一员，它用于监视所选接口，并显示两个主机间当前网络带宽的使用情况。</p> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/714ccc615ab261043efa782ab3a25469.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img size-full=""  wp-image-59794"="" alt="720140219110814" src="http://jbcdn2.b0.upaiyun.com/2014/02/714ccc615ab261043efa782ab3a25469.jpg" /></a></p> <p>iftop-监视网络带宽。</p> <p><strong>更多信息请参阅：</strong><a href="http://www.tecmint.com/install-iftop-bandwidth-monitoring-tool-in-rhel-centos-fedora/" target="_blank" rel="nofollow">iftop-监视网络带宽的使用情况</a>。</p> <p><strong>14 Monitorix-系统和网络监控</strong></p> <p>Monitorix 是一个免费的轻量级应用工具，它的设计初衷是运行和监控Linux/Unix服务器系统和资源等。它有一个HTTP  网络服务器，这个服务器有规律的收集系统和网络的信息并以图形化的形式展示出来。它监控系统的平均负载和使用，内存分配、磁盘健康状况、系统服务、网络端   口、邮件统计（Sendmail，Postfix,Dovecot等），MySQL统计，等等。它就是用来监控系统的总体性能，帮助发现失误、瓶颈和异常  活动的。</p> <p><a href="http://jbcdn2.b0.upaiyun.com/2014/02/4e65a7f7cd0873c1d53c2c857da7a9de.jpg" rel="lightbox[59790]" title="监控 Linux 性能的 18 个命令行工具"><img size-full=""  wp-image-59793"="" alt="820140219110833" src="http://jbcdn2.b0.upaiyun.com/2014/02/4e65a7f7cd0873c1d53c2c857da7a9de.jpg" /></a></p> <h3>15. Arpwatch &#8211; 以太网活动监视器</h3> <p><strong>Arpwatch</strong>被设计用来监控Linux上的以太网地址解析 (<strong>MAC</strong>和<strong>IP</strong>地址的变化)。他在一段时间内持续监控以太网活动并输出IP和MAC地址配对变动的日志。它还可以向管理员发送邮件通知，对地址配对的增改发出警告。这对于检测网络上的ARP攻击很有用。</p> <p><strong>更多信息请参阅</strong> : <a href="http://www.tecmint.com/monitor-ethernet-activity-in-linux/" target="_blank" rel="nofollow">Arpwatch to Monitor Ethernet Activity</a></p> <h3>16. Suricata &#8211; 网络安全监控</h3> <p><strong>Suricata</strong>&nbsp;是一个开源的高性能网络安全、入侵检测和反监测工具，可以运行Linux、FreeBSD和Windows上。非营利组织<strong>OISF</strong> (<strong>Open Information Security Foundation</strong>)开发并拥有其版权。</p> <p><strong>更多信息请参阅</strong> : <a href="http://www.tecmint.com/suricata-a-network-intrusion-detection-prevention-system/" target="_blank" rel="nofollow">Suricata &#8211; A Network Intrusion Detection and Prevention System</a></p> <h3>17. VnStat PHP &#8211; 网络流量监控</h3> <p><strong>VnStat PHP</strong>&nbsp;是流行网络工具&#8221;vnstat&#8221;的基于web的前端呈现。<strong>VnStat PHP</strong>&nbsp;将网络使用情况呈现在漂亮的图形界面中。他可以显示以小时、日、月计的上传和下载流量并输出总结报告。</p> <p><strong>更多信息请参阅</strong> : <a href="http://www.tecmint.com/vnstat-php-frontend-for-monitoring-network-bandwidth/" target="_blank" rel="nofollow">VnStat PHP &#8211; Monitoring Network Bandwidth</a></p> <h3>18. Nagios &#8211; 网络/服务器监控</h3> <p>Nagios是领先而强大的开源监控系统，他可以让网络/系统管理员在问题影响到正常的业务之前发现并解决它们。有了Nagios系统，管理员可以   在单个窗口内远程检测Linux、Windows、开关、路由器和打印机。它可以危险警告并指出系统/服务器是否有异常，这可以间接帮助你在问题发生之前  采取抢救措施。</p> <p><strong>更多信息请参阅</strong> : <a href="http://www.tecmint.com/install-nagios-in-linux/" target="_blank" rel="nofollow">Install Nagios Monitoring System to Monitor Remote Linux/Windows Hosts</a></p> <p>我们想知道：你在用什么监控程序来监控Linux服务器的性能呢？如果我们在上面错过了你认为重要的工具，请在评论中告诉我们，不要忘了分享它！</p> </div></div><img src ="http://www.blogjava.net/zhangwei217245/aggbug/410062.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2012-02-19 22:16 <a href="http://www.blogjava.net/zhangwei217245/archive/2012/02/19/410062.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【Effective】Logging最佳实践</title><link>http://www.blogjava.net/zhangwei217245/archive/2011/02/12/409787.html</link><dc:creator>X-Spirit</dc:creator><author>X-Spirit</author><pubDate>Sat, 12 Feb 2011 11:55:00 GMT</pubDate><guid>http://www.blogjava.net/zhangwei217245/archive/2011/02/12/409787.html</guid><wfw:comment>http://www.blogjava.net/zhangwei217245/comments/409787.html</wfw:comment><comments>http://www.blogjava.net/zhangwei217245/archive/2011/02/12/409787.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhangwei217245/comments/commentRss/409787.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhangwei217245/services/trackbacks/409787.html</trackback:ping><description><![CDATA[<div><div style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><strong>#意识</strong></div> <p><strong style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><span style="color: #0000ff; font-size: medium;">ASAP (As Soon As Possible)原则</span></strong></p> <div style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">当线上出现诡异问题，</div> <div style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">当你意识到靠现有的日志无法定位问题时，</div> <div style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">当现象难以在你的开发环境重现时，</div> <div style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">请不要执著于枯坐肉眼看代码，因为：一）不一定是你代码逻辑问题，可能是脏数据造成的，是老业务数据造成的，是分布式环境造成的，是其他子系统造成的；二）线上业务处于不稳定中，条件不允许问题定位无限期。</div> <div style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">此时，<strong>请立即在问题相关的调用链条上，一次性：</strong></div> <div style="color: #000000; font-family: 微软雅黑; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"> <ul><li><strong>在函数的入口和出口打印日志，同时</strong><strong><span style="font-size: 10.5pt; font-family: 微软雅黑, sans-serif; color: red;">打印输入、输出参数</span></strong></li><li><strong>catch(){&#8230;&#8230;}里打印stacktrace，</strong><strong><span style="font-size: 10.5pt; font-family: 微软雅黑, sans-serif;">同时</span><span style="font-size: 10.5pt; font-family: 微软雅黑, sans-serif; color: red;">打印try块中关键变量的值（避免你发现某个异常是问题第一原因，却不知道是什么变量传入导致的）</span></strong></li><li><strong>与其他模块交互的接口入口处打印输入参数，</strong></li></ul> </div> 即，<strong>解决线上问题归根结底要靠log、a lot of log output！</strong><br /> <div>在logging的力度上切勿犹犹豫豫，我们的工程师习惯于吝啬地找两个函数打印日志、打包部署一把、没看出来、再找几个函数打印、再部署、等着现象重现再观察、&#8230;&#8230;，一来二去时间流逝，闲庭信步，从客服知道的小事故变成了全国皆知的大事故。</div> <div>所以，再强调一遍：<strong>在你的调用链条上，逐层调用的函数入口和出口都打印详细日志，不怕多只怕少，然后部署，等待现象重现，毕其功于一役！</strong></div> <div>&nbsp;</div> <div> <div><strong><span style="color: #0000ff; font-size: medium;">我们要记录什么？</span></strong></div> <div>1）完成某项操作所需的时间</div>    </div> <div> <p>通过它可以跟踪为什么系统响应变慢或者太快</p> <ul><li>处理完一个incoming request所耗费的时间，精确到毫秒</li><li>执行数据库查询的时间</li><li>从磁盘或者存储介质获取数据的时间</li><li>等等</li></ul>    </div> <div>2）异常和堆栈跟踪</div> <div>&nbsp;</div> <div>3）Sessions</div> <div>知道一个问题是由谁引起的非常重要，因此在日志中使用会话标识符就变得必不可少。它可以简单到是一个 IP 地址或者是一个更复杂的 UUID，只要能区分不同的请求者就足够。</div> <div>&nbsp;</div> <div>4）版本号</div> <div>&nbsp;</div> <div><strong>#工具</strong></div> <div><strong><span style="color: #0000ff; font-size: medium;">推荐的Java Logging框架</span></strong></div> <div>1）log4j：我们的配置是，log4j.appender.CONSOLE.layout.ConversionPattern= [%-d{yyyy-MM-dd HH\:mm\:ss.SSS}] [%p] [%c]  [%m]%n；%p是日志优先级，%c是类目名，%m是输出信息，%n是回车换行符。</div> <div>2）logback：log4j创建人Ceki G&#252;lc&#252;后续推出了SLF4J+logback。SLF4J(Simple Logging  Facade for Java)作为commons-logging的替代，为各种logging  APIs提供了一个简单的统一接口，使得最终用户能够在部署的时候配置所希望的logging  APIs的实现。logback胜在性能，据称&#8220;某些关键操作，比如判定是否记录一条日志语句的操作，其性能得到了显著的提高。这个操作在logback 中需要3纳秒，而在 log4j&nbsp;中则需要30纳 秒。 logback&nbsp;创建记录器（logger）的速度也更快：13毫秒，而在  log4j&nbsp;中需要23毫秒。更重要的是，它获取已存在的记录器只需94纳秒， 而  log4j&nbsp;需要2234纳秒，时间减少到了1/23。跟java.util.logging(JUL)相比性能提高也是显著的&#8221;。</div> <div>&nbsp;</div> <div><strong>#配置</strong></div> <div><strong><span style="color: #0000ff; font-size: medium;">不要随便从网上找一个log4j的配置文件，请确认你理解每一个配置项</span></strong></div> <div>我们既然输出日志，自然期望在面对&#8220;<strong>这个问题是否从过去几天开始出现？</strong>&#8221;这样的疑问时，不至于发现你的rollingPolicy错误设置导致只能看到最近几小时的日志，或者日志发生时间没有精确到毫秒。</div> <div>&nbsp;</div> <div> <div><strong>#理念</strong></div> <div><strong><span style="color: #0000ff; font-size: medium;">可用grep抽取的日志：独立的行！</span></strong></div> <div>我们总是希望能用grep处理日志文件。这意味着：<strong>一个日志条目永远不应该跨多行，除非你是堆栈打印</strong>。</div>    </div> <div>我们会用grep问日志什么问题呢？如：</div> <div> <ul><li>用手机号13910******下单的顾客最近三天内都来自于哪些IP？</li><li>浏览地址是****?from=kfapi的顾客，但referral却是搜索引擎域名，最近三天有多少次？</li><li>最近一周内，订单中心执行的所有事务，耗时最长的一次是多长时间？</li><li>&#215;&#215;&#215;&#215;的接口是否真的于18:00发送了一个请求，我们收到的参数是什么？</li></ul>    </div> <div>确保你的日志能回答这样的问题。</div> <div>&nbsp;</div> <div><strong><span style="color: #0000ff; font-size: medium;">不同关注领域写不同的日志文件</span></strong></div> <div>当访问和调用极其频繁，有时候你会发现把你的工程里什么信息都打印到一个日志文件里，会让你看得头昏脑胀。</div> <div>最简单的示范就是Apache的访问日志和错误日志是分开的。</div> <div>同样，你也可以把更加安静的事件（偶尔出现）与更加喧闹的事件分开存储。</div> <div>如，对外的开放平台可以打印三种日志文件：connection log（建立链接和关闭链接，附带接入参数），message log（内部调用链），stacktrace log（异常的堆栈打印）。</div> <div>&nbsp;</div> <div><strong>#具体实现</strong></div> <div> <div><strong><span style="color: #0000ff; font-size: medium;">至少精确到毫秒</span></strong></div> <div>日志必须包含时间戳，精确到至少毫秒级。</div>    </div> <div>如果只是记录到秒级，我们曾明知代码因缺乏并发控制而产生BUG，却只能郁闷地看着精确到秒级的日志。</div> <div>对Java来说，最好配置为：<span style="font-family: tahoma;">yyyy-MM-dd/HH:mm:ss<span style="background-color: yellow; color: #ff0000;">.SSS</span>。</span></div> <div>&nbsp;</div> <div> <div><strong><span style="color: #0000ff; font-size: medium;">请尽可能打印明确的会话标识</span></strong></div> <div>日志条目里打印一个会话标识（A certain session identifier），当有许多并发请求打过来时，你就能基于此字段过滤 client 了。比如，我们日志会补充打印一个浏览器 cookies 里种下的 UUID 。</div>    </div> <div>&nbsp;</div> <div><strong><span style="color: #0000ff; font-size: medium;">log4j的isDebugEnabled判断</span></strong></div> <div>如果打印信息是常量字符串或简单字符串拼接，那么不需要if ( log.isDebugEnabled() )。</div> <div>如果你拼装的动作比较耗资源，请用if ( log.isDebugEnabled() )。</div> <div>&nbsp;</div> <div> <div><strong><span style="color: #0000ff; font-size: medium;">如有可能，请将性能数据标准化输出</span></strong></div> <div>这样更方便grep或hadoop做性能数据抽取和挖掘，从而能很轻松地转换为图形监控。</div>    </div> <div>比如，订单中心的性能数据格式为：<strong>树枝标志&nbsp;当前节点起始时间 [当前节点持续时间, 当前节点自身消耗时间, 在父节点中所占的时间比例]</strong></div> <div>&nbsp;</div> <div> <div><strong><span style="color: #0000ff; font-size: medium;">哪些位置需要部署性能检测点&nbsp;</span></strong></div> <div>（1）访问数据库的dao层；</div> <div>（2）访问外部资源的ext层；</div> <div>（3）访问mq的方法；</div> <div>（4）等等，一切不在你自己负责的工程掌握的部分（外部），或一切你认为自己工程的性能危险点，都需要加入性能监控日志。</div>    </div> <div>&nbsp;</div> <div>&nbsp;</div> <div><strong>#Sample</strong></div> <div> <div><span style="color: #0000ff; font-size: medium;"><strong>一个好的启动日志</strong></span></div>    </div> <div><a href="http://www.cnblogs.com/zhengyun_ustc/" target="_blank"><img style="width: 709px;" src="http://images.cnblogs.com/cnblogs_com/zhengyun_ustc/255879/o_clipboard%20-013%20%E5%89%AF%E6%9C%AC.png" alt="http://images.cnblogs.com/cnblogs_com/zhengyun_ustc/255879/o_clipboard%20-013%20%E5%89%AF%E6%9C%AC.png" /></a></div> <div>打印了应用的版本号，客户端的会话标识，关键步骤的执行时长。</div> <div>&nbsp;</div> <div><strong style="color: #0000ff; font-size: medium;">一个好的堆栈跟踪日志</strong></div> <div><a href="http://www.cnblogs.com/zhengyun_ustc/" target="_blank"><img style="width: 709px;" src="http://images.cnblogs.com/cnblogs_com/zhengyun_ustc/255879/o_clipboard%20-%20014%E5%89%AF%E6%9C%AC.png" alt="http://images.cnblogs.com/cnblogs_com/zhengyun_ustc/255879/o_clipboard%20-%20014%E5%89%AF%E6%9C%AC.png" /></a></div></div><br /><br /><div>本文首发于<a href="http://www.cnblogs.com/zhengyun_ustc/" target="_blank">旁观者-郑昀</a>的<a href="http://www.cnblogs.com/zhengyun_ustc/category/438091.html" target="_blank">55最佳实践系列</a>，链接：<a href="http://www.cnblogs.com/zhengyun_ustc/archive/2012/12/15/logging_bp.html" target="_blank">http://www.cnblogs.com/zhengyun_ustc/archive/2012/12/15/logging_bp.html</a></div><img src ="http://www.blogjava.net/zhangwei217245/aggbug/409787.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhangwei217245/" target="_blank">X-Spirit</a> 2011-02-12 19:55 <a href="http://www.blogjava.net/zhangwei217245/archive/2011/02/12/409787.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>