锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲宅男天堂在线观看无病毒 ,在线观看国产区亚洲一区成人,亚洲综合国产一区二区三区http://www.tkk7.com/paulwong/category/50768.htmlzh-cnThu, 16 Jan 2025 02:42:00 GMTThu, 16 Jan 2025 02:42:00 GMT60寮婧愰暅鍍忓簱http://www.tkk7.com/paulwong/archive/2025/01/13/451550.htmlpaulwongpaulwongMon, 13 Jan 2025 02:32:00 GMThttp://www.tkk7.com/paulwong/archive/2025/01/13/451550.htmlhttp://www.tkk7.com/paulwong/comments/451550.htmlhttp://www.tkk7.com/paulwong/archive/2025/01/13/451550.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/451550.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/451550.html https://mirrors.huaweicloud.com/home
https://mirrors.huaweicloud.com/artifactory/pypi-public/simple/torch/

娓呭崕:

paulwong 2025-01-13 10:32 鍙戣〃璇勮
]]>
linux鍒犻櫎澶氫綑鐨勬棫鍐呮牳http://www.tkk7.com/paulwong/archive/2025/01/05/451537.htmlpaulwongpaulwongSun, 05 Jan 2025 04:01:00 GMThttp://www.tkk7.com/paulwong/archive/2025/01/05/451537.htmlhttp://www.tkk7.com/paulwong/comments/451537.htmlhttp://www.tkk7.com/paulwong/archive/2025/01/05/451537.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/451537.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/451537.html
dnf remove $(dnf repoquery --installonly --latest-limit=-2)




paulwong 2025-01-05 12:01 鍙戣〃璇勮
]]>
REDHEAD 8 LINUX 杞歡闆嗗悎http://www.tkk7.com/paulwong/archive/2022/06/23/450773.htmlpaulwongpaulwongThu, 23 Jun 2022 09:27:00 GMThttp://www.tkk7.com/paulwong/archive/2022/06/23/450773.htmlhttp://www.tkk7.com/paulwong/comments/450773.htmlhttp://www.tkk7.com/paulwong/archive/2022/06/23/450773.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/450773.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/450773.htmlhttps://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/index




paulwong 2022-06-23 17:27 鍙戣〃璇勮
]]>
LINUX YUMhttp://www.tkk7.com/paulwong/archive/2022/06/23/450772.htmlpaulwongpaulwongThu, 23 Jun 2022 09:21:00 GMThttp://www.tkk7.com/paulwong/archive/2022/06/23/450772.htmlhttp://www.tkk7.com/paulwong/comments/450772.htmlhttp://www.tkk7.com/paulwong/archive/2022/06/23/450772.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/450772.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/450772.html
yum module list nginx

Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
Name                                         Stream                                         Profiles                                         Summary
nginx                                        1.14 [d]                                       common [d]                                       nginx webserver
nginx                                        1.16                                           common [d]                                       nginx webserver
nginx                                        1.18                                           common [d]                                       nginx webserver
nginx                                        1.20 [e]                                       common [d]                                       nginx webserver

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled


璁懼畾鏌愪釜鐗堟湰涓洪粯璁ょ増鏈?br />
yum module enable nginx:1.20


瀹夎榛樿鐗堟湰
yum install nginx





paulwong 2022-06-23 17:21 鍙戣〃璇勮
]]>
openJDK鏃犳硶榪涜jmaphttp://www.tkk7.com/paulwong/archive/2022/05/19/450751.htmlpaulwongpaulwongThu, 19 May 2022 05:53:00 GMThttp://www.tkk7.com/paulwong/archive/2022/05/19/450751.htmlhttp://www.tkk7.com/paulwong/comments/450751.htmlhttp://www.tkk7.com/paulwong/archive/2022/05/19/450751.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/450751.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/450751.htmlhttps://blog.csdn.net/qq_32447301/article/details/85109014


paulwong 2022-05-19 13:53 鍙戣〃璇勮
]]>
REDHEAD 7 LINUX 杞歡闆嗗悎http://www.tkk7.com/paulwong/archive/2021/12/22/436243.htmlpaulwongpaulwongWed, 22 Dec 2021 06:28:00 GMThttp://www.tkk7.com/paulwong/archive/2021/12/22/436243.htmlhttp://www.tkk7.com/paulwong/comments/436243.htmlhttp://www.tkk7.com/paulwong/archive/2021/12/22/436243.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/436243.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/436243.htmlhttps://www.softwarecollections.org/en/

涓嶇敤鍐岹OOGLE瀵繪壘瀹夎鏂規硶銆?br />
瀹夎MYSQL紺轟緥錛?br />
# 2. Install the collection:
$ sudo yum install rh-mariadb103

# 3. Start using software collections:
$ scl enable rh-mariadb103 bash

$ service rh-mariadb103-mariadb start 
$ mysql
$ mysqld

#寮鏈哄姞杞藉懡浠?br />cp /opt/rh/rh-mariadb103/enable /etc/profile.d/rh-mariadb103.sh


paulwong 2021-12-22 14:28 鍙戣〃璇勮
]]>
LINUX涓嬪驚鐜鍙栨枃浠跺弬鏁板茍CURL榪滅▼APIhttp://www.tkk7.com/paulwong/archive/2021/08/26/435954.htmlpaulwongpaulwongThu, 26 Aug 2021 07:40:00 GMThttp://www.tkk7.com/paulwong/archive/2021/08/26/435954.htmlhttp://www.tkk7.com/paulwong/comments/435954.htmlhttp://www.tkk7.com/paulwong/archive/2021/08/26/435954.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435954.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435954.html
鍙傛暟鏂囦歡錛宼est1.json
{"ADDRESS_FREE":"XXX","NAME":{"SURNAME":"XXX","FIRST_NAME":"XXX"}}
{"ADDRESS_FREE":"XXX","NAME":{"SURNAME":"XXX","FIRST_NAME":"XXX"}}
{"ADDRESS_FREE":"XXX","NAME":{"SURNAME":"XXX","FIRST_NAME":"XXX"}}

test1.sh
#! /bin/bash

RESULT_FILE="result.csv"
echo "" > $RESULT_FILE
i=1
while read line || [[ "$line" ]] #In case the file has an incomplete (missing newline) last line, you could use this alternative:
do 
    echo "$i"
    printf "$i;$line;" >> $RESULT_FILE
    curl -w %{time_total} -o /dev/null -X POST -H "Content-Type:application/json" -d "$line" http://ip:port  >> $RESULT_FILE
    #printf "\n\r" >> $RESULT_FILE
    echo "" >> $RESULT_FILE
    #i=$(( $i + 1 ))
    (( i++ ))
done < test1.json

Reference:
https://stackoverflow.com/questions/30988586/creating-an-array-from-a-text-file-in-bash











paulwong 2021-08-26 15:40 鍙戣〃璇勮
]]>
Linux sha512sum commandhttp://www.tkk7.com/paulwong/archive/2021/07/14/435926.htmlpaulwongpaulwongWed, 14 Jul 2021 05:41:00 GMThttp://www.tkk7.com/paulwong/archive/2021/07/14/435926.htmlhttp://www.tkk7.com/paulwong/comments/435926.htmlhttp://www.tkk7.com/paulwong/archive/2021/07/14/435926.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435926.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435926.html
sha512sum [OPTION] [FILE]



paulwong 2021-07-14 13:41 鍙戣〃璇勮
]]>
NAS vs. SAN - What Are the Differences Between Themhttp://www.tkk7.com/paulwong/archive/2021/06/25/435910.htmlpaulwongpaulwongFri, 25 Jun 2021 07:18:00 GMThttp://www.tkk7.com/paulwong/archive/2021/06/25/435910.htmlhttp://www.tkk7.com/paulwong/comments/435910.htmlhttp://www.tkk7.com/paulwong/archive/2021/06/25/435910.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435910.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435910.htmlhttps://www.backblaze.com/blog/whats-the-diff-nas-vs-san/

NAS vs. SAN: Differences and Use Cases
https://www.enterprisestorageforum.com/networking/nas-vs-san-differences-and-use-cases/

DAS / NAS / IP SAN / FC SAN鍖哄埆
https://cloud.tencent.com/developer/article/1580887

