www 发布的文章

电脑标准分辨率比例
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 等
}

现有一个简单的需求,需要用户弹窗选择一个铃音,要求在正式的确认之前就能播放对应的音乐作预听,微信小程序picker(mode = selector)可以实现选择确认功能,但只有点击确认后的bindchange事件,没有选择变化事件。根据微信文档,在mode = multiSelector时,有多了一个bindcolumnchange事件,灵光一闪,只有一列的multiSelector不就是selector?那不就可以把multiSelector当selector用?

wxml:

          <view class="option">铃声: 
          <picker mode="multiSelector" range="{{[ringtones]}}" data-alarmid="{{item.id}}" bindcolumnchange="bindRingtoneSelect" bindchange="bindRingtoneChange">
            <view class="picker">{{ringtones[item.ringtoneIndex]}} <text class="picker-selector"> ❯</text> </view> 
          </picker>
          </view>

特别注意其中:ringtones一维数组,调整为:[ringtones]引用。

js:

  bindRingtoneSelect: function(e) {
    proto.sendPlayMusic(e.detail.value);
  },

  bindRingtoneChange:function(e) {
    proto.sendSaveMusic(e.detail.value);
  },

实验效果完美解决~~

Debian默认root帐号shell无色彩解决

默认root帐号的shell无色彩

修改.bashrc文件为:

# ~/.bashrc: executed by bash(1) for non-login shells.

# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
 PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
 export LS_OPTIONS='--color=auto'
 eval "$(dircolors)"
 alias ls='ls $LS_OPTIONS'
 alias ll='ls $LS_OPTIONS -l'
 alias l='ls $LS_OPTIONS -lA'

# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ ! -z "$PS1" ]; then
    if [ "$color_prompt" = yes ]; then
        PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    else
        PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi
fi