{"id":6043,"date":"2016-08-15T14:46:33","date_gmt":"2016-08-15T06:46:33","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=6043"},"modified":"2016-08-15T14:48:08","modified_gmt":"2016-08-15T06:48:08","slug":"linux%e5%91%bd%e4%bb%a4%e7%ac%94%e8%ae%b0%e5%85%ab","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/6043.html","title":{"rendered":"Linux\u547d\u4ee4\u7b14\u8bb0[\u516b]"},"content":{"rendered":"<p>fc-list \u67e5\u770b\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u53ef\u7528\u5b57\u4f53\u5217\u8868\u3002<\/p>\n<p>\u6267\u884c\u547d\u4ee4\u62a5\u9519\uff1a<\/p>\n<p>perl: warning: Setting locale failed.<br \/>\nperl: warning: Please check that your locale settings:<br \/>\nLANGUAGE = &#8220;en_US:en&#8221;,<br \/>\nLC_ALL = (unset),<br \/>\nLC_TIME = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_MONETARY = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_ADDRESS = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_TELEPHONE = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_NAME = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_MEASUREMENT = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_IDENTIFICATION = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_NUMERIC = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLC_PAPER = &#8220;zh_CN.UTF-8&#8221;,<br \/>\nLANG = &#8220;en_US.UTF-8&#8221;<br \/>\nare supported and installed on your system.<br \/>\nperl: warning: Falling back to the standard locale (&#8220;C&#8221;).<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n<p>export LANGUAGE=en_US.UTF-8<br \/>\nexport LANG=en_US.UTF-8<br \/>\nexport LC_ALL=en_US.UTF-8<br \/>\nlocale-gen en_US.UTF-8<br \/>\ndpkg-reconfigure locales<\/p>\n<p>\u6216:<\/p>\n<p>sudo vi \/var\/lib\/locales\/supported.d\/local<br \/>\n\u6dfb\u52a0\uff1a<br \/>\nen_US.UTF-8 UTF-8<br \/>\nzh_CN.UTF-8 UTF-8<br \/>\n\u7136\u540e\uff1a<br \/>\nsudo dpkg-reconfigure locales<\/p>\n<p>\u5229\u7528rsync\u4f20\u8f93\u6587\u4ef6\uff1arsync -avzP &#8211;protocol=29 u4.meilapp.com:\/data\/idc_migration\/*.sql .<\/p>\n<p>ubuntu\u4fee\u6539\u7f51\u7edc\u8bbe\u7f6e\u540e\uff0c\u751f\u6548\u4f7f\u7528\uff1asudo service network-manager restart , sudo ifdown eth0 &amp;&amp; sudo ifup eth0<\/p>\n<p>ubuntu\u5b89\u88c5\u5305\u768432\u4f4d\u7248\u672c\uff0c\u53ea\u8981\u5728\u6240\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u540e\u9762\u52a0\u4e0a:i386\u5c31\u53ef\u4ee5\u4e86\uff0c\u6bd4\u5982\u8981\u5b89\u88c5libfontconfig1\uff0c\u90a3\u4e48\u6211\u4eec\u6240\u8f93\u5165\u7684\u547d\u4ee4\u5c31\u662f sudo apt-get install libfontconfig1:i386<\/p>\n<p>ubuntu\u4e0a\u7684\u4e00\u6b3e\u7f51\u9875\u622a\u56fe\u547d\u4ee4\u5de5\u5177\uff1awebkit2png https:\/\/github.com\/AdamN\/python-webkit2png\/ \u5b89\u88c5\uff1apip install webkit2png<br \/>\nThere are a few python alternatives : Browshot, eagleeye_te, django-url2png, sharder, django-thummer, WeasyPrint, wkhtmltopdf and probably more (look for libraries like ReportLab too)<br \/>\nBrowshot, WeasyPrint &amp; wkhtmltopdf seems to be the best choices.<br \/>\nfrom selenium import webdriver<\/p>\n<p>browser = webdriver.Firefox() \u6216 browser = webdriver.PhantomJS()<br \/>\nbrowser.get(&#8216;http:\/\/www.google.com\/&#8217;)<br \/>\nbrowser.save_screenshot(&#8216;screenshot.png&#8217;)<br \/>\nbrowser.quit()<\/p>\n<p>\u5f00\u6e90\u7684png\u56fe\u7247\u538b\u7f29\u5de5\u5177\uff1ahttp:\/\/pngquant.com\/<\/p>\n<p>\u914d\u7f6esamba:<br \/>\n$ sudo apt-get install samba<\/p>\n<p>$ sudo vim \/etc\/samba\/smb.conf<\/p>\n<p>\u5728smb.conf\u6700\u540e\u6dfb\u52a0\uff1a<\/p>\n<p>[share]<br \/>\npath = \/home\/share<br \/>\nbrowseable = yes<br \/>\nwritable = yes<\/p>\n<p>\u6ce8\u610f\uff0c\u521b\u5efasamba\u7528\u6237\u4e4b\u524d\uff0c\u5fc5\u987b\u5148\u786e\u4fdd\u6709\u4e00\u4e2a\u540c\u540d\u7684Linux\u7528\u6237\uff0c\u5426\u5219samba\u7528\u6237\u4f1a\u521b\u5efa\u5931\u8d25\u3002<br \/>\n\u6dfb\u52a0\u4e00\u4e2a\u4e13\u95e8\u7528\u6237\u6765\u7ed9samb\u7528\uff0csudo useradd share &#8211;shell \/bin\/false<\/p>\n<p>$ sudo smbpasswd -a smbuser<\/p>\n<p>\u91cd\u542fsamba\u670d\u52a1<\/p>\n<p>$ sudo service smbd restart<\/p>\n<p>\u6302\u8f7d\u7684\u547d\u4ee4\uff1asudo mount -t cifs \/\/172.16.1.30\/kyle\/ \/media\/kyle\/ -o username=kyle,password=kyle123456,uid=kyle,gid=users,file_mode=0640,dir_mode=0750,iocharset=utf8<\/p>\n<p>\u5c06\u7528\u6237\u52a0\u5165sudo\u6743\u9650\u7ec4\uff1a sudo usermod -a -G sudo username<\/p>\n<p>\u4e00\u4e2a\u597d\u7528\u7684diff\u5de5\u5177\uff1aicdiff https:\/\/github.com\/jeffkaufman\/icdiff git difftool &#8211;extcmd icdiff<\/p>\n<p>\u627e\u51fa\u4e24\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u5dee\u5f02\u884c\uff0c\u6bd4\u5982\u4e00\u4e2a\u6587\u4ef6\u591a\u51fa\u7684\u4e00\u4e9b\u6570\u636e\u884c\uff1adiff &lt;(sort open_id.txt) &lt;(sort open_id_union.txt)<\/p>\n<p>grep\u65e5\u5fd7\u6587\u4ef6\u4e2d\u7684unicode \uff1agrep &#8216;\\\\u4f60\\\\u73b0\\\\u5728\\\\u4eceL&#8217; m19\/meila_app\/2014122300.log<\/p>\n<p>$ head express<br \/>\n10000 aae AAE<br \/>\n10010 anxindakuaixi \u5b89\u4fe1\u8fbe<br \/>\n$ cat express | awk &#8216;{print &#8220;(&#8220;$1&#8243;,&#8221;&#8221;\\&#8221;&#8221;$2&#8243;\\&#8221;&#8221;&#8221;,&#8221;&#8221;\\&#8221;&#8221;$3&#8243;\\&#8221;&#8221;&#8221;)&#8221;}&#8217; | head<br \/>\n(10000,&#8221;aae&#8221;,&#8221;AAE&#8221;)<br \/>\n(10010,&#8221;anxindakuaixi&#8221;,&#8221;\u5b89\u4fe1\u8fbe&#8221;)<\/p>\n<p>rsync\u901a\u8fc7\u975e\u6807\u51c6ssh\u7aef\u53e3\u4f20\u8f93\u6587\u4ef6\uff1a rsync -avz -e &#8220;ssh -p $portNumber&#8221; user@remoteip:\/path\/to\/files\/ \/local\/path\/\uff0c \u7528-e\u53c2\u6570<\/p>\n<p>\u5b89\u88c5deluged\u5305\u9047\u5230\u9519\u8bef \uff1aDepends: python:any<br \/>\n\u89e3\u51b3\u529e\u6cd5\uff1avi \/var\/lib\/dpkg\/status \uff0c\u5220\u9664 python:any \u8fd9\u4e00\u90e8\u5206 \u3002<\/p>\n<p>\u6d41\u91cf\u76d1\u63a7\uff0c\u6309\u8fdb\u7a0b\u5206\u7c7b\u67e5\u770b\u6d41\u7a0b\u60c5\u51b5\uff0csudo nethogs -p eth0<\/p>\n<p>\u8bbe\u7f6ecrontab\u4f7f\u7528vim\u7f16\u8f91\u5668\uff1aexport VISUAL=vim<br \/>\nsudo update-alternatives &#8211;config editor<\/p>\n<p>crontab \u8bbe\u7f6e\u56fa\u5b9a\u65f6\u95f4\uff0c\u4e0d\u6267\u884c\uff0c\u4f46\u662f\u8bbe\u7f6e\u6bcf\u9694\u51e0\u5206\u949f\u5c31\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\uff0c\u95ee\u9898\u5728\u4e8e\u65f6\u533a\u95ee\u9898\u3002debian\u4e2dcron\u4f1a\u8bfb\/etc\/timezone\u6765\u505a\u4e3a\u65f6\u533a\uff0c\u6211\u4eec\u9700\u8981\u7f16\u8f91 \/etc\/timezone\uff0c\u628a\u91cc\u9762\u5168\u90e8\u5220\u9664\uff0c\u7136\u540e\u6dfb\u52a0Asia\/Shangha\uff0c\u8fd9\u6837\u662f\u8bbe\u7f6e\u4e3a\u4e0a\u6d77\u65f6\u533a\uff0c\u6700\u540e\u91cd\u542f\u4e00\u4e0bcron\u3002\uff08ubuntu\u4e0b\u914d\u7f6e\u65f6\u533a sudo dpkg-reconfigure tzdata\uff09<br \/>\n\u67e5\u770bcron\u65e5\u5fd7 grep CRON \/var\/log\/syslog<\/p>\n<p>nginx\u5c4f\u853d\u6307\u5b9aip\u8bbf\u95ee\u65b9\u6cd5 \uff0cvi nginx.conf \u5728http\u8282\u70b9\u6dfb\u52a0\uff1ainclude blockips.conf\uff1b \u7136\u540e\u5728 blockips.conf \u6587\u4ef6\u4e2d\u5199<br \/>\ndeny 1.2.3.4;<br \/>\ndeny 91.212.45.0\/24;<br \/>\ndeny 91.212.65.0\/24;<br \/>\n\u7136\u540e \u518dnginx -s reload\uff0c\u53ef\u4ee5\u5148\u7528nginx -t \u6d4b\u8bd5\u4e00\u4e0b\u914d\u7f6e\u6b63\u786e<\/p>\n<p>vim\u5728\u5339\u914d\u5230\u7684\u524d\u9762\u65b0\u63d2\u5165\u4e00\u884c\uff0c\u547d\u4ee4 :%s\/^####\/&#8212;\\r\\r\\0\/g \\r\u8868\u793a\u6362\u884c\uff0c\\0\u8868\u793a\u5339\u914d\u5230\u7684\u4e1c\u897f<\/p>\n<p>awk\u6c42\u548c\uff0c\u7b2c\u4e00\u5217\u5927\u4e8e600\u7684\u6240\u5360\u6bd4\u4f8b\uff1aawk &#8216;BEGIN{s=0;a=0}{a+=($2&gt;600?$1:0);s+=$1;}END{print a\/s}&#8217; aa.log<\/p>\n<p>\u67e5\u770blinux\u7684\u811a\u672c\u4e3a\u4ec0\u4e48\u88ab\u7cfb\u7edfkill\u6389\uff0c\u65e5\u5fd7\u5728 \/var\/log\/kern.log<\/p>\n<p>\u7ed9\u786c\u76d8\u5206\u533a\uff0csudo fdisk \/dev\/sdb \uff0c\u7136\u540e n \u65b0\u5efa\u5206\u533a\uff0cp\u6253\u5370\u73b0\u6709\u5206\u533a\uff0cw\u4fdd\u5b58\u5e76\u9000\u51fa\u3002\u683c\u5f0f\u5316\u5206\u533a mkfs.ext4 \/dev\/sdb1<\/p>\n<p>samba \u670d\u52a1 service samba restart \u6ca1\u6709\u53cd\u5e94\u89e3\u51b3\uff1asudo service nmbd restart \u7136\u540e\u518d sudo service smbd restart<\/p>\n<p>ubuntu\u4e0b\u4fee\u6539\u6700\u5927\u6587\u4ef6\u63cf\u8ff0\u7b26\uff0culimit -n\uff1a<br \/>\n# \/etc\/security\/ulimits\/conf<br \/>\n* soft nofile 999999<br \/>\n* hard nofile 999999<\/p>\n<p># \/etc\/pam.d\/su<br \/>\nsession required pam_limits.so<\/p>\n<p># \/etc\/profile<br \/>\nulimit -SHn 999999<\/p>\n<p>\u83b7\u53d6\u5916\u7f51ip\u5730\u5740\uff0ccurl &#8220;http:\/\/members.3322.org\/dyndns\/getip&#8221;<\/p>\n<p>\u67e5\u770b\u5185\u5b58\u4f7f\u7528\u7387\uff1afree -b | awk &#8216;{split($1,a,&#8221; &#8220;);for (i in a){if (a[i]==&#8221;Mem:&#8221;)x=$2;else if (a[i]==&#8221;-\/+&#8221;) y=$3} }END{printf (&#8220;%4.2f\\n&#8221;,y\/x)}&#8217;<\/p>\n<p>ubuntu 14.04\u5b89\u88c5 PIL \u62a5\u9519<br \/>\n_imagingft.c:73:31: fatal error: freetype\/fterrors.h: No such file or directory<br \/>\n\u89e3\u51b3\u529e\u6cd5<br \/>\nln -s \/usr\/include\/freetype2 \/usr\/include\/freetype<\/p>\n<p>jpeg\u538b\u7f29\u5de5\u5177\uff0capt-get install jpegoptim\uff0cpng\u538b\u7f29\u5de5\u5177\uff0capt-get install optipng<\/p>\n<p>Linux\u4e0b\u9762\u67e5\u770b\u9644\u8fd1wifi\u5217\u8868\u7684\u5de5\u5177\uff1aLinSSID<\/p>\n<p>mac\u4e0b\u9762tree\u663e\u793a\u4e2d\u6587\u4e71\u7801\uff0c\u662f\u56e0\u4e3a\u5b57\u7b26\u88ab\u8f6c\u4e49\u4e86\uff0c\u52a0\u4e2a\u53c2\u6570\u5c31\u597d\u4e86\uff1atree -N<br \/>\n-N Print non-printable characters as is instead of as escaped octal numbers.<\/p>\n<p>Mac\u7528pip\u5b89\u88c5\u8f6f\u4ef6\uff0c\u4f1a\u51fa\u73b0\u9519\u8bef\uff1a<br \/>\nerror: could not create &#8216;\/System\/Library\/Frameworks\/Python.framework\/Versions\/2.7\/share&#8217;: Operation not permitted<br \/>\n\u89e3\u51b3\u529e\u6cd5\u662fpip\u52a0\u4e0a\u53c2\u6570 \uff0cpip &#8211;user\uff0c\u4f1a\u5b89\u88c5\u5230\u7528\u6237\u81ea\u5df1\u76ee\u5f55\u4e0b\u73b0\uff0c\u7136\u540e\u52a0\u5165\u5230shell\u7684\u5168\u5c40path\u4e2d\uff0c\u5982\u679c\u662ffish\uff1a<br \/>\nset &#8211;universal fish_user_paths $fish_user_paths ~\/Library\/Python\/2.7\/bin\/<\/p>\n<p>export python\u73af\u5883\u53d8\u91cf\u9700\u8981\u6ce8\u610f\u7684\u662f\uff1a<br \/>\nLD_LIBRARY_PATH is Linux (UNIX), under OSX it&#8217;s DYLD_LIBRARY_PATH.<br \/>\n\u6bd4\u5982\u5b89\u88c5 naoqi SDK\uff0c\u9700\u8981\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u4e0b\u9762\u662ffish shell\u7684\u8bed\u6cd5\uff0cbash\u5c31\u7528export<br \/>\nset -gx PYTHONPATH \/Users\/kyle\/Include\/pynaoqi-python2.7-2.1.4.13-mac64<br \/>\nset -gx LD_LIBRARY_PATH \/Users\/kyle\/Include\/pynaoqi-python2.7-2.1.4.13-mac64<br \/>\nset -gx DYLD_LIBRARY_PATH \/Users\/kyle\/Include\/pynaoqi-python2.7-2.1.4.13-mac64<\/p>\n<p>ubuntu server\u5b89\u88c5\u597d\u540e\u542f\u52a8\uff0c\u51fa\u73b0\u201cAdding 4051964K swap on \/dev\/sda5. Priority:-1 extents:1 across 4051964K FS\u201d \u8fd9\u4e00\u884c\u540e\uff0c\u5c31\u6b7b\u6389\u6ca1\u53cd\u5e94\u4e86\uff0c\u539f\u56e0\u662fUbuntu is trying to switch to a high resolution video mode for the console and your hardware isn&#8217;t cooperating\uff0c\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\nhttp:\/\/serverfault.com\/questions\/546079\/ubuntu-server-hanging-on-adding-swap<\/p>\n<p>\u88c5\u4e86Proxychains\uff0c\u89e3\u51b3\u4e86\u547d\u4ee4\u884c\u4e0bsock5\u4ee3\u7406\u95ee\u9898\u3002\u8fde\u4e0d\u4e0a\u65f6\uff0c\u53ea\u8981\u5728\u547d\u4ee4\u524d\u52a0proxychains4\u5c31\u884c\u4e86\uff0c\u6bd4\u5982sudo apt-get update\uff0c\u6539\u6210sudo proxychains4 apt-get update<\/p>\n<p>\u5bf9\u4e00\u4e2a\u6587\u4ef6\u5939\u4e0b\u9762\u7684\u56fe\u7247\uff0c\u6309\u4ece1.jpg\u9012\u589e\u7684\u65b9\u5f0f\u91cd\u547d\u540d\uff1a<br \/>\nfind DSI_*.jpg | awk &#8216;BEGIN {a=1} {printf &#8220;mv %s %04d.jpg\\n&#8221;, $0, a++}&#8217; | bash<\/p>\n<p>ubuntu server\u7cfb\u7edf\u542f\u52a8\u65f6\u62a5\u9519\uff1aTarget filesystem doesn&#8217;t have requested \/sbin\/init \uff0c\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\nhttp:\/\/askubuntu.com\/questions\/17647\/target-filesystem-doesnt-have-requested-sbin-init<\/p>\n<p>mac\u4e0b\u5c06iso\u6587\u4ef6\u7cfb\u7edf\u5236\u4f5c\u6210u\u76d8\u542f\u52a8\u76d8\u3002http:\/\/johanndutoit.net\/making-a-bootable-usb-on-mac-osx\/<br \/>\nhdiutil convert -format UDRW -o ~\/path\/to\/ubuntu.img ~\/path\/to\/ubuntu.iso<br \/>\n\u9996\u5148\u7528 df -h \u770bU\u76d8\u6709\u6ca1\u6709\u6302\u8f7d\uff0cdiskutil list \u770b\u78c1\u76d8\u540d\u79f0\u3002\u5982\u679c\u6709\u6302\u8f7d\uff0c\u5c31\u7528 diskutil unmount \/dev\/disk2s2\uff0c\u7136\u540e\u518d\u7528dd\u547d\u4ee4\uff1a<br \/>\nsudo dd if=\/Users\/kyle\/Downloads\/systemrescuecd-x86-4.7.1.iso.dmg of=\/dev\/disk2<br \/>\n\u6700\u540e\u5378\u8f7d\uff1adiskutil eject \/dev\/diskN<br \/>\n\u6ce8\u610f\uff1a\u7528unetbootin\u5236\u4f5c\u7684\u542f\u52a8\u76d8\u53ef\u80fd\u4f1a\u6709\u95ee\u9898\u3002<\/p>\n<p>\u5982\u4f55\u4e0d\u901a\u8fc7\u5de5\u5177\uff0c\u81ea\u5df1\u81ea\u52a8\u5236\u4f5cU\u76d8\u542f\u52a8\u76d8\uff1ahttp:\/\/askubuntu.com\/questions\/372607\/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal<\/p>\n<p>ubuntu\u652f\u6301ExFat\u6587\u4ef6\u683c\u5f0f \uff0csudo apt-get install exfat-fuse exfat-utils\uff0c\u7136\u540e sudo mount -t exfat \/dev\/sdxx \/media\/exfat<\/p>\n<p>\u5982\u679c\u5b9e\u65f6\u67e5\u770b\u6811\u8393\u6d3e\u7684\u6444\u50cf\u5934 http:\/\/raspberrypi.stackexchange.com\/questions\/23182\/how-to-stream-video-from-raspberry-pi-camera-and-watch-it-live<br \/>\nmplayer tv:\/\/ -tv driver=v4l2:width=640:height=480:device=\/dev\/video0 -fps 30<\/p>\n<p>\u6811\u8393\u6d3e\u9700\u8981\u8fd0\u884c sudo modprobe bcm2835-v4l2 \u8fd9\u4e2a\u547d\u4ee4\uff0c\u624d\u80fd\u4f7f\u7528\u4e3b\u7248\u4e0a\u7684 \/dev\/video\u8bbe\u5907\uff0c<br \/>\nYou can access the camera board on \/dev\/video0 by running the command<br \/>\nhttp:\/\/raspberrypi.stackexchange.com\/questions\/19822\/setting-camera-module-to-dev-video0-to-scan-qr-codes-using-zbar<\/p>\n<p>\u5c06\u6811\u8393\u6d3e\u4e0a\u7684\u89c6\u9891\u901a\u8fc7\u7f51\u7edc\u4f20\u8f93\u5230\u7535\u8111\uff0c\u5728\u6811\u8393\u6d3e\u7aef\uff0c\u8fd0\u884c<br \/>\nraspivid -w 640 -h 380 -fps 30 -t 999999 -o &#8211; | nc 192.168.124.5 5001<br \/>\n\u7136\u540e\u5728\u5ba2\u6237\u7aef 192.168.124.5 \u8fd0\u884c<br \/>\nnc -l 5001 | mplayer -fps 30 -cache 1024 &#8211;<\/p>\n<p>pip\u9ed8\u8ba4\u5b89\u88c5\u7684zbar\u6a21\u5757\u6709bug\uff0cimport zbar \u5c31\u76f4\u63a5 Segmentation fault\uff0c\u9700\u8981\u5b89\u88c5 git \u4e0a\u5728\u4fee\u590d\u7684\u7248\u672c\uff1asudo pip install git+https:\/\/github.com\/npinchot\/zbar.git<\/p>\n<p>Linux\u89c6\u9891\u76d1\u63a7\u76f8\u5173\u7a0b\u5e8f\uff0cfswebcam \uff0c\u5b83\u8c8c\u4f3c\u662f\u4e00\u4e2a\u622a\u56fe\u5de5\u5177\uff0c\u7136\u540e sudo apt-get install motion<br \/>\n\u6811\u8393\u6d3e\u4e2d\uff0c\u5c06\u89c6\u9891\u901a\u8fc7http\u5f62\u5f0f\u8f6c\u53d1\u51fa\u53bb\uff0c\u5728\u6d4f\u89c8\u5668\u91cc\u9762\u67e5\u770b\uff1ahttps:\/\/github.com\/jacksonliam\/mjpg-streamer<br \/>\nmjpg_streamer -i &#8220;input_raspicam.so -x 640 -y 480 -fps 6 -quality 8&#8221; -o &#8216;output_http.so &#8211;port=5001 -w .\/www&#8217;<\/p>\n<p>\u5728mac\u4e2d\u67e5\u770b\u5360\u752822\u7aef\u53e3\u7684\u7a0b\u5e8f \uff1a sudo lsof -n -i:22 | grep LISTEN<\/p>\n<p>.DS_Store\u662fMac OS\u4fdd\u5b58\u6587\u4ef6\u5939\u7684\u81ea\u5b9a\u4e49\u5c5e\u6027\u7684\u9690\u85cf\u6587\u4ef6\uff0c\u5982\u6587\u4ef6\u7684\u56fe\u6807\u4f4d\u7f6e\u6216\u80cc\u666f\u8272\uff0c\u76f8\u5f53\u4e8eWindows\u7684desktop.ini\u3002<br \/>\n1\uff0c\u7981\u6b62.DS_store\u751f\u6210\uff1a<br \/>\n\u6253\u5f00 \u201c\u7ec8\u7aef\u201d \uff0c\u590d\u5236\u9ecf\u8d34\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u56de\u8f66\u6267\u884c\uff0c\u91cd\u542fMac\u5373\u53ef\u751f\u6548\u3002<br \/>\ndefaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE<br \/>\n2\uff0c\u6062\u590d.DS_store\u751f\u6210\uff1a<br \/>\ndefaults delete com.apple.desktopservices DSDontWriteNetworkStores<\/p>\n<p>\u5173\u6389ssh\u68c0\u67e5 know_hosts<br \/>\nIn your ~\/.ssh\/config (if this file doesn&#8217;t exist, just create it):<br \/>\nHost *<br \/>\nStrictHostKeyChecking no<\/p>\n<p>\u76f4\u63a5\u7528\u7f51\u7edc\u8fde\u63a5raspberrypi\u548cmacbook\u65f6\uff0c\u6253\u5f00mac\u7cfb\u7edf\u8bbe\u7f6e-\u5171\u4eab-\u7f51\u7edc\u5171\u4eab\uff0c\u5c06wifi\u7f51\u7edc\u5171\u4eab\u5230usb\u7f51\u7edc\uff0c\u8fd9\u6837rasp\u5c31\u53ef\u4ee5\u62ff\u5230\u4e00\u4e2a\u7f51\u6bb5\u7684ip\uff0c\u518d\u7528nmap -sP &#8211;stats-every 10s 192.168.2.1\/24 \u5c31\u53ef\u4ee5\u53d1\u73b0\u6811\u8393\u6d3e\u7684ip\u3002<br \/>\n\u6240\u6709\u6811\u8393\u6d3e\u7684mac\u5730\u5740\u90fd\u662f\u4ee5 b8:27:eb \u5f00\u5934\u7684\uff0c\u901a\u8fc7\u7f51\u7ebf\u8fde\u63a5\u65f6\uff0c\u53ef\u4ee5\u53d1\u73b0\u8bf7\u6c42dhcp\u4fe1\u606f sudo tcpdump |egrep &#8220;b8:27:eb&#8221; \uff0c\u6216\u662f\u901a\u8fc7\u5206\u914d\u7684IP\u65ad\u6765\u67e5\u770b\uff1a sudo tcpdump |egrep &#8220;A 169.254&#8221;<\/p>\n<p>\u7ed9audio\u8bbe\u5907\u5236\u9020\u968f\u673a\u7684\u58f0\u97f3\uff1acat \/dev\/urandom | padsp tee \/dev\/audio &gt; \/dev\/null<br \/>\nhttp:\/\/unix.stackexchange.com\/questions\/13732\/generating-random-noise-for-fun-in-dev-snd<\/p>\n<p>\u5c06\u58f0\u97f3\u901a\u8fc7\u7f51\u7edc\u4f20\u8f93\u7ed9\u5176\u5b83\u8bbe\u5907\u64ad\u653e \uff1a http:\/\/www.commandlinefu.com\/commands\/view\/13030\/piping-microphone-audio-over-netcat<br \/>\n\u5728A\u7aef\uff1aport=3333;card=0;subdevice=0;arecord -D hw:${card},${subdevice} -f S16_LE -c2|nc -l $port<br \/>\n\u5728B\u7aef\uff1anc [A IP] 3333|aplay<br \/>\n\u6216\u662f\u901a\u8fc7 ssh\u4f20\u8f93\uff08\u5b9e\u9645\u6d4b\u8bd5\u5ef6\u8fdf\u975e\u5e38\u5927\uff09\uff1ahttp:\/\/unix.stackexchange.com\/questions\/116919\/redirect-sound-microphone-via-ssh-how-to-telephone-via-ssh<br \/>\narecord -f cd -t raw | oggenc &#8211; -r | ssh &lt;user&gt;@&lt;remotehost&gt; mplayer &#8211;<br \/>\n\u6216\u662f\u4fee\u6539alsa\u914d\u7f6e\u6587\u4ef6\u6765\u5b9e\u73b0\uff1ahttp:\/\/superuser.com\/questions\/432894\/pipe-system-sound-to-another-computer<\/p>\n<p>bundle\u5b89\u88c5\u56fd\u5916\u88abblock\uff0c\u6362\u7528taobao\u7684\u6e90\uff1abundle config mirror.https:\/\/rubygems.org https:\/\/ruby.taobao.org<\/p>\n<p>mac\u8001\u662f\u8fde\u4e0d\u4e0aUSB\u7f51\u7edc\u8f6c\u63a5\u5668\uff0c\u89e3\u51b3\u529e\u6cd5\uff1a<br \/>\n\u2014 Delete all network interfaces in System Preferences &gt; Network<br \/>\n\u2014 Delete file \/Library\/Preferences\/SystemConfiguration\/NetworkInterfaces.plist (and maybe you can need delete file \/Library\/Preferences\/SystemConfiguration\/preferences.plist)<br \/>\n\u2014 Reboot<br \/>\n\u2014 After Reboot go to System Preferences &gt; Network and add all network interfaces (wi-fi Ethernet and other)<br \/>\n\u2014 Done!<br \/>\n\u6765\u6e90\uff1ahttps:\/\/discussions.apple.com\/thread\/7251574?start=0&amp;tstart=0<\/p>\n<p>ubuntu\u4e0b\u9762\u5b89\u88c5\u8f6f\u4ef6\u51fa\u73b0\u4f9d\u8d56\u95ee\u9898\uff1a<br \/>\n&#8220;`<br \/>\n\u4e0b\u5217\u8f6f\u4ef6\u5305\u6709\u672a\u6ee1\u8db3\u7684\u4f9d\u8d56\u5173\u7cfb\uff1a<br \/>\nmysql-client : \u4f9d\u8d56: mysql-client-5.5 \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\nmysql-community-client:i386 : \u4f9d\u8d56: libaio1:i386 (&gt;= 0.3.93) \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u4f9d\u8d56: libncurses5:i386 (&gt;= 5.5-5~) \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u4f9d\u8d56: libtinfo5:i386 \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\nmysql-community-server:i386 : \u4f9d\u8d56: mysql-client:i386 (= 5.7.13-1ubuntu14.04)<br \/>\n\u4f9d\u8d56: apparmor:i386 \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u4f9d\u8d56: psmisc:i386 \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u4f9d\u8d56: libaio1:i386 (&gt;= 0.3.93) \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u4f9d\u8d56: libmecab2:i386 (&gt;= 0.996-1.1) \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u51b2\u7a81: mysql-server-5.6 \u4f46\u662f 5.6.30-0ubuntu0.14.04.1 \u6b63\u8981\u88ab\u5b89\u88c5<br \/>\nmysql-server : \u4f9d\u8d56: mysql-server-5.5 \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\nmysql-server-5.6 : \u4f9d\u8d56: mysql-client-5.6 (&gt;= 5.6.30-0ubuntu0.14.04.1) \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u4f9d\u8d56: mysql-server-core-5.6 (= 5.6.30-0ubuntu0.14.04.1) \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u63a8\u8350: mysql-common-5.6 \u4f46\u662f\u5b83\u5c06\u4e0d\u4f1a\u88ab\u5b89\u88c5<br \/>\n\u7834\u574f: virtual-mysql-server:i386<br \/>\nE: \u6709\u672a\u80fd\u6ee1\u8db3\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u8bf7\u5c1d\u8bd5\u4e0d\u6307\u660e\u8f6f\u4ef6\u5305\u7684\u540d\u5b57\u6765\u8fd0\u884c\u201capt-get -f install\u201d(\u4e5f\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u89e3\u51b3\u529e\u6cd5)\u3002<br \/>\n&#8220;`<\/p>\n<p>\u539f\u56e0\u662f\u6e90\u7684\u7248\u672c\u4e0e\u7cfb\u7edf\u7248\u672c\u4e0d\u5339\u914d\uff0cubuntu\u7248\u672c\u4e3a14.04.1\uff0c\u800c\u901a\u8fc7dpkg\u770b\u7248\u672c\u5374\u4e3a 14.04<\/p>\n<p>&#8220;`<br \/>\ndpkg -l | grep mysql<br \/>\nrc mysql-community-server 5.7.13-1ubuntu14.04<br \/>\n&#8220;`<\/p>\n<p>\u901a\u8fc7 dpkg -r \u628a\u7248\u672c\u4e0d\u6b63\u786e\u7684\u5305\u5220\u9664\u6389\uff1a dpkg -r mysql-community-server<\/p>\n<p>virtualbox\u589e\u52a0\u5df2\u7ecf\u5206\u914d\u865a\u62df\u673a\u786c\u76d8\u5927\u5c0f\uff1aVBoxManage modifyhd ~\/VirtualBox\\ VMs\/win10\/win10.vdi &#8211;resize 15360<\/p>\n<p>\u89e3\u51b3Supervisor\u4e0d\u80fd\u771f\u6b63\u505c\u6b62django\u8fdb\u7a0b\uff0c\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u914d\u7f6e\uff1a<br \/>\nstopasgroup=true<\/p>\n<p>\u5c06\u89c6\u9891\u6587\u4ef6\u53bb\u9664\u6389\u97f3\u9891 ffmpeg -i 1.MOV -vcodec copy -an 2.mov<\/p>\n<p>mac\u4e0a\u9762 spotlight \u53ef\u4ee5\u624b\u52a8\u7a97\u53e3\uff0c\u6709\u65f6\u5019\u4e0d\u5c0f\u5fc3\u62d6\u8d70\u4e86\uff0c\u5c31\u6ca1\u529e\u6cd5\u8fd8\u539f\u5c45\u4e2d\u7684\u4f4d\u7f6e\uff0c\u5f3a\u8feb\u75c7\u4e0d\u80fd\u5fcd\uff0c\u4e00\u4e2a\u547d\u4ee4\u89e3\u51b3\uff1adefaults delete com.apple.Spotlight userHasMovedWindow<\/p>\n<p>\u8c03\u8bd5nginx\u7684\u914d\u7f6e\u6587\u4ef6\u89c4\u5219 \uff0c\u7279\u522b\u662f location \u5339\u914d\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u5728 nginx \u7684\u65e5\u5fd7\u91cc\u9762\u52a0\u4e0a debug :<br \/>\nerror_log \/var\/log\/nginx\/app30.axmtec.com-error.log debug;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>fc-list \u67e5\u770b\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u53ef\u7528\u5b57\u4f53\u5217\u8868\u3002 \u6267\u884c\u547d\u4ee4\u62a5\u9519\uff1a perl: warning: Setting  [&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-6043","post","type-post","status-publish","format-standard","hentry","category-my_notes"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6043","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=6043"}],"version-history":[{"count":2,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6043\/revisions"}],"predecessor-version":[{"id":6045,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/6043\/revisions\/6045"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=6043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=6043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=6043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}