paulwong 2021-06-25 15:18 鍙戣〃璇勮
]]>
Bash get filename from given path on Linux or Unixhttp://www.tkk7.com/paulwong/archive/2021/05/21/435879.htmlpaulwongpaulwongFri, 21 May 2021 06:10:00 GMThttp://www.tkk7.com/paulwong/archive/2021/05/21/435879.htmlhttp://www.tkk7.com/paulwong/comments/435879.htmlhttp://www.tkk7.com/paulwong/archive/2021/05/21/435879.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435879.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435879.htmlhttps://www.cyberciti.biz/faq/bash-get-filename-from-given-path-on-linux-or-unix/

paulwong 2021-05-21 14:10 鍙戣〃璇勮
]]>
TCP 閫g窔鐙鎱嬫鍒惰垏嫻佺▼http://www.tkk7.com/paulwong/archive/2020/12/29/435758.htmlpaulwongpaulwongTue, 29 Dec 2020 02:04:00 GMThttp://www.tkk7.com/paulwong/archive/2020/12/29/435758.htmlhttp://www.tkk7.com/paulwong/comments/435758.htmlhttp://www.tkk7.com/paulwong/archive/2020/12/29/435758.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435758.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435758.htmlhttps://dev.twsiyuan.com/2017/09/tcp-states.html
鍦ㄩ枊鐧煎熀鏂?HTTP 鐨勭恫璺噳鐢ㄦ湇鍕欐檪錛岀暥鏈夊ぇ閲忛g窔瑕佹眰錛屾垨鏄垏闀烽g窔 (Persistent connection) 瑕佹眰鏅傦紝甯稿父閬囧埌搴曞堡 TCP 鐨勯g窔鏂風窔閷錛屽皫鑷存湇鍕欎笉絀╁畾銆傚洜姝ょ爺絀朵簡瑙?TCP 鐨勯g窔鐙鎱嬫鍒訛紝涓﹀槜瑭︾敤鑷繁鐨勬柟寮忔暣鐞嗙瓎璦橈紝甯屾湜鑳藉緸鍩虹鐭ヨ瓨涓壘鍒拌В姹洪尟瑾ょ殑綬氱儲錛屾垨鏄換浣曡兘鏇撮蹭竴姝ュ劒鍖栨湇鍕欑殑鎵嬫銆?/p>

鍍呯磤閷?TCP 閫g窔鐙鎱嬩互鍙婂緩绔嬫垨鏄柗闁嬮g窔嫻佺▼錛岄棞鏂奸蹭竴姝ョ殑 TCP 灝佸寘鍗斿畾鍙弮鑰?Reference 閫g窔銆?/p>

TCP 寤虹珛閫g窔 (Open)

閫氬父鐨?TCP 閫g窔寤虹珛嫻佺▼鑸囩媭鎱嬶紝闇瑕佷笁嬈$殑璦婃伅浜ゆ彌渚嗗緩绔嬮g窔 (three-way handshaking)錛?/p>

TCP 寤虹珛閫g窔嫻佺▼鍦? src=

TCP 寤虹珛閫g窔嫻佺▼鍦?/p>

鍏朵腑宸﹂倞閫氬父鐐?server錛屽彸閭婂墖鐐?client錛屾枃瀛楁祦紼嬫弿榪幫細

  1. Server 寤虹珛 TCB錛岄枊鍟熺洠鑱介g窔錛岄插叆鐙鎱?LISTENING
  2. Client 鐧煎嚭閫g窔瑕佹眰 SYN錛岄插叆鐙鎱?SYN-SENT錛岀瓑寰呭洖鎳?/li>
  3. Server 鏀跺埌 SYN 瑕佹眰錛屽洖鎳夐g窔鍌抽?nbsp;SYN+ACK錛屼甫閫插叆鐙鎱?SYN-RCVD (SYN-RECEIVED)
  4. Client 鏀跺埌 SYN+ACK 紕鴻獚瀹屾垚閫g窔閫插叆鐙鎱?ESTABLISHED錛屼甫閫佸嚭 ACK
  5. Server 鏀跺埌 ACK 紕鴻獚閫g窔瀹屾垚錛屼篃閫插叆鐙鎱?ESTABLISHED
  6. 闆欐柟闁嬪鍌抽佷氦鎻涜硣鏂?/li>

瑭蹭簺鍚嶈鑸囩媭鎱嬭鏄庯細

  • CLOSED錛氶g窔闂滈枆鐙鎱?/li>
  • LISTENING錛氱洠鑱界媭鎱嬶紝琚嫊絳夊緟閫g窔
  • SYN-SENT錛氫富鍕曢佸嚭閫g窔瑕佹眰 SYN錛屼甫絳夊緟灝嶆柟鍥炴噳
  • SYN-RCVD錛氭敹鍒伴g窔瑕佹眰 SYN錛岄佸嚭宸辨柟鐨?SYN+ACK 寰岋紝絳夊緟灝嶆柟鍥炴噳
  • ESTABLISHED錛氱⒑瀹氬畬鎴愰g窔錛屽彲闁嬪鍌寵幾璩囨枡
  • TCB錛歍ransmission Control Block錛宻ee wiki
  • SYN錛歋ynchronous錛岃〃紺鴻垏灝嶆柟寤虹珛閫g窔鐨勫悓姝ョ铏?/li>
  • ACK錛欰cknowledgement錛岃〃紺虹櫦閫佺殑鏁告摎宸叉敹鍒扮劇瑾?/li>

鍦ㄥ緩绔嬮g窔鏅傦紝鍙兘鏈冪櫦鐢熼洐鏂瑰悓姝ュ緩绔嬮g窔鐨勬儏褰?(Simultaneous open)錛屽父瑕嬫柤 P2P 鐨勬噳鐢ㄤ腑錛屽叾 TCP 寤虹珛閫g窔鐨勬祦紼嬩笉澶竴妯o細

TCP 鍚屾寤虹珛閫g窔嫻佺▼鍦? src=

TCP 鍚屾寤虹珛閫g窔嫻佺▼鍦?/p>

鐣垚 TCP 鐙鎱嬫祦紼嬪湒鏈冩槸閫欐ǎ錛?/p>

TCP Open 鐙鎱嬪湒

TCP Open 鐙鎱嬪湒

TCP 鏂烽枊閫g窔 (Close)

TCP 闂滈枆嫻佺▼濡備笅錛屾瘮寤虹珛閫g窔閭勮瑜囬洔涓浜涳紝闇瑕佺稉閬庡洓嬈$殑璦婃伅浜ゆ彌 (four-way handshaking)錛岃娉ㄦ剰鐨勬槸鍙互鏄敱 server 鐧艱搗涓誨嫊闂滈枆錛屾姂鎴栨槸 client 鐧艱搗涓誨嫊闂滈枆錛?/p>

TCP 闂滈枆閫g窔嫻佺▼鍦? src=

TCP 闂滈枆閫g窔嫻佺▼鍦?/p>

鍏朵腑宸﹂倞閫氬父鐐?client 鐙鎱?(鐢?client 涓誨嫊鐧艱搗闂滈枆閫g窔)錛屽彸閭婂墖鐐?server 鐙鎱嬶紝鏂囧瓧嫻佺▼鎻忚堪錛?/p>

  1. Client 婧栧倷闂滈枆閫g窔錛岀櫦鍑?nbsp;FIN錛岄插叆鐙鎱?FIN-WAIT-1
  2. Server 鏀跺埌 FIN錛岀櫦鍥炴敹鍒扮殑 ACK錛岄插叆鐙鎱?CLOSE-WAIT錛屼甫閫氱煡 App 婧栧倷鏂風窔
  3. Client 鏀跺埌 ACK錛岄插叆鐙鎱?FIN-WAIT-2錛岀瓑寰?server 鐧煎嚭 FIN
  4. Server 紕鴻獚 App 铏曠悊瀹屾柗綬氳珛姹傦紝鐧煎嚭 FIN錛屼甫閫插叆鐙鎱?LAST-ACK
  5. Client 鏀跺埌 FIN錛屼甫鍥炲偝紕鴻獚鐨?nbsp;ACK錛岄插叆鐙鎱?TIME-WAIT錛岀瓑寰呮檪闁撻亷寰屾寮忛棞闁夐g窔
  6. Server 鏀跺埌 ACK錛屼究鐩存帴闂滈枆閫g窔

