Swds 发布的文章

更新,路由器总是重定向DNS到1053,改用了v2ray内置dns,效果更好。

路由器内置的dns总是不稳定,希望这个好用。

opkg update; opkg install dnscrypt-proxy
dnscrypt-proxy -R cs-de -a 0.0.0.0:5353 -d

/etc/dnsmasq.conf

no-resolv
server=127.0.0.1#5353
cache-size=1500

添加第二IP,Debian9修改interfaces总是不成功,只好用NetworkManager,好用多了。

apt-get install network-manager; 
nano /etc/NetworkManager/NetworkManager.conf; # false --> true
nmtui; # 添加第二IP,DNS等

NetwrikManager和原有的network兼容性不好,重启后需要再次重启网络服务

nmcli con down ens32; nmcli con up ens32;

@echo off
set itime=0

:start
for /f "tokens=2 delims==" %%a in ('wmic path Win32_PerfFormattedData_PerfOS_Processor get PercentProcessorTime /value^|findstr "PercentProcessorTime"') do set UseCPU=%%a
if %UseCPU% gtr 60 set /a itime=%itime%+1
if %UseCPU% lss 40 set itime=0
if %itime% gtr 30 goto vmrestart
choice /t 60 /d y /m "%date% %time% CPU %UseCPU% %itime% Waiting 60s"
goto start

choice /t 10 /d y /m "%date% %time% Somthing wrong, to end"
goto end

:vmrestart
choice /t 600 /d y /m "%date% %time% Restart finished, to start again"
set itime=0
goto start

:end
pause

#!/bin/sh
. /etc/profile
. /root/.bashrc
cd /xxxxx/xxxxx
sold=`stat -c %Y snews.html` # 文件修改时间戳
snew=`date +%s` # 系统当前时间戳
sdiff=$[$snew-$sold]
sload=`uptime | awk -F 'load average: ' '{print $2}'| awk -F ', ' '{print $1}'| awk -F '.' '{print $1}'`
if [ $sdiff -gt 700 ];then # 文件太旧,需要重启系统
  if [$sload -gt "0"];then
    echo "File Read Only, but loading > 1, waiting to reboot"
  else
    curl http://sc.ftqq.com/xxxxx.send?text=RebootCEforFileReadOnly
    reboot
  if
fi