编辑
2021-01-27
主机教程
00

crontab开机自启

vi /etc/rcexit 0前面新增一行synoservice --start crond

编辑crontab

vim /etc/crontab

重启crontab即可

synoservice --restart crond

编辑
2020-11-24
建站知识
00

安装redis

docker pull redis docker run --network host -d --restart always --name redis redis:latest

安装redis扩展

vi /volume1/@appstore/PHP7.2/misc/php-fpm.ini

在尾部添加

[Redis] extension = redis.so

重启webstation(需要同时重启apache)

安装redis缓存插件

  1. 下载插件

  2. 解压缩放入/usr/plugins,重命名为TpCache并启用

  3. 修改端口,开启SSL image.png

缓存更新机制

  • 来自原生评论系统的评论
  • 后台文章或页面更新
  • 重启redis
  • 缓存到期
编辑
2020-11-21
编程开发
00

说明

随便点击一门课学习即可

已知问题

自动刷新有时会卡住,原因未知(疑似该课程已学习完毕,但页面并未自动跳转),建议偶尔查看一次

解决方案

  • 在看视频页面定时获取主页内容,查找对应ID的课程是否学习完毕,若完毕则关闭本页面,跳转主页自动学习下一门课
  • (偷懒方法)看视频时获取当前视频时长,定时2/3时间后跳转主页(会损失一点观看进度,但胜在稳定)

脚本

javascript
// ==UserScript== // @name 东奥会计人员在线继续教育刷课脚本 // @namespace https://blog.mcraft.cn/s/DongaoStudy.html // @version 0.1 // @description 东奥会计人员在线继续教育 // @author 7 // @match *://*.dongao.com/* // @grant none // ==/UserScript== (function() { var href = location.href; var text; var i; if(href.indexOf("study/u/myCourse")!=-1){ if(href.indexOf("auto=true")!=-1){ //我的课程页面 for(i=0;i<document.getElementsByClassName("operate-a active").length;i++){ //进入第一门未完成课程 text = document.getElementsByClassName("operate-a active")[i].innerText; if(text=="继续学习" || text=="开始学习"){ //自动开始学习 document.getElementsByClassName("operate-a active")[i].click(); break; } } //关闭页面 window.close(); }else{ setInterval(function(){ location.reload(); },300000); //GM_setValue("accountId", href.match(/(\d+)/)[1]); var tb = document.getElementsByClassName("table all")[0]; var rows = tb.rows; var rowNum = tb.rows.length; for (i = (rowNum-1); i >= 1; i--){ if(rows[i].cells[6].innerText.indexOf("已完成") != -1){ tb.deleteRow(i); } } } }else if(href.indexOf("lecture/lectureList")!=-1){ //课程目录页面 //是否有下一节课 var findNextCourseID = false; var courseID; for(i=0;i < document.getElementsByClassName("item-button1").length;i++){ text=document.getElementsByClassName("item-button1")[i].innerText; if(text=="继续学习" || text=="开始学习"){ var onclickValue = document.getElementsByClassName("item-button1")[i].getAttributeNode("onclick").nodeValue; courseID = onclickValue.match(/(\d+),(\d+)/); var endhref=href.indexOf("/lecture"); var prefix=href.substring(endhref); findNextCourseID = true; break; //document.getElementsByClassName("item-button1")[i].click(); //break; } } //尝试学习下一节课 if(findNextCourseID == true){ location.href="http://"+location.host+"/cwweb/videoShow/video/videoPlay?lectureID="+courseID[2]+"&cwID="+courseID[1]; }else{ //否则打开主页,并自动学习下一门课 //location.href = "http://study.dongao.com/study/u/myCourse?accountId=" + GM_getValue("accountId") + "&auto=true"; jumpToMainPage(); } }else if(href.indexOf("video/videoPlay")!=-1){ //视频结束后回到主目录 var currentTime = (new Date()).getTime(); setInterval(function(){ //如果90分钟没有 if((new Date()).getTime() - currentTime > 5400000){ //checkVideoShow(); jumpToMainPage(); } },300000); document.getElementById('syno-nsc-ext-gen3').click(); timerReopenMainPage(); var paused = false; //自动点击弹窗 setInterval(function(){ var clickSure = document.querySelector(".box-sure"); if(clickSure != null) clickSure.click(); //如果视频暂停超过10秒,返回主页/课程目录 if(isVideoPaused() == true){ if(paused == true){ //checkVideoShow(); jumpToMainPage(); } paused = true; }else{ paused = false; } },10000); } function checkVideoShow(){ var endhref=href.indexOf("/videoShow"); var prefix=href.substring(endhref); var cwId=href.substring(href.indexOf("cwID="),href.indexOf("&lectureID")); cwId=cwId.substring(5); location.href="http://"+location.host+"/cwweb/lecture/lectureList?cwID="+cwId; } function jumpToMainPage(){ location.href = "http://study.dongao.com/study/u/myCourse?auto=true"; } function isVideoPaused(){ return window.video.paused(); } function getVideoTotalTime(){ return window.video.getTotalTime(); } function timerReopenMainPage(){ setTimeout(function(){ if(isVideoPaused()){ window.video.play(); } setTimeout(function(){ jumpToMainPage(); },parseInt(getVideoTotalTime()*1000/2+10000)); },5000); } })();
编辑
2020-08-15
编程开发
00

用pyinstaller打包python程序时,因用了win32库,出现了如下错误:

解决方法

1)确认pywin32安装成功 2)将pywin32_system32路径加入系统环境变量path中 例如: D:\Program Files\Python\Lib\site-packages\pywin32_system32 3)重新打包即可(建议重启确保环境变量生效)

编辑
2020-05-03
游戏相关
00

游戏存档加载失败或云存档较新

解决办法:删除我的文档下的Rockstar Games文件夹,启动游戏后按提示开启云存档,加载完故事模式后重进游戏即可

无法启动游戏,请验证您的游戏数据

解决办法:网络不通,重新启动加速器即可