瑭蹭簺鍚嶈鑸囩媭鎱嬭鏄庯細

  • ESTABLISHED錛氶g窔闁嬪暉鐙鎱?/li>
  • CLOSE-WAIT錛氱瓑寰呴g窔闂滈枆鐙鎱嬶紝絳夊緟 App 鍥炴噳
  • LAST-ACK錛氱瓑寰呴g窔闂滈枆鐙鎱嬶紝絳夊緟閬犵鍥炴噳 ACK 寰岋紝渚塊棞闁夐g窔
  • FIN-WAIT-1錛氱瓑寰呴g窔闂滈枆鐙鎱嬶紝絳夊緟閬犵鍥炴噳 ACK
  • FIN-WAIT-2錛氱瓑寰呴g窔闂滈枆鐙鎱嬶紝絳夊緟閬犵鍥炴噳 FIN
  • TIME-WAIT錛氱瓑寰呴g窔闂滈枆鐙鎱嬶紝絳夋涓孌墊檪鍊欙紝淇濊瓑閬犵鏈夋敹鍒板叾 ACK 闂滈枆閫g窔 (綞茶礬寤墮伈鍟忛)
  • CLOSED錛氶g窔闂滈枆鐙鎱?/li>
  • FIN錛氳〃紺洪棞闁夐g窔鐨勫悓姝ョ铏?/li>
  • ACK錛欰cknowledgement錛岃〃紺虹櫦閫佺殑鏁告摎宸叉敹鍒扮劇瑾?/li>

鏈夊彲鑳介g窔鐨勯洐鏂瑰悓鏅傜櫦璧烽棞闁夛紝闆栫劧姍熺巼閭勮牷浣庣殑錛?/p>

TCP 鍚屾闂滈枆閫g窔嫻佺▼鍦? src=

TCP 鍚屾闂滈枆閫g窔嫻佺▼鍦?/p>

閫欓倞澶氫竴鍊嬬媭鎱嬶細

  • CLOSING錛氱瓑寰呴g窔闂滈枆鐙鎱嬶紝絳夊緟閬犵鍥炴噳 ACK

鐣垚 TCP 鐙鎱嬫祦紼嬪湒鏈冩槸閫欐ǎ錛?/p>

TCP Close 鐙鎱嬪湒

TCP Close 鐙鎱嬪湒

鏌ヨ鐝懼湪闆昏叇鐨?TCP 鐙鎱?/h2>

鏌ヨ鐩墠鎵鏈夌殑閫g窔鐙鎱?(Windows & Linux)錛?/p>

netstat -a

Reference



paulwong 2020-12-29 10:04 鍙戣〃璇勮
]]>
LINUX SHELL涔婼CLhttp://www.tkk7.com/paulwong/archive/2020/11/05/435715.htmlpaulwongpaulwongThu, 05 Nov 2020 08:42:00 GMThttp://www.tkk7.com/paulwong/archive/2020/11/05/435715.htmlhttp://www.tkk7.com/paulwong/comments/435715.htmlhttp://www.tkk7.com/paulwong/archive/2020/11/05/435715.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435715.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435715.htmlhttps://blog.51cto.com/hashlinux/1772066

CentOS/RHEL 寮鍙戠幆澧冧箣 devtoolset
http://blog.fungo.me/2016/03/centos-development-env/

How can I make a Red Hat Software Collection persist after a reboot/logout?
https://access.redhat.com/solutions/527703

paulwong 2020-11-05 16:42 鍙戣〃璇勮
]]>
!!!鏈嶅姟鍣ㄧ鍚勭瀹夎http://www.tkk7.com/paulwong/archive/2020/10/24/435705.htmlpaulwongpaulwongSat, 24 Oct 2020 15:46:00 GMThttp://www.tkk7.com/paulwong/archive/2020/10/24/435705.htmlhttp://www.tkk7.com/paulwong/comments/435705.htmlhttp://www.tkk7.com/paulwong/archive/2020/10/24/435705.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435705.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435705.htmlhttps://www.server-world.info/en/



paulwong 2020-10-24 23:46 鍙戣〃璇勮
]]>
鍦↙INUX涓牸寮忓寲JSON鐨勫伐鍏?jqhttp://www.tkk7.com/paulwong/archive/2020/10/12/435689.htmlpaulwongpaulwongMon, 12 Oct 2020 01:55:00 GMThttp://www.tkk7.com/paulwong/archive/2020/10/12/435689.htmlhttp://www.tkk7.com/paulwong/comments/435689.htmlhttp://www.tkk7.com/paulwong/archive/2020/10/12/435689.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435689.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435689.html
wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
chmod +x ./jq
cp jq /usr/bin


paulwong 2020-10-12 09:55 鍙戣〃璇勮
]]>
綰夸笂JVM宸ュ叿http://www.tkk7.com/paulwong/archive/2020/10/09/435686.htmlpaulwongpaulwongFri, 09 Oct 2020 11:12:00 GMThttp://www.tkk7.com/paulwong/archive/2020/10/09/435686.htmlhttp://www.tkk7.com/paulwong/comments/435686.htmlhttp://www.tkk7.com/paulwong/archive/2020/10/09/435686.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435686.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435686.htmlhttps://github.com/vipshop/vjtools

paulwong 2020-10-09 19:12 鍙戣〃璇勮
]]>
linux shell 涓鏌ユ枃浠跺す鏄惁瀛樺湪http://www.tkk7.com/paulwong/archive/2020/09/25/435673.htmlpaulwongpaulwongFri, 25 Sep 2020 03:11:00 GMThttp://www.tkk7.com/paulwong/archive/2020/09/25/435673.htmlhttp://www.tkk7.com/paulwong/comments/435673.htmlhttp://www.tkk7.com/paulwong/archive/2020/09/25/435673.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435673.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435673.html
if [ -d "$DIRECTORY" ]; then
  # Control will enter here if $DIRECTORY exists.
fi

Or to check if a directory doesn't exist:
if [ ! -d "$DIRECTORY" ]; then
  # Control will enter here if $DIRECTORY doesn't exist.
fi


paulwong 2020-09-25 11:11 鍙戣〃璇勮
]]>
linux shell 涓嚱鏁扮殑璋冪敤http://www.tkk7.com/paulwong/archive/2020/09/25/435672.htmlpaulwongpaulwongFri, 25 Sep 2020 03:06:00 GMThttp://www.tkk7.com/paulwong/archive/2020/09/25/435672.htmlhttp://www.tkk7.com/paulwong/comments/435672.htmlhttp://www.tkk7.com/paulwong/archive/2020/09/25/435672.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435672.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435672.htmlfunction fun1(){
  return 34
}

function fun2(){
  local res=$(fun1)
  echo $res
}
涓婇潰璋冪敤fun1鏃訛紝鎵撳嵃緇撴灉鍗翠笉榪斿洖34錛岃繖鏄負浣曪紵鍘熸潵鍑芥暟鍙槸榪斿洖緇撴灉鎴愬姛涓庡惁鐨勫鹼紝騫朵笉鑳借嚜瀹氫箟銆傚洜姝よ鏀規垚涓嬮潰榪欑鍐欐硶

function fun1(){
  echo 34
}

function fun2(){
  local res=$(fun1)
  echo $res
}

https://stackoverflow.com/questions/17336915/return-value-in-a-bash-function


