Ubuntu 22.04.1默认采用systemd-resolved作为DNS维护服务,其生成的/etc/resolv.conf文件内容如下:

# This is /run/systemd/resolve/resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 192.168.1.1
search .

如果需要修改DNS服务器,则修改文件/etc/systemd/resolved.conf中的DNS字段,示例:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the resolved.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
#
# See resolved.conf(5) for details.

[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google:     8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9:      9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=223.6.6.6 119.29.29.29
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#CacheFromLocalhost=no
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no

再重启服务生效:

sudo systemctl restart systemd-resolved

电脑标准分辨率比例
CGA320×20016:10
QVGA320×2404:3
WQVGA480×27216:9
B&W Macintosh/Macintosh LC512×3844:3
HVGA480×3203:2
EGA640×350约5:3
nHD640×36016:9
VGAMCGA640×4804:3
HGC720×34860:29
MDA720×35072:35
Apple Lisa720×3602:1
SVGA800×6004:3
WVGA800×4805:3
FWVGA854×480约16:9
qHD960×54016:9
DVGA960×6403:2
WSVGA1024×600128:75
XGA1024×7684:3
XGA+1152×8644:3
HD1280×72016:9
WXGA1280×76815:9
WXGA1280×80016:10
SXGA1280×10245:4
WXSGA+1366×768683:384和16:9
WXGA+1440×90016:10
SXGA+1400×10504:3
WSXGA1600×102425:16
WSXGA+1680×105016:10
UXGA1600×12004:3
WUXGA1920×120016:10
Full HD1920×108016:9
QXGA2048×15364:3
QHD2560×108021:9
WQHD2560×144016:9
WQXGA2560×160016:10
QSXGA2560×20485:4
WQSXGA3200×2048约15.6:10
QUXGA3200×24004:3
QHD3440×144021:9
QFHD3840×216016:9
4K Ultra HD4096×2160(256:135和约17:9)
WQUXGA3840×240016:10
HSXGA5120×40965:4
WHSXGA6400×409625:16
HUXGA6400×48004:3
8K Ultra HD7680×432016:9
WHUXGA7680×480016:10
模拟电视标准分辨率
PAL720×5765:4,非正方形的像素
PAL VHS320×576
NTSC720×480
NTSC VHS320×4823:2,非正方形的像素
数字电视标准分辨率
NTSC(首选格式)648×4864:3
D-1 NTSC720×486
D-1 NTSC (square pixels)720×540
PAL720×486
D-1 PAL720×5764:3
D-1 PAL(正方形像素)768×576
HDTV 1080i1920×108016:9
HDMI1366×76816:9
HDTV 720p1280×72016:9
EDTV 480p704×480
数字电影标准分辨率
协会标准(2k)2048×15364:3
协会标准(4k)4096×30724:3
DVD "NTSC"720×4803:2,非正方形的像素
DVD "PAL"720×5765:4,非正方形的像素
VCD "NTSC"352×24022:15,非正方形的像素
VCD "PAL"352×28811:9,非正方形的像素
LD560×360

frps作为服务端,需要在Windows服务器上实现服务后台运行,借助winsw工具快速搞定,记录如下:

  • 下载winsw
    https://github.com/winsw/winsw/releases
    下载对应的版本,如WinSW-x64.exe
  • 填写服务配置文件
    配置文件名:WinSW-x64.xml,注意取名跟所下载的应用程序名WinSW-x64.exe相同,并放入同一目录下。

    <service>
    <!--  该服务的唯一标识  -->
    <id>frps</id>
    <!--  该服务的名称  -->
    <name>frp-server</name>
    <!--  该服务的描述  -->
    <description>frp服务器</description>
    <!--  要运行的程序路径  -->
    <executable>C:\bug\frp\frps.exe</executable>
    <!--  携带的参数  -->
    <startargument>-c</startargument>
    <startargument>C:\bug\frp\frps.toml</startargument>
    <!--  第一次启动失败 60秒重启  -->
    <onfailure action="restart" delay="60 sec"/>
    <!--  第二次启动失败 120秒后重启  -->
    <onfailure action="restart" delay="120 sec"/>
    <!--  日志模式  -->
    <logmode>append</logmode>
    <!--  指定日志文件目录(相对于executable配置的路径)  -->
    <logpath>logs</logpath>
    </service>
  • 安装并启动服务

    以管理员权限运行cmd:

      WinSW-x64.exe install
      WinSW-x64.exe start
  • 查看log
    找到配置文件所在的logs目录查看即可。

Nginx 只允许Cloudflare CDN IP访问

server {
    listen 80;
    server_name your_domain.com;

    # 允许 Cloudflare 的 IP 地址访问
    # 定义允许的 IPv4 地址范围
    allow 173.245.48.0/20;
    allow 103.21.244.0/22;
    allow 103.22.200.0/22;
    allow 103.31.4.0/22;
    allow 141.101.64.0/18;
    allow 108.162.192.0/18;
    allow 190.93.240.0/20;
    allow 188.114.96.0/20;
    allow 197.234.240.0/22;
    allow 198.41.128.0/17;
    allow 162.158.0.0/15;
    allow 104.16.0.0/13;
    allow 104.24.0.0/14;
    allow 172.64.0.0/13;
    allow 131.0.72.0/22;

    # 定义允许的 IPv6 地址范围
    allow 2400:cb00::/32;
    allow 2606:4700::/32;
    allow 2803:f800::/32;
    allow 2405:b500::/32;
    allow 2405:8100::/32;
    allow 2a06:98c0::/29;
    allow 2c0f:f248::/32;

    # 禁止其他 IP 地址访问
    deny all;

    # 此处添加其他 Nginx 配置,如 location 等
}