Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

12 total results found

学习笔记

Shell Script Snippets

随机生成密码

Shell Script Snippets

cat /dev/urandom |tr -dc 'a-zA-Z0-9'|fold -w 20 |head -n 10

通过SysRq调用重启服务器

Shell Script Snippets

# 允许 magic SysRq 功能 echo 1 > /proc/sys/kernel/sysrq # 立即重启 echo b > /proc/sysrq-trigger

获取本机IPv6地址

Shell Script Snippets

dig -6 TXT +short o-o.myaddr.l.google.com @ns1.google.com

服务器上使用 ssh-agent

Shell Script Snippets

登录时自动运行ssh-agent 添加 eval $(ssh-agent -s) 到 .bashrc 退出登录时自动退出ssh-agent 添加 trap 'eval $(ssh-agent -sk)' EXIT 到 .bashrc 添加ssh密钥到ssh-agent ssh-add

OpenSSL 常用命令

Shell Script Snippets

openssl s_client echo QUIT | openssl s_client -connect hsderps6cd1.cloud.sccncd.com:443 -showcerts openssl s_client -connect www.google.com:443 -showcerts -no-interactive openssl s_client -connect www.google.com:443 -status -no-interactive openssl s_client...

Fedora 41 Linux 系统调优

Shell Script Snippets

安装tuned dnf install tuned 启用latency-performance配置文件 tuned-adm profile latency-performance  

Windows 服务器设置端口映射

Shell Script Snippets

netsh interface portproxy add v4tov4 listenport=22 listenaddress=0.0.0.0 connectport=22 connectaddress=192.168.1.10 netsh interface portproxy show all 不要忘记在Windows防火墙里开放相应的端口  

ZFS 操作

Shell Script Snippets

zpool 状态显示磁盘信息和容量 ZPOOL_SCRIPTS_AS_ROOT=1 zpool status -c vendor,model,size zpool iostat 显示磁盘容量 ZPOOL_SCRIPTS_AS_ROOT=1 zpool iostat -vc size

Fedora upgrade using DNF System Upgrade plugin

Shell Script Snippets

sudo dnf upgrade --refresh sudo dnf system-upgrade download --releasever=42 If some of your packages have unsatisfied dependencies, the upgrade will refuse to continue until you run it again with an extra --allowerasing option. This often happens with pa...

CentOS 7 安装 fail2ban

Shell Script Snippets

sudo yum install epel-release sudo yum install fail2ban sudo systemctl enable fail2bansudo nano /etc/fail2ban/jail.local[DEFAULT] [DEFAULT] # Ban hosts for one hour: bantime = 3600 # Override /etc/fail2ban/jail.d/00-firewalld.conf: banaction = iptable...