两种方式在树莓派上设置接入 WiFi 的静态 IP
Dec 04, 2024
在树莓派上有两种网络管理方式:dhcpcd 和 NetworkManager。 dhcpcd 编辑配置文件 /etc/dhcpcd.conf,里面可以对网络接口配置: SSID Your-WiFi-Name static ip_address=192.168.0.100/24 static routers=192.168.0.1 static domain_name_servers=192.168.0.1 NetworkManager 需要使用命令 nmcli 进行配置。 …
设置 FIN_WAIT_2 超时值
Nov 28, 2024
Debian 编辑 sysctl.conf,单位是秒(s): net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_fin_timeout = 60 net.ipv4.tcp_keepalive_time = 600 FreeBSD 编辑 sysctl.conf,单位是毫秒(ms): net.inet.tcp.fast_finwait2_recycle = 1 net.inet.tcp.finwait2_timeout = 60000 查看当前活跃的 TCP 连接数 $ netstat -an | grep ESTABLISHED | wc -l 使用 wrk 工具测试并发连接 $ wrk -t16 -c1000 -d60s --latency https://apple.com
在 Mac 上使用 macports 安装 git
Nov 17, 2024
安装 git,支持 macOS 的钥匙链特性,Diff 高亮和 SVN 支持: sudo port install git +credential_osxkeychain +diff_highlight +svn 推荐再安装 git-lfs 对大文件的支持: sudo port install git-lfs 最后配置 git: [credential] helper = osxkeychain [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process required = true
设置代理时 DNS 的解析情况
Nov 13, 2024
当配置了代理服务器时,访问一个 URL 就会由代理服务器负责请求和响应,但是 URL 中的域名解析是根据代理服务器的类型而有一些区别: HTTP/HTTPS 代理 域名解析在代理服务器进行,本地的 DNS 解析、缓存和 Hosts 不生效。 …
iOS 开发中用户数据存放位置的选择
Nov 04, 2024
在 iOS 开发中,用户数据有两类: 用户本地配置、登录状态等清除后会影响功能的数据 缓存数据,比如网络图片等即使被清除了也不影响功能 对于第 1 种数据,应该保存在 Library/Application Support 目录中: …
Xcode 14 调试 iOS 17 设备
Oct 24, 2024
问题现象: iOS 17 设备不显示在 Xcode 14 的设备列表里。 解决方法: 让 Xcode 把设备作为 Core Device: $ defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled
Git 设置本地代理
Oct 22, 2024
虽然代理类工具都提供「增强模式」来接管全局代理,但是有时候仅仅需要对浏览器和 git 设置代理。 $ git config --global http.proxy 'socks5h://127.0.0.1:1080' socks5h 和 socks5 都可以配置 socks5 代理,区别在于 socks5h 是在远程解析 DNS,socks5 是本地解析 DNS。 …
Debian 从官方源安装 nginx 并且开启 HTTP/3
Oct 19, 2024
Debian 12 的仓库带的 Nginx 版本还是 1.22 而且不支持 HTTP/3,官方的版本已经是 1.26 了,而且编译时带上了 HTTP/3 的支持。 配置 Apt 源 以下命令需要使用 root 权限执行: 更新软件源到最新: …
解决阿里云 Debian VPS 启动慢的问题
Oct 13, 2024
阿里云的轻量服务器提供的 Debian 镜像是 11 版本的,自己升级到 12 以后,发现从系统启动到网络可用期间,需要花很长时间。 提供命令分析启动的时候各个服务花了多少时间: …
使用 xcodebuild 下载 SDK
Oct 07, 2024
Xcode 16.1 beta2 的更新日志有一段说明: The simulator runtimes are currently available on the Apple Developer website, but will no longer be posted through the website in future updates. Please use xcodebuild -downloadPlatform -exportPath command to download the runtime and then xcodebuild -importPlatform <path/simruntime.dmg> to install it. For more details, see Installing and managing Simulator runtimes. (133776444) …