{"id":2010,"date":"2012-08-27T20:53:27","date_gmt":"2012-08-27T12:53:27","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=2010"},"modified":"2013-11-19T21:05:15","modified_gmt":"2013-11-19T13:05:15","slug":"linux%e5%91%bd%e4%bb%a4%e7%ac%94%e8%ae%b0%e4%ba%94","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/2010.html","title":{"rendered":"Linux\u547d\u4ee4\u7b14\u8bb0[\u4e94]"},"content":{"rendered":"<p>cd &#8211; \u8fdb\u5165\u4e0a\u6b21\u7684\u76ee\u5f55<br \/>\n\u547d\u4ee4\u884c\u4e2d\uff0cCtrl+U\u5220\u9664\u6574\u884c<br \/>\nVIM\u5f00\u591a\u7a97\u53e3\u547d\u4ee4\uff1a:sp [filename]\uff0c\u7ffb\u9875\uff1a[Ctrl] + [f] [Ctrl] + [b]\uff0c[Ctrl]+r \u91cd\u505a\u4e0a\u4e00\u4e2a\u52a8\u4f5c\u3002ZZ \u8fd9\u662f\u5927\u5199\u7684 Z \u5594\uff01\u82e5\u6863\u6848\u6ca1\u6709\u66f4\u52a8\uff0c\u5219\u4e0d\u50a8\u5b58\u79bb\u5f00\uff0c\u82e5\u6863\u6848\u5df2\u7ecf\u88ab\u66f4\u52a8\u8fc7\uff0c\u5219\u50a8\u5b58\u540e\u79bb\u5f00\uff01:r [filename] \u5728\u7f16\u8f91\u7684\u6570\u636e\u4e2d\uff0c\u8bfb\u5165\u53e6\u4e00\u4e2a\u6863\u6848\u7684\u6570\u636e\u3002:w [filename] \u5c06\u7f16\u8f91\u7684\u6570\u636e\u50a8\u5b58\u6210\u53e6\u4e00\u4e2a\u6863\u6848\u3002:n1,n2 w [filename] \u5c06 n1 \u5230 n2 \u7684\u5185\u5bb9\u50a8\u5b58\u6210 filename \u8fd9\u4e2a\u6863\u6848\u3002<\/p>\n<p>vim \u975e\u8d2a\u5a6a\uff0c\u5c06 .* \u6362\u6210 .\\{-}<\/p>\n<p>Ubuntu\u4e0b\u8bbf\u95ee\u548c\u6302\u8f7dWindows\u5171\u4eab\u6587\u4ef6\u5939<br \/>\n\u786e\u8ba4\u5b89\u88c5\u4e86smb,smbclient,\u548csmbfs<br \/>\n\u6267\u884c<br \/>\nsudo mount -t smbfs -o username=winusername \/\/192.168.1.102\/sharefolder\/media\/localfolder<\/p>\n<p>ssh\u81ea\u52a8\u767b\u9646\u5e76\u6267\u884c\u8fdc\u7a0b\u547d\u4ee4\uff1a<br \/>\nsshpass -p uxwwma ssh developer@192.168.2.15 &#8216;uname -a&#8217;<\/p>\n<p>grep -o\u53ea\u6253\u5370\u5339\u914d\u7684\u90e8\u5206\uff0cgrep -o -E &#8220;[0-9]+&#8221;.jpg<\/p>\n<p>cut -d : -f 1,5 \/etc\/passwd<br \/>\n#-d\u540e\u9762\u7684\u5192\u53f7\u8868\u793a\u5b57\u6bb5\u4e4b\u95f4\u7684\u5206\u9694\u7b26,-f\u8868\u793a\u53d6\u5206\u5272\u540e\u7684\u54ea\u4e9b\u5b57\u6bb5<br \/>\n#\u8fd9\u91cc\u53d6\u51fa\u7684\u662f\u7b2c\u4e00\u4e2a\u548c\u7b2c\u4e94\u4e2a\u5b57\u6bb5\u3002<br \/>\ncut -d: -f 3- \/etc\/passwd<br \/>\n#\u4ece\u7b2c\u4e09\u4e2a\u5b57\u6bb5\u5f00\u59cb\u663e\u793a,\u76f4\u5230\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u3002<br \/>\ncut -c 1-4 \/etc\/passwd<br \/>\n#\u53d6\u6bcf\u884c\u7684\u524d1-4\u4e2a\u5b57\u7b26\u3002<br \/>\ncut -c-4 \/etc\/passwd<br \/>\n#\u53d6\u6bcf\u884c\u7684\u524d4\u4e2a\u5b57\u7b26\u3002<br \/>\ncut -c1-4,5 \/etc\/passwd<br \/>\n#\u53d6\u6bcf\u884c\u76841-4\u548c\u7b2c5\u4e2a\u5b57\u7b26\u3002<\/p>\n<p>head -n 5 \/etc\/passwd<br \/>\n#\u663e\u793a\u8f93\u5165\u6587\u4ef6\u7684\u524d\u4e94\u884c\u3002<br \/>\ntail -n 5 \/etc\/passwd<br \/>\n#\u663e\u793a\u8f93\u5165\u6587\u4ef6\u7684\u6700\u540e\u4e94\u884c\u3002<br \/>\n\u5982\u679c\u4f7f\u7528\u8005\u60f3\u67e5\u770b\u4e0d\u95f4\u65ad\u589e\u957f\u7684\u65e5\u5fd7(\u5982\u670d\u52a1\u7a0b\u5e8f\u8f93\u51fa\u7684),\u53ef\u4ee5\u4f7f\u7528tail\u7684-f\u9009\u9879,\u8fd9\u6837\u53ef\u4ee5\u8ba9tail\u547d\u4ee4\u4e0d\u4f1a\u81ea\u52a8\u9000\u51fa,\u5fc5<br \/>\n\u987b\u901a\u8fc7CTRL+C\u547d\u4ee4\u5f3a\u5236\u9000\u51fa,\u56e0\u6b64\u8be5\u9009\u9879\u4e0d\u9002\u5408\u7528\u4e8eShell\u811a\u672c\u4e2d,\u89c1\u5982\u4e0b\u7528\u4f8b:<br \/>\ntail -f -n 5 my_server_log<\/p>\n<p>grep\u9000\u51fa\u72b6\u6001:<br \/>\n0: \u8868\u793a\u6210\u529f;<br \/>\n1: \u8868\u793a\u5728\u6240\u63d0\u4f9b\u7684\u6587\u4ef6\u65e0\u6cd5\u627e\u5230\u5339\u914d\u7684pattern;<br \/>\n2: \u8868\u793a\u53c2\u6570\u4e2d\u63d0\u4f9b\u7684\u6587\u4ef6\u4e0d\u5b58\u5728\u3002<\/p>\n<p>VIM\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u5c06\u91cd\u590d\u7684\u591a\u884c\u66ff\u6362\u6210\u4e00\u884c:<br \/>\n\u5339\u914d\u91cd\u590d\u884c\uff1a^\\(.*\\)\\(\\n\\1\\)\\+$<br \/>\n\u66ff\u6362\u5c31\u662f\uff1a:%s\/^\\(.*\\)\\(\\n\\1\\)\\+$\/\\1\/<\/p>\n<p>\u68c0\u6d4bBOM\u7684\u811a\u672c \uff1a<br \/>\ngrep -R $&#8217;^\\xEF\\xBB\\xBF&#8217; file\/<\/p>\n<p>diff\u9012\u5f52\u6bd4\u8f83\u76ee\u5f55\uff1a<br \/>\ndiff -u -r -x .svn \/cygdrive\/d\/www\/iguess\/system\/\/cygdrive\/d\/www\/iguess<br \/>\n-u unified\uff0c\u663e\u793a\u4e0a\u4e0b\u6587\uff08\u9ed8\u8ba43\u884c\uff09<br \/>\n-r \u9012\u5f52\u6bd4\u8f83(recursive)<br \/>\n-x \u5ffd\u7565\u6307\u5b9a\u6a21\u5f0f(pattern)\u5339\u914d\u7684\u6587\u4ef6<\/p>\n<p>mysql\u5fd8\u8bb0root\u5bc6\u7801\uff0c\u5e72\u6389mysql\u670d\u52a1\uff0c\u7136\u540emysqld &#8211;skip-grant-tables\uff0c\u518dmysql -uroot -p\u4fee\u6539\u5bc6\u7801<\/p>\n<p>\u8ba1\u7b97\u4e24\u5f20\u56fe\u7247\u76f8\u4f3c\u5ea6\uff1a<br \/>\nconvert img1.jpg img2.jpg -compose Difference -composite -colorspace gray -verbose info: | sed -n &#8216;\/statistics:\/,\/^ [^ ]\/ p&#8217; | grep mean | cut -d &#8216;:&#8217; -f 2 | cut -d &#8216;(&#8216; -f 1<br \/>\n\u6216\u8005\uff1a<br \/>\nconvert 0.jpg 1.jpg -compose Difference -composite -colorspace gray -format &#8216;%[fx:mean*100]&#8217; info:<br \/>\nhttp:\/\/www.imagemagick.org\/Usage\/compare\/#compare<\/p>\n<p>\u5229\u7528imagemagick\u548ctesseract-ocr\u8bc6\u522b\u9a8c\u8bc1\u7801\uff1a<br \/>\nsudo apt-get install tesseract-ocr<br \/>\nsudo apt-get install imagemagick<\/p>\n<p>\u5b89\u88c5hiphop\uff0ccurl\u65f6\uff1a<br \/>\nhttps:\/\/github.com\/bagder\/curl\/commit\/26b487a5d6ed9da5bc8e4a134a88d3125884b852<br \/>\n\u7f16\u8bd1\u65f6\uff1a<br \/>\nhttps:\/\/github.com\/facebook\/hiphop-php\/issues\/470<br \/>\n\u4f7f\u7528\u524d\uff1a<br \/>\nexport CMAKE_PREFIX_PATH=\u653ehiphop\u7684\u76ee\u5f55<br \/>\nexport HPHP_HOME=hiphop\u76ee\u5f55<br \/>\nexport HPHP_LIB=hiphop\u76ee\u5f55\u4e0b\u9762\u7684bin\u76ee\u5f55<\/p>\n<p>\u7528crontab\u6267\u884csh\u811a\u672c\u65f6\uff0c\u8c03\u8bd5\u811a\u672c\uff1a<br \/>\n01 * * * * (sh -x \/data\/htdocs\/1.sh &gt; \/root\/debug.txt)<br \/>\n#1.sh\u4e2d\u5b58\u653e\u81ea\u5df1\u7684\u811a\u672c<br \/>\ncrontab\u8981\u6267\u884c\u7684\u811a\u672c\u4e2d\uff0c\u6ce8\u610f\u8981\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u7136\u540e\u5bfc\u5165\u73af\u5883\u53d8\u91cf\u3002\u6709\u811a\u672c\u524d\u52a0\u5165\uff1a<br \/>\nexport PATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/usr\/local\/bin<br \/>\nfreebsd\u4e2d\uff0cshell\u4e3ash\uff0c\u6ca1\u88c5bash\u4e00\u822c<\/p>\n<p>shell \u666e\u901a\u65f6\u95f4\u8f6cUNIX\u65f6\u95f4\uff1a<br \/>\ndate +%s -d&#8221;2012-7-2 11:00:00&#8243;<br \/>\ndate -d @Unix timestamp<\/p>\n<p>mysql \u5bfc\u5165sql\u811a\u672c\u540e\uff0c\u8bbe\u8ba1\u8868\u51fa\u73b0\u201ccannot load from mysql.proc\u201d\u9519\u8bef\uff0c\u89e3\u51b3\u529e\u6cd5\uff1amysql_upgrade -uroot -p123456<\/p>\n<p>vim\u5b8c\u7f8e\u914d\u7f6e\uff1ahttps:\/\/github.com\/spf13\/spf13-vim<br \/>\ngnome\u7684\u7ec8\u7aef\u989c\u8272\u4e2a\u6570\u4e5f\u9700\u8981\u914d\u7f6e\u4e0b,\u63d2\u4ef6csapprox-terminal\u53ea\u652f\u630188\/256\u4e24\u79cd\u989c\u8272.<br \/>\nCSApprox skipped; terminal only has 8 colors, not 88\/256<br \/>\nTry checking :help csapprox-terminal for workarounds<br \/>\n\u589e\u52a0\u4ee5\u4e0b\u5185\u5bb9\u81f3~\/.vimrc.local<br \/>\nif &amp;term =~ &#8216;^\\(xterm\\|screen\\)$&#8217; &amp;&amp; $COLORTERM == &#8216;gnome-terminal&#8217;<br \/>\nset t_Co=256<br \/>\nelse<br \/>\nset t_Co=88<br \/>\nendif<br \/>\nBundle &#8216;TabBar&#8217;<br \/>\n\u586b\u52a0\u5b8c\u518d\u91cd\u65b0\u4f7f\u7528\u8fd0\u884c\u4e0b\u547d\u4ee4\u5b89\u88c5\u65b0\u589e\u52a0\u7684TabBar\u63d2\u4ef6:<br \/>\nvim +BundleInstall! +BundleClean +q<br \/>\nack\u63d2\u4ef6\u8981\u5148\u5b89\u88c5ack: sudo apt-get install ack-grep\uff0c\u7136\u540e\uff1asudo ln -s \/usr\/bin\/ack-grep\/usr\/local\/bin\/ack \u518d\u91cd\u65b0\u5b89\u88c5Bundle<br \/>\n\u4e24\u4e2a\u4e3b\u9898 zenburn oceandeap(88\u8272)<br \/>\n&lt;c-e&gt; \u6253\u5f00\u6587\u4ef6\u5bfc\u822a<br \/>\n&lt;c-p&gt;\u67e5\u627e\u6700\u65b0\u6587\u4ef6<br \/>\n&lt;leader&gt;c&lt;space&gt;\u6dfb\u52a0\u6216\u53d6\u6d88\u6ce8\u91ca\uff0cleader\u952e\u5728vim\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u8bbe\u7f6e<br \/>\n,pd\u5bf9PHP\u51fd\u6570\u751f\u6210\u6ce8\u91ca PHP DocK\u67e5\u770bPHP\u51fd\u6570\u7684\u6587\u6863\u624b\u518c<br \/>\n&lt;Leader&gt;tt \u6253\u5f00\u51fd\u6570\u5bfc\u822a<br \/>\nCtrl-] \u8df3\u8f6c\u5230\u51fd\u6570\u5b9a\u4e49 \u4f7f\u7528\u524d\u5148\u751f\u6210tags\uff1actags -R * \uff0cCtrl-O \u8fd4\u56de\u5230\u8df3\u8f6c\u524d\u7684\u4f4d\u7f6e\uff0cCtrl-T \u6cbf\u7740\u7ecf\u8fc7\u7684\u6807\u7b7e\u5217\u8868\u5411\u56de\u8df3\u8f6c<br \/>\nzc \u6298\u53e0<br \/>\n\u89e3\u51b3sudo vim\u5bfc\u81f4\u7684\u95ee\u9898\uff1a<br \/>\nYou can add always_set_home in following way<br \/>\n#sudo visudo<br \/>\nand change line<br \/>\nDefaults env_reset<br \/>\nto line<br \/>\nDefaults env_reset,always_set_home<br \/>\nsave and exit<\/p>\n<p>\u5b89\u88c5PHP \u7684imagick\u6269\u5c55\uff0c\u4ece\u6e90\u7801\u5b89\u88c5imagemagick\uff0c\u7136\u540e\u518d\u4ece\u6e90\u7801\u5b89\u88c5PHP\u7684imagick\u6269\u5c55\uff0c\u90fd\u8981\u5b89\u88c5\u6700\u65b0\u7684\uff0c\u4e0d\u7136\u4e0d\u652f\u6301PNG<\/p>\n<p>linux\u4e0b\u6587\u4ef6\u6bd4\u8f83\u5de5\u5177 diffuse\u548cmeld \uff0c\u6536\u8d39\u6709\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684BCompare\uff0c<\/p>\n<p>vimdiff FILE_LEFT FILE_RIGHT<br \/>\n\u628a\u4e00\u4e2a\u5dee\u5f02\u70b9\u4e2d\u5f53\u524d\u6587\u4ef6\u7684\u5185\u5bb9\u590d\u5236\u5230\u53e6\u4e00\u4e2a\u6587\u4ef6\u91cc\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<br \/>\ndp \uff08diff &#8220;put&#8221;\uff09<br \/>\n\u5982\u679c\u5e0c\u671b\u628a\u53e6\u4e00\u4e2a\u6587\u4ef6\u7684\u5185\u5bb9\u590d\u5236\u5230\u5f53\u524d\u884c\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4<br \/>\ndo (diff &#8220;get&#8221;\uff0c\u4e4b\u6240\u4ee5\u4e0d\u7528dg\uff0c\u662f\u56e0\u4e3adg\u5df2\u7ecf\u88ab\u53e6\u4e00\u4e2a\u547d\u4ee4\u5360\u7528\u4e86)<br \/>\n\u540c\u65f6\u9000\u51fa\uff1a<br \/>\n:qa \uff08quit all\uff09<br \/>\n\u5982\u679c\u5e0c\u671b\u4fdd\u5b58\u5168\u90e8\u6587\u4ef6\uff1a<br \/>\n:wa \uff08write all\uff09<br \/>\n\u6216\u8005\u662f\u4e24\u8005\u7684\u5408\u5e76\u547d\u4ee4\uff0c\u4fdd\u5b58\u5168\u90e8\u6587\u4ef6\uff0c\u7136\u540e\u9000\u51fa\uff1a<br \/>\n:wqa \uff08write, then quit all\uff09<br \/>\n\u5982\u679c\u5728\u9000\u51fa\u7684\u65f6\u5019\u4e0d\u5e0c\u671b\u4fdd\u5b58\u4efb\u4f55\u64cd\u4f5c\u7684\u7ed3\u679c\uff1a<br \/>\n:qa! \uff08force to quit all\uff09<\/p>\n<p>\u5438\u53d6\u6559\u8bad\uff0cmysql \u6570\u636e\u5e93InnoDB\u8f6cNDB\u5f15\u64ce\u540e\uff0cNDB\u4e0d\u652f\u6301\u5916\u952e\uff0c\u67e5\u8be2\u4e5f\u4e0d\u4f1a\u81ea\u52a8\u5e2e\u4f60\u6392\u597d\u5e8f\uff0c\u6240\u4ee5\u6709\u7684SQL\u8bed\u53e5\uff0c\u8981\u52a0\u4e0aORDER BY \uff0c\u4e0d\u7136\u67e5\u51fa\u6765\u7684\u987a\u5229\u4f1a\u4e71\u6389\uff0c\u4ece\u800c\u5bfc\u81f4\u7a0b\u5e8f\u51fa\u73b0\u975e\u5e38\u5947\u602a\u7684\u95ee\u9898\u3002<\/p>\n<p>imagemagick\u51fa\u73b0\u9519\u8bef\uff1a<br \/>\nconvert: error while loading shared libraries: libMagickCore.so.2: cannot open shared object file: No such file or directory<br \/>\n\u89e3\u51b3\u529e\u6cd5\uff1asudo ldconfig<\/p>\n<p>surround\u63d2\u4ef6\uff1a<br \/>\n&#8220;Hello world!&#8221; &#8212;&gt; &#8216;Hello world!&#8217; : cs&#8221;&#8216;<br \/>\n&lt;q&gt;Hello world!&lt;\/q&gt; : cs'&lt;q&gt;<br \/>\n&#8220;Hello world!&#8221; : cst&#8221;<br \/>\nHello world! : ds&#8221;<br \/>\n[Hello] world! : ysiw]<br \/>\n{ Hello } world! : cs]{<br \/>\n({ Hello } world!) : yss)<br \/>\nHello world! : ds{ds)<br \/>\n&lt;em&gt;Hello&lt;\/em&gt; world! : ysiw&lt;em&gt;<br \/>\n\u5148\u7528V\u9009\u62e9\u533a\u57df\uff0c\u7136\u540e\u518d\u8ddf S&lt;p&gt;\u53d8\u6210\u4e0b\u9762\uff1a<br \/>\n&lt;p&gt;<br \/>\n&lt;em&gt;Hello&lt;\/em&gt; world!<br \/>\n&lt;\/p&gt;<\/p>\n<p>vim\u79fb\u52a8:<br \/>\n{ (\u5de6\u5927\u62ec\u53f7) \u8df3\u5230\u4e0a\u4e00\u6bb5\u7684\u5f00\u5934<br \/>\n} (\u53f3\u5927\u62ec\u53f7) \u8df3\u5230\u4e0b\u4e00\u6bb5\u7684\u7684\u5f00\u5934.<br \/>\n( (\u5de6\u5c0f\u62ec\u53f7) \u79fb\u5230\u8fd9\u4e2a\u53e5\u5b50\u7684\u5f00\u5934<br \/>\n) (\u53f3\u5c0f\u62ec\u53f7) \u79fb\u5230\u4e0b\u4e00\u4e2a\u53e5\u5b50\u7684\u5f00\u5934<br \/>\n[[ \u8df3\u5f80\u4e0a\u4e00\u4e2a\u51fd\u5f0f<br \/>\n]] \u8df3\u5f80\u4e0b\u4e00\u4e2a\u51fd\u5f0f<br \/>\n\u548c #: \u5339\u914d\u5149\u6807\u5f53\u524d\u6240\u5728\u7684\u5355\u8bcd\uff0c\u79fb\u52a8\u5149\u6807\u5230\u4e0b\u4e00\u4e2a\uff08\u6216\u4e0a\u4e00\u4e2a\uff09\u5339\u914d\u5355\u8bcd\uff08*\u662f\u4e0b\u4e00\u4e2a\uff0c#\u662f\u4e0a\u4e00\u4e2a\uff09<br \/>\n`.\uff1a\u5230\u4f60\u4e0a\u6b21\u7f16\u8f91\u6587\u4ef6\u7684\u5730\u65b9<br \/>\n# \u5c06\u6240\u6709\u5f53\u524d\u5355\u8bcd\u7f6e\u4e3a\u9ad8\u4eae<\/p>\n<p>\u5728VIM\u4e2d\u6253\u5f00\u5176\u5b83\u7a0b\u5e8f\uff0c\u6bd4\u5982shell\u7a97\u53e3\u7684\u4e00\u4e2a\u63d2\u4ef6\uff1aconque<br \/>\n\u5b89\u88c5\uff1a\u5728.vimrc.local\u4e2d\u6dfb\u52a0 Bundle &#8216;rosenfeld\/conque-term&#8217; \u7136\u540e\u5728VIM\u4e2d\u6267\u884c\u547d\u4ee4 :BundleInstall!<br \/>\nType :ConqueTerm &lt;command&gt; to run your command in vim, for example:<br \/>\n:ConqueTerm bash<br \/>\n:ConqueTermSplit mysql -h localhost -u joe -p sock_collection<br \/>\n:ConqueTermTab Powershell.exe<br \/>\n:ConqueTermVSplit C:\\Python27\\python.exe<\/p>\n<p>\u7f16\u8f91\u5728\u7f13\u5b58\u4e2d\u7684\u4e24\u4e2a\u6587\u4ef6\u5feb\u901f\u5207\u6362\u547d\u4ee4<br \/>\n\u6bd4\u5982\u5728\u540c\u4e00\u4e2a\u7a97\u53e3\u4e2d\u5148\u540e\u6253\u5f00\u4e86 file1.txt \u548c file2.txt \uff0c\u8fd9\u65f6\u5019\u4f7f\u7528 Ctrl+^ \u53ef\u4ee5\u5728\u540c\u4e00\u7a97\u53e3\u4e2d\u6765\u56de\u5207\u6362\u8fd9\u4e24\u4e2a\u6587\u4ef6\u3002<\/p>\n<p>php\u6027\u80fd\u74f6\u9888(bottleneck)\u68c0\u6d4b\u5de5\u5177\uff0cXDebug+ KCacheGrind<br \/>\nxdebug\u8bbe\u7f6e\u51e0\u4e2a\u53c2\u6570<br \/>\nxdebug.profiler_output_dir\uff1d\/home\/chenming\/<br \/>\nxdebug.profiler_enable_trigger \u548c xdebug.profiler_enable \u5177\u4f53\u770b\u6587\u6863\uff0c\u5728IDE\u4e2d\u8c03\u8bd5\u540e\uff0c\u4f1a\u751f\u6210\u62a5\u544a\u6587\u4ef6\u5230profiler_output_dir\u76ee\u5f55\u4e2d\uff0c\u7136\u540e\u7528KCacheGrind\u6253\u5f00\u62a5\u544a\u6587\u4ef6\u3002<br \/>\n\u6ce8\u610f\u8f93\u51fa\u76ee\u5f55\u7684\u6743\u9650\u95ee\u9898<br \/>\nxdebug.profiler_append=1<br \/>\nxdebug.profiler_enable=0<br \/>\nxdebug.profiler_enable_trigger=1<br \/>\nxdebug.profiler_output_name=cachegrind.out.%s.%H<br \/>\nxdebug.profiler_output_dir=&#8221;\/tmp\/xdebug\/&#8221;<br \/>\nxdebug.trace_output_dir=&#8221;\/tmp\/xdebug\/&#8221;<br \/>\n\u7136\u540echrome\u6709\u4e00\u4e2a\u63d2\u4ef6 xdebug helper<\/p>\n<p>\u4e0d\u91cd\u542f\u5173\u95edSeLinux\uff1a\u6267\u884c\u547d\u4ee4\uff1asetenforce 0<\/p>\n<p>vim\u683c\u5f0f\u5316json\uff0c:%!python -m json.tool \u3002\u5feb\u6377\u952e &lt;leader&gt;jt&lt;Esc&gt;<br \/>\nvim\u4e2d\uff0cJ\u5220\u9664\u6362\u884c\u7b26\uff0c\u4e5f\u5c31\u662f\u628a\u4e24\u884c\u5408\u6210\u4e00\u884c\u3002<\/p>\n<p>\u540c\u6b65\u65f6\u95f4\u547d\u4ee4\uff1antpdate time.windows.com<\/p>\n<p>vim\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u5bf9\u6807\u70b9\u5185\u7684\u5185\u5bb9\u8fdb\u884c\u64cd\u4f5c\u3002<br \/>\nci&#8217;\u3001ci&#8221;\u3001ci(\u3001ci[\u3001ci{\u3001ci&lt; &#8211; \u5206\u522b\u66f4\u6539\u8fd9\u4e9b\u914d\u5bf9\u6807\u70b9\u7b26\u53f7\u4e2d\u7684\u6587\u672c\u5185\u5bb9<br \/>\ndi&#8217;\u3001di&#8221;\u3001di(\u6216dib\u3001di[\u3001di{\u6216diB\u3001di&lt; &#8211; \u5206\u522b\u5220\u9664\u8fd9\u4e9b\u914d\u5bf9\u6807\u70b9\u7b26\u53f7\u4e2d\u7684\u6587\u672c\u5185\u5bb9<br \/>\nyi&#8217;\u3001yi&#8221;\u3001yi(\u3001yi[\u3001yi{\u3001yi&lt; &#8211; \u5206\u522b\u590d\u5236\u8fd9\u4e9b\u914d\u5bf9\u6807\u70b9\u7b26\u53f7\u4e2d\u7684\u6587\u672c\u5185\u5bb9<br \/>\nvi&#8217;\u3001vi&#8221;\u3001vi(\u3001vi[\u3001vi{\u3001vi&lt; &#8211; \u5206\u522b\u9009\u4e2d\u8fd9\u4e9b\u914d\u5bf9\u6807\u70b9\u7b26\u53f7\u4e2d\u7684\u6587\u672c\u5185\u5bb9<br \/>\n\u53e6\u5916\u5982\u679c\u628a\u4e0a\u9762\u7684i\u6539\u6210a\u53ef\u4ee5\u8fde\u914d\u5bf9\u6807\u70b9\u4e00\u8d77\u64cd\u4f5c\u3002<br \/>\n\u4e3e\u4e2a\u4f8b\u5b50\uff1a<br \/>\n\u6bd4\u5982\u8981\u64cd\u4f5c\u7684\u6587\u672c\u5982\u4e0b\uff1a<br \/>\n111&#8243;222&#8243;333<br \/>\n\u5c06\u5149\u6807\u79fb\u5230&#8221;222&#8243;\u7684\u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u5904\u8f93\u5165\u547d\u4ee4 di&#8221; ,\u6587\u672c\u4f1a\u53d8\u6210\uff1a 111&#8243;&#8221;333<br \/>\n\u82e5\u8f93\u5165\u547d\u4ee4 da&#8221; ,\u6587\u672c\u4f1a\u53d8\u6210\uff1a 111333<\/p>\n<p>diff -w \u6bd4\u8f83\u7684\u65f6\u5019\u5ffd\u7565\u7a7a\u683c\u4e0eTAB<\/p>\n<p>awk \uff0dF\u6307\u5b9a\u5206\u9694\u7b26\uff0c\u5982cat pics.url |awk -F\/ &#8216;{print $NF}&#8217; \uff0c\u6307\u5b9a\u5206\u9694\u7b26\u4e3a\/\u5e76\u4e14\u6253\u5370\u51fa\u6700\u540e\u4e00\u4e2a\u5b57\u6bb5\u3002<\/p>\n<p>tac\u547d\u4ee4\uff0c\u5c06\u6587\u672c\u5185\u5bb9\u98a0\u5012\uff0c\u6700\u540e\u4e00\u884c\u5f53\u7b2c\u4e00\u884c<\/p>\n<p>php &#8211;ini \u67e5\u770bphp.ini\u5728\u54ea\u91cc<\/p>\n<p>\u4e3a\u4e86\u5b9e\u73b0\u5c06\u8fdc\u7a0b\u670d\u52a1\u5668\u4e2d\u7684\u6587\u4ef6\u540c\u6b65\u5907\u4efd\u5230\u672c\u673a\uff0c\u4f7f\u7528\u4e0b\u5217\u547d\u4ee4\uff08Rsync+ssh\uff09\uff1a<br \/>\nrsync -avlR &#8211;delete -e ssh user@xxx.xxx.xxx.xxx:\/remotedir\/localdir\/<br \/>\n\u8be5\u6307\u4ee4\u4e2d\u6d89\u53ca\u5230\u7684\u9009\u9879\u4f5c\u7528\u5982\u4e0b\uff1a<br \/>\n-a\uff1a\u5b58\u6863<br \/>\n-v\uff1a\u7ed9\u51fa\u6587\u4ef6\u4f20\u8f93\u7684\u76f8\u5173\u4fe1\u606f<br \/>\n-l\uff1a\u4fdd\u7559\u539f\u6587\u4ef6\u7684\u7b26\u53f7\u94fe\u63a5<br \/>\n-R\uff1a\u4fdd\u7559\u76f8\u5bf9\u8def\u5f84<br \/>\n&#8211;delete\uff1a\u4e0e\u8fdc\u7a0b\u670d\u52a1\u5668\u6587\u4ef6\u5185\u5bb9\u4fdd\u6301\u4e00\u81f4<br \/>\n-e\uff1a\u4f7f\u7528 ssh \u8fde\u63a5<\/p>\n<p>tac\u547d\u4ee4\uff0c\u5c06\u6587\u672c\u5185\u5bb9\u98a0\u5012\uff0c\u6700\u540e\u4e00\u884c\u5f53\u7b2c\u4e00\u884c<\/p>\n<p>iptables -L \u5217\u51faiptables\u89c4\u5219<br \/>\niptables -F \u6e05\u9664iptables\u5185\u7f6e\u89c4\u5219<br \/>\niptables -X \u6e05\u9664iptables\u81ea\u5b9a\u4e49\u89c4\u5219<\/p>\n<p>php\u6587\u6863\u751f\u6210\u5de5\u5177phpDocumentor<br \/>\nhttps:\/\/github.com\/phpDocumentor\/phpDocumentor2<br \/>\nSphinx \u6587\u6863\u751f\u6210\u5de5\u5177<\/p>\n<p>\u5728vim\u4e2d\uff0c\u6709\u65f6\u9700\u8981\u5c06tab\u8f6c\u6362\u6210space\u3002\u4f7f\u7528ret\u547d\u4ee4\uff08replace tab\uff09\u3002<br \/>\n[range]ret[ab]! [new-tabstop]<br \/>\n\u4e3e\u4f8b\uff1a\u5c06\u7b2c\u4e00\u884c\u5230\u6587\u4ef6\u5c3e\u7684tab\u8f6c\u6362\u6210space\uff0c\u6bcf\u4e2atab\u75284\u4e2aspace\u66ff\u4ee3\u3002<br \/>\n:set expandtab<br \/>\n:%ret! 4<br \/>\n\u5982\u679c\u6ca1\u6709\u7ed9\u5b9a4\uff0c\u5219\u7528\u5f53\u524d\u7684tab\u5bbd\u5ea6\u8bbe\u5b9a\u66ff\u6362\u4e3aspace\u3002<\/p>\n<p>vim\u5bf9\u9f50\u7ebf\u63d2\u4ef6\uff1ahttps:\/\/github.com\/nathanaelkane\/vim-indent-guides<\/p>\n<p>strace -c -p 5140 \u5bf9\u8fdb\u7a0b\u4e00id\u4e3a5140\u7684\u7a0b\u5e8f\u8fdb\u884c\u7cfb\u7edf\u8c03\u7528\u76d1\u63a7\uff0c\u5f53\u9000\u51fa\u65f6\u6253\u5370\u62a5\u8868<\/p>\n","protected":false},"excerpt":{"rendered":"<p>cd &#8211; \u8fdb\u5165\u4e0a\u6b21\u7684\u76ee\u5f55 \u547d\u4ee4\u884c\u4e2d\uff0cCtrl+U\u5220\u9664\u6574\u884c VIM\u5f00\u591a\u7a97\u53e3\u547d\u4ee4\uff1a:sp [filen [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-2010","post","type-post","status-publish","format-standard","hentry","category-my_notes"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=2010"}],"version-history":[{"count":4,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2010\/revisions"}],"predecessor-version":[{"id":4822,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2010\/revisions\/4822"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=2010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=2010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=2010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}