paulwong 2020-09-25 11:06 鍙戣〃璇勮
]]>
鍚戞墍鏈夋湇鍔″櫒鍙戦佺浉鍚屽懡浠?/title><link>http://www.tkk7.com/paulwong/archive/2020/09/24/435670.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Thu, 24 Sep 2020 02:52:00 GMT</pubDate><guid>http://www.tkk7.com/paulwong/archive/2020/09/24/435670.html</guid><wfw:comment>http://www.tkk7.com/paulwong/comments/435670.html</wfw:comment><comments>http://www.tkk7.com/paulwong/archive/2020/09/24/435670.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/paulwong/comments/commentRss/435670.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/paulwong/services/trackbacks/435670.html</trackback:ping><description><![CDATA[鍏堝湪涓繪帶鏈烘墽琛宻sh-keygen錛屽啀鍚戣鎺ф満浼犺緭key錛?br /><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 />-->ssh-copy-id -i ~/.ssh/id_rsa.pub user1@ip</div><br />鏍蜂緥鑴氭湰transfer-artemis.sh濡備笅錛?br /><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 />-->#!/bin/bash<br /><br />loop_server(){<br />    for ((i=2<span style="color: #008000; ">;</span><span style="color: #008000; "> i<=8; i++))</span><span style="color: #008000; "><br /></span>    do<br />      ipd=10.10.31.1${i}2<br />      echo ${ipd}<br />      $1 ${ipd}<br />    done<br />    <br />    for ((i=1<span style="color: #008000; ">;</span><span style="color: #008000; "> i<=2; i++))</span><span style="color: #008000; "><br /></span>    do<br />      ipd=10.20.31.1${i}2<br />      echo ${ipd}<br />      $1 ${ipd}<br />    done<br />    <br />}<br /><br />start_artemis_cmd(){<br />    echo "ssh user1@${1} '/opt/myapp/artemis/apache-artemis-2.15.0/instance/bin/artemis-service start'"<br />    ssh user1@${1} '/opt/myapp/artemis/apache-artemis-2.15.0/instance/bin/artemis-service start'<br />}<br /><br />stop_artemis_cmd(){<br />    echo "ssh user1@${1} '/opt/myapp/apache-activemq-5.15.10/bin/activemq stop'"<br />    echo "ssh user1@${1} '/opt/myapp/artemis/apache-artemis-2.15.0/instance/bin/artemis-service stop'"<br />    ssh user1@${1} '/opt/myapp/apache-activemq-5.15.10/bin/activemq stop'<br />    ssh user1@${1} '/opt/myapp/artemis/apache-artemis-2.15.0/instance/bin/artemis-service stop'<br />}<br /><br />scp_artemis_cmd(){<br />    echo "ssh user1@${1} 'rm -rf /opt/myapp/artemis'"<br />    echo "scp -r /opt/myapp/artemis user1@${1}:/opt/myapp/"<br />    ssh user1@${1} 'rm -rf /opt/myapp/artemis'<br />    scp -r /opt/myapp/artemis user1@${1}:/opt/myapp/<br />}<br /><br />stop_artemis(){<br />    loop_server stop_artemis_cmd<br />}<br /><br />start_artemis(){<br />    loop_server start_artemis_cmd<br />}<br /><br />scp_artemis(){ <br />    loop_server scp_artemis_cmd<br />}<br /><br />#start_artemis "Hello start_artemis"<br /><br />$1</div><br />鎵ц鍛戒護錛?br /><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 />-->./transfer-artemis.sh start_artemis</div><img src ="http://www.tkk7.com/paulwong/aggbug/435670.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/paulwong/" target="_blank">paulwong</a> 2020-09-24 10:52 <a href="http://www.tkk7.com/paulwong/archive/2020/09/24/435670.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>linux nohup鍛戒護璇﹁Вhttp://www.tkk7.com/paulwong/archive/2020/09/02/435652.htmlpaulwongpaulwongWed, 02 Sep 2020 03:52:00 GMThttp://www.tkk7.com/paulwong/archive/2020/09/02/435652.htmlhttp://www.tkk7.com/paulwong/comments/435652.htmlhttp://www.tkk7.com/paulwong/archive/2020/09/02/435652.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435652.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435652.html
nohup鍛戒護錛氬鏋滀綘姝e湪榪愯涓涓繘紼嬶紝鑰屼笖浣犺寰楀湪閫鍑哄笎鎴鋒椂璇ヨ繘紼嬭繕涓嶄細緇撴潫錛岄偅涔堝彲浠ヤ嬌鐢╪ohup鍛戒護銆傝鍛戒護鍙互鍦ㄤ綘閫鍑哄笎鎴?鍏抽棴緇堢涔嬪悗緇х畫榪愯鐩稿簲鐨勮繘紼嬨俷ohup灝辨槸涓嶆寕璧風殑鎰忔? n ohang up)銆?br />
涓鑸兘鏄湪linux涓媙ohup鏍煎紡錛?nbsp; 

nohup command

鎴栬?br />
nohup command &

榪欎箣闂寸殑宸埆鏄甫&鐨勫懡浠よ錛屽嵆浣縯erminal錛堢粓绔級鍏抽棴錛屾垨鑰呯數鑴戞鏈虹▼搴忎緷鐒惰繍琛岋紙鍓嶆彁鏄綘鎶婄▼搴忛掍氦鍒版湇鍔″櫒涓婏級錛?br />
瀹冩妸鏍囧噯杈撳嚭錛圫TDOUT錛夊拰鏍囧噯閿欒錛圫TDERR錛夌粨鏋滆緭鍑哄埌nohup.txt鏂囦歡榪欎釜鐪嬩技寰堟柟渚匡紝浣嗘槸褰撹緭鍑哄緢澶х殑鏃跺欙紝nohup.txt鏂囦歡浼氶潪甯稿ぇ錛屾垨鑰呭涓悗鍙板懡浠ょ殑鏃跺欏ぇ瀹墮兘浼氳緭鍑哄埌nohup.txt鏂囦歡錛屼笉鍒╀簬鏌ユ壘緇撴灉鍜岃皟璇曠▼搴忋?br />
鎵浠ヨ兘澶熼噸瀹氬悜杈撳嚭浼氶潪甯告柟渚褲備笅闈㈣浠嬬粛鏍囧噯杈撳嚭錛屾爣鍑嗚緭鍏?鍜屾爣鍑嗛敊璇簡銆?br />
鍏跺疄鎴戜滑涓鐩撮兘鍦ㄧ敤錛屽彧鏄病鏈夋敞鎰忓埌錛?nbsp;

姣斿

>./command.sh > output

#榪欏叾涓殑>灝辨槸鏍囧噯杈撳嚭絎﹀彿錛屽叾瀹炴槸 1>output 鐨勭緝鍐?br />
>./command.sh 2> output

錛冭繖閲岀殑2>灝辨槸灝嗘爣鍑嗛敊璇緭鍑哄埌output鏂囦歡閲屻?br />
鑰?< 鍒欐槸鏍囧噯杈撳叆浜嗐?br />
涓嬮潰姝ュ叆姝i錛岄噸瀹氬悜鍚庡彴鍛戒護

>nohup ./command.sh > output 2>&1 &

瑙i噴錛氬墠闈㈢殑nohup 鍜屽悗闈㈢殑&鎴戞兂澶у閮借兘鏄庣櫧浜嗘妸銆?br />
涓昏鏄腑闂寸殑 2>&1鐨勬剰鎬?br />
榪欎釜鎰忔濇槸鎶婃爣鍑嗛敊璇紙2錛夐噸瀹氬悜鍒版爣鍑嗚緭鍑轟腑錛?錛夛紝鑰屾爣鍑嗚緭鍑哄張瀵煎叆鏂囦歡output閲岄潰錛?  www.2cto.com

鎵浠ョ粨鏋滄槸鏍囧噯閿欒鍜屾爣鍑嗚緭鍑洪兘瀵煎叆鏂囦歡output閲岄潰浜嗐?br />
鑷充簬涓轟粈涔堥渶瑕佸皢鏍囧噯閿欒閲嶅畾鍚戝埌鏍囧噯杈撳嚭鐨勫師鍥狅紝閭e氨褰掔粨涓烘爣鍑嗛敊璇病鏈夌紦鍐插尯錛岃宻tdout鏈夈?br />
榪欏氨浼氬鑷?>output 2>output 鏂囦歡output琚袱嬈℃墦寮錛岃宻tdout鍜宻tderr灝嗕細绔炰簤瑕嗙洊錛岃繖鑲畾涓嶆槸鎴戦棬鎯寵鐨?

榪欏氨鏄負浠涔堟湁浜轟細鍐欐垚錛?br />
nohup ./command.sh >output 2>output
鍑洪敊鐨勫師鍥犱簡

##########################

鏈鍚庤皥涓涓?dev/null鏂囦歡鐨勪綔鐢?br />
榪欐槸涓涓棤搴曟礊錛屼換浣曚笢瑗塊兘鍙互瀹氬悜鍒拌繖閲岋紝浣嗘槸鍗存棤娉曟墦寮銆?br />
鎵浠ヤ竴鑸緢澶х殑stdou鍜宻tderr褰撲綘涓嶅叧蹇冪殑鏃跺欏彲浠ュ埄鐢╯tdout鍜宻tderr瀹氬悜鍒拌繖閲?br />
>./command.sh >/dev/null 2>&1


