首页
留言
关于
友链
Search
1
IOTQQ色图机器人
547 阅读
2
计算组装与维护笔记
529 阅读
3
Nodecache免费CDN加速
492 阅读
4
SEO基础,适合新站长
458 阅读
5
计算机基础应用笔记
414 阅读
笔记
折腾
游戏
Search
标签搜索
教程
笔记
Linux
随记
CDN
Windows
色图
碎碎念
Macos
PhotoShop
WinPE
cmapp
cmfix
小技巧
沐予之枫
累计撰写
38
篇文章
累计收到
60
条评论
首页
栏目
笔记
折腾
游戏
页面
留言
关于
友链
搜索到
12
篇与
教程
的结果
2020-04-03
给你的网站加上黑白哀悼模式
找个合适的地方粘贴一下<!-- 哀悼日网站变成灰色 <style type="text/css">html{ filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,#grayscale"); filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(1);} </style> -->
2020年04月03日
201 阅读
2 评论
0 点赞
2020-03-28
Typecho评论获取QQ头像
Typecho默认获取的头像是Gravatar的,要修改为获取QQ的头像只需一点小改动在/var/Typecho/Common.php第986行 public static function gravatarUrl($mail, $size, $rating, $default, $isSecure = false) { if (defined('__TYPECHO_GRAVATAR_PREFIX__')) { $url = __TYPECHO_GRAVATAR_PREFIX__; } else { $url = $isSecure ? 'https://secure.gravatar.com' : 'http://www.gravatar.com'; $url .= '/avatar/'; } if (!empty($mail)) { $url .= md5(strtolower(trim($mail))); } $url .= '?s=' . $size; $url .= '&r=' . $rating; $url .= '&d=' . $default; return $url; }修改为public static function gravatarUrl($mail, $size, $rating, $default, $isSecure = false) { $reg = "/^\d{5,11}@[qQ][Qq]\.(com)$/"; if (preg_match($reg, $mail)) { $img = explode("@", $mail); $url = "//q2.qlogo.cn/headimg_dl?dst_uin={$img[0]}&spec=100"; } else { if (defined('__TYPECHO_GRAVATAR_PREFIX__')) { $url = __TYPECHO_GRAVATAR_PREFIX__; } else { $url = $isSecure ? 'https://secure.gravatar.com' : 'http://www.gravatar.com'; $url .= '/avatar/'; } if (!empty($mail)) { $url .= md5(strtolower(trim($mail))); } $url .= '?s=' . $size; $url .= '&r=' . $rating; $url .= '&d=' . $default; } return $url; }如果找不到可以Ctrl F查找一下获取gravatar头像地址就在注释下方
2020年03月28日
235 阅读
0 评论
1 点赞
2020-03-26
Termux安装Nodejs Git
标题是这么写的,不过只是前提,关键还是要用Hexo来搭建个人博客啦至于怎么搭建的话,我这里就不说了,还是看另一篇文章吧,操作步骤都是一样的Coding安装Hexo并推送到Github准备一下如果你还不知道什么是Termux的话,还是看看下面这段描述吧Termux是一个Android下一个高级的终端模拟器, 开源且不需要root, 支持apt管理软件包,十分方便安装软件包, 完美支持Python, PHP, Ruby, Go, Nodejs, MySQL等。随着智能设备的普及和性能的不断提升,如今的手机、平板等的硬件标准已达到了初级桌面计算机的硬件标准, 用心去打造完全可以把手机变成一个强大的工具.简单来说就是你可以把Android手机当做Linux来用,毕竟是Linux内核嘛。这里是Termux的安装包下载地址酷安Termux开始安装吧如果你完成了简单介绍和安装,你已经对Termux有个大概的了解了打开Termux『需要科学上网,喜欢搞♂机的都有一个』无法打开安装的话用这个完整包吧等待环境安装完成,完成之后可以开始执行命令了切换到清华源sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list apt update && apt upgrade安装nodejspkg install nodejs -y安装Gitpkg install git -y安装Hexo 这里需要科学上网npm install hexo-cli -g
2020年03月26日
151 阅读
0 评论
0 点赞
2020-03-21
垃圾评论过滤-防广告
正在改博客样式的时候突然蹦出一个广告,嗯,还是俄文,着实恶心,一天之内连收两份广告大礼,一份GHS一份没看不知道是什么使用插件CommentFilter来过滤,这是寒泥写的,功能挺丰富的看着配置就可以插件下载
2020年03月21日
187 阅读
0 评论
0 点赞
2020-03-20
Centos不换内核安装锐速
使用指令查看内核,有一个3.10.....的内核,或者其他的版本uname -r在锐速库中查看和你内核版本比较相近的内核版本,执行指令安装,将3.10.0-229.1.2.el7.x86_64/x64改为你选择的版本wget --no-check-certificate -O appex.sh https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh && chmod +x appex.sh && bash appex.sh install '3.10.0-229.1.2.el7.x86_64/x64'一路Y过去,启动了就恭喜你,失败了就重新找内核
2020年03月20日
150 阅读
0 评论
0 点赞
2020-03-17
使用Haproxy代理防止smtp发信泄露ip
Smtp发信会泄露源站ip,CDN无法防护,使用Haproxy就可以避免了Centosyum -y install haproxydebianecho deb http://httpredir.debian.org/debian wheezy-backports main | \ sed 's/\(.*\)-sloppy \(.*\)/&@\1 \2/' | tr @ '\n' | \ tee /etc/apt/sources.list.d/backports.list #安装 apt-get update apt-get install haproxy -t wheezy-backports配置清空文件内容cd /etc/haproxy/ > haproxy.cfg写入以下配置global ulimit-n 51200 defaults log global mode tcp option dontlognull timeout connect 1000ms timeout client 150000ms timeout server 150000ms listen status bind 0.0.0.0:1080 mode http log global stats refresh 30s stats uri /admin?stats stats realm Private lands stats auth admin:password stats hide-version frontend ssin bind *:465 #如果是普通模式,那这里就填25,如果是SSL模式,就需要填465 default_backend ssout backend ssout server server1 11.22.33.44 maxconn 204800 #这里的IP需要改成SMTP地址的IP,ping一下SMTP域名即可得到地址设置为开机启动service haproxy restart chkconfig haproxy on使用在你的网站服务器下编辑hosts文件,写入你的中转服务器以及使用的smtpvi /etc/hosts 127.0.0.1 localhost ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 22.33.44.55 smtp.qq.com #22.33.44.55就是中转服务器的IP
2020年03月17日
137 阅读
0 评论
0 点赞
2020-03-06
Coding安装Hexo并推送到Github
今天还是要水下文章,这里说下,coding已经被腾讯收购了,所以叫Cloud Studio也是一样的之所以使用Cloud Studio是因为简便,如果你有服务器的话可以不适用Cloud Studio官网:Cloud Studio自行注册总结简单来说无非就几条命令,这里列一下,下面详细讲npm install hexo-cli -g hexo init Blog cd Blog npm install hexo g hexo d创建注册完成之后先创建下工作空间名称:必填,随意预置:Nodejs代码:空创建安装进入工作空间开始操作打开控制台,输入指令npm install hexo-cli -g安装完成如下初始化hexohexo init blogCD到blog目录cd blog安装依赖npm install生成博客文件hexo g启动服务hexo s不过是cloud studio也看不到吧,这是多余的推送到github配置推送信息git config --global user.name "你的名字" git config --global user.email "邮箱地址"创建秘钥-全部默认回车ssh-keygen -t rsa -C "your_email@mail.com"key文件在你的根目录.ssh文件夹将秘钥填入github仓库 deploy key将id_rsa.pub文件中的ssh key填入仓库中验证是否连接成功ssh -T git@github.com出现你的名字或者邮箱即可添加推送源修改_config.json将其下Mottoi改为你的用户名以及仓库名·记住仓库名必须为用户名.github.iodeploy: type: git repository: https://github.com/Mottoi/Mottoi.github.io.git branch: master推送完成之后生成博客文件,并将其推送hexo g hexo d大功告成,你可以在仓库查看你的文件了
2020年03月06日
126 阅读
0 评论
0 点赞
2020-03-02
Akina的一些小修改
Akina for Typecho是由缺乏维生素移植自Wordpress因为个人觉得有些不完善,所以加点小修改聚焦作者聚焦图片是写死了的,所以给主题小小修改一下就可以在后台给聚焦加标题图片链接了修改位置:index.php<!-- 聚焦内容 --> <div class="top-feature"> <h1 class="fes-title">聚焦</h1> <div class="feature-content"> <li class="feature-1"><a href="<?php $this->options->feature1();?>"><div class="feature-title"><span class="foverlay">feature1</span></div><img src="<?php echo theurl; ?>images/feature/feature1.jpg"></a></li> <li class="feature-2"><a href="<?php $this->options->feature2();?>"><div class="feature-title"><span class="foverlay">feature2</span></div><img src="<?php echo theurl; ?>images/feature/feature2.jpg"></a></li> <li class="feature-3"><a href="<?php $this->options->feature3();?>"><div class="feature-title"><span class="foverlay">feature3</span></div><img src="<?php echo theurl; ?>images/feature/feature3.jpg"></a></li> </div> </div>修改为<!-- 聚焦内容 --> <div class="top-feature"> <h1 class="fes-title">聚焦</h1> <div class="feature-content"> <li class="feature-1"><a href="<?php $this->options->feature1();?>"><div class="feature-title"><span class="foverlay"><?php $this->options->title1();?></span></div><img src="<?php $this->options->n1();?>"></a></li> <li class="feature-2"><a href="<?php $this->options->feature2();?>"><div class="feature-title"><span class="foverlay"><?php $this->options->title2();?></span></div><img src="<?php $this->options->n2();?>"></a></li> <li class="feature-3"><a href="<?php $this->options->feature3();?>"><div class="feature-title"><span class="foverlay"><?php $this->options->title3();?></span></div><img src="<?php $this->options->n3();?>"></a></li> </div> </div>修改位置:functions.php $feature1 = new Typecho_Widget_Helper_Form_Element_Text('feature1', NULL,NULL, _t('聚焦内容1'), _t('请规范填写,需https://,http://或者//')); $form->addInput($feature1); $feature2 = new Typecho_Widget_Helper_Form_Element_Text('feature2', NULL,NULL, _t('聚焦内容2'), _t('请规范填写,需https://,http://或者//')); $form->addInput($feature2); $feature3 = new Typecho_Widget_Helper_Form_Element_Text('feature3', NULL,NULL, _t('聚焦内容3'), _t('请规范填写,需https://,http://或者//')); $form->addInput($feature3);修改为 $feature1 = new Typecho_Widget_Helper_Form_Element_Text('feature1', NULL,NULL, _t('聚焦文章1'), _t('请规范填写,需https://,http://或者//')); $form->addInput($feature1); $n1 = new Typecho_Widget_Helper_Form_Element_Text('n1', NULL,'/usr/themes/Akina/images/feature/feature1.jpg', _t('聚焦图片1'), _t('默认图/usr/themes/Akina/images/feature/feature1.jpg')); $form->addInput($n1); $title1 = new Typecho_Widget_Helper_Form_Element_Text('title1', NULL,'/usr/themes/Akina/images/feature/feature1.jpg', _t('标题1')); $form->addInput($title1); $feature2 = new Typecho_Widget_Helper_Form_Element_Text('feature2', NULL,NULL, _t('聚焦文章2'), _t('请规范填写,需https://,http://或者//')); $form->addInput($feature2); $n2 = new Typecho_Widget_Helper_Form_Element_Text('n2', NULL,'/usr/themes/Akina/images/feature/feature2.jpg', _t('聚焦图片2'), _t('默认图/usr/themes/Akina/images/feature/feature2.jpg')); $form->addInput($n2); $title2 = new Typecho_Widget_Helper_Form_Element_Text('title2', NULL,'/usr/themes/Akina/images/feature/feature1.jpg', _t('标题2')); $form->addInput($title2); $feature3 = new Typecho_Widget_Helper_Form_Element_Text('feature3', NULL,NULL, _t('聚焦文章3'), _t('请规范填写,需https://,http://或者//')); $form->addInput($feature3); $n3 = new Typecho_Widget_Helper_Form_Element_Text('n3', NULL,'/usr/themes/Akina/images/feature/feature3.jpg', _t('聚焦图片3'), _t('默认图/usr/themes/Akina/images/feature/feature3.jpg')); $form->addInput($n3); $title3 = new Typecho_Widget_Helper_Form_Element_Text('title3', NULL,'/usr/themes/Akina/images/feature/feature1.jpg', _t('标题3')); $form->addInput($title3);有些乱,凑合着用聚焦图片自动裁剪配合上面的修改一起用,主题原本是没有自动裁剪图片功能的,没有事先裁剪好,图片会拉伸修改位置:css/style.css将下面代码添加到.top-feature img {}花括号里面,保存就成了object-fit: cover;添加灯箱效果这个是因为在pc端看不见小图片我给加上去的,代码来自Typecho文章图片添加灯箱效果修改位置:header.php </head>标签之前<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <!--如果主题已经引用了jQuery库,可以忽略这条--> <link rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.2/jquery.fancybox.min.css"> <script src="https://cdn.staticfile.org/fancybox/3.5.2/jquery.fancybox.min.js"></script>修改位置:post.php<?php $this->content(); ?> #改为------- <?php $pattern = '/\<img.*?src\=\"(.*?)\"[^>]*>/i'; $replacement = '<a href="$1" data-fancybox="gallery" /><img src="$1" alt="'.$this->title.'" title="点击放大图片"></a>'; $content = preg_replace($pattern, $replacement, $this->content); echo $content; ?>修改位置:footer.php </body>标签之前<script type="text/javascript"> $(document).ready(function () { $( ".fancybox").fancybox(); }); </script>完成刷新下吧。
2020年03月02日
148 阅读
0 评论
0 点赞
2020-03-01
使用Aria2Drive搭建网盘
这个是群友推荐的,使用aria2+oneindex+rclone搭建下载自动上传到onedrive的网盘,原址Aria2Drive:一键搭建自己的网盘安装因为作者适配的是debian所以我使用的是debian系统搭建的,不过作者理论上说支持ubuntu等,只要删除相关代码就行了wget --no-check-certificate -O Aria2Drive.sh https://raw.githubusercontent.com/uselibrary/Aria2Drive/master/Aria2Drive.sh && chmod +x Aria2Drive.sh && bash Aria2Drive.sh复制粘贴运行脚本之后会安装以下软件基础性软件:vim git curl wget unzip维持性软件:nginx php-fpm php-curl功能性软件:aria2 AriaNG Oneindex rclone安装过程中需要填写信息域名邮箱密码是否开启SSl安装完成只会需要你配置rclone来挂载你的onedriveNo remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n #选择N新建新配置name> onedrive #配置名称,后面要用到 #选择网盘类型 Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / A stackable unification remote, which can appear to merge the contents of several remotes \ "union" 2 / Alias for a existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc) \ "s3" 5 / Backblaze B2 \ "b2" 6 / Box \ "box" 7 / Cache a remote \ "cache" 8 / Dropbox \ "dropbox" 9 / Encrypt/Decrypt a remote \ "crypt" 10 / FTP Connection \ "ftp" 11 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 12 / Google Drive \ "drive" 13 / Hubic \ "hubic" 14 / JottaCloud \ "jottacloud" 15 / Local Disk \ "local" 16 / Mega \ "mega" 17 / Microsoft Azure Blob Storage \ "azureblob" 18 / Microsoft OneDrive \ "onedrive" 19 / OpenDrive \ "opendrive" 20 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH) \ "swift" 21 / Pcloud \ "pcloud" 22 / QingCloud Object Storage \ "qingstor" 23 / SSH/SFTP Connection \ "sftp" 24 / Webdav \ "webdav" 25 / Yandex Disk \ "yandex" 26 / http Connection \ "http" Storage> 18 #选择18,Microsoft OneDrive 安装选项不同,这是演示,安装过程请对准序号。配置token在rclone下载电脑版本,打开cmd命令提示行输入以下指令rclone authorize "onedrive"认证获取tokenPaste the following into your remote machine ---> {"access_token":"xxxx"} #请复制{xx}整个内容(包括花括号),后面需要用到 <---End paste填入token** See help for onedrive backend at: https://rclone.org/onedrive/ ** Microsoft App Client Id Leave blank normally. Enter a string value. Press Enter for the default (""). client_id> #留空 Microsoft App Client Secret Leave blank normally. Enter a string value. Press Enter for the default (""). client_secret> #留空 Edit advanced config? (y/n) y) Yes n) No y/n> n Remote config Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes n) No y/n> n #选择n For this to work, you will need rclone available on a machine that has a web browser available. Execute the following on your machine: rclone authorize "onedrive" Then paste the result below: result> {"access_token":""} #输入之前在客户端授权的内容补充填入邮箱认证SSL证书会给你的邮箱发送一封邮件认证,务必填写正确Aria2密码请使用大小写字母以及数字标点符号,防止出错安装完成后需要重启服务器以确保所有服务运行如何安装请查看Github说明下载文件会储存在/home/downloads/文件夹Aria2密码储存在/etc/aria2/aria2.confsystemd会负责aria2的进程守护,systemctl start/stop/enable/disable/restart aria2使用AriaNG地址为你的域名/AriaNG需要配置Aria RPC下载完成之后将会被上传到onedrive中,有时上传后没有删除下载文件,需要自己删除
2020年03月01日
150 阅读
0 评论
0 点赞
2020-02-27
使用客户端更好地管理typecho
刚写完一篇文章没多久我又开始瞎折腾了,这次用客户端发布文章准备打开博客的XmlRpc接口 (设置->基本->XMLRPC 接口)下载xmlrpc替换/var/Widget/XmlRpc.php打开xmlrpc的Markdown语法编辑功能https://example.com/admin/profile.php安装应用下载文件上传解决客户端上传文件失败问题修改位置:/var/Widget/Upload.php#126行 if (!file_put_contents($path, $file['bytes'])) {} #改为 if (!file_put_contents($path, base64_decode($file['bytes']))) {}如果你使用其他上传插件,以下针对插件修改注意:新版本需要base64解密base64_decode($file['bytes'])OssForTypecho 阿里云OSS上传插件修改位置:Plugin.php#152行 $result = $ossClient->uploadFile($options->bucket, substr($path,1), $uploadfile); #改为 if (isset($file['tmp_name'])) { $result = $ossClient->uploadFile($options->bucket, substr($path, 1), $uploadfile); } else { $result = $ossClient->putObject($options->bucket, substr($path, 1), $uploadfile); }#310行 return isset($file['tmp_name']) ? $file['tmp_name'] : (isset($file['bytes']) ? $file['bytes'] : (isset($file['bits']) ? $file['bits'] : '')); #改为 return isset($file['tmp_name']) ? $file['tmp_name'] : (isset($file['bytes']) ? base64_decode($file['bytes']) : (isset($file['bits']) ? $file['bits'] : ''));#169行 'mime' => @Typecho_Common::mimeContentType($path) #改为 'mime' => (isset($file['tmp_name']) ? Typecho_Common::mimeContentType($file['tmp_name']) : $file['mime'])Qiniu File Typecho 的附件上传至七牛云存储中修改位置:Plugin.php#108行 $filename = $file['tmp_name']; if (!isset($filename)) return false; #删除#116到127行 if ($error == null) .... else return false; #替换为 if (isset($file['bytes'])) { list($ret, $error) = $upManager->put($token, $option->savepath . $file['name'], base64_decode($file['bytes'])); if ($error == null) { return array( 'name' => $file['name'], 'path' => $option->savepath . $file['name'] . ($option->imgstyle == '' ? '' : '-' . $option->imgstyle), 'size' => $file['size'], 'type' => $ext, 'mime' => $file['mime']//Typecho_Common::mimeContentType($option->savepath . $file['name']) ); } else { return false; } } else { // 上传文件 $filename = $file['tmp_name']; //if (!isset($filename)) return false; list($ret, $error) = $upManager->putFile($token, $option->savepath . $file['name'], $filename); if ($error == null) { return array( 'name' => $file['name'], 'path' => $option->savepath . $file['name'] . ($option->imgstyle == '' ? '' : '-' . $option->imgstyle), 'size' => $file['size'], 'type' => $ext, 'mime' => Typecho_Common::mimeContentType($filename) ); } else { return false; } }cosUploadV5 针对腾讯云cos v5更新 for Typecho修改位置:Plugin.php#164行 $file['bytes'] #改为 base64_decode($file['bytes'])问题闪退需要使用Android7+版本关闭post和ua过滤截图
2020年02月27日
179 阅读
0 评论
0 点赞
2020-02-27
QQ二次元搜图机器人
CQ-picfinder-robot插件由神代綺凜使用nodejs编写(开源)项目地址:Github该插件需要配合酷Q使用,并且需要启动CoolQ HTTP API插件,并将配置文件use_ws设置为true详情查看官方使用文档这是一个以 Nodejs 编写的酷Q机器人插件,用于搜图、搜番、搜本子,并夹带了许多娱乐向功能安装酷Q支持Docker一键配置,先安装Docker#CentOS 6 rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum update -y yum -y install docker-io service docker start chkconfig docker on #CentOS 7、Debian、Ubuntu curl -sSL https://get.docker.com/ | sh systemctl start docker systemctl enable docker安装酷Q#酷QAir版 docker run --name wine-coolq -d \ -v /coolq:/home/user/coolq \ -p 9000:9000 \ -p 6700:6700 \ -e VNC_PASSWD=123456 \ richardchien/cqhttp #酷QPro版 docker run --name wine-coolq -d \ -v /coolq:/home/user/coolq \ -p 9000:9000 \ -p 6700:6700 \ -e VNC_PASSWD=123456 \ -e COOLQ_URL=https://dlsec.cqp.me/cqp-tuling \ richardchien/cqhttp参数说明-p 将内部的Web运行端口9000映射到外部的9000,可自行修改端口。 -v 将内部酷Q和其数据文件夹/home/user/coolq映射到外部的/coolq文件夹,可自行修改路径。 -e VNC_PASSWD为VNC密码。注意该密码不能超过8个字符,默认123456。删除默认配置,使用特定配置rm -rf /coolq/app/io.github.richardchien.coolqhttpapi/config/general.ini访问VNC地址配置机器人,http://ip:9000输入密码,默认123456第一次登陆QQ会生成配置文件,先进行修改/coolq/app/io.github.richardchien.coolqhttpapi/config目录下的你的qq.json将use_ws后面的false改为true #SSH客户端直接修改 sed -i 's#"use_ws": false#"use_ws": true#g' /coolq/app/io.github.richardchien.coolqhttpapi/config/*.json安装Nodejs#Debian/Ubuntu系统 curl -sL https://deb.nodesource.com/setup_10.x | bash - apt install -y git nodejs #CentOS系统 curl -sL https://rpm.nodesource.com/setup_10.x | bash - yum install nodejs git -y安装CQ-picfinder-robot#拉取项目 git clone https://github.com/Tsuk1ko/CQ-picfinder-robot.git cd CQ-picfinder-robot #复制配置文件 cp config.default.json config.json #安装依赖 npm i #安装pm2 npm install -g pm2config.json配置文件参考如下:#别直接将下面配置文件复制进去,JSON是不允许注释的,仅供参考 { //前面这几项配置请参考https://github.com/momocow/node-cq-websocket/blob/master/docs/api/CQWebSocket.md#cqwebsocketoption "host": "127.0.0.1", "port": 6700, "enableAPI": true, "enableEvent": true, "access_token": "", "reconnection": true, "reconnectionAttempts": 10, "reconnectionDelay": 5000, //以下开始都是搜图机器人配置 "picfinder": { "debug": false, //调试模式,启用后会在控制台输出每次查询的返回文本 "admin": -1, //指定管理者QQ,请务必设置 "autoAddFriend": false, //自动同意好友申请(false则忽略,但不会拒绝) "addFriendAnswers": [], //根据问题回答同意好友申请(后续详解 "autoAddGroup": false, //自动同意入群申请(false同上,但可以用命令手动允许,后续有说明) "searchLimit": 30, //每名用户每日搜索次数限制 //复读机 "repeat": { "enable": true, //开关 "times": 3, //当检测到某个群有这么多次相同发言后会概率参与复读 "probability": 40, //复读概率(百分比) "commonProb": 0.1 //日常复读概率(百分比) }, //setu功能 "setu": { "enable": false, //是否启用 "allowPM": true, //是否允许私聊使用 "pximgProxy": "", //设置发送setu时使用的反向代理,后续详解 "deleteTime": 30, //发送后这么多秒自动撤回(0则不撤回,下同) "cd": 600, //使用冷却时间(秒),每名用户独立,0则无冷却 "limit": 30, //每名用户每日次数限制 "whiteGroup": [], //群组白名单(请按照json数组格式填写) "whiteOnly": false, //仅允许白名单群使用(与上面的私聊使用是独立的) "whiteCd": 0, //白名单群组的使用冷却时间 "whiteDeleteTime": 0 //白名单群组的撤回时间 }, //指令正则表达式 "regs": { //开启搜图模式 "searchModeOn": "竹竹搜[图圖]", //关闭搜图模式 "searchModeOff": "[谢謝]+竹竹", //签到 "sign": "我(.*)签到", //setu "setu": "(竹竹.*[来來发發给給].*[色瑟][图圖])|(--setu)" }, //回复 "replys": { //默认回复 "default": "必须要发送图片我才能帮你找噢_(:3」」\n支持批量!", //调试模式时 "debug": "维护升级中,暂时不能使用,抱歉啦~", //个人搜索次数到达上限时 "personLimit": "您今天搜的图太多辣!休息一下明天再来搜吧~", //搜索失败时 "failed": "搜索失败惹 QAQ\n有可能是服务器网络爆炸,请重试一次", //签到相关 "sign": "签到成功,送您10个赞!", "signed": "您今天已经签到过啦_(:3」∠)_", //开启搜图模式 "searchModeOn": "了解~请发送图片吧!支持批量噢!\n如想退出搜索模式请发送“谢谢竹竹”", //已经开启搜图模式 "searchModeAlreadyOn": "您已经在搜图模式下啦!\n如想退出搜索模式请发送“谢谢竹竹”", //关闭搜图模式 "searchModeOff": "不用谢~", //已经关闭搜图模式 "searchModeAlreadyOff": "にゃ~", //setu冷却中 "setuLimit": "乖,要懂得节制噢 →_→", //setu请求错误 "setuError": "瑟图服务器爆炸惹_(:3」∠)_", //其他不满足发送setu的条件 "setuReject": "很抱歉,该功能暂不开放_(:3」」" }, //OCR(详细见“附加功能”) "ocr": { "use": "ocr.space", //选择使用的OCR服务 "ocr.space": { "defaultLANG": "eng", "apikey": "" }, "baidubce": { "useApi": "accurate_basic", "apiKey": "", "secretKey": "" } }, //明日方舟公开招募计算器(详细见“附加功能”) "akhr": { "enable": false, //true则启用 "ocr": "ocr.space" //选择使用的OCR服务 } }, //数据库配置(用于缓存搜图结果) "mysql": { "enable": false, //是否开启缓存功能 "expire": 172800, //缓存时间(秒),默认为两天(172800秒) "host": "127.0.0.1", //数据库地址 "port": 3306, //端口 "db": "", //数据库名 "user": "", //用户名 "password": "", //密码 "expire": 172800 //缓存时间 }, //Saucenao地址,一般请不要动,除非你猜到了我提供此设置的意义( "saucenaoHost": [ "saucenao.com" ], //WhatAnime的域名,同上 "whatanimeHost": [ "trace.moe" ] }配置完成之后cd到插件目录使用指令启动#启动 npm run pm2start #停止 npm run pm2stop #重启 npm run pm2restart #查看日志 npm run pm2log使用日常使用#私聊 1、直接发送图片即可 2、详见下方搜图模式说明 #群组&讨论组 1、@机器人并发送图片 2、详见下方搜图模式说明(群限定) 3、特别地,在群组中可以发送符合配置中正则表达式的发言以进入搜图模式,在搜图模式中,发送的所有图片即使不@也会被搜图,此功能通常用于在手机上无法在转发图片时@的情况;另外,进入搜图模式后也请务必记得退出搜图模式! #可以在同一条消息中包含多张图片(针对PC),会自动批量搜索 #搜索图片时可以在消息内包含以下参数来指定搜索范围或者使用某项功能,参数之间互斥,优先级从上到下 1、--get-url:获取图片的在线链接(不会搜图) 2、--a2d:使用 ascii2d 进行搜索(优势在于可搜索局部图) 3、--pixiv:从P站中搜索 4、--danbooru:从Danbooru中搜索 5、--book:搜索本子 6、--anime:搜索番剧 #如果saucenao得到的结果相似度低于60%,会自动使用ascii2d进行搜索 #如果搜索到本子,会自动在 nhentai 中搜索并返回链接(如果有汉化本会优先返回汉化本链接) #如果搜到番剧,会自动使用WhatAnime搜索番剧详细信息 1、AnimeDB与WhatAnime的结果可能会不一致,是正常现象,毕竟这是两个不同的搜索引擎 2、同时展示这两个搜索的目的是为了尽力得到你可能想要的识别结果 2、搜图模式搜图模式#搜图模式存在的意义是方便手机用户在转发图片等不方便在消息中夹带@或搜图参数的情况下指定搜索库 #在私聊时直接发送图库关键字 此时你发出来的下一张图(只有下一张,也就是一次性的)会使用指定搜索库 #在群组中发送符合配置中正则表达式的发言进入搜图模式 1、此时你发出的所有图片都会被搜图(默认使用全范围搜索) 2、发送图库关键字后,你后续发出的所有图片都会使用你指定的搜索库 3、每次使用完后请务必记得退出搜图模式啊,同理,也是发送符合配置中正则表达式的发言 #图库关键字: 1、all:默认的全范围搜索模式 2、以下与上方“日常使用”中描述的搜索参数功能相同 pixiv danbooru book anime处理好友申请#如果在QQ中设置选择“允许任何人”,则直接通过,酷Q无法干预 #如果选择“需要验证信息”,则是否通过由autoAddFriend设置项决定 #如果选择“需要正确回答问题”,则是否通过由对方的回答决定,酷Q无法干预 #如果选择“需要回答问题并由我确认”,则在autoAddFriend为true,且addFriendAnswers数组不为空的情况下会进行判断,只有对方的回答与addFriendAnswers的设置完全一致才会同意autoAddFriend为false时不会主动拒绝申请,只是忽略申请而已,autoAddGroup同理。addFriendAnswers配置规则:#请将问题的答案顺次作为addFriendAnswers数组的元素写入,例: "addFriendAnswers": [ "问题一的答案", "问题二的答案" ]手动加群当你设定了picfinder.admin为你自己的QQ后,假如123456789是你需要让机器人加的群,向机器人私聊发送--add-group=123456789,此时:#如果该群之前已经在机器人处于运行状态的时候邀请过机器人,那么该邀请会被直接同意 #如果之前没有邀请过,那么下一次邀请将会被同意 #以上两种操作都是一次性的封禁用户/群组发送--ban-u=Q号或--ban-g=群号,该封禁功能并不是真的拉入黑名单,仅仅是忽略用户/群的发言,如果想解封请自行编辑data/ban.json删除对应Q号/群号。更多配置查看github说明#为什么有时候搜不想要的出结果? 需要说明的是,搜图引擎发现新图片并收录也是需要时间的,因此画师刚上传的画作一般情况下是没办法搜到的 另外,搜图时发送的图片必须是刚好完整的图片,使用以下几种情况的图片会导致大概率搜不到结果: 1、使用的是原图的局部图,即因剪裁而不完整,此时可以尝试使用ascii2d的特征搜索功能 2、图片被 马赛克/图片马赛克等 遮挡的部分面积过大 3、截图没截好,留有黑边,例如为了省事直接使用手机截屏或者电脑手动框选截图,这种情况请在搜图前4自行编辑裁去与图片无关的部分 4、清晰度过低的图片每次重启Docker都会生成general.ini,其文件会使特定文件失效,需要将文件删除,也可以在安装Docker镜像的时候加入变量-e COOLQ_ACCOUNT=123456来解决这个问题docker restart wine-coolq rm -rf /coolq/app/io.github.richardchien.coolqhttpapi/config/general.iniDocker启动指令docker start wine-coolq
2020年02月27日
352 阅读
0 评论
0 点赞
2020-02-27
Ubuntu初体验&安装
最近突发奇想想装个Linux系统用,第一次用Linux系统我选择Ubuntu发行版,主要是第一次装,没什么经验,安装系统过程磕磕碰碰,这里做个总结,避免忘记准备一个8G或以上的U盘Ubuntu镜像Balena Etcher镜像烧录工具一台电脑或者虚拟机虚拟机不需要U盘制作打开Balena Etcher,点击Select image选择镜像,插入U盘点击Flash等待制作完成安装主机关机重启进入Bios设置U盘启动,具体操作百度主板型号启动之后选择Install Ubuntu按照自己所需选择语言拔掉网线选择最小安装能安装更快全新安装密码是必要的等待安装完成分区是非必须的,全部分配给/根目录就行
2020年02月27日
182 阅读
1 评论
0 点赞