This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repo="adams549659584/go-proxy-bingai" | |
# 获取远程tag | |
tag=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -o '"tag_name": ".*"' | sed 's/"tag_name": "//;s/"//') | |
# 获取本地tag | |
if [ -f "cur_tag" ]; then | |
cur=$(cat "cur_tag") | |
else | |
cur="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Random colorscheme function | |
function! RandomColorscheme() | |
" Get a list of all colorschemes | |
let s:colorschemes = split(globpath(&rtp, 'colors/*.vim'), '\n') | |
" Remove the path and extension from each colorscheme name | |
let s:colorschemes = map(s:colorschemes, 'fnamemodify(v:val, ":t:r")') | |
" Remove unwanted colorschemes | |
let s:colorschemes = filter(s:colorschemes, 'v:val != "blue" && v:val != "darkblue" && v:val != "default" && v:val != "delek" && v:val != "morning" && v:val != "peachpuff" && v:val != "shine" && v:val != "zellner"') | |
" Select a random colorscheme from the list | |
let s:random_colorscheme = s:colorschemes[rand() % len(s:colorschemes)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import json | |
import os | |
import sys | |
""" | |
通过 vnstat 统计当日&当月流量,达到第一限制时禁用网络 | |
接口,达到第二限制则禁用网络接口+关机 | |
p.s. 若开机时间不足最小开机时长,则达到第二限制时只会 |