paulwong 2020-09-02 11:52 鍙戣〃璇勮
]]>
濡備綍鎵懼嚭LINUX涓秷鑰桟PU鏈澶х殑搴旂敤鐨凱IDhttp://www.tkk7.com/paulwong/archive/2020/08/14/435642.htmlpaulwongpaulwongFri, 14 Aug 2020 03:52:00 GMThttp://www.tkk7.com/paulwong/archive/2020/08/14/435642.htmlhttp://www.tkk7.com/paulwong/comments/435642.htmlhttp://www.tkk7.com/paulwong/archive/2020/08/14/435642.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435642.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435642.html
top -i //杈撳嚭搴旂敤鍒楄〃錛屽茍闅愯棌IDEL鐨勫簲鐢?br /> P //鍦ㄥ垪琛ㄦ椂錛屾寜P錛屽垯鎸塁PU鐨勪嬌鐢ㄦ帓搴?/div>

How To Check CPU Utilization In Linux With Command Line
https://phoenixnap.com/kb/check-cpu-usage-load-linux

paulwong 2020-08-14 11:52 鍙戣〃璇勮
]]>shell 鑴氭湰鏇挎崲鏂囦歡涓煇涓瓧絎︿覆http://www.tkk7.com/paulwong/archive/2020/08/07/435636.htmlpaulwongpaulwongFri, 07 Aug 2020 10:01:00 GMThttp://www.tkk7.com/paulwong/archive/2020/08/07/435636.htmlhttp://www.tkk7.com/paulwong/comments/435636.htmlhttp://www.tkk7.com/paulwong/archive/2020/08/07/435636.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435636.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435636.html1銆佸皢褰撳墠鐩綍涓嬪寘鍚玧ack涓茬殑鏂囦歡涓紝jack瀛楃涓叉浛鎹負tom
sed -i "s/jack/tom/g" `grep "jack" -rl ./`

2銆佸皢鏌愪釜鏂囦歡涓殑jack瀛楃涓叉浛鎹負tom

sed -i "s/jack/tom/g" test.txt

鍙傝冭繛鎺ワ細http://blog.csdn.net/lizhi200404520/article/details/7968483


