www 发布的文章

现有一个简单的需求,需要用户弹窗选择一个铃音,要求在正式的确认之前就能播放对应的音乐作预听,微信小程序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

IP归属地查询

有一些网站提供免费的API,可以批量查询给定IP的归属地。以下是一些常用的免费IP地理位置API:

  1. IPinfo.io 推荐:

    • 官网: ipinfo.io
    • 免费套餐每月允许多达 50,000 次请求。
    • API调用示例: http://ipinfo.io/8.8.8.8?token=$TOKEN
    • 需要注册获取API密钥。
  2. ipstack 不推荐:

    • 官网: ipstack.com
    • 免费套餐每月允许 100 次请求。
    • API调用示例: http://api.ipstack.com/{IP}?access_key=YOUR_ACCESS_KEY
    • 需要注册获取API密钥。
  3. IPgeolocation.io 推荐:

    • 官网: ipgeolocation.io
    • 免费套餐每天允许 1000 次请求,每月30K次。
    • API调用示例: https://api.ipgeolocation.io/ipgeo?apiKey=YOUR_API_KEY&ip={IP}
    • 需要注册获取API密钥。
  4. ipapi 不推荐:

    • 官网: ipapi.com
    • 免费套餐每月允许 100 次请求。
    • API调用示例: http://api.ipapi.com/{IP}?access_key=YOUR_ACCESS_KEY
    • 需要注册获取API密钥。
  5. IP2Location 推荐:

    • 官网: ip2location.com
    • 免费试用版本每月允许 30K 次查询。
    • API调用示例: https://api.ip2location.io/?key={YOUR_API_KEY}&ip=8.8.8.8&format=json
    • 需要注册获取API密钥。

这些API服务通常都提供一定数量的免费查询额度,可以满足一些基本的需求。如果需要进行大量查询,可能需要考虑付费版本。建议在选择之前详细阅读每个服务的免费套餐条款,以确定其是否满足您的需求。

CVE-2024-6387漏洞影响,各大版本的openssh基本上都要更新(这个漏洞存在于 OpenSSH < 4.4p1 或 8.5p1 <= OpenSSH < 9.8p1 的版本中),目前各大版本也都发布了安全更新,debian/ubuntu系升级主要两条指令:

sudo apt update
sudo apt install --only-upgrade openssh-server

升级后,确认一下版本:

ssh -V
  • debian:

    bullseye (security), bullseye    1:8.4p1-5+deb11u3
      bookworm (security)    1:9.2p1-2+deb12u3
                   sid    1:9.7p1-7
  • ubuntu:

    jammy    Released (1:8.9p1-3ubuntu0.10)
    mantic    Released (1:9.3p1-1ubuntu3.6)
    noble    Released (1:9.6p1-3ubuntu13.3)

FOFA搜索:

body="get all proxy from proxy pool"

可以得到很多爬虫维护的代理站点:

http://113.235.121.92:5010/
http://112.74.98.149:5010/
http://159.75.88.180:5010/
http://101.200.37.197:5010/
https://49.235.191.186/
...……

拉取一个:

http://113.235.121.92:5010/all/

可得:

