Skip to main content

Tools

iproute2#

net-tools#

ethtool#

  • ethtool.8
  • query or control network driver and hardware settings
ethtool eth0
Settings for eth0:    Supported ports: [ TP ]    Supported link modes:   10baseT/Half 10baseT/Full                            100baseT/Half 100baseT/Full                            1000baseT/Full    Supported pause frame use: No    Supports auto-negotiation: Yes    Advertised link modes:  10baseT/Half 10baseT/Full                            100baseT/Half 100baseT/Full                            1000baseT/Full    Advertised pause frame use: No    Advertised auto-negotiation: Yes    Speed: 100Mb/s    Duplex: Full    Port: Twisted Pair    PHYAD: 1    Transceiver: internal    Auto-negotiation: on    MDI-X: off    Supports Wake-on: g    Wake-on: d    Link detected: yes

aria2c#

# 使用文件作为下载列表# 最大并发 16# 默认继续下载# 单个服务最多 16 个链接# 重试次数 0, 忽略 404aria2c -i list.txt -j 16 -c -x 16 -m 0
dir=.continue=truemax-connection-per-server=5min-split-size=10M
input-file=aria2.sessionsave-session=aria2.session
enable-rpc=truerpc-allow-origin-all=truerpc-listen-all=truerpc-listen-port=6800
touch aria2.sessionaria2c --conf-path=$PWD/aria2.conf

OpenSSL Tunnel#

# 生成服务器端签名FILENAME=serveropenssl genrsa -out $FILENAME.key 1024openssl req -new -key $FILENAME.key -x509 -days 3653 -out $FILENAME.crt -subj "/C=CN/ST=Wener/L=ShangHai/O=None/CN=hello"cat $FILENAME.key $FILENAME.crt >$FILENAME.pemchmod 600 $FILENAME.key $FILENAME.pem
# 生成客户端签名FILENAME=clientopenssl genrsa -out $FILENAME.key 1024openssl req -new -key $FILENAME.key -x509 -days 3653 -out $FILENAME.crt -subj "/C=CN/ST=Wener/L=ShangHai/O=None/CN=hello"cat $FILENAME.key $FILENAME.crt >$FILENAME.pemchmod 600 $FILENAME.key $FILENAME.pem
# 启动服务端socat openssl-listen:4433,reuseaddr,cert=$PWD/server.pem,cafile=$PWD/client.crt echo
# 启动客户端socat stdio openssl-connect:localhost:4433,cert=$PWD/client.pem,cafile=$PWD/server.crt# 如果出现异常 2016/12/15 17:49:50 socat[8259] E certificate is valid but its commonName does not match hostname# 可使用 verify=0 关闭验证# 或者添加 commonnamesocat stdio openssl-connect:localhost:4433,cert=$PWD/client.pem,cafile=$PWD/server.crt,commonname=hello

# 通过 SSL 转发 DNS# 服务端监听 1053socat openssl-listen:1053,fork,reuseaddr,cert=$PWD/server.pem,cafile=$PWD/client.crt UDP:8.8.8.8:53# 客户端连接服务端的 1053sudo socat UDP-RECVFROM:53,fork,reuseaddr openssl-connect:SERVER:1053,cert=$PWD/client.pem,cafile=$PWD/server.crt

curl#

wget#

  • GNU Wget Manual
  • -e robots=off
    • 忽略 robot.txt
  • -np/--no-parent
    • 不访问上级
  • -N/--timestamping
    • 只访问更新的
  • -nc/--no-clobber
    • 不要下载已存在将被覆盖的文件
  • -q/--quiet
    • 安静模式
短选项长选项说明
2.5 下载选项
--limit-rate=amount限速
目录选项
-P--directory-prefix存储文件到前缀
-nH--no-host-directories不创建主机前缀目录
-nd--no-directories不创建递归目录
2.11 递归下载选项
-r--recursive递归, 默认最大深度为 5
-l depth--level=depth指定最大递归深度
-m--mirror镜像, 等同于 -r -N -l inf --no-remove-listing
wget -rN --no-parent -e robots=off -P /some/where http://some.site# 镜像站点wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.orgwget -mkEpnp http://example.org

httpie#

kcptun#

# Alpinedocker run -d --name tmp xtaci/kcptundocker cp tmp:/bin/client kcptun-clientdocker cp tmp:/bin/server kcptun-serverdocker rm -f tmp
# App <-> Target Client(9003/tcp) <-> KCP Client <-> KCP Server(9002/udp) <-> Target Server(9001/tcp)# 目标 9001 监听 9002./kcptun-server -key $KEY -t "127.0.0.1:9001" -l ":9002" -mode fast2# 目标 9002 监听 9003./kcptun-client -key $KEY -r "127.0.0.1:9002" -l ":9003" -mode fast2