paulwong 2020-08-07 18:01 鍙戣〃璇勮
]]>
TCL 鐨勮繛鎺IME_WAIT澶鐨勫鐞?/title><link>http://www.tkk7.com/paulwong/archive/2020/08/07/435632.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Fri, 07 Aug 2020 02:27:00 GMT</pubDate><guid>http://www.tkk7.com/paulwong/archive/2020/08/07/435632.html</guid><wfw:comment>http://www.tkk7.com/paulwong/comments/435632.html</wfw:comment><comments>http://www.tkk7.com/paulwong/archive/2020/08/07/435632.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/paulwong/comments/commentRss/435632.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/paulwong/services/trackbacks/435632.html</trackback:ping><description><![CDATA[TCP TIME_WAIT 璇﹁В<br /><a target="_blank">https://www.zhuxiaodong.net/2018/tcp-time-wait-instruction/</a><br /><br />mysql鏈嶅姟鍣紝澶ч噺tcp榪炴帴鐘舵乀IME_WAIT<br /><a target="_blank">https://www.cnblogs.com/zhjh256/p/6363312.html</a><br /><br />linux涓嬮噴鏀綯IME_WAIT鏂規硶<br /><a target="_blank">https://blog.csdn.net/u013488847/article/details/46421867</a><br /><br /><img src ="http://www.tkk7.com/paulwong/aggbug/435632.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/paulwong/" target="_blank">paulwong</a> 2020-08-07 10:27 <a href="http://www.tkk7.com/paulwong/archive/2020/08/07/435632.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>緇熻鏂囦歡琛屾暟鎴朙IST鐩綍鐨勬潯鏁?/title><link>http://www.tkk7.com/paulwong/archive/2020/08/05/435626.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 05 Aug 2020 03:32:00 GMT</pubDate><guid>http://www.tkk7.com/paulwong/archive/2020/08/05/435626.html</guid><wfw:comment>http://www.tkk7.com/paulwong/comments/435626.html</wfw:comment><comments>http://www.tkk7.com/paulwong/archive/2020/08/05/435626.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/paulwong/comments/commentRss/435626.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/paulwong/services/trackbacks/435626.html</trackback:ping><description><![CDATA[<a target="_blank">https://www.thegeekdiary.com/how-to-count-lines-in-a-file-in-unix-linux/</a><br /><br /><img src ="http://www.tkk7.com/paulwong/aggbug/435626.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/paulwong/" target="_blank">paulwong</a> 2020-08-05 11:32 <a href="http://www.tkk7.com/paulwong/archive/2020/08/05/435626.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤ssh-keygen鍜宻sh-copy-id涓夋瀹炵幇SSH鏃犲瘑鐮佺櫥褰?鍜宻sh甯哥敤鍛戒護http://www.tkk7.com/paulwong/archive/2020/07/31/435622.htmlpaulwongpaulwongFri, 31 Jul 2020 06:19:00 GMThttp://www.tkk7.com/paulwong/archive/2020/07/31/435622.htmlhttp://www.tkk7.com/paulwong/comments/435622.htmlhttp://www.tkk7.com/paulwong/archive/2020/07/31/435622.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435622.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435622.htmlssh-keygen  浜х敓鍏挜涓庣閽ュ.
ssh-copy-id 灝嗘湰鏈虹殑鍏挜澶嶅埗鍒拌繙紼嬫満鍣ㄧ殑authorized_keys鏂囦歡涓紝ssh-copy-id涔熻兘璁╀綘鏈夊埌榪滅▼鏈哄櫒鐨刪ome, ~./ssh , 鍜?~/.ssh/authorized_keys鐨勬潈鍒?/div>
絎竴姝?鍦ㄦ湰鍦版満鍣ㄤ笂浣跨敤ssh-keygen浜х敓鍏挜縐侀挜瀵?div id="codeText" style="box-sizing: border-box; outline: 0px; margin: 0px; overflow-wrap: break-word;">
  1. zhz@zhz:~/$ ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/zhz/.ssh/id_rsa):
  2. Enter passphrase (empty for no passphrase): [Press enter key
  3. same passphrase again: [Pess enter key]
  4. Your identification has been saved in /home/zhz/.ssh/id_rsa.
  5. Your public key has been saved in /home/zhz/.ssh/id_rsa.pub.
  6. The key fingerprint is:
  7. 鐢╟at鍛戒護鏌ョ湅鏄惁鐢熸垚浜х敓鍏挜縐侀挜瀵?/li>
  8. zhz@zhz:~$ cat .ssh/id_rsa.pub
    ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl9N5+xboqSIagBx02rdZ2fkROCPW8iW7hl6Gu+2hkBYYy/b1qcOm8RF/AMyas3i0QEK7Hcu9H51l2lulVbS5n9M9FaWIyYzssaS012x2mg9iA6MxPMlaXFsZ5jnVrGicndzf3VUu9kCErp5q0OzzMjsG3PKQevzWZJSBaFgc8NF5ZJ+VT54BN8ktMTHVwOo15I2Uai+bs4eP0NsuwIJmGyYIUOuvTuUtJxGV3hZ+tcjhupupqVCwYOE+cDz8VkFBGtnKsdE69hWoY2VUfEOAfHZptra7Ce9dXfDgx9jxuuNiJYtGo/bZDfe+UJ5HUv8wrL+hFeRIihdmP2CKJD8j5 zhz@zhz


絎簩姝?鐢╯sh-copy-id灝嗗叕閽ュ鍒跺埌榪滅▼鏈哄櫒涓?div style="box-sizing: border-box; outline: 0px; margin: 0px; overflow-wrap: break-word;">
  1. zhz@zhz:~$  ssh-copy-id -i .ssh/id_rsa.pub  鐢ㄦ埛鍚嶅瓧@192.168.x.xxx

娉ㄦ剰: ssh-copy-id 灝唊ey鍐欏埌榪滅▼鏈哄櫒鐨?~/ .ssh/authorized_key.鏂囦歡涓?/p>絎笁姝? 鐧誨綍鍒?/span>榪滅▼鏈哄櫒涓嶇敤杈撳叆瀵嗙爜

  1. zhz@zhz:~$  ssh 鐢ㄦ埛鍚嶅瓧@192.168.x.xxx

  2. Last login: Sun Nov 16 17:22:33 2008 from 192.168.1.2

甯歌闂錛?/p>

  1. ssh-copy-id -u eucalyptus -i ~eucalyptus/.ssh/id_rsa.pub ssh 鐢ㄦ埛鍚嶅瓧@192.168.x.xxx
  2. 絎竴嬈¢渶瑕佸瘑鐮佺櫥褰?br style="box-sizing: border-box; outline: 0px; margin: 0px; padding: 0px; overflow-wrap: break-word;" />

涓婅堪鏄粰eucalyptus鐢ㄦ埛璧嬩簣鏃犲瘑鐮佺櫥闄嗙殑鏉冨埄

  1. /usr/bin/ssh-copy-id: ERROR: No identities found

浣跨敤閫夐」 -i 錛屽綋娌℃湁鍊間紶閫掔殑鏃跺欐垨鑰?nbsp;濡傛灉 ~/.ssh/identity.pub 鏂囦歡涓嶅彲璁塊棶錛堜笉瀛樺湪錛? ssh-copy-id 灝嗘樉紺轟笂榪扮殑閿欒淇℃伅  錛?-i閫夐」浼氫紭鍏堜嬌鐢ㄥ皢ssh-add -L鐨勫唴瀹癸級



ssh鍛戒護

1銆佸鍒禨SH瀵嗛挜鍒扮洰鏍囦富鏈猴紝寮鍚棤瀵嗙爜SSH鐧誨綍

ssh-copy-id user@host

濡傛灉榪樻病鏈夊瘑閽ワ紝璇蜂嬌鐢╯sh-keygen鍛戒護鐢熸垚銆?/p>

2銆佷粠鏌愪富鏈虹殑80绔彛寮鍚埌鏈湴涓繪満2001绔彛鐨勯毀閬?/span>

ssh -N -L2001:localhost:80 somemachine

鐜板湪浣犲彲浠ョ洿鎺ュ湪嫻忚鍣ㄤ腑杈撳叆http://localhost:2001璁塊棶榪欎釜緗戠珯銆?/p>

3銆佸皢浣犵殑楹﹀厠椋庤緭鍑哄埌榪滅▼璁$畻鏈虹殑鎵0鍣?/span>

dd if=/dev/dsp | ssh -c arcfour -C username@host dd of=/dev/dsp

榪欐牱鏉ヨ嚜浣犻害鍏嬮绔彛鐨勫0闊沖皢鍦⊿SH鐩爣璁$畻鏈虹殑鎵0鍣ㄧ鍙h緭鍑猴紝浣嗛仐鎲劇殑鏄紝澹伴煶璐ㄩ噺寰堝樊錛屼綘浼氬惉鍒板緢澶氬樁鍢跺0銆?/p>

4銆佹瘮杈冭繙紼嬪拰鏈湴鏂囦歡

ssh user@host cat /path/to/remotefile | diff /path/to/localfile –

鍦ㄦ瘮杈冩湰鍦版枃浠跺拰榪滅▼鏂囦歡鏄惁鏈夊樊寮傛椂榪欎釜鍛戒護寰堢鐢ㄣ?/p>

5銆侀氳繃SSH鎸傝澆鐩綍/鏂囦歡緋葷粺

sshfs name@server:/path/to/folder /path/to/mount/point

浠?a rel="nofollow" style="box-sizing: border-box; outline: none; margin: 0px; padding: 0px; text-decoration-line: none; cursor: pointer; color: #6795b5; overflow-wrap: break-word;">http://fuse.sourceforge.net/sshfs.html涓嬭澆sshfs錛屽畠鍏佽浣犺法緗戠粶瀹夊叏鎸傝澆涓涓洰褰曘?/p>

6銆侀氳繃涓棿涓繪満寤虹珛SSH榪炴帴

ssh -t reachable_host ssh unreachable_host

Unreachable_host琛ㄧず浠庢湰鍦扮綉緇滄棤娉曠洿鎺ヨ闂殑涓繪満錛屼絾鍙互浠巖eachable_host鎵鍦ㄧ綉緇滆闂紝榪欎釜鍛戒護閫氳繃鍒皉eachable_host鐨?#8220;闅愯棌”榪炴帴錛屽垱寤鴻搗鍒皍nreachable_host鐨勮繛鎺ャ?/p>

7銆佸皢浣犵殑SSH鍏挜澶嶅埗鍒拌繙紼嬩富鏈猴紝寮鍚棤瀵嗙爜鐧誨綍 – 綆鍗曠殑鏂規硶

ssh-copy-id username@hostname

8銆佺洿鎺ヨ繛鎺ュ埌鍙兘閫氳繃涓繪満B榪炴帴鐨勪富鏈篈

ssh -t hostA ssh hostB

褰撶劧錛屼綘瑕佽兘璁塊棶涓繪満A鎵嶈銆?/p>

9銆佸垱寤哄埌鐩爣涓繪満鐨勬寔涔呭寲榪炴帴

ssh -MNf <user>@<host>

鍦ㄥ悗鍙板垱寤哄埌鐩爣涓繪満鐨勬寔涔呭寲榪炴帴錛屽皢榪欎釜鍛戒護鍜屼綘~/.ssh/config涓殑閰嶇疆緇撳悎浣跨敤錛?/p>

Host host ControlPath ~/.ssh/master-%r@%h:%p ControlMaster no

鎵鏈夊埌鐩爣涓繪満鐨凷SH榪炴帴閮藉皢浣跨敤鎸佷箙鍖朣SH濂楁帴瀛楋紝濡傛灉浣犱嬌鐢⊿SH瀹氭湡鍚屾鏂囦歡錛堜嬌鐢╮sync/sftp/cvs/svn錛夛紝榪欎釜鍛戒護灝嗛潪甯告湁鐢紝鍥犱負姣忔鎵撳紑涓涓猄SH榪炴帴鏃朵笉浼氬垱寤烘柊鐨勫鎺ュ瓧銆?/p>

10銆侀氳繃SSH榪炴帴灞忓箷

ssh -t remote_host screen –r

鐩存帴榪炴帴鍒拌繙紼嬪睆騫曚細璇濓紙鑺傜渷浜嗘棤鐢ㄧ殑鐖禸ash榪涚▼錛夈?/p>

11銆佺鍙f嫻嬶紙鏁查棬錛?/span>

knock <host> 3000 4000 5000 && ssh -p <port> user@host && knock <host> 5000 4000 3000

鍦ㄤ竴涓鍙d笂鏁蹭竴涓嬫墦寮鏌愪釜鏈嶅姟鐨勭鍙o紙濡係SH錛夛紝鍐嶆暡涓涓嬪叧闂绔彛錛岄渶瑕佸厛瀹夎knockd錛屼笅闈㈡槸涓涓厤緗枃浠剁ず渚嬨?/p>

[options] logfile = /var/log/knockd.log [openSSH] sequence = 3000,4000,5000 seq_timeout = 5 command = /sbin/iptables -A INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT tcpflags = syn [closeSSH] sequence = 5000,4000,3000 seq_timeout = 5 command = /sbin/iptables -D INPUT -i eth0 -s %IP% -p tcp –dport 22 -j ACCEPT tcpflags = syn

12銆佸垹闄ゆ枃鏈枃浠朵腑鐨勪竴琛屽唴瀹癸紝鏈夌敤鐨勪慨澶?/span>

ssh-keygen -R <the_offending_host>

鍦ㄨ繖縐嶆儏鍐典笅錛屾渶濂戒嬌鐢ㄤ笓涓氱殑宸ュ叿銆?/p>

13銆侀氳繃SSH榪愯澶嶆潅鐨勮繙紼媠hell鍛戒護

ssh host -l user $(<cmd.txt)

鏇村叿縐繪鎬х殑鐗堟湰錛?/p>

ssh host -l user “`cat cmd.txt`”

14銆侀氳繃SSH灝哅ySQL鏁版嵁搴撳鍒跺埌鏂版湇鍔″櫒

mysqldump –add-drop-table –extended-insert –force –log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost “mysql -uUSER -pPASS NEW_DB_NAME”

閫氳繃鍘嬬緝鐨凷SH闅ч亾Dump涓涓狹ySQL鏁版嵁搴擄紝灝嗗叾浣滀負杈撳叆浼犻掔粰mysql鍛戒護錛屾垜璁や負榪欐槸榪佺Щ鏁版嵁搴撳埌鏂版湇鍔″櫒鏈蹇渶濂界殑鏂規硶銆?/p>

15銆佸垹闄ゆ枃鏈枃浠朵腑鐨勪竴琛岋紝淇“SSH涓繪満瀵嗛挜鏇存敼”鐨勮鍛?/span>

sed -i 8d ~/.ssh/known_hosts

16銆佷粠涓鍙版病鏈塖SH-COPY-ID鍛戒護鐨勪富鏈哄皢浣犵殑SSH鍏挜澶嶅埗鍒版湇鍔″櫒

cat ~/.ssh/id_rsa.pub | ssh user@machine “mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys”

濡傛灉浣犱嬌鐢∕ac OS X鎴栧叾瀹冩病鏈塻sh-copy-id鍛戒護鐨?nix鍙樼錛岃繖涓懡浠ゅ彲浠ュ皢浣犵殑鍏挜澶嶅埗鍒拌繙紼嬩富鏈猴紝鍥犳浣犵収鏍峰彲浠ュ疄鐜版棤瀵嗙爜SSH鐧誨綍銆?/p>

17銆佸疄鏃禨SH緗戠粶鍚炲悙閲忔祴璇?/span>

yes | pv | ssh $host “cat > /dev/null”

閫氳繃SSH榪炴帴鍒頒富鏈猴紝鏄劇ず瀹炴椂鐨勪紶杈撻熷害錛屽皢鎵鏈変紶杈撴暟鎹寚鍚?dev/null錛岄渶瑕佸厛瀹夎pv銆?/p>

濡傛灉鏄疍ebian錛?/p>

apt-get install pv

濡傛灉鏄疐edora錛?/p>

yum install pv

錛堝彲鑳介渶瑕佸惎鐢ㄩ澶栫殑杞歡浠撳簱錛夈?/p>

18銆佸鏋滃緩绔嬩竴涓彲浠ラ噸鏂拌繛鎺ョ殑榪滅▼GNU screen

ssh -t user@some.domain.com /usr/bin/screen –xRR

浜轟滑鎬繪槸鍠滄鍦ㄤ竴涓枃鏈粓绔腑鎵撳紑璁稿shell錛屽鏋滀細璇濈獊鐒朵腑鏂紝鎴栦綘鎸変笅浜?#8220;Ctrl-a d”錛岃繙紼嬩富鏈轟笂鐨剆hell涓嶄細鍙楀埌涓濇褰卞搷錛屼綘鍙互閲嶆柊榪炴帴錛屽叾瀹冩湁鐢ㄧ殑screen鍛戒護鏈?#8220;Ctrl-a c”錛堟墦寮鏂扮殑shell錛夊拰“Ctrl-a a”錛堝湪shell涔嬮棿鏉ュ洖鍒囨崲錛夛紝璇瘋闂甴ttp://aperiodic.net/screen/quick_reference闃呰鏇村鍏充簬screen鍛戒護鐨勫揩閫熷弬鑰冦?/p>

19銆佺戶緇璖CP澶ф枃浠?/span>

rsync –partial –progress –rsh=ssh $file_source $user@$host:$destination_file

瀹冨彲浠ユ仮澶嶅け璐ョ殑rsync鍛戒護錛屽綋浣犻氳繃VPN浼犺緭澶ф枃浠訛紝濡傚浠界殑鏁版嵁搴撴椂榪欎釜鍛戒護闈炲父鏈夌敤錛岄渶瑕佸湪涓よ竟鐨勪富鏈轟笂瀹夎rsync銆?/p>

rsync –partial –progress –rsh=ssh $file_source $user@$host:$destination_file local -> remote

鎴?/p>

rsync –partial –progress –rsh=ssh $user@$host:$remote_file $destination_file remote -> local

20銆侀氳繃SSH W/ WIRESHARK鍒嗘瀽嫻侀噺

ssh root@server.com ‘tshark -f “port !22″ -w -' | wireshark -k -i –

浣跨敤tshark鎹曟崏榪滅▼涓繪満涓婄殑緗戠粶閫氫俊錛岄氳繃SSH榪炴帴鍙戦佸師濮媝cap鏁版嵁錛屽茍鍦╳ireshark涓樉紺猴紝鎸変笅Ctrl+C灝嗗仠姝㈡崟鎹夛紝浣嗕篃浼氬叧闂瓀ireshark紿楀彛錛屽彲浠ヤ紶閫掍竴涓?#8220;-c #”鍙傛暟緇檛shark錛岃瀹冨彧鎹曟崏“#”鎸囧畾鐨勬暟鎹寘綾誨瀷錛屾垨閫氳繃鍛藉悕綆¢亾閲嶅畾鍚戞暟鎹紝鑰屼笉鏄洿鎺ラ氳繃SSH浼犺緭緇檞ireshark錛屾垜寤鴻浣犺繃婊ゆ暟鎹寘錛屼互鑺傜害甯﹀錛宼shark鍙互浣跨敤tcpdump鏇夸唬錛?/p>

ssh root@example.com tcpdump -w – ‘port !22′ | wireshark -k -i –

21銆佷繚鎸丼SH浼氳瘽姘鎬箙鎵撳紑

autossh -M50000 -t server.example.com ‘screen -raAd mysession’

鎵撳紑涓涓猄SH浼氳瘽鍚庯紝璁╁叾淇濇寔姘鎬箙鎵撳紑錛屽浜庝嬌鐢ㄧ瑪璁版湰鐢佃剳鐨勭敤鎴鳳紝濡傛灉闇瑕佸湪Wi-Fi鐑偣涔嬮棿鍒囨崲錛屽彲浠ヤ繚璇佸垏鎹㈠悗涓嶄細涓㈠け榪炴帴銆?/p>

22銆佹洿紼沖畾錛屾洿蹇紝鏇村己鐨凷SH瀹㈡埛绔?/span>

ssh -4 -C -c blowfish-cbc

寮哄埗浣跨敤IPv4錛屽帇緙╂暟鎹祦錛屼嬌鐢˙lowfish鍔犲瘑銆?/p>

23銆佷嬌鐢╟stream鎺у埗甯﹀

tar -cj /backup | cstream -t 777k | ssh host ‘tar -xj -C /backup’

浣跨敤bzip鍘嬬緝鏂囦歡澶癸紝鐒跺悗浠?77k bit/s閫熺巼鍚戣繙紼嬩富鏈轟紶杈撱侰stream榪樻湁鏇村鐨勫姛鑳斤紝璇瘋闂甴ttp://www.cons.org/cracauer/cstream.html#usage浜嗚В璇︽儏錛屼緥濡傦細

echo w00t, i’m 733+ | cstream -b1 -t2

24銆佷竴姝ュ皢SSH鍏挜浼犺緭鍒板彟涓鍙版満鍣?/span>

ssh-keygen; ssh-copy-id user@host; ssh user@host

榪欎釜鍛戒護緇勫悎鍏佽浣犳棤瀵嗙爜SSH鐧誨綍錛屾敞鎰忥紝濡傛灉鍦ㄦ湰鍦版満鍣ㄧ殑~/.ssh鐩綍涓嬪凡緇忔湁涓涓猄SH瀵嗛挜瀵癸紝ssh-keygen鍛戒護鐢熸垚鐨勬柊瀵嗛挜鍙兘浼氳鐩栧畠浠紝ssh-copy-id灝嗗瘑閽ュ鍒跺埌榪滅▼涓繪満錛屽茍榪藉姞鍒拌繙紼嬭處鍙風殑~/.ssh/authorized_keys鏂囦歡涓紝浣跨敤SSH榪炴帴鏃訛紝濡傛灉浣犳病鏈変嬌鐢ㄥ瘑閽ュ彛浠わ紝璋冪敤ssh user@host鍚庝笉涔呭氨浼氭樉紺鴻繙紼媠hell銆?/p>

25銆佸皢鏍囧噯杈撳叆錛坰tdin錛夊鍒跺埌浣犵殑X11緙撳啿鍖?/span>

ssh user@host cat /path/to/some/file | xclip

浣犳槸鍚︿嬌鐢╯cp灝嗘枃浠跺鍒跺埌宸ヤ綔鐢ㄧ數鑴戜笂錛屼互渚垮鍒跺叾鍐呭鍒扮數瀛愰偖浠朵腑錛焫clip鍙互甯埌浣狅紝瀹冨彲浠ュ皢鏍囧噯杈撳叆澶嶅埗鍒癤11緙撳啿鍖猴紝浣犻渶瑕佸仛鐨勫氨鏄偣鍑婚紶鏍囦腑閿矘璐寸紦鍐插尯涓殑鍐呭銆?/p>

濡傛灉浣犺繕鏈夊叾瀹僑SH鍛戒護鎶宸э紝嬈㈣繋鍦ㄦ湰鏂囪瘎璁轟腑甯栧嚭銆?/p>

鍘熸枃錛?a rel="nofollow" style="box-sizing: border-box; outline: none; margin: 0px; padding: 0px; text-decoration-line: none; cursor: pointer; color: #6795b5; overflow-wrap: break-word;">http://blog.urfix.com/25-ssh-commands-tricks/







paulwong 2020-07-31 14:19 鍙戣〃璇勮
]]>
涓嬈″垹闄ゅ墠5涓互澶栫殑鍏朵粬鏂囦歡澶圭殑SHELLhttp://www.tkk7.com/paulwong/archive/2020/07/27/435614.htmlpaulwongpaulwongMon, 27 Jul 2020 03:35:00 GMThttp://www.tkk7.com/paulwong/archive/2020/07/27/435614.htmlhttp://www.tkk7.com/paulwong/comments/435614.htmlhttp://www.tkk7.com/paulwong/archive/2020/07/27/435614.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435614.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435614.html
find path/to/folder/ -mindepth 1 -maxdepth 1 -type d | head -n -5 | xargs rm -rf

