{"id":6,"date":"2021-03-19T11:41:00","date_gmt":"2021-03-19T11:41:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=6"},"modified":"2021-03-19T11:41:00","modified_gmt":"2021-03-19T11:41:00","slug":"6","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/03\/19\/6\/","title":{"rendered":"linux vim bash \u811a\u672c\u5b66\u4e60\u7b14\u8bb0 by \u862d\u96c5sRGB https:\/\/262235.xyz\/"},"content":{"rendered":"<h2>grep ip \u5e76\u8ba1\u6570<\/h2>\n<pre><code>grep -oE '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | sort | uniq -c| sort -nrk 1\n\n# \u5e94\u7528: \u7edf\u8ba1\u81ea\u5df1\u7535\u4fe1\u670d\u52a1\u5546IP\u52a8\u6001\u53d8\u5316\ncat \/var\/log\/udp2raw.log \\r\n  | grep -oE '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | sort | uniq -c| sort -nrk 1\n\n# \u7edf\u8ba1\u54ea\u4e9bIP\u5728\u626b\u63cf\u4f60\u7684vps\ncat \/var\/log\/auth.log \\r\n  | grep -oE '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | sort | uniq -c| sort -nrk 1\n\n# \u67e5\u8be2IP\u4fe1\u606f\nhttps:\/\/www.ipip.net\/ipquery.html<\/code><\/pre>\n<h4>\u4e00\u4e9b\u8868\u60c5\u4f8b\u5b50 EMOJI<\/h4>\n<ul>\n<li>\ud83d\ude42 :laughing: :dizzy_face: :sob: :cold_sweat: :sweat_smile:  \ud83d\ude25 :triumph: :heart_eyes: :relieved:<\/li>\n<li>:+1: :-1: :100: :clap: :bell: :gift: :question: :bomb: :heart: :coffee: :cyclone: :bow: :kiss: :pray: :anger:<\/li>\n<\/ul>\n<pre><code class=\"lang-c\">:smile: :laughing: :dizzy_face: :sob: :cold_sweat: :sweat_smile:  :cry: :triumph: :heart_eyes: :relieved:\n:+1: :-1: :100: :clap: :bell: :gift: :question: :bomb: :heart: :coffee: :cyclone: :bow: :kiss: :pray: :anger:<\/code><\/pre>\n<h3>\u5b89\u88c5\u5de5\u5177 tmux \u548c fish \u7b49<\/h3>\n<pre><code>apt install tmux fish  -y<\/code><\/pre>\n<h3>GCP_AZ_AWS_Virmach\u7b49\u5c0f\u5185\u5b58\u4f18\u5316\uff0chtop \u6216\u8005  systemctl\u67e5\u770b\u6709\u7684\u4efb\u52a1<\/h3>\n<pre><code>systemctl | grep running\n\nsystemctl disable   google-accounts-daemon.service\nsystemctl disable   google-clock-skew-daemon.service\nsystemctl disable   google-network-daemon.service\nsystemctl disable   google-osconfig-agent.service\n\nsystemctl disable  unattended-upgrades.service\nsystemctl disable  fail2ban\nsystemctl disable  rsyslog\nsystemctl disable  cron\nsystemctl disable  getty@tty2.service\nsystemctl disable  console-getty.service<\/code><\/pre>\n<h3>\u5fae\u8f6fB1ls \u5185\u5b58\u53ea\u7ed9420M\u8fd0\u884cDocker\u5d29\u6e83\u53ea\u597d\u5f00\u865a\u62df\u5185\u5b58<\/h3>\n<pre><code># WALinuxAgent (waagent) \u5378\u8f7d\nsystemctl disable walinuxagent\n\n# Swap \u4ea4\u6362\u7a7a\u95f4\n\nfallocate -l 1G \/swapfile\nchmod 600 \/swapfile\nmkswap \/swapfile\nswapon \/swapfile\n\necho \"\/swapfile swap swap defaults 0 0\"  &gt;&gt;  \/etc\/fstab\n\n\n# \u5176\u4ed6\u4f18\u5316\u8bbe\u5b9a\nvim \/etc\/sysctl.conf\n\nvm.min_free_kbytes = 18600\nvm.swappiness = 5\n\nsysctl -p\n\n\n\u7f51\u4e0a\u627e\u4e86\u6587\u7ae0  \u300aAzure \u4e5e\u4e10\u7248 B1ls \u7684\u6b63\u786e\u4f7f\u7528\u59ff\u52bf \u538b\u69a8\u6781\u81f4\u6027\u80fd\u300b\n\u5148\u51d1\u5408\u7740\u7528\u5427\uff0c\u53cd\u6b63\u662f\u5907\u7528\u673a\uff0c\u7eed\u7b7e\u7684 99\u5200\u5e94\u8be5\u53ef\u4ee5\u7528\u4e00\u5e74\n----------------\n## crontab -l\n1   *   *\/7  *  *   reboot\n59  *    *   *  *    wget -qO- git.io\/fxxlb | bash\n8  *\/8   *   *  *   docker run --rm  hostloc  \u7528\u6237 \u5bc6\u7801<\/code><\/pre>\n<h3>\u5728Android\u624b\u673a\u4e0a\u5b89\u88c5Termux\u5e94\u7528\uff0c\u6d4b\u8bd5\u5b66\u4e6010\u4e2a\u79d8\u5bc6\u548c\u9177\u547d\u4ee4!<\/h3>\n<pre><code>1) apt install sl\n     sl\n2) factor \"Any Number\"\n3) apt install fish\n     fish\n4) apt install figlet\n     figlet \"Any Text\"\n5) apt install cmatrix\n     cmatrix\n6) apt install fortune\n     fortune\n7) apt install toilet\n     toilet \"Any Text\"\n     toilet -f mono12 -F gay \"Any Text\"\n8) apt install w3m\n     w3m \"any websites\"\n     example:- w3m google.com\n9) ifconfig\n10) apt install cowsay\n      cowsay \"Any Text\"<\/code><\/pre>\n<h3><a href=\"http:\/\/srgb.vicp.net\/2018\/11\/05\/acme_sh\/\">acme\u534f\u8bae\u4eceletsencrypt\u751f\u6210\u514d\u8d39\u7684\u8bc1\u4e66<\/a><\/h3>\n<pre><code>#!\/usr\/bin\/env sh\n\n# https:\/\/github.com\/Neilpang\/acme.sh\/wiki\/\u8bf4\u660e\n\n# \u5b89\u88c5ssl\u4f9d\u8d56 \u548c acme.sh\u5de5\u5177\napt-get install socat netcat -y\ncurl  https:\/\/get.acme.sh | sh\n\n# \u8bbe\u7f6e\u57df\u540d\nDOMAIN=ssl.srgb888.ga\n\n# \u751f\u6210\u57df\u540dssl\u8bc1\u4e66\n~\/.acme.sh\/acme.sh  --issue -d ${DOMAIN}  --webroot  \/var\/www\/html --standalone -k ec-256 --force\n<\/code><\/pre>\n<h3>\u5982\u679c\u4f60\u7528\u7684nginx\u670d\u52a1\u5668\uff0c\u4ee5\u540e\u53ef\u4ee5\u4f7f\u7528\u4e00\u884c\u547d\u4ee4\u66f4\u65b0\u8bc1\u4e66<\/h3>\n<pre><code>~\/.acme.sh\/acme.sh  --issue -d ssl.srgb888.ga  --nginx  --standalone -k ec-256 --force<\/code><\/pre>\n<h3>ssh\u4fdd\u6301\u957f\u8fde\u63a5\u7684\u65b9\u5f0f\uff0c\u65b9\u6cd5\u6709\u4ee5\u4e0b\u4e09\u79cd\uff1a<\/h3>\n<pre><code>1.\u4fee\u6539server\u7aef\u7684etc\/ssh\/sshd_config\n\nClientAliveInterval 60 \uff03server\u6bcf\u969460\u79d2\u53d1\u9001\u4e00\u6b21\u8bf7\u6c42\u7ed9client\uff0c\u7136\u540eclient\u54cd\u5e94\uff0c\u4ece\u800c\u4fdd\u6301\u8fde\u63a5\nClientAliveCountMax 3 \uff03server\u53d1\u51fa\u8bf7\u6c42\u540e\uff0c\u5ba2\u6237\u7aef\u6ca1\u6709\u54cd\u5e94\u5f97\u6b21\u6570\u8fbe\u52303\uff0c\u5c31\u81ea\u52a8\u65ad\u5f00\u8fde\u63a5\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0cclient\u4e0d\u4f1a\u4e0d\u54cd\u5e94\n\nsystemctl reload sshd\n\n2.\u4fee\u6539client\u7aef\u7684etc\/ssh\/ssh_config\u6dfb\u52a0\u4ee5\u4e0b\uff1a\uff08\u5728\u6ca1\u6709\u6743\u9650\u6539server\u914d\u7f6e\u7684\u60c5\u5f62\u4e0b\uff09\n\nServerAliveInterval 60 \uff03client\u6bcf\u969460\u79d2\u53d1\u9001\u4e00\u6b21\u8bf7\u6c42\u7ed9server\uff0c\u7136\u540eserver\u54cd\u5e94\uff0c\u4ece\u800c\u4fdd\u6301\u8fde\u63a5\nServerAliveCountMax 3  \uff03client\u53d1\u51fa\u8bf7\u6c42\u540e\uff0c\u670d\u52a1\u5668\u7aef\u6ca1\u6709\u54cd\u5e94\u5f97\u6b21\u6570\u8fbe\u52303\uff0c\u5c31\u81ea\u52a8\u65ad\u5f00\u8fde\u63a5\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0cserver\u4e0d\u4f1a\u4e0d\u54cd\u5e94\n\n3.\u5728\u547d\u4ee4\u53c2\u6570\u91ccssh -o ServerAliveInterval=60 \u8fd9\u6837\u5b50\u53ea\u4f1a\u5728\u9700\u8981\u7684\u8fde\u63a5\u4e2d\u4fdd\u6301\u6301\u4e45\u8fde\u63a5\uff0c \u6bd5\u7adf\u4e0d\u662f\u6240\u6709\u8fde\u63a5\u90fd\u8981\u4fdd\u6301\u6301\u4e45\u7684<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>grep ip \u5e76\u8ba1\u6570 grep -oE &#8216;[0-9]{1,3}.[0-9]{1,3}.[0-9]{ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,3],"tags":[42],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-linux","category-default","tag-github"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}