du -h / | sort -rh | head -20find / -type f -exec du -sb {} + | awk '{ size_gb = $1 / (1024*1024*1024); printf "%.2fGB\t%s\n", size_gb, $2 }' | sort -nr | head -n 20awk 'FNR==1 {print FILENAME} {print}' *.conf | lessgrep -Ev '^\s*($|#|;)' example.conffind . -type f -name "*.zip" -printf "%T@ %p\n" | sort -nr | tail -n +2 | awk '{print $2}' | xargs rm -ftar -cf - test | pigz -p 3 > test.tar.gzss -ano | awk '{print $2}' | sort -n | uniq -c | sortecho <passwd> | passwd root --stdin
# salt批量修改密码
python3 -c "import crypt; print(crypt.crypt('your_password', crypt.mksalt(crypt.METHOD_SHA512)))"
salt '*' shadow.set_password root '<hashed_password>'find /data/app/tmp -mtime +30 -name "*.flv" -exec rm -Rf {} \;sed -ri 's/.*swap.*/#&/' /etc/fstab && swapoff -aPASSWORD=$(base64 < /dev/urandom | head -c16); echo "$PASSWORD"; echo -n "$PASSWORD" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-'for file in $(ls); do sed -i 's/nmg/sz/g' "$file"; donedocker build --build-arg https_proxy=127.0.0.1:8088apt-get install dpkg-repack
# 保存主软件包
dpkg-repack telnet
apt-get download telnet
# 保存主软件包和所有依赖
apt-cache depends telnet
# 导入包
dpkg -i telnet.debUSERNAME=muen-admin;
PASSWORD=$(base64 < /dev/urandom | head -c16);
echo "USERNAME:$USERNAME,PASSWORD:$PASSWORD";docker run --rm \
--entrypoint htpasswd \
httpd:alpine \
-mbn $USERNAME $PASSWORD > nginx.htpasswd
# -mbn Force MD5 encryption
# -Bbn Force bcrypt encryptionssh-keygen -t rsa -P '' -f /root/.ssh/id_rsa
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
# 然后保存/root/.ssh/id_rsa用于连接# 查看源端口为40000端口的,客户端连接按数量排序前50个
ss -tn sport = :40000 | awk '{print $5}' | cut -d':' -f1 | sort | uniq -c | sort -nr | head -n 50
# 去重连接数
ss -tn sport = :40000 | awk 'NR > 1 {print $4}' | cut -d':' -f1 | sort -u | wc -l
# 总连接数
ss -ano | grep 40000 | wc -l-M后面传0就是随机在远程主机上32768-65535开一个端口来监听,如果传自定义值就是指定端口监听
注:还是会监听22端口
yum install -y autossh
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NfR *:11000:172.168.1.1:6061 root@172.168.1.1docker image prune -a docker system dfdocker builder prune -adocker system prune -acurl使用代理# socks5代理
curl -x socks5h://user:xxx@192.168.1.1:1080# 需要用到dos2unix包
find . -type f -exec dos2unix {} \;#!/bin/bash
parse_commandline() {
while test $# -gt 0
do
key="$1"
case "$key" in
-i|--install-dir)
PARSED_INSTALL_DIR="$2"
shift 2
;;
-b|--bin-dir)
PARSED_BIN_DIR="$2"
shift 2
;;
-u|--update)
PARSED_UPGRADE="yes"
shift
;;
-h|--help)
usage
exit 0
;;
*)
die "Got an unexpected argument: $1"
;;
esac
done
}
usage() {
echo "Usage: scriptname [options]"
echo "Options:"
echo " -i, --install-dir Specify installation directory"
echo " -b, --bin-dir Specify binary directory"
echo " -u, --update Update the installation"
echo " -h, --help Show this help message"
}
die() {
echo "$@" >&2
exit 1
}
parse_commandline "$@"
echo "Install directory: $PARSED_INSTALL_DIR"
echo "Bin directory: $PARSED_BIN_DIR"temp_file_name="temp_database.csv"
exclude_list="
aaa
"
function exclude_database {
file=$1
rm -f ${file}
line_num=0
for instance in $(cat ${temp_file_name}|egrep -v "^#");do
id=$(echo "${instance}" |awk -F ',' '{print $1}')
excluded=false
for excluded_item in $exclude_list; do
if [[ "$id" == "$excluded_item" ]]; then
excluded=true
break
fi
done
if [ "$excluded" == false ]; then
echo "${instance}" >> ${file}
fi
done
rm -f ${temp_file_name}
}cat << EOF >> /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.core.somaxconn=65535
net.ipv4.tcp_max_tw_buckets=1440000
net.ipv4.ip_local_port_range=1024 65000
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_fin_timeout=15
EOF
sysctl -pyum install -y epel-release
yum install -y iperf3# 默认端口 5201
# 服务端
iperf3 -s
# 客户端
# 上传
iperf3 -c <server_ip>
# 下载
iperf3 -c <server_ip> -R