-find: the unix command for finding files / directories / links etc.
-/path/to/base/dir: the directory to start your search in.
-mindepth 1 -maxdepth 1 only search the first sub folder
-type d: only find directories
-head -n -5: Filter out all lines except the last 5
-xargs rm -rf: remove each given folder.


paulwong 2020-07-27 11:35 鍙戣〃璇勮
]]>
涓嬈″垹闄?0澶╁墠鐨勬枃浠跺す鐨凷HELLhttp://www.tkk7.com/paulwong/archive/2020/07/27/435613.htmlpaulwongpaulwongMon, 27 Jul 2020 02:48:00 GMThttp://www.tkk7.com/paulwong/archive/2020/07/27/435613.htmlhttp://www.tkk7.com/paulwong/comments/435613.htmlhttp://www.tkk7.com/paulwong/archive/2020/07/27/435613.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435613.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435613.htmlfind /path/to/base -mindepth 1 -maxdepth 1 -type d -ctime +10 | xargs rm -rf

-find: the unix command for finding files / directories / links etc.
/path/to/base/dir: the directory to start your search in.
-type d: only find directories
-ctime +10: only consider the ones with modification time older than 10 days
-exec  \;: for each such result found, do the following command in 
-rm -rf dir1 dir2 dir3 

https://stackoverflow.com/questions/13868821/shell-script-to-delete-directories-older-than-n-days