[{"anonymous":"","check_count":60,"fail_count":0,"https":true,"last_status":true,"last_time":"2024-06-26 14:47:38","proxy":"47.96.176.130:59394","region":"\u4e2d\u56fd \u6d59\u6c5f \u676d\u5dde \u963f\u91cc\u4e91/\u7535\u4fe1/\u8054\u901a/\u79fb\u52a8/\u94c1\u901a/\u6559\u80b2\u7f51","source":"freeProxy11"},{"anonymous":"","check_count":2,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:42","proxy":"154.203.132.49:8080","region":"\u4e2d\u56fd \u9999\u6e2f  cloudinnovation.org","source":"freeProxy11"},{"anonymous":"","check_count":5,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:38","proxy":"183.60.141.41:443","region":"\u4e2d\u56fd \u5e7f\u4e1c \u4e1c\u839e \u7535\u4fe1","source":"freeProxy11"},{"anonymous":"","check_count":44,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:39","proxy":"178.48.68.61:18080","region":"\u5308\u7259\u5229 \u5308\u7259\u5229  upc.hu","source":"freeProxy11"},{"anonymous":"","check_count":13,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:45:44","proxy":"50.62.183.223:80","region":"\u7f8e\u56fd \u4e9a\u5229\u6851\u90a3\u5dde \u51e4\u51f0\u57ce godaddy.com","source":"freeProxy11"},{"anonymous":"","check_count":163,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:37","proxy":"116.63.129.202:6000","region":"\u4e2d\u56fd \u8d35\u5dde \u8d35\u9633 \u7535\u4fe1/\u8054\u901a/\u79fb\u52a8","source":"freeProxy11"},{"anonymous":"","check_count":1,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:45:51","proxy":"120.197.40.219:9002","region":"\u4e2d\u56fd \u5e7f\u4e1c \u5e7f\u5dde \u79fb\u52a8","source":"freeProxy11/freeProxy03"},{"anonymous":"","check_count":14,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:41","proxy":"62.236.76.83:8085","region":"\u82ac\u5170 \u65b0\u5730\u533a \u8d6b\u5c14\u8f9b\u57fa dna.fi","source":"freeProxy11"},{"anonymous":"","check_count":3,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:45:44","proxy":"142.93.142.36:9122","region":"\u8377\u5170 \u5317\u8377\u5170\u7701 \u963f\u59c6\u65af\u7279\u4e39 digitalocean.com","source":"freeProxy11"},{"anonymous":"","check_count":6,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:43","proxy":"154.203.132.55:8090","region":"\u4e2d\u56fd \u9999\u6e2f  cloudinnovation.org","source":"freeProxy11"},{"anonymous":"","check_count":4,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:37","proxy":"223.113.80.158:9091","region":"\u4e2d\u56fd \u6c5f\u82cf \u5f90\u5dde \u79fb\u52a8","source":"freeProxy11"},{"anonymous":"","check_count":46,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:39","proxy":"112.19.241.37:19999","region":"\u4e2d\u56fd \u56db\u5ddd \u6210\u90fd \u79fb\u52a8","source":"freeProxy11"},{"anonymous":"","check_count":2,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:37","proxy":"51.89.73.162:80","region":"\u5fb7\u56fd \u9ed1\u68ee\u5dde \u5170\u6cb3\u7554\u6797\u5821 ovh.com","source":"freeProxy11"},{"anonymous":"","check_count":5,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:43","proxy":"154.203.132.55:8080","region":"\u4e2d\u56fd \u9999\u6e2f  cloudinnovation.org","source":"freeProxy11"},{"anonymous":"","check_count":7,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:37","proxy":"60.12.168.114:9002","region":"\u4e2d\u56fd \u6d59\u6c5f \u53f0\u5dde \u8054\u901a","source":"freeProxy03"},{"anonymous":"","check_count":2,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:40","proxy":"8.209.253.237:8080","region":"\u65e5\u672c \u4e1c\u4eac\u90fd \u4e1c\u4eac \u963f\u91cc\u4e91","source":"freeProxy07"},{"anonymous":"","check_count":9,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:47:37","proxy":"111.160.204.146:9091","region":"\u4e2d\u56fd \u5929\u6d25 \u5929\u6d25 \u8054\u901a","source":"freeProxy11"},{"anonymous":"","check_count":3,"fail_count":0,"https":false,"last_status":true,"last_time":"2024-06-26 14:45:54","proxy":"161.34.40.109:3128","region":"\u65e5\u672c \u65e5\u672c  sphere.ne.jp","source":"freeProxy11"},{"anonymous":"","check_count":4,"fail_count":0,"https":true,"last_status":true,"last_time":"2024-06-26 14:45:48","proxy":"160.248.93.84:3128","region":"\u65e5\u672c \u65e5\u672c  sphere.ne.jp","source":"freeProxy11"}]

验证

#!/bin/bash

# 代理列表
proxies=(
  "47.96.176.130:59394"
  "178.48.68.61:18080"
  "91.148.127.162:8080"
  "50.62.183.223:80"
  "116.63.129.202:6000"
  "120.197.40.219:9002"
  "212.127.93.185:8081"
  "154.203.132.55:8090"
  "142.93.142.36:9122"
  "223.113.80.158:9091"
  "112.19.241.37:19999"
  "51.89.73.162:80"
  "154.203.132.55:8080"
  "49.13.9.253:80"
  "79.110.196.145:8081"
  "60.12.168.114:9002"
  "111.160.204.146:9091"
  "91.148.126.189:8080"
  "161.34.40.109:3128"
  "160.248.93.84:3128"
  "8.219.97.248:80"
  "103.153.154.6:80"
)

# 目标URL
url="http://www.baidu.com"

# 检查代理是否有效
for proxy in "${proxies[@]}"; do
  # 通过代理发送请求
  response=$(curl -s -o /dev/null -w "%{http_code}" -x "$proxy" "$url")
  
  # 检查响应状态码
  if [ "$response" -eq 200 ]; then
    echo "Proxy $proxy is valid."
  else
    echo "Proxy $proxy is invalid."
  fi
done

结果:

Proxy 47.96.176.130:59394 is valid.
Proxy 178.48.68.61:18080 is valid.
Proxy 91.148.127.162:8080 is valid.
Proxy 50.62.183.223:80 is valid.
Proxy 116.63.129.202:6000 is valid.
Proxy 120.197.40.219:9002 is valid.
Proxy 212.127.93.185:8081 is valid.
Proxy 154.203.132.55:8090 is valid.
Proxy 142.93.142.36:9122 is valid.
Proxy 223.113.80.158:9091 is valid.
Proxy 112.19.241.37:19999 is valid.
Proxy 51.89.73.162:80 is valid.
Proxy 154.203.132.55:8080 is valid.
Proxy 49.13.9.253:80 is invalid.
Proxy 79.110.196.145:8081 is valid.
Proxy 60.12.168.114:9002 is valid.
Proxy 111.160.204.146:9091 is valid.
Proxy 91.148.126.189:8080 is invalid.
Proxy 161.34.40.109:3128 is invalid.
Proxy 160.248.93.84:3128 is valid.
Proxy 8.219.97.248:80 is valid.
Proxy 103.153.154.6:80 is valid.

总结

  1. 可以通过脚本自动获取并验证更新代理节点
  2. 还有更多的搜索方法:

      protocol=="socks5" && "Version:5 Method:No Authentication(0x00)" && after="1900-01-01" && country="CN"
     "“89e3175.js”" 或title="代理池网页管理界面"