{"id":5706,"date":"2014-08-23T15:28:54","date_gmt":"2014-08-23T07:28:54","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=5706"},"modified":"2016-01-29T17:14:05","modified_gmt":"2016-01-29T09:14:05","slug":"linux%e5%91%bd%e4%bb%a4%e7%ac%94%e8%ae%b0%e4%b8%83","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/5706.html","title":{"rendered":"Linux\u547d\u4ee4\u7b14\u8bb0[\u4e03]"},"content":{"rendered":"<p>\u4fee\u6539 ssh \u7aef\u53e3<br \/>\nsudo vi \/etc\/ssh\/sshd_config<br \/>\n\u4fee\u6539port 22 \u4e3a port \u7aef\u53e3\u53f7<br \/>\nsudo \/etc\/init.d\/ssh restart<br \/>\nssh -p \u7aef\u53e3\u53f7 root@10.6.0.1<\/p>\n<p>git add -u \u53ea\u6dfb\u52a0\u672c\u5730\u66f4\u6539\u7684\uff0c\u4e0d\u6dfb\u52a0\u65b0\u6587\u4ef6<br \/>\ngit add -A \u6dfb\u52a0\u6240\u6709\u4e0d\u5728\u5ffd\u7565\u5217\u8868\u91cc\u9762\u7684\uff0c\u5305\u62ec\u66f4\u6539\u4e0e\u65b0\u6587\u4ef6<\/p>\n<p>ubuntu\u4e0b\u5b89\u88c5root\u6839\u8bc1\u4e66\u65b9\u6cd5\uff0c\u5047\u8bbe\u8981\u5c06\u8bc1\u4e66foo.crt\u5bfc\u5165\u5230\u7cfb\u7edf\u4e2d\u3002<br \/>\n1.\u521b\u5efa\u6587\u4ef6\u5939\u7528\u6765\u88c5\u6211\u4eec\u5bfc\u5165\u7684\u8bc1\u4e66<br \/>\nsudo mkdir \/usr\/share\/ca-certificates\/extra<br \/>\n2.\u5c06\u8bc1\u4e66\u6587\u4ef6\u653e\u5230\u8be5\u6587\u4ef6\u5939\u4e2d<br \/>\nsudo cp foo.crt \/usr\/share\/ca-certificates\/extra\/foo.crt<br \/>\n3.\u914d\u7f6ecrt\u6587\u4ef6\u7684\u76f8\u5bf9\u8def\u5f84\u3000Add the &#8216;.crt&#8217; file&#8217;s path relative to \/usr\/share\/ca-certificates to \/etc\/ca-certificates.conf<br \/>\nsudo dpkg-reconfigure ca-certificates<br \/>\n4.\u66f4\u65b0\u5b89\u88c5\u7684ca\u8bc1\u4e66\uff0c\u4ee5\u751f\u6548<br \/>\nsudo update-ca-certificates<\/p>\n<p>sublime \u5c06tab\u7f29\u8fdb\u6210\u7a7a\u683c\u914d\u7f6e\uff1a<br \/>\n&#8220;translate_tabs_to_spaces&#8221;: true,<\/p>\n<p>\u5236\u4f5cubuntu\u542f\u52a8\u76d8\u7684\u65f6\u5019\uff0c\u542f\u52a8\u51fa\u73b0\u201cbootmgt is missing\u201d\u7684\u9519\u8bef\uff0c\u89e3\u51b3\u529e\u6cd5\u662f\u5c06U\u76d8\u683c\u5f0f\u5316\u6210fat32\u683c\u5f0f\u7684\uff0c\u800c\u4e0d\u662fnfts\u683c\u5f0f\u3002<\/p>\n<p>ZIP\u6587\u4ef6\u4e71\u7801\uff0chttp:\/\/forum.ubuntu.org.cn\/viewtopic.php?f=122&amp;t=301951 \u516d\u697c\u89e3\u51b3\u529e\u6cd5\u3002<\/p>\n<p>im-switch\uff0c\u8c03\u51fa\u6765input method switcher\uff0c\u9009\u62e9fcitx\u4f5c\u4e3a\u7cfb\u7edf\u9ed8\u8ba4\u7684\u4e2d\u6587\u8f93\u5165\u6cd5\u3002\u6ce8\u9500\u7cfb\u7edf\u540e\u5c31\u53ef\u4ee5\u4f7f\u7528fcitx\u4e86\u3002<\/p>\n<p>Disable the ALT+Right click Ubuntu 12.04\uff1a<br \/>\nwent to the compiz configuration settings &gt;&gt; general options &gt;&gt; Keybindings.<br \/>\nLooked for the &#8220;Window Menu&#8221; and changed to super+alt+button4 and did work!<\/p>\n<p>\u591a\u7ebf\u7a0b\u4e0b\u8f7d\u5de5\u5177 axel: axel -n 50 url\uff0c\u4f7f\u752850\u4e2a\u5e76\u53d1\u4e0b\u8f7d\u3002\u4f1a\u6bd4wget\u7b49\u5feb\u5f97\u591a\u3002<\/p>\n<p>\u5b89\u88c5jdk\uff1a<\/p>\n<p>wget -c http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/7u65-b17\/jdk-7u65-linux-x64.tar.gz<br \/>\nsudo tar zxvf .\/jdk-7u65-linux-x64.tar.gz -C \/usr\/lib\/jvm<br \/>\ncd \/usr\/lib\/jvm<br \/>\nsudo mv jdk1.7.0\/ java-7-sun<\/p>\n<p>vim ~\/.bashrc<br \/>\nexport JAVA_HOME=\/usr\/lib\/jvm\/java-7-sun<br \/>\nexport JRE_HOME=${JAVA_HOME}\/jre<br \/>\nexport CLASSPATH=.:${JAVA_HOME}\/lib:${JRE_HOME}\/lib<br \/>\nexport PATH=${JAVA_HOME}\/bin:$PATH<\/p>\n<p>source ~\/.bashrc \u6216 . .bashrc<\/p>\n<p>sudo update-alternatives &#8211;install \/usr\/bin\/java java \/usr\/lib\/jvm\/java-7-sun\/bin\/java 300<br \/>\nsudo update-alternatives &#8211;install \/usr\/bin\/javac javac \/usr\/lib\/jvm\/java-7-sun\/bin\/javac 300<br \/>\nsudo update-alternatives &#8211;install \/usr\/bin\/jar jar \/usr\/lib\/jvm\/java-7-sun\/bin\/jar 300<br \/>\nsudo update-alternatives &#8211;install \/usr\/bin\/javah javah \/usr\/lib\/jvm\/java-7-sun\/bin\/javah 300<br \/>\nsudo update-alternatives &#8211;install \/usr\/bin\/javap javap \/usr\/lib\/jvm\/java-7-sun\/bin\/javap 300<\/p>\n<p>sudo update-alternatives &#8211;config java<\/p>\n<p>useradd -m -s \/bin\/bash username\uff0c-m\u4f1a\u81ea\u52a8\u521b\u5efahome\u76ee\u5f55\u3002<br \/>\npasswd username \u4fee\u6539\u7528\u6237username\u6709\u5bc6\u7801<br \/>\n\u65b0\u7528\u6237\u547d\u4ee4\u63d0\u793a\u7b26\u53ea\u6709\u4e00\u4e2a\u201c$\u201d\uff0c\u8fd9\u662fshell\u7684\u95ee\u9898\uff0c\u5728\u65b0\u6dfb\u7528\u6237\u65f6\uff0c\u9700\u8981\u624b\u52a8\u5730\u8bbe\u7f6e\u9ed8\u8ba4shell\uff0c useradd -s \/bin\/bash new user<\/p>\n<p>\u6237\u4e0d\u80fd\u4f7f\u7528sudo \uff0c\u89e3\u51b3\uff1a<br \/>\nsudo visudo<br \/>\nyour_user_name ALL=(ALL) ALL #\u6700\u540e\u4e00\u884c\u6dfb\u6b64\u53e5<\/p>\n<p>\u6216\u76f4\u63a5\u6dfb\u52a0\u5230sudo\u7ec4\uff0csudo usermod -aG sudo <username>\uff0c\u53d6\u6d88  sudo gpasswd  -d <username> sudo\uff0c\u53ea\u662f\u53d6\u6d88sudo\u6743\u9650\uff0c\u5e76\u4e0d\u4f1a\u5220\u9664\u7528\u6237\u3002<\/p>\n<p>netstat -nplt \u67e5\u770b\u5230\u5916\u5f00\u653e\u7684\u7aef\u53e3\u53ca\u76f8\u5173\u7a0b\u5e8f\u3002 sudo netstat -apn|grep 9001 \u52a0sudo\u4e0e\u4e0d\u52a0\uff0c\u7ed3\u679c\u662f\u4e0d\u4e00\u6837\u7684\u3002<\/p>\n<p>nl \u80fd\u591f\u663e\u793a\u884c\u53f7\u7684\u547d\u4ee4\u3002\u5728\u9605\u8bfb\u811a\u672c\u6216\u4ee3\u7801\u65f6\uff0c\u8fd9\u4e2a\u547d\u4ee4\u5e94\u8be5\u975e\u5e38\u6709\u7528\uff0c\u5982\uff1anl wireless.sh | head<\/p>\n<p>ssh user@server bash &lt; \/path\/to\/local\/script.sh \u5728\u8fdc\u7a0b\u673a\u5668\u4e0a\u8fd0\u884c\u4e00\u6bb5\u811a\u672c\u3002\u8fd9\u6761\u547d\u4ee4\u6700\u5927\u7684\u597d\u5904\u5c31\u662f\u4e0d\u7528\u628a\u811a\u672c\u62f7\u5230\u8fdc\u7a0b\u673a\u5668\u4e0a\u3002<br \/>\nssh user@host cat \/path\/to\/remotefile | diff \/path\/to\/localfile &#8211; \u6bd4\u8f83\u4e00\u4e2a\u8fdc\u7a0b\u6587\u4ef6\u548c\u4e00\u4e2a\u672c\u5730\u6587\u4ef6 <\/p>\n<p>curl ifconfig.me \u5f53\u4f60\u7684\u673a\u5668\u5728\u5185\u7f51\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\u67e5\u770b\u5916\u7f51\u7684IP\u3002 <\/p>\n<p>\u901a\u8fc7python\u7684json.tool\u6a21\u5757\u6765\u683c\u5f0f\u5316json\uff0c\u5982\uff1a curl http:\/\/example.com\/test.json | python -mjson.tool\uff0c\u6709\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\u4e2d\u6587\u4f1a\u663e\u793a\u6210unicode\u7f16\u7801\u3002\u89e3\u51b3\u529e\u6cd5\uff1a \u5728%python%\/lib\/json\/tool.py\u4e2d\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u53ea\u652f\u6301ascii\uff0c\u589e\u52a0ensure_ascii=False\uff0c\u4fee\u6539tool.py\u5982\u4e0b json.dump(obj, outfile, sort_keys=True, indent=4, ensure_ascii=False) vim -x filename \u7f16\u8f91\u5e76\u52a0\u5bc6\u6587\u4ef6 <\/p>\n<p>pip\u5b89\u88c5PIL\u5e93\u65f6\uff0c\u4e0d\u652f\u6301jpeg sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev<br \/>\n\u7136\u540e\uff1a<br \/>\n# ln -s \/usr\/lib\/`uname -i`-linux-gnu\/libfreetype.so \/usr\/lib\/<br \/>\n# ln -s \/usr\/lib\/`uname -i`-linux-gnu\/libjpeg.so \/usr\/lib\/<br \/>\n# ln -s \/usr\/lib\/`uname -i`-linux-gnu\/libz.so \/usr\/lib\/<br \/>\n\u5982\u679c\u8981\u88c5\u5728virtualenv\u91cc\u9762\u7684\u8bdd\u5c31\u5148 cd $VIRTUAL_ENV\/lib\uff0c\u7136\u540eln -s<br \/>\n\u5168\u5c40\u5b89\u88c5\u7684\u8bdd pip install -U PIL\uff0c-U\u8868\u793a\u91cd\u65b0\u7f16\u8bd1<br \/>\nIn Ubuntu 14.04 try:    sudo ln -s \/usr\/include\/freetype2 \/usr\/local\/include\/freetype<\/p>\n<p>\u89e3\u51b3\u6302\u8f7dsamba\u540e\u65e0\u53ef\u5199\u6743\u9650\u95ee\u9898\uff1asudo mount -t cifs \/\/192.168.2.80\/kyle \/home\/kyle\/kyleshare -o username=kyle,password=test,uid=kyle,gid=users,file_mode=0640,dir_mode=0750,iocharset=utf8 <\/p>\n<p>\u914d\u7f6egit diff\u7528\u7279\u5b9a\u7684\u7f16\u8f91\u5668\uff1a git config &#8211;global diff.tool vimdiff<br \/>\n\u6216\u8005\u7528\u6709\u754c\u9762\u7684meld git config &#8211;global diff.tool meld git config &#8211;global difftool.prompt No <\/p>\n<p>\u5c06\u6587\u672c\u987a\u5e8f\u5012\u7f6e\u8f93\u51fa\uff0ctac file.txt\uff0c\u6216 tail -r file.txt <\/p>\n<p>\u52a8\u6001\u57df\u540d\u89e3\u6790\u514d\u8d39\u670d\u52a1\uff1ahttps:\/\/freedns.afraid.org\/\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528url\u8bf7\u6c42\u6765\u7ed1\u5b9aip <\/p>\n<p>ubuntu\u4fee\u6539dns\u5730\u5740\u3002vim \/etc\/network\/interfaces\uff0c\u6dfb\u52a0dns-nameservers 8.8.8.8\uff0c\u518d vim \/etc\/resolv.conf\uff0c\u4fee\u6539 nameserver 8.8.8.8\u3002 <\/p>\n<p>mysql \u590d\u5236\u4e00\u4e2a\u6570\u636e\u5e93\u4e3a\u53e6\u4e00\u4e2a\u6570\u636e\u5e93\uff1amysqldump -h [server] -u [user] -p[password] db1 | mysql -h [server] -u [user] -p[password] db2 <\/p>\n<p>ipv6\u670d\u52a1 miredo\u542f\u52a8\u5931\u8d25\uff0cifconfig\u4e2d\u6ca1\u6709teredo\uff0c\u67e5\u770b\u65e5\u5fd7 tail \/var\/log\/syslog \uff0c\u53d1\u73b0\uff1aNo reply from Teredo server\u3002<br \/>\ngoogle\u540e\u53d1\u73b0\u4fee\u6539 \/etc\/miredo.conf \u4e2d\u7684ServerAddress\uff0c\u4f46\u662f\u4e5f\u6ca1\u7528\u3002\u6700\u540e\u53d1\u73b0\u662fdns\u670d\u52a1\u5668\u4e0d\u652f\u6301ipv6\uff0c\u628adns\u6362\u6210 8.8.8.8\u5c31\u597d\u4e86\u3002 <\/p>\n<p>redis\u5220\u9664\u6240\u6709\u6307\u5b9akey\uff1aredis-cli keys search.*|awk &#8216;{print $1}&#8217;|xargs -i redis-cli del {} <\/p>\n<p>bash\u7f16\u7a0b\u4e2d\uff0cecho\u4e00\u5927\u6bb5\u6587\u672c\u5230\u6587\u4ef6\u4e2d\uff1a cat &gt; file.tmp &lt;&lt;&#8216;endmsg&#8217; script goes here&#8230; endmsg <\/p>\n<p>git \u5ffd\u7565 submodule\u9879\u76ee\u7684\u66f4\u6539\uff0c\u5728.gitmodules\u6587\u4ef6\u4e2d\u6dfb\u52a0 ignore = all (https:\/\/www.kernel.org\/pub\/software\/scm\/git\/docs\/gitmodules.html)<br \/>\n\u4f8b\u5982\uff1a [submodule &#8220;bundle\/fugitive&#8221;] path = bundle\/fugitive url = git:\/\/github.com\/tpope\/vim-fugitive.git ignore = all <\/p>\n<p>ngrep \u76d1\u6d4bhttp\u8bf7\u6c42\uff1asudo ngrep -q -d eth0 -W byline host api.xxxxoooo.com and port 80 <\/p>\n<p>\u642dgitlab\u7684\u65f6\u5019\uff0cssh keys\u8ba4\u8bc1\u4e0d\u4e86\uff0c\u539f\u56e0\u4e3a .ssh \u76ee\u5f55 \u53ca .ssh\/authorized_keys \u6587\u4ef6\u7684\u6743\u9650\u8bbe\u7f6e\u4e0d\u6b63\u786e\uff0c\u5206\u522b\u4e3a 775 \u548c 644\u5c31\u884c\u4e86\u3002 &gt;&gt;&gt;\/home\/git\/gitlab$ sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production<\/p>\n<p>sudo \u4e0d\u7528\u8f93\u5bc6\u7801\uff1a<br \/>\nsudo visudo<br \/>\n\u628a\/etc\/sudoers(\u81ea\u52a8\u6253\u5f00)\u88e1\u9762\u6700\u5f8c\u4e00\u884c<br \/>\n%admin ALL=(ALL)ALL<br \/>\n\u6539\u70ba<br \/>\n%admin ALL=(ALL) NOPASSWD: NOPASSWD: ALL<\/p>\n<p>sudo urlsnarf -i wlan0 \u6293\u53d6\u8bbf\u95ee\u7684url\u8bf7\u6c42<\/p>\n<p>\u7528awk\u53d6\u663e\u793a\u51fa\u6765\u7684\u7b2c\u4e8c\u884c\uff1a<br \/>\ngrep -o &#8220;PHPSESSID=.\\{26\\}&#8221; cookies.txt | awk &#8216;NR==2 {print}&#8217;<\/p>\n<p>id -u username \u83b7\u53d6\u7cfb\u7edf\u7528\u6237username\u7684\u7528\u6237id<br \/>\n&gt;&gt;&gt;id -u nobody<br \/>\n65534<\/p>\n<p>grep -B 3 -A 2 &#8220;test&#8221; test.txt -B\u663e\u793a\u524d3\u884c\uff0c-A\u663e\u793a\u540e2\u884c<\/p>\n<p>\u8ba1\u7b97\u6587\u4ef6\u5404\u79cdhash\u503c\uff0c\u751f\u6210ed2k\uff0cmagnet\uff0ctorrent\u7b49\uff0c\u547d\u4ee4\uff1a rhash<\/p>\n<p>mysql\u6240\u6709\u7528\u6237\u767b\u9646\u90fd\u62a5\u9519\uff1aERROR 1045 (28000): Access denied for user\uff0c\u89e3\u51b3\uff1a<\/p>\n<p>killall mysqld<br \/>\n\/usr\/sbin\/mysqld &#8211;skip-grant-tables<br \/>\nupdate mysql.user set password=password(&#8220;123456&#8221;) where user = &#8216;root&#8217;;<\/p>\n<p>\u901a\u8fc7ip\u67e5\u627e\u5176mac\u5730\u5740\uff0c\u5148ping\u4e0bip\uff0c\u518darp -a ip<\/p>\n<p>notify-send\u547d\u4ee4\u53ef\u4ee5\u5728\u684c\u9762\u4e0a\u6253\u5370\u4e00\u4e2a\u901a\u77e5\uff0c\u5f39\u51fa\u4e00\u4e2a\u6846\u4e4b\u7c7b\u7684\u3002<\/p>\n<p>\u8ba1\u7b97\u6587\u4ef6score\u7b2c\u56db\u5217\u6240\u6709\u6570\u5b57\u7684\u603b\u548c\uff1a<br \/>\nawk &#8216;{s+=$4} END {print s}&#8217; score<\/p>\n<p>\u5c06\u4ee5\u4e0b\u6587\u672c<br \/>\ncsharp,<br \/>\nphp,<br \/>\njavascript,<br \/>\npascal,<br \/>\nobjectc<br \/>\n\u4e2d\uff0cpascal\u524d\u4e00\u884cjavascript\u6700\u540e\u7684\u9017\u53f7\u6539\u6210\u5206\u53f7\uff0c\u7528sed\u6765\u5b9e\u73b0\uff1a sed &#8216;\/,$\/{N; s\/javascript,\\npascal\/javascript;\\npascal\/g}&#8217; sed.txt<br \/>\nsed has three commands to manage multi-line operations: N, D and P<\/p>\n<p>\u67e5\u770bBT\u6587\u4ef6\u8be6\u7ec6\u4fe1\u606f\uff1atransmission-show 1.torrent \u6216 btshowmetainfo \u547d\u4ee4<br \/>\npython\u4e0b\u9762\uff0capt-get install python-libtorrent<\/p>\n<p>\u901a\u8fc7wget\u547d\u4ee4\u9012\u5f52\u4e0b\u8f7dapache\u76ee\u5f55\u5217\u51fa\u7684\u6240\u6709\u6307\u5b9a\u540e\u7f00\u6587\u4ef6\uff0cwget -e robots=off -r -nd -np -A mp4 http:\/\/ia600409.us.archive.org\/27\/items\/MIT18.01JF07<br \/>\n\u5177\u4f53\u53c2\u6570\u53ef\u4ee5\u5230 http:\/\/explainshell.com\/ \u67e5\u8be2\u3002<\/p>\n<p>ssh\u957f\u65f6\u95f4\u8fde\u63a5\u540e\uff0c\u88ab\u65ad\u5f00\u8fde\u63a5\uff0c\u6b7b\u5728\u90a3\u91cc\uff0cctrl+c\u90fd\u6ca1\u7528\uff0c\u53ea\u80fd\u5f3a\u5173\u7a97\u53e3\uff0c\u6709\u4e00\u62db\uff0c\u7528 ~. \u53ef\u4ee5\u4f18\u96c5\u5730\u65ad\u5f00\u8fde\u63a5\u3002<\/p>\n<p>\u5f3a\u5236\u5360\u7528\u5927\u91cfcpu \u7684\u547d\u4ee4\uff1a dd if=\/dev\/zero of=\/dev\/null<\/p>\n<p>\u6e05\u9664iptables\u89c4\u5219\uff1a<br \/>\niptables -F<br \/>\niptables -X<br \/>\niptables -t nat -F<br \/>\niptables -t nat -X<br \/>\niptables -t mangle -F<br \/>\niptables -t mangle -X<br \/>\niptables -P INPUT ACCEPT<br \/>\niptables -P FORWARD ACCEPT<br \/>\niptables -P OUTPUT ACCEPT<\/p>\n<p>\u5c06\u56fe\u7247\u7f29\u653e\uff0c\u7136\u540e\u88c1\u51cf\u6210\u6b63\u65b9\u5f62\uff1a<br \/>\nconvert 2.jpg -resize 100&#215;100^ -gravity Center -crop 80&#215;80+0+0 +repage square_2.jpg<\/p>\n<p>ubuntu\u4e0b\u6302\u8f7dwindows\u4e0b\u7684\u76d8\uff1a sudo mount -t ntfs -o nls=utf8,umask=0222 \/dev\/hdb1 \/media\/c<\/p>\n<p>\u4eca\u5929\u9047\u5230\u91cd\u542fnginx\u7684\u65f6\u5019\uff0c\u4e00\u76f4\u6302\u6b7b\u5728 Restarting nginx\uff0c\u6ca1\u6709\u4efb\u4f55\u8f93\u51fa\uff0c\u540e\u6765\u53d1\u73b0\u662f\u6709\u914d proxy_pass http:\/\/imgproxy.meilapp.com; \u89e3\u6790\u8fd9\u4e2a\u57df\u540d\u4e00\u76f4\u89e3\u6790\u4e0d\u5230\u7684\u539f\u56e0\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2ahosts\u6765\u5feb\u901f\u89e3\u51b3\u3002<\/p>\n<p>\u7528dd\u547d\u4ee4\u514b\u9686\u786c\u76d8\uff1a dd if=\/dev\/sda of=\/dev\/sdb bs=100M<br \/>\n\u76d1\u63a7\u8fdb\u5ea6\uff0c\u6253\u5f00\u65b0\u7684\u7ec8\u7aef\uff1asudo kill -USR1 $(pgrep ^dd)\uff0c\u5b8c\u540e\uff0c\u5728\u539f\u6765\u7684\u7ec8\u7aef\u4e0b\u9762\u5c31\u4f1a\u8f93\u51fa\u8fdb\u5ea6\u4fe1\u606f\u3002<br \/>\n\u6bcf\u96945\u79d2\u76d1\u63a7\u4e00\u4e0b\uff1awatch -n5 &#8216;sudo kill -USR1 $(pgrep ^dd)&#8217;<br \/>\ndd\u4e4b\u540e\uff0c\u7528rsync\u540c\u6b65\u6587\u4ef6\u5939\uff1arsync -arh \/root\/rpmpkgs \/tmp\/backups\/<\/p>\n<p>\u7528nc\u6765\u4f20\u5927\u6587\u4ef6\uff0c\u6bd4ssh\u8981\u5feb\uff0c\u6bd4\u5982\u5c06server1 \u4f20\u5230 server2 \u4e0a\u9762\u53bb\uff0c\u5148\u5728 server2\u6253\u5f00\u4e00\u4e2a\u7aef\u53e3\uff1a<br \/>\nserver2$ nc -l -p 12345 | tar xvzf &#8211;<br \/>\n\u518d\u5728server1 \u4e0a\u9762\u5c06\u8981\u4f20\u7684\u6587\u4ef6\u901a\u8fc7nc\u53d1\u9001\u5230\u76ee\u6807\u673a\u5668\u7684\u6307\u5411\u7aef\u53e3\u4e0a\uff0c\u518d\u901a\u8fc7tar\u89e3\u538b\uff1a<br \/>\nserver1$ tar cvzf &#8211; myfile.myd | nc -q 1 server2 12345<\/p>\n<p>\u6d4b\u8bd5\u786c\u76d8\u8bfb\u5199\u6027\u80fd\uff1a sudo hdparm -Tt \/dev\/sda<\/p>\n<p>\u53ea\u6253\u5370\u5076\u6570\u884c\uff1ased -n 2~2p filename\uff0c \u5947\u6570\u884c\uff1ased -n 1~2p filename<br \/>\n\u5c06\u6587\u672c\u4e2d\u7684\u6362\u884c\u5408\u5e76\uff0c\u7528\u9017\u53f7\u8fde\u63a5 \uff1a cat q2 | head -n 100 | tr &#8220;\\n&#8221; &#8220;,&#8221;<\/p>\n<p>vi\u63d2\u5165\u5f53\u524d\u884c\u53f7 :%s\/^\/\\=printf(&#8216;%-4d&#8217;, line(&#8216;.&#8217;))<\/p>\n<p>pip\u66f4\u65b0\u5305\u8001\u662f\u66f4\u65b0\u4e0d\u5230\u65b0\u7248\u672c\u4e0a\u53bb\uff0c\u89e3\u51b3\u529e\u6cd5\u662f\u627e\u5230env\u73af\u5883\u7684build\u76ee\u5f55\uff0c\u628a\u76f8\u5e94\u5305\u7684\u76ee\u5f55\u5e72\u6389\uff0c\u5e76\u7528 pip install &#8211;upgrade &#8211;ignore-installed \u3002<\/p>\n<p>\u89e3\u51b3 ssh \u8fde\u63a5\u8d85\u65f6\u4e2d\u65ad\u7684\u95ee\u9898\uff0c~\/.ssh\/config\uff1a<br \/>\nHost *<br \/>\nServerAliveInterval 300<br \/>\nServerAliveCountMax 2<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4fee\u6539 ssh \u7aef\u53e3 sudo vi \/etc\/ssh\/sshd_config \u4fee\u6539port 22 \u4e3a port [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-5706","post","type-post","status-publish","format-standard","hentry","category-my_notes"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/5706","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=5706"}],"version-history":[{"count":5,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/5706\/revisions"}],"predecessor-version":[{"id":5987,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/5706\/revisions\/5987"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=5706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=5706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=5706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}