|
|
|
@ -28,4 +28,34 @@ memray run --live -m module.file
|
|
|
|
|
```bash
|
|
|
|
|
pip install py-spy
|
|
|
|
|
py-spy top --pid ${pid}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 批量设置ssh自动登录
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
# FileName: auto-ssh-login.sh
|
|
|
|
|
# Revision: 1.0
|
|
|
|
|
# Date: 2020-03-25
|
|
|
|
|
# Author: baige
|
|
|
|
|
# Description: the script for auto-ssh-login
|
|
|
|
|
while read host;do
|
|
|
|
|
ip=`echo $host | cut -d " " -f1`
|
|
|
|
|
username=`echo $host | cut -d " " -f2`
|
|
|
|
|
password=`echo $host | cut -d " " -f3`
|
|
|
|
|
expect <<EOF
|
|
|
|
|
spawn ssh-copy-id -i $username@$ip
|
|
|
|
|
expect {
|
|
|
|
|
"yes/no" {send "yes\n";exp_continue}
|
|
|
|
|
"password" {send "$password\n"}
|
|
|
|
|
}
|
|
|
|
|
expect eof
|
|
|
|
|
EOF
|
|
|
|
|
done < host.txt
|
|
|
|
|
|
|
|
|
|
# host.txt 格式 如下
|
|
|
|
|
## host1 username1 password1
|
|
|
|
|
## host2 username2 password2
|
|
|
|
|
```
|