Linux 快速打包并加密文件夹 (7zip替代tar加密码)

# 安装7-zip # 注意这里硬件的指令集区别 有 x86 x64 arm 和 arm64 # https://www.7-zip.org/a/7z2201-linux-x86.tar.xz # https://www.7-zip.org/a/7z2201-linux-x64.tar.xz # https://www.7-zip.org/a/7z2201-linux-arm.tar.xz # https://www.7-zip.org/a/7z2201-linux-arm64.tar.xz mkdir 7zip cd 7zip wget https://www.7-zip.org/a/7z2201-linux-x64.tar.xz tar -xf 7z2201-linux-x64.tar.xz chmod +x 7zzs mv 7zzs /usr/local/bin/ ln -s /usr/local/bin/7zzs /usr/bin/7z cd .. # 清理文件 tar -cf - 7zip --remove-files > /dev/null # 打

C# FindWindowEx 查找窗体

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace ConsoleApp1 { class Program { [DllImport("user32.dll", EntryPoint = "FindWindowEx")] private static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); static void Main(string[] args) { IntPtr maindHwnd = FindWindowEx((IntPtr)0, (IntPtr)0,"窗体Class",&

nginx 关闭低版本 tls 协议 禁用 tls 1.0 tls 1.1

关键配置 ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off; 改完记得重启nginx 配置工具 https://ssl-config.mozilla.org/#server=nginx&version=1.17.7&config=intermediate&openssl=1.1.1k&hsts=false&ocsp=false&guideline=5.6 测试工具(支持自定义端口的测试好难找) https://geekflare.com/tools/tls-test https://myssl.com/

iptables 控制 docker 端口开放范围

对于类似 docker run -d -p 80:80 shaowenchen/demo-whoami 运行的服务,需要在 DOCKER-USER 链中添加规则。 Docker 会将 iptables 规则添加到 DOCKER 链中,如果需要在 Docker 之前添加规则需要添加到 DOCKER-USER 链中 iptables -I DOCKER-USER -i ens192 ! -s 1.2.3.4 -p tcp

IPv6 端口转发联机软件 4to6

https://github.com/wangyu-/tinyPortMapper https://www.onlinedown.net/soft/110765.htm 两个工具都可以用,但难点不在这里,家庭路由器和光猫很少有对ipv6防火墙的管理设定,导致哪怕拿到了公网IP 也开不出端口,防火墙挡住了。o

windows 批处理同步系统时间

@echo off >NUL 2>&1 REG.exe query "HKU\S-1-5-19" || ( ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs" ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs" "%TEMP%\Getadmin.vbs" DEL /f /q "%TEMP%\Getadmin.vbs" 2>NUL Exit /b ) cd /d %~dp0 net stop w32time w32tm /unregister w32tm /register net start w32time w32tm /config /manualpeerlist:"ntp1.aliyun.com" /syncfromflags:manual /reliable:yes /update w32tm /resync ``