networksetup 常用命令

  1. 列出所有网络服务

    networksetup -listallnetworkservices
  2. 获取特定服务的 IP 信息

    networksetup -getinfo "Wi-Fi"
  3. 设置 Wi-Fi 为手动 IP 配置

    networksetup -setmanual "Wi-Fi" 192.168.1.100 255.255.255.0 192.168.1.1
  4. 设置 Wi-Fi 使用 DHCP

    networksetup -setdhcp "Wi-Fi"
  5. 设置 DNS 服务器

    networksetup -setdnsservers "Wi-Fi" 8.8.8.8 8.8.4.4
  6. 获取当前 DNS 服务器

    networksetup -getdnsservers "Wi-Fi"
  7. 打开或关闭 Wi-Fi

    networksetup -setairportpower en0 on
    networksetup -setairportpower en0 off
  8. 配置 HTTP 代理

    networksetup -setwebproxy "Wi-Fi" proxy.example.com 8080
    networksetup -setwebproxystate "Wi-Fi" off
  9. 启用或禁用网络服务

    networksetup -setnetworkserviceenabled "Wi-Fi" on
    networksetup -setnetworkserviceenabled "Wi-Fi" off
  10. 获取网络服务状态

    networksetup -getnetworkserviceenabled "Wi-Fi"
  11. 连接到特定的 Wi-Fi 网络

    networksetup -setairportnetwork en0 "NetworkName" "Password"
  12. 检测新硬件

    networksetup -detectnewhardware

esxcli system hostname set --host=esxi
esxcli system hostname set --fqdn=esxi

OpenWrt

镜像

https://downloads.openwrt.org/releases/23.05.0/targets/x86/64/

https://downloads.openwrt.org/releases/23.05.0/targets/x86/64/openwrt-23.05.0-x86-64-generic-ext4-combined-efi.img.gz

brew install qemu

qemu-img convert -f raw -O vmdk openwrt-23.05.0-x86-64-generic-ext4-combined-efi.img openwrt-23.05.0-x86-64-generic-ext4-combined-efi.vmdk

# 把转换后的文件上传到 ESXi 中
cd /vmfs/volumes/datastore1/OpenWrt
vmkfstools -i arpl.vmdk openwrt-23.05.0-x86-64-generic-ext4-combined-efi.vmdk -d thin

源码

https://github.com/openwrt/openwrt

常用包安装

sed -i 's/downloads.openwrt.org/mirrors.ustc.edu.cn\/openwrt/g' /etc/opkg/distfeeds.conf
echo 'src/gz openwrt_kiddin9 https://dl.openwrt.ai/packages-23.05/x86_64/kiddin9' >> /etc/opkg/customfeeds.conf
sed -i 's/^option check_signature/# &/' /etc/opkg.conf
opkg update
opkg install unzip
opkg install git-http ca-bundle
opkg install lrzsz
# 命令行磁盘管理
opkg install cfdisk
# 磁盘管理
opkg install lsblk

# Argon主题
opkg install luci-theme-argon luci-app-argon-config
# Diskman
opkg install luci-app-diskman
# 挂载点
opkg install block-mount

# openclash
# opkg remove dnsmasq
opkg install luci-compat
opkg install luci-app-openclash

# sftp
opkg install openssh-sftp-server

# mosdns
opkg install luci-app-mosdns
# smartdns
opkg install luci-app-smartdns
# adguardhome
opkg install luci-app-adguardhome
# wechatpush
opkg install luci-app-wechatpush luci-app-pushbot

扩容

https://doc.openwrt.cc/1-General/6-Resize

https://seahi.me/263.html

clash 插件

https://github.com/vernesong/OpenClash

opkg remove dnsmasq
#iptables
opkg install coreutils-nohup bash iptables dnsmasq-full curl ca-certificates ipset ip-full iptables-mod-tproxy iptables-mod-extra libcap libcap-bin ruby ruby-yaml kmod-tun kmod-inet-diag unzip luci-compat luci luci-base

mkdir -p /etc/openclash/core/
cd /etc/openclash/core/
# 上传 clash-linux-amd64.tar
tar -xf clash-linux-amd64.tar

#上传IPK文件至您路由器的 /tmp 目录下
opkg install /tmp/luci-app-openclash*.ipk

自定义防火墙规则

23.05 界面上没了,需要自行设置

https://www.right.com.cn/forum/thread-8305441-1-1.html

# vim /etc/config/firewall
config include
    option    enabled    1
    option    type    'script'
    option    path    '/etc/firewall.user'
    option    fw4_compatible    1
# vim /etc/config/firewall.user
nft add rule inet fw4 dstnat tcp dport 53 counter redirect to :53
nft add rule inet fw4 dstnat udp dport 53 counter redirect to :53

turboacc 插件

https://github.com/chenmozhijin/turboacc

openwrt 安装的 23.05

此处需要按此步骤

23.05/master(kernel-5.15)

cd /tmp
git clone https://github.com/openwrt/openwrt -b v23.05.0
cd /tmp/openwrt

opkg install perl perlbase-getopt perlbase-env perlbase-findbin perlbase-thread make coreutils-nproc git gcc libncurses-dev libncurses6 perlbase-thread rsync tar findutils patch diffutils gawk grep gzip file wget-ssl python3 coreutils-install coreutils-realpath getopt coreutils-stat musl-fts
./scripts/feeds update -a

./scripts/feeds install -a

安装黑群晖

黑群晖引导镜像
https://github.com/fbelavenuto/arpl

黑群晖引导镜像-汉化
https://github.com/wjz304/arpl-zh_CN

https://github.com/wjz304/rr/releases

https://github.com/alibaba/druid/tree/1.1.20/src/main/java/com/alibaba/druid/pool

https://github.com/alibaba/druid/blob/1.1.20/src/main/java/com/alibaba/druid/pool/PreparedStatementPool.java

https://github.com/alibaba/druid/blob/1.1.20/src/main/java/com/alibaba/druid/pool/DruidAbstractDataSource.java

# 共享预处理语句 默认为false
sharePreparedStatements

  1. Monaco(内置)
  2. Fira Code
  3. JetBrains Mono
  4. Comic Mono
brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git

brew install font-fira-code
brew install font-jetbrains-mono
brew install font-comic-mono

fliqlo - 复古翻页数字时钟

https://fliqlo.com/screensaver/

Padbury Clock — 超细字体极简时钟

https://github.com/Kamik423/Padbury-Clock-Revived

Blue Screen Saver

https://github.com/dessibelle/Blue-Screen-Saver

WATCH OS X — WATCH 时钟

MatrixSaver — 黑客帝国矩阵屏保

https://github.com/st235/RainingCode

Line Friends — 布朗尼熊和可妮兔故事

动画网站

假装 Windows 升级界面
https://fakeupdate.net

自动化生成打字动画的网站
https://ilove.works/