paulwong 2020-07-27 10:48 鍙戣〃璇勮
]]>
LINUX SHELLhttp://www.tkk7.com/paulwong/archive/2020/07/06/435591.htmlpaulwongpaulwongMon, 06 Jul 2020 01:23:00 GMThttp://www.tkk7.com/paulwong/archive/2020/07/06/435591.htmlhttp://www.tkk7.com/paulwong/comments/435591.htmlhttp://www.tkk7.com/paulwong/archive/2020/07/06/435591.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435591.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435591.htmlhttps://tecadmin.net/tutorial/bash-scripting/

Shell 鏁欑▼
https://www.runoob.com/linux/linux-shell.html

Check existence of input argument in a Bash shell script
https://stackoverflow.com/questions/6482377/check-existence-of-input-argument-in-a-bash-shell-script

How to Check if a File or Directory Exists in Bash
https://linuxize.com/post/bash-check-if-file-exists/

bash string compare to multiple correct values
https://stackoverflow.com/questions/21157435/bash-string-compare-to-multiple-correct-values

Bash – Check If Two Strings are Equal
https://tecadmin.net/tutorial/bash/examples/check-if-two-strings-are-equal/





paulwong 2020-07-06 09:23 鍙戣〃璇勮
]]>
How To Run Java Jar Application with Systemd on Linuxhttp://www.tkk7.com/paulwong/archive/2020/05/11/435427.htmlpaulwongpaulwongMon, 11 May 2020 08:16:00 GMThttp://www.tkk7.com/paulwong/archive/2020/05/11/435427.htmlhttp://www.tkk7.com/paulwong/comments/435427.htmlhttp://www.tkk7.com/paulwong/archive/2020/05/11/435427.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435427.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435427.htmlhttps://computingforgeeks.com/how-to-run-java-jar-application-with-systemd-on-linux/

systemd鑷惎鍔╦ava紼嬪簭
https://www.cnblogs.com/yoyotl/p/8178363.html
------------------------------------------------------------

[Unit]
Description=TestJava
After=network.target

[Service]
Type=forking
ExecStart=/home/test/startTest.sh
ExecStop=/home/test/stopTest.sh

[Install]
WantedBy=multi-user.target

-------------------------------------------------------------
How to Autorun application at the start up in Linux
https://developer.toradex.com/knowledge-base/how-to-autorun-application-at-the-start-up-in-linux

How to automatically run program on Linux startup
https://www.simplified.guide/linux/automatically-run-program-on-startup


Systemd 鍏ラ棬鏁欑▼錛氬疄鎴樼瘒
https://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html

Systemd 鍏ラ棬鏁欑▼錛氬懡浠ょ瘒

http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html

paulwong 2020-05-11 16:16 鍙戣〃璇勮
]]>
How to disable IPv6 on CentOS / RHEL 7http://www.tkk7.com/paulwong/archive/2020/05/06/435410.htmlpaulwongpaulwongWed, 06 May 2020 04:42:00 GMThttp://www.tkk7.com/paulwong/archive/2020/05/06/435410.htmlhttp://www.tkk7.com/paulwong/comments/435410.htmlhttp://www.tkk7.com/paulwong/archive/2020/05/06/435410.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435410.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435410.html https://www.thegeekdiary.com/centos-rhel-7-how-to-disable-ipv6/

https://linuxconfig.org/redhat-8-enable-disable-ipv6




paulwong 2020-05-06 12:42 鍙戣〃璇勮
]]>
How To Count Files in Directory on Linuxhttp://www.tkk7.com/paulwong/archive/2020/05/05/435404.htmlpaulwongpaulwongTue, 05 May 2020 09:01:00 GMThttp://www.tkk7.com/paulwong/archive/2020/05/05/435404.htmlhttp://www.tkk7.com/paulwong/comments/435404.htmlhttp://www.tkk7.com/paulwong/archive/2020/05/05/435404.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435404.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435404.htmlhttps://devconnected.com/how-to-count-files-in-directory-on-linux/



paulwong 2020-05-05 17:01 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 免费看一区二区三区四区| 国产亚洲精品高清在线| 午夜影院免费观看| 一道本不卡免费视频| 国产精品亚洲片在线va| 亚洲第一视频网站| 亚洲午夜久久久久妓女影院 | 亚洲国产a∨无码中文777| 免费一级做a爰片性色毛片| 成年人性生活免费视频| 最近免费中文字幕大全免费版视频 | 亚洲AV无码一区二区三区在线| 亚洲综合色婷婷七月丁香| 免费一级成人毛片| 四虎AV永久在线精品免费观看| 成人免费午间影院在线观看| 免费看黄视频网站| 四虎免费影院ww4164h| 99久久人妻精品免费二区| 午夜老司机永久免费看片| 国产麻豆成人传媒免费观看| 国产精品免费视频观看拍拍| 人人公开免费超级碰碰碰视频| 深夜特黄a级毛片免费播放| 日韩亚洲人成网站| 爱情岛论坛亚洲品质自拍视频网站 | 美女露100%胸无遮挡免费观看 | 亚洲AV永久无码精品一区二区国产| 岛国av无码免费无禁网站| 国产精品久久久久久久久久免费| 无码人妻精品中文字幕免费东京热| 中文字幕亚洲免费无线观看日本 | 久久精品国产亚洲AV电影| 亚洲成人激情在线| 亚洲精品国产手机| 亚洲人xxx日本人18| 亚洲精品国产suv一区88| 日日摸日日碰夜夜爽亚洲| 九九视频高清视频免费观看| 亚洲天堂免费在线视频| 色www永久免费|