mycpen-blog 0.0.0-eyaxxvchhu → 0.0.0-fiaycbbull
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index.css +1 -1
- package/friend.json +1 -1
- package/js/custom.js +1 -1
- package/js/fcircle.js +1 -1
- package/js/people.js +1 -1
- package/js/random.js +1 -1
- package/link.json +1 -1
- package/package.json +1 -1
- package/search.xml +1 -1
- package/sitemap.xml +105 -105
package/package.json
CHANGED
package/search.xml
CHANGED
@@ -238,7 +238,7 @@
|
|
238
238
|
<link href="/posts/cee83196.html"/>
|
239
239
|
<url>/posts/cee83196.html</url>
|
240
240
|
|
241
|
-
<content type="html"><![CDATA[<h2 id="前言">前言<a class="header-anchor" href="#前言"></a></h2><p>记录一些小知识点、工具、文章收藏</p><h2 id="01-链接收藏">01. 链接收藏<a class="header-anchor" href="#01-链接收藏"></a></h2><table><thead><tr><th colspan="3">地址</th></tr></thead><tbody><tr><td><a href="https://tools.liumingye.cn/music/#/">MyFreeMP3</a></td><td><a href="https://www.cnblogs.com/hider/p/11614688.html">Typora入门</a></td><td><a href="https://zhuanlan.zhihu.com/p/193101244">Typora页面美化</a></td></tr><tr><td><a href="https://apps.microsoft.com/store/apps">Microsoft Store</a></td><td><a href="https://github.com/sparanoid/chinese-copywriting-guidelines/blob/master/README.zh-Hans.md">中文文案排版指北</a></td><td><a href="https://blog.csdn.net/m0_37624402/article/details/108960118">Git常见用法总结</a></td></tr><tr><td><a href="https://www.processon.com/">ProcessOn</a></td><td><a href="https://www.nowcoder.com/discuss/353154816606150656">牛客网-面经-运开资料</a></td><td><a href="https://www.cnblogs.com/blogkui/p/12900655.html">JavaScript日期格式化,不足两位数补0</a></td></tr><tr><td><a href="https://molunerfinn.com/my-2019-interview-of-summer-internship/">Molunerfinn 大佬面经</a></td><td><a href="https://akilar.top/posts/f752c86d/#%E9%85%8D%E7%BD%AEGithub-Action">Akilar:Github Action自动部署</a></td><td><a href="https://auto.oldwu.top/">AutoPlan.哔哩升级</a></td></tr><tr><td><a href="https://www.cnblogs.com/xxhxs-21/p/17151813.html">Jetbrains 激活方法</a></td><td><a href="https://mp.weixin.qq.com/cgi-bin/settingpage?t=setting/index&action=index&token=168808346&lang=zh_CN">公众号二维码.下载</a></td><td><a href="https://github.com/RayWangQvQ/BiliBiliToolPro">GitHub: BiliBiliToolPro</a></td></tr><tr><td><a href="https://jingyan.baidu.com/article/25648fc14b3276d091fd00c3.html">Snipaste JPG 截图格式</a></td><td><a href="https://www.yilantingfeng.site/%e5%ad%a6%e4%b8%9a%e7%9b%b8%e5%85%b3/1503/">倚栏听风.2023计算机保研经历总结</a></td><td><a href="https://blog.zwying.com/archives/93.html">Veen Zhao.南师大.考研</a></td></tr><tr><td><a href="https://github.com/dxhuii/delWeibo">批量删除微博博文</a></td><td><a href="https://xedu.me/">chatgpt账号-key购买</a></td><td><a href="https://blog.zwying.com/archives/121.html">Veen Zhao.南师大.复试</a></td></tr><tr><td colspan="3"></td></tr></tbody></table><p>其他:</p><ol><li class="lvl-3"><p><a href="https://blog.cpen.top/posts/583c5c34.html">03_Other-PC端环境记录</a></p></li></ol><p>非技术:</p><table><thead><tr><th colspan="3">地址</th></tr></thead><tbody><tr><td><a href="http://coolshell.cn/articles/20276.html">酷壳:别让自己“墙”了自己</a></td><td rowspan="2" colspan="2"></td></tr><tr><td></td></tr></tbody></table><p>云服务器:</p><ul class="lvl-0"><li class="lvl-2"><p>阿里云 ECS 99/年,活动期内(活动时间: <mark>2023年10月31日0点0分0秒至2026年3月31日23点59分59秒</mark>。)续费同价,新老用户同享:<a href="https://www.aliyun.com/lowcode/promotion/allinaliyun/99program">https://www.aliyun.com/lowcode/promotion/allinaliyun/99program</a></p></li><li class="lvl-2"><p>阿里云在校学生300无门券/合作高校3折券领取:<a href="https://university.aliyun.com/">https://university.aliyun.com/</a></p></li></ul><h2 id="02-sshpass-非交互登录">02. sshpass 非交互登录<a class="header-anchor" href="#02-sshpass-非交互登录"></a></h2><p>ssh 不能在命令行中指定密码</p><p>sshpass:</p><ol><li class="lvl-3"><p>用于非交互的 ssh 密码验证,允许用 -p 参数指定明文密码</p></li><li class="lvl-3"><p>支持密码从命令行,文件,环境变量中读取</p></li></ol><blockquote><p>Ubuntu 报错 <code>E: Unable to locate package sshpass</code></p><p><code>apt-get update</code> ; sudo apt-get install sshpass</p><p>参考文章:<a href="https://www.cnblogs.com/itsfei/p/15014277.html">ssh快捷登录 sshpass+alias</a></p></blockquote><p>登录脚本(第一次需 SSH 登录)</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cat</span> ali.sh</span><br><span class="line"><span class="comment">#!/bin/bash</span></span><br><span class="line"></span><br><span class="line">sshpass -p 密码 ssh -o ServerAliveinterval=60 root@IP</span><br><span class="line"><span class="comment"># sshpass -p 密码 ssh root@IP</span></span><br><span class="line"></span><br><span class="line">$ <span class="built_in">chmod</span> +x ali.sh</span><br><span class="line"></span><br></pre></td></tr></table></figure><ul class="lvl-0"><li class="lvl-2"><p>-o option => Can be used to give options in the format used in the configuration file.</p></li><li class="lvl-2"><p><code>ServerAliveinterval=60</code> client每隔60秒发送一次请求给server,然后server响应,从而保持连接(防止连接空闲超时)</p></li></ul><p>定义别名 alias</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cat</span> ~/.bashrc</span><br><span class="line"><span class="comment"># User specific aliases and functions</span></span><br><span class="line"><span class="built_in">alias</span> ali=<span class="string">'bash /home/peng/sh_file/ali.sh'</span></span><br></pre></td></tr></table></figure><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://blog.csdn.net/u013288190/article/details/116921994">Shell 脚本 ssh免密码 登录 远程服务器 sshpass用法示例</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/liao392781/article/details/79220395">Shell脚本免密码登录远程服务器(方法一)</a></p></li><li class="lvl-3"><p><a href="https://www.cnblogs.com/itsfei/p/15014277.html">ssh快捷登录 sshpass+alias</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/weixin_48693408/article/details/125961472">Linux – 将自己的shell脚本设置成命令</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/qq_44895681/article/details/124841145">配置SSH服务远程连接空闲超时退出时间(包括SSH无法登录、登录缓慢)</a></p></li></ol><h2 id="03-Xftp-显示隐藏文件">03. Xftp 显示隐藏文件<a class="header-anchor" href="#03-Xftp-显示隐藏文件"></a></h2><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304042240000.png" alt="image-20230404224047926" style="zoom: 33%;" /><p>参考文章:<a href="http://www.nndssk.com/xtjc/287647HVA4sC.html">Xftp显示隐藏文件的方法</a></p><h2 id="04-Github-多账户-SSH-配置">04. Github 多账户 SSH 配置<a class="header-anchor" href="#04-Github-多账户-SSH-配置"></a></h2><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -f ~/.ssh/id_rsa_gh -C user_gh@gmail.com</span><br></pre></td></tr></table></figure><ul class="lvl-1"><li class="lvl-2">-b:指定 key 的 bit 数,对于 RSA key 而言,默认是 3072 bits</li><li class="lvl-2">-f:指定 key 的文件名,若需要指定路径,则文件名需要和路径一直,如 ~/.ssh/id_rsa_gh</li><li class="lvl-2">-C:指定新的 comment,即公钥末尾的字符串,一般是邮箱地址,若不指定会是 “username@hostname” 的形式</li><li class="lvl-2">-t:指定私钥类型,一般有 “dsa”, “ecdsa”, “ecdsa-sk”, “ed25519”, “ed25519-sk” 和 “rsa” 等几种,若指定为 rsa 还可以指定签名类型,默认为 “rsa-sha2-512”</li></ul></blockquote><blockquote><p>Github 不同账户,类似配置</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cat</span> ~/.ssh/config</span><br><span class="line">Host github.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> PreferredAuthentications publickey</span><br><span class="line"> IdentityFile ~/.ssh/user1_rsa</span><br><span class="line"> User user1</span><br><span class="line">Host github.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> PreferredAuthentications publickey</span><br><span class="line"> IdentityFile ~/.ssh/user2_rsa</span><br><span class="line"> User user2</span><br><span class="line">------</span><br><span class="line">Host user_gh.github.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> User user_gh</span><br><span class="line"> IdentityFile ~/.ssh/id_rsa_gh</span><br><span class="line">Host github-qileq.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> User qileq</span><br><span class="line"> IdentityFile ~/.ssh/id_rsa_qileq</span><br><span class="line">Host gitlab.com</span><br><span class="line"> HostName gitlab.com</span><br><span class="line"> User user_gl</span><br><span class="line"> IdentityFile ~/.ssh/id_rsa_gl</span><br><span class="line"></span><br></pre></td></tr></table></figure><ul class="lvl-1"><li class="lvl-2"><p>Host 类型昵称,可以简化登录的输入地址,比如<code>Host ccl</code>,则可以用<code>ssh ccl</code>直接连接</p></li><li class="lvl-2"><p>HostName 表示连接的远程主机地址</p></li><li class="lvl-2"><p>IdentityFile 表示指定私钥文件路径</p></li><li class="lvl-2"><p>Port 指定端口</p></li><li class="lvl-2"><p>User 指定用户名</p></li></ul><p>修改仓库的 git 信息,将仓库配置 url 的 <a href="https://link.zhihu.com/?target=http%3A//github.com">http://github.com</a> 替换为 ssh config 中设置的 Host 值。</p><p>笔者以 <a href="https://link.zhihu.com/?target=https%3A//github.com/qileq/java-roam-guide">java-roam-guide</a> 为例,使用如下两种方式来修改仓库地址:</p><ol><li class="lvl-3"><p>执行命令 git remote set-url origin <a href="mailto:git@github-qileq.com">git@github-qileq.com</a>:qileq/java-roam-guid.git</p></li><li class="lvl-3"><p>将该仓库 .git/config 中的 url = <a href="mailto:git@github.com">git@github.com</a>:qileq/java-roam-guide.git 修改为 url = <a href="mailto:git@github-qileq.com">git@github-qileq.com</a>:qileq/java-roam-guide.git</p></li></ol><p>修改完成后,执行 git remote -v 查看仓库地址是否正确。</p></blockquote><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 当使用<user1.github.com>替换<github.com>进行访问时,ssh会自动识别为user1</span></span><br><span class="line"><span class="comment"># 配置用户1</span></span><br><span class="line">Host user1.github.com<span class="comment"># 别名,可以随便写一个url。</span></span><br><span class="line">Hostname github.com<span class="comment"># 网站真实的域名,如果是GitHub就不用改了</span></span><br><span class="line">PreferredAuthentications publickey</span><br><span class="line">IdentityFile ~/.ssh/id_rsa_user1<span class="comment"># 指向user1的私钥路径,似乎只能在~/.ssh下,不要随便放</span></span><br><span class="line">User user1<span class="comment"># 填写user1的Github用户名,不过似乎最后获取的还是真实的Github用户名</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 配置用户2</span></span><br><span class="line">Host user1.github.com</span><br><span class="line">Hostname github.com</span><br><span class="line">PreferredAuthentications publickey</span><br><span class="line">IdentityFile ~/.ssh/id_rsa_user2<span class="comment"># 指向user2的私钥路径,似乎只能在~/.ssh下,不要随便放</span></span><br><span class="line">User user2<span class="comment"># 填写user2的GitHub用户名,不过似乎最后获取的还是真实的Github用户名</span></span><br><span class="line"></span><br></pre></td></tr></table></figure><p>如果是直接使用 <code>git@github.com</code>,那么ssh将自动识别为config列表的第一个用户,可以认为是单用户模式</p><p>由于是多用户,所以在第一次clone一个GitHub地址的时候,需要简单的修改一下对应的域名,此时SSH将可以识别使用哪个用户进行操作,并建立配置记录</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 原始要clone的仓库命令</span></span><br><span class="line">git <span class="built_in">clone</span> git@github.com:oneflyingfish/WebServer_C.git</span><br><span class="line"></span><br><span class="line"><span class="comment"># 对应修改一下<github.com>,user1修改为上面配置的<user1.github.com>即可</span></span><br><span class="line">git <span class="built_in">clone</span> git@user1.github.com:oneflyingfish/WebServer_C.git</span><br><span class="line"></span><br></pre></td></tr></table></figure><p>多用户共用情况下,如果提示设置用户名,一定要设置为<code>局部信息</code>,而不是<code>global</code>。命令应修改为</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># git默认提示的命令</span></span><br><span class="line">git config --global user.name <span class="string">"your_name"</span></span><br><span class="line">git config --global user.email <span class="string">"your_eamil"</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 我们应该使用的命令</span></span><br><span class="line">git config user.name <span class="string">"your_name"</span></span><br><span class="line">git config user.email <span class="string">"your_eamil"</span></span><br><span class="line"></span><br></pre></td></tr></table></figure></blockquote><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://zhuanlan.zhihu.com/p/521768041">* SSH 多账号的配置</a></p></li><li class="lvl-3"><p><a href="https://cloud.tencent.com/developer/article/2121948">ssh config多账户/多域名配置</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/senlin1202/article/details/122081089">SSH Config 使用</a></p></li><li class="lvl-3"><p><a href="https://blog.anheyu.com/posts/443e.html">Mac上配置多个SSH</a></p></li><li class="lvl-3"><p><a href="https://oneflyingfish.gitee.io/articles/20c7aea41283/">* 配置SSH keys连接GitHub(支持多用户)</a></p></li><li class="lvl-3"><p><a href="https://happyleecode.gitee.io/2023/04/05/SSH/">解决 Git 同时部署到 GitHub 和 Gitee 时,密钥 SSH 冲突问题</a></p></li></ol><h2 id="05-APICloud-打包网页">05. APICloud 打包网页<a class="header-anchor" href="#05-APICloud-打包网页"></a></h2><p><mark>未成功</mark></p><p><a href="https://www.apicloud.com/portal-web/console">APICloud</a> => Web App 创建</p><p>图标<a href="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700919.png">https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700919.png</a></p><p>启动页<a href="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700867.png">https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700867.png</a></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061613612.png" alt="image-20230406161352487" style="zoom:33%;" /><p>安装后的 APP 因无法开启存储空间权限,未能成功(个人原因,<a href="https://www.fomal.cc/">Fomalhaut🥝</a> 的 <a href="https://lskypro.acozycotage.net/Fomalhaut/Fomalhaut.apk">APP</a> 能设置)</p><p>参考教程:<a href="https://naokuoteng.cn/posts/2afd210.html">将网站 / 博客打包成桌面 APP</a>、<a href="https://www.fomal.cc/comments/#9392fccc60784238be439c910336af0b">Fomalhaut🥝.留言</a></p><h2 id="06-Hexo-渲染脚注">06. Hexo 渲染脚注<a class="header-anchor" href="#06-Hexo-渲染脚注"></a></h2><p>下文采用 hexo-renderer-markdown-it 渲染器(渲染脚注效果一般,不打算用脚注了)</p><blockquote><p>尽管标准 Markdown 不支持脚注,但很多 Markdown 变种都支持。一般来说,大多数 Markdown 方言和编辑器支持行内脚注和引用式脚注这两种方式,而后者使用更为普遍(原文:<a href="https://sspai.com/post/77513">在 Markdown 中使用引用式链接和脚注</a>)</p></blockquote><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm uninstall --save hexo-renderer-marked</span><br><span class="line">npm install --save hexo-renderer-markdown-it</span><br></pre></td></tr></table></figure><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">markdown:</span></span><br><span class="line"> <span class="attr">plugins:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">markdown-it-footnote</span></span><br></pre></td></tr></table></figure><p>原文:<a href="https://blog.imql.life/2020/01/24/My_HexoBlog_with_NexT(2)/#%E6%9B%B4%E6%8D%A2%E9%BB%98%E8%AE%A4%E7%9A%84-Markdown-%E6%B8%B2%E6%9F%93%E5%99%A8-1">我的博客的诞生(二)</a></p></blockquote><blockquote><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">Here is a footnote reference,[^1] and another.[^longnote]</span><br><span class="line"></span><br><span class="line">[<span class="symbol">^1</span>]: <span class="link">Here is the footnote.</span></span><br><span class="line"></span><br><span class="line">[<span class="symbol">^longnote</span>]: <span class="link">Here's one with multiple blocks.</span></span><br><span class="line"></span><br><span class="line"><span class="code"> Subsequent paragraphs are indented to show that they</span></span><br><span class="line"><span class="code">belong to the previous footnote.</span></span><br></pre></td></tr></table></figure><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Here is an inline note.^[Inlines notes are easier to write, since</span><br><span class="line">you don't have to pick an identifier and move down to type the</span><br><span class="line">note.]</span><br></pre></td></tr></table></figure><p>来源:<a href="https://github.com/markdown-it/markdown-it-footnote">markdown-it/markdown-it-footnote</a></p></blockquote><p>个人配置:</p><figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br></pre></td><td class="code"><pre><span class="line"># https://butterfly.js.org/posts/ceeb73f/#Math-%E6%95%B8%E5%AD%B8</span><br><span class="line"># https://www.nickxu.top/2022/04/17/Hexo-Butterfly-建站指南(八)使用-KaTeX-数学公式/</span><br><span class="line"># https://github.com/hexojs/hexo-renderer-markdown-it</span><br><span class="line"># https://ezgx.tk/posts/65320/</span><br><span class="line">markdown:</span><br><span class="line"> preset: 'default'</span><br><span class="line"> render:</span><br><span class="line"> html: true</span><br><span class="line"> xhtmlOut: false</span><br><span class="line"> langPrefix: 'language-'</span><br><span class="line"> breaks: true</span><br><span class="line"> linkify: true</span><br><span class="line"> typographer: true</span><br><span class="line"> quotes: '“”‘’'</span><br><span class="line"> enable_rules:</span><br><span class="line"> disable_rules:</span><br><span class="line"> plugins:</span><br><span class="line"> - markdown-it-abbr</span><br><span class="line"> # installed external plugins also can be enabled</span><br><span class="line"> - markdown-it-table-of-contents</span><br><span class="line"> - markdown-it-attrs</span><br><span class="line"> # - markdown-it-cjk-breaks</span><br><span class="line"> - markdown-it-container</span><br><span class="line"> - markdown-it-deflist</span><br><span class="line"> - markdown-it-emoji</span><br><span class="line"><span class="addition">+ - markdown-it-footnote</span></span><br><span class="line"> - markdown-it-ins</span><br><span class="line"> - markdown-it-mark</span><br><span class="line"> - markdown-it-sub</span><br><span class="line"> - markdown-it-sup</span><br><span class="line"> - markdown-it-checkbox</span><br><span class="line"> - markdown-it-imsize</span><br><span class="line"> - markdown-it-expandable</span><br><span class="line"> - markdown-it-merge-cells</span><br><span class="line"> - '@renbaoshuo/markdown-it-katex'</span><br><span class="line"> # - @iktakahiro/markdown-it-katex</span><br><span class="line"> # - name: '@neilsustc/markdown-it-katex'</span><br><span class="line"> # enable: true</span><br><span class="line"> # options:</span><br><span class="line"> # strict: false</span><br><span class="line"> # - markdown-it-toc-and-anchor</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: success</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: tips</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: warning</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: danger</span><br><span class="line"> anchors:</span><br><span class="line"> level: 1</span><br><span class="line"> collisionSuffix: ''</span><br><span class="line"> permalink: false</span><br><span class="line"> permalinkClass: 'header-anchor'</span><br><span class="line"> permalinkSide: 'left'</span><br><span class="line"> permalinkSymbol: '¶'</span><br><span class="line"> case: 0</span><br><span class="line"> separator: '-'</span><br><span class="line"> images:</span><br><span class="line"> lazyload: false</span><br><span class="line"> prepend_root: false</span><br><span class="line"> post_asset: false</span><br></pre></td></tr></table></figure><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://sspai.com/post/77513">在 Markdown 中使用引用式链接和脚注</a></p></li><li class="lvl-3"><p><a href="https://markdown.com.cn/extended-syntax/footnotes.html">Markdown 脚注</a></p></li><li class="lvl-3"><p><a href="https://blog.meta-code.top/2023/03/21/2023-53/">百里飞洋 Barry-Flynn(得知脚注)</a></p></li><li class="lvl-3"><p><a href="https://github.com/hexojs/hexo-renderer-markdown-it">hexojs/hexo-renderer-markdown-it</a></p></li><li class="lvl-3"><p><a href="https://github.com/markdown-it/markdown-it-footnote">* markdown-it/markdown-it-footnote</a></p></li><li class="lvl-3"><p><a href="https://blog.imql.life/2020/01/24/My_HexoBlog_with_NexT(2)/#%E6%9B%B4%E6%8D%A2%E9%BB%98%E8%AE%A4%E7%9A%84-Markdown-%E6%B8%B2%E6%9F%93%E5%99%A8-1">* 我的博客的诞生(二)</a></p></li></ol><h2 id="07-Base64-加密邮箱-解密">07. Base64 加密邮箱 解密<a class="header-anchor" href="#07-Base64-加密邮箱-解密"></a></h2><p>加密的邮箱地址,使用 base64 加密。在线加密:<a href="https://encode.chahuo.com/">https://encode.chahuo.com/</a></p><p>解密 <code>javascript:decryptEmail(...)</code>,代码示例:<a href="https://www.mycpen.cn/">https://www.mycpen.cn/</a></p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">a</span> <span class="attr">href</span>=<span class="string">"javascript:decryptEmail('bXljcGVuQHFxLmNvbQ==');"</span> <span class="attr">title</span>=<span class="string">"email"</span>></span><span class="tag"></<span class="name">a</span>></span></span><br></pre></td></tr></table></figure><h2 id="08-Word-转-MD(Pandoc)">08. Word 转 MD(Pandoc)<a class="header-anchor" href="#08-Word-转-MD(Pandoc)"></a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pandoc -xxx.docx -o xxx.md</span><br></pre></td></tr></table></figure><blockquote><p>一、下载pandoc<br>建议使用msi直接安装,而不是下载安装包直接使用,msi的下载方法:安装方法。</p><p>二、pandoc转换<br>1、cmd进入文件夹<br>打开cmd。<br>转换到文件所在的路径中。d:进入D盘的路径下,CD D:\Program Files\OneDrive\桌面\temp</p><p>2、代码实现</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pandoc -xxx.docx -o xxx.md <span class="comment"># docx 文件转换为 md 文件</span></span><br></pre></td></tr></table></figure><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304162143719.png" alt="image-20230416214320662" style="zoom: 33%;" /></blockquote><p>参考文章:<a href="http://www.taodudu.cc/news/show-3860696.html">word文件转md文件</a></p><h2 id="09-GitHub-删除历史记录">09. GitHub 删除历史记录<a class="header-anchor" href="#09-GitHub-删除历史记录"></a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git reset <上一步复制到的字符串></span><br><span class="line">git push -f</span><br></pre></td></tr></table></figure><p>参考文章:<a href="https://blog.csdn.net/sunzequan888/article/details/125738176">GITHUB删除历史记录</a></p><h2 id="10-ChatGPT-API-Key-个人站">10. ChatGPT API Key 个人站<a class="header-anchor" href="#10-ChatGPT-API-Key-个人站"></a></h2><p>项目地址:</p><ol><li class="lvl-3"><p><a href="https://github.com/Chanzhaoyu/chatgpt-web">https://github.com/Chanzhaoyu/chatgpt-web</a></p></li><li class="lvl-3"><p><a href="https://github.com/Yidadaa/ChatGPT-Next-Web">https://github.com/Yidadaa/ChatGPT-Next-Web</a></p></li></ol><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://www.fomal.cc/posts/74ac8dc8.html">无服务器部署自己的chatGPT</a></p></li></ol><h2 id="11-字符画-consolo-log">11. 字符画 consolo.log()<a class="header-anchor" href="#11-字符画-consolo-log"></a></h2><p><strong>推荐</strong>:<a href="http://patorjk.com/software/taag">http://patorjk.com/software/taag</a></p><p>文字生成字符画:<br><a href="http://patorjk.com/software/taag">http://patorjk.com/software/taag</a><br><a href="http://www.network-science.de/ascii/">http://www.network-science.de/ascii/</a></p><p>图片生成字符画:<br><a href="http://www.degraeve.com/img2txt.php">http://www.degraeve.com/img2txt.php</a><br><a href="http://life.chacuo.net/convertphoto2char">http://life.chacuo.net/convertphoto2char</a></p><p>流程图生成字符画:<br><a href="http://asciiflow.com/">http://asciiflow.com/</a></p><p>VSCode 插件:<br><a href="https://github.com/OBKoro1/koro1FileHeader">https://github.com/OBKoro1/koro1FileHeader</a></p><p>参考:<a href="https://blog.saop.cc/p/c9df/">https://blog.saop.cc/p/c9df/</a></p><h2 id="12-ERR-HTTP2-PROTOCOL-ERROR-关闭-HSTS">12. ERR_HTTP2_PROTOCOL_ERROR 关闭 HSTS<a class="header-anchor" href="#12-ERR-HTTP2-PROTOCOL-ERROR-关闭-HSTS"></a></h2><p>访问网站,偶然性报错:ERR_HTTP2_PROTOCOL_ERROR。试着关闭 HSTS</p><p>CDN HTTPS 配置 关闭 <code>HSTS</code>,<a href="https://console.dogecloud.com/cdn/domain/https?domainId=6667">多吉云个人链接</a></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304191935126.png" alt="image-20230419193555012" style="zoom: 33%;" /><p>以下内容来自 ChatGPT:</p><blockquote><p>问:<code>ERR_HTTP2_PROTOCOL_ERROR 和 HSTS 有什么联系</code></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304191946818.png" alt="image-20230419194615758" style="zoom: 50%;" /><p>问:<code>HSTS 会导致 ERR_HTTP2_PROTOCOL_ERROR 报错吗</code></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304191946462.png" alt="image-20230419194650417" style="zoom: 50%;" /></blockquote><h2 id="13-Clash-Parsers">13. Clash Parsers<a class="header-anchor" href="#13-Clash-Parsers"></a></h2><p>设置 => 配置 => 配置文件预处理</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">parsers:</span> <span class="comment"># array</span></span><br><span class="line"> <span class="bullet">-</span> <span class="attr">url:</span> <span class="string">https://xxx.xxx/xxx</span></span><br><span class="line"> <span class="attr">yaml:</span></span><br><span class="line"> <span class="attr">prepend-rules:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">DOMAIN-SUFFIX,xxx.com,香港Az-优化3</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">DOMAIN-SUFFIX,xxx.com,GLOBAL</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">DOMAIN-SUFFIX,xxx.com,DIRECT</span></span><br><span class="line"></span><br></pre></td></tr></table></figure><p>参考链接:</p><ol><li class="lvl-3"><p><a href="https://docs.cfw.lbyczf.com/contents/parser.html">* Clash for Windows:配置文件预处理</a></p></li><li class="lvl-3"><p><a href="https://zhuanlan.zhihu.com/p/600564111">* Clash利用parsers进行规则预处理</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/u013559309/article/details/129437063">* Clash使用Parser添加自定义规则并防止更新覆盖</a></p></li><li class="lvl-3"><p><a href="https://www.wangpc.cc/software/clash-for-windows-paarsers-rules/">clash for windows自定义规则(不会被更新覆盖)</a></p></li><li class="lvl-3"><p><a href="https://www.zhihu.com/question/507810862">clash for windows如何设置指定IP或者网站才走xx?</a></p></li></ol><h2 id="14-Replit-部署-Typecho-TimePlus">14. Replit 部署 Typecho.TimePlus<a class="header-anchor" href="#14-Replit-部署-Typecho-TimePlus"></a></h2><blockquote><p>步骤:<a href="https://github.com/zhheo/TimePlus/wiki/">https://github.com/zhheo/TimePlus/wiki/</a></p><p>Demo:<a href="https://plog.zhheo.com/">https://plog.zhheo.com/</a></p><p>在 Typecho 后台导航栏点击【撰写】,在自定义字段中填写图片地址。并填写文章标题和内容,即对应为图片的标题和简介。</p></blockquote><p>搭建步骤:</p><ol><li class="lvl-3"><p><a href="https://replit.com/">Replit</a> Create a Repl,环境选 SQLite;参照 <a href="https://github.com/valetzx/typechonreplit">@valetzx/typechonreplit</a> 执行 <code>git clone https://github.com/valetzx/typechonreplit && mv -b typechonreplit/* ./ && mv -b typechonreplit/.[^.]* ./ && rm -rf *~ && rm -rf typechonreplit</code>;注释 <code>main.sh</code> butterfly 相关行,<code>bash main.sh</code>;Run 运行;设置 Typecho 时选择 SQLite 数据库</p></li><li class="lvl-3"><p>按照 <a href="https://github.com/zhheo/TimePlus/wiki/%E7%AC%AC%E4%B8%80%E6%AC%A1%E4%B8%8A%E6%89%8B">TimePlus.Wiki</a> 设置,将 <a href="https://github.com/zhheo/TimePlus/releases">Source code</a> 解压上传 Replit Repl 对应路径,按步骤设置</p></li><li class="lvl-3"><p>图片仓库批量获取图片 URL <code>ls ./bj |awk '{print "https://mycpen.gitee.io/cdn2/image/bj/"$1""}' > C:/Users/Administrator/Desktop/TimePlus.txt</code></p></li><li class="lvl-3"><p>Replit Repl 绑自定义域名,需先 TXT 记录认证(因验证问题无法使用 https)</p></li></ol><p>相关链接:</p><ol><li class="lvl-3"><p><a href="https://github.com/zhheo/TimePlus/wiki/">https://github.com/zhheo/TimePlus/wiki/</a></p></li><li class="lvl-3"><p><a href="https://github.com/zhheo/TimePlus">https://github.com/zhheo/TimePlus</a></p></li><li class="lvl-3"><p><a href="https://github.com/valetzx/typechonreplit">https://github.com/valetzx/typechonreplit</a></p></li><li class="lvl-3"><p><a href="https://blog.zhheo.com/p/bed74f41.html">https://blog.zhheo.com/p/bed74f41.html</a></p></li><li class="lvl-3"><p><a href="https://replit.com/">Replit</a></p></li><li class="lvl-3"><p><a href="https://dns.console.aliyun.com/">阿里云.DNS</a></p></li></ol><h2 id="15-Git-修改提交信息">15. Git 修改提交信息<a class="header-anchor" href="#15-Git-修改提交信息"></a></h2><p><strong>2023-12-13 更新</strong></p><p>使用 <code>git rebase -i HEAD~<n></code> 修改最近某一次的提交信息,以下来自 chatgpt</p><blockquote><p>当您执行 <code>git rebase -i HEAD~<n></code> 命令时,会打开一个交互式的编辑器界面,列出最近 <code><n></code> 个提交。下面是一个示例,假设您要修改最近的前三次提交的提交信息:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">pick 1a2b3c4 Commit message 1</span><br><span class="line">pick 5d6e7f8 Commit message 2</span><br><span class="line">pick 9g0h1i2 Commit message 3</span><br></pre></td></tr></table></figure><p>要修改提交信息,将每个提交的行的开头的 <code>pick</code> 改为 <code>reword</code> 或 <code>r</code>,然后保存并关闭编辑器。修改后的示例如下:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">reword 1a2b3c4 Commit message 1</span><br><span class="line">reword 5d6e7f8 Commit message 2</span><br><span class="line">reword 9g0h1i2 Commit message 3</span><br></pre></td></tr></table></figure><p>保存并关闭编辑器后,Git 会逐个应用这些提交,并在每个提交之前暂停并等待您编辑提交信息。对于每个提交,Git 会打开一个新的编辑器窗口,允许您修改提交信息。完成修改后,保存并关闭编辑器。</p><p>请注意,如果在 rebase 过程中出现冲突,您需要解决冲突并使用 <code>git add</code> 命令将解决后的文件标记为已解决。然后,继续进行 rebase,直到所有提交都被处理完毕。</p><p>完成 rebase 后,您可以使用 <code>git log</code> 命令验证提交信息是否已成功修改。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git log</span><br></pre></td></tr></table></figure><p>如果要将修改的提交信息推送到远程仓库,您需要使用 <code>git push --force</code> 命令,因为您已经修改了历史提交。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git push --force</span><br></pre></td></tr></table></figure><p>请确保在进行此操作之前备份您的代码,并与团队成员进行沟通,以免影响其他人的工作。</p></blockquote><hr><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git commit --amend</span><br><span class="line">git push --force <remote-name> <branch-name></span><br><span class="line"></span><br></pre></td></tr></table></figure><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202305131749192.png" alt="image-20230513174958143" style="zoom: 80%;" /></blockquote><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">log</span> --oneline</span><br><span class="line">git commit --amend -m <span class="string">"新的提交信息"</span></span><br><span class="line">git push --force origin master</span><br><span class="line"></span><br></pre></td></tr></table></figure><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202305131751216.png" alt="image-20230513175153157" style="zoom: 67%;" /></blockquote><h2 id="16-GitHub-BiliBiliToolPro">16. GitHub: BiliBiliToolPro<a class="header-anchor" href="#16-GitHub-BiliBiliToolPro"></a></h2><p>地址:<a href="https://github.com/RayWangQvQ/BiliBiliToolPro">https://github.com/RayWangQvQ/BiliBiliToolPro</a></p><p><a href="https://github.com/RayWangQvQ/BiliBiliToolPro/blob/main/docs/runInLocal.md#3-linux">本地部署</a>:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">pwd</span></span><br><span class="line">/root/sh_file/BiliBiliToolPro</span><br><span class="line"></span><br><span class="line">$ wget https://github.com/RayWangQvQ/BiliBiliToolPro/releases/download/1.0.3/bilibili-tool-pro-v1.0.3-linux-x64.zip</span><br><span class="line">$ unzip bilibili-tool-pro-v1.0.3-linux-x64.zip</span><br><span class="line">$ <span class="built_in">cd</span> ./linux-x64/</span><br><span class="line">$ ./Ray.BiliBiliTool.Console --runTasks=Login</span><br><span class="line"></span><br></pre></td></tr></table></figure><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$ crontab -l</span><br><span class="line">0 1 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=VipBigPoint</span><br><span class="line">0 8 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=Daily</span><br><span class="line">* */12 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=LiveLottery</span><br><span class="line">0 16 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=UnfollowBatched</span><br><span class="line">0 20 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=LiveFansMedal</span><br><span class="line"></span><br></pre></td></tr></table></figure><h2 id="17-GitHub-Compare">17. GitHub Compare<a class="header-anchor" href="#17-GitHub-Compare"></a></h2><p>原文:<a href="https://akilar.top/posts/bbf68ad4/">https://akilar.top/posts/bbf68ad4/</a></p><p>示例:<a href="https://github.com/jerryc127/hexo-theme-butterfly/compare/4.8.5...4.9.0">https://github.com/jerryc127/hexo-theme-butterfly/compare/4.8.5...4.9.0</a></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202309161502336.png" alt="image-20230916150258235" style="zoom:50%;" /><h2 id="18-new-Date-getFullYear">18. new Date().getFullYear();<a class="header-anchor" href="#18-new-Date-getFullYear"></a></h2><p>JavaScript 获取当前年份</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 要以自动方式获取明年的年份并将其用于创建日期对象,您可以按如下方式修改代码:</span></span><br><span class="line"><span class="keyword">const</span> currentYear = <span class="keyword">new</span> <span class="title class_">Date</span>().<span class="title function_">getFullYear</span>();</span><br><span class="line"><span class="keyword">const</span> nextYear = currentYear + <span class="number">1</span>;</span><br><span class="line"><span class="keyword">const</span> newYearTimestamp = <span class="keyword">new</span> <span class="title class_">Date</span>(<span class="string">`<span class="subst">${nextYear}</span>-01-01 00:00:00`</span>).<span class="title function_">getTime</span>() / <span class="number">1000</span>;</span><br><span class="line"></span><br></pre></td></tr></table></figure><h2 id="19-JavaScript-解码-Base64">19. JavaScript 解码 Base64<a class="header-anchor" href="#19-JavaScript-解码-Base64"></a></h2><p>在线加密:<a href="https://encode.chahuo.com/">https://encode.chahuo.com/</a></p><p>以下来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p>在 JavaScript 中解码 Base64 编码的数据,你可以使用 <code>atob()</code> 函数。该函数可以将 Base64 编码的字符串解码为原始的文本数据。示例代码如下:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> base64String = <span class="string">"SGVsbG8gd29ybGQ="</span>; <span class="comment">// Base64 编码的字符串</span></span><br><span class="line"><span class="keyword">const</span> decodedString = <span class="title function_">atob</span>(base64String); <span class="comment">// 解码</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(decodedString); <span class="comment">// 输出解码后的字符串</span></span><br></pre></td></tr></table></figure><p>在这个例子中,<code>base64String</code> 你要解码Base64编码的字符串。使用<code>atob()</code>函数对它进行解码,然后你就可以处理解码后的原始字符串了。</p></blockquote><h2 id="20-JavaScript-取绝对值">20. JavaScript 取绝对值<a class="header-anchor" href="#20-JavaScript-取绝对值"></a></h2><p>来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p>在 JavaScript 中,你可以使用 <code>Math.abs()</code> 函数来获取一个数的绝对值,从而去除负号。例如:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> num = -<span class="number">5</span>;</span><br><span class="line"><span class="keyword">let</span> absNum = <span class="title class_">Math</span>.<span class="title function_">abs</span>(num); <span class="comment">// absNum将是5</span></span><br></pre></td></tr></table></figure><p>这样,<code>absNum</code> 将会取得 <code>num</code> 的绝对值,而不考虑其正负。</p></blockquote><h2 id="21-JavaScript-三元运算">21. JavaScript 三元运算<a class="header-anchor" href="#21-JavaScript-三元运算"></a></h2><p>来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p>你可以使用条件运算符(三元运算符)来判断 <code>e - now1</code> 是否大于 0,然后决定是否执行 +1。下面是优化后的代码:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> daysDifference = <span class="title class_">Math</span>.<span class="title function_">floor</span>(((e - now1) / <span class="number">1e3</span> / <span class="number">60</span> / <span class="number">60</span> / <span class="number">24</span>) + (e - now1 > <span class="number">0</span> ? <span class="number">1</span> : <span class="number">0</span>));</span><br></pre></td></tr></table></figure><p>这行代码首先计算 <code>(e - now1) / 1e3 / 60 / 60 / 24</code> 得到天数差,然后根据 <code>(e - now1 > 0)</code> 条件判断天数差是否大于 0,如果是则加 1,否则加 0。最后使用 <code>Math.floor</code> 向下取整。</p></blockquote><h2 id="22-Snipaste-截图格式改-JPG">22. Snipaste 截图格式改 JPG<a class="header-anchor" href="#22-Snipaste-截图格式改-JPG"></a></h2><p>参考:<a href="https://jingyan.baidu.com/article/25648fc14b3276d091fd00c3.html">https://jingyan.baidu.com/article/25648fc14b3276d091fd00c3.html</a></p><p>右键 → 首选项 → 输出 → 文件名.后缀</p><p>实测大大减少图片体积,500 KB (PNG) → 70KB (JPG)</p><p>仅适用于保存为本地文件,从剪贴板中粘贴到 typora 里还是 PNG 格式的</p><p>本人格式:<code>image-$yyyyMMddHHmmsszzz$.jpg</code>,目的 与 typora 剪贴板 上场时的 alt 命名保持一致</p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202310070313815.jpg" alt="image-20231007031301508" style="zoom: 25%;" /><h2 id="23-CSS-视口单位-dvh-svh-lvh">23. CSS 视口单位 dvh, svh, lvh<a class="header-anchor" href="#23-CSS-视口单位-dvh-svh-lvh"></a></h2><p>参考:</p><ol><li class="lvl-3"><p><a href="https://blog.anheyu.com/posts/e644.html">https://blog.anheyu.com/posts/e644.html</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/LuckyWinty/article/details/128962918">https://blog.csdn.net/LuckyWinty/article/details/128962918</a></p></li></ol><h2 id="24-CSS-旋转-rotate-90deg">24. CSS 旋转 rotate(90deg)<a class="header-anchor" href="#24-CSS-旋转-rotate-90deg"></a></h2><p>来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p><code>rotate(90deg)</code> 是CSS中的旋转变换指令,用于将元素顺时针旋转90度。这可以应用于任何HTML元素,使其在页面上以指定角度旋转。</p><p>逆时针旋转一个元素90度,<code>rotate(-90deg)</code></p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.about-page-chicken-soup</span> <span class="selector-tag">details</span><span class="selector-attr">[open]</span>><span class="selector-tag">summary</span><span class="selector-pseudo">:after</span> {</span><br><span class="line"> <span class="attribute">transform</span>: <span class="built_in">rotate</span>(-<span class="number">90deg</span>);</span><br><span class="line">}</span><br></pre></td></tr></table></figure></blockquote><h2 id="25-Markdown-折叠语法">25. Markdown 折叠语法<a class="header-anchor" href="#25-Markdown-折叠语法"></a></h2><p>参考:<a href="https://blog.csdn.net/ybb_ymm/article/details/128508243">https://blog.csdn.net/ybb_ymm/article/details/128508243</a></p><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="language-xml"><span class="tag"><<span class="name">details</span>></span></span> </span><br><span class="line"><span class="code"> <summary>指示标题</summary></span></span><br><span class="line"><span class="code"> 内容</span></span><br><span class="line"><span class="code"></details></span></span><br></pre></td></tr></table></figure><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="language-xml"><span class="tag"><<span class="name">details</span>></span></span> </span><br><span class="line"><span class="code"> <summary>展开查看</summary></span></span><br><span class="line"><span class="code"> <pre><code></span></span><br><span class="line"><span class="code"> 此处为代码的块具体内容</span></span><br><span class="line"><span class="code"> </code></pre> </span></span><br><span class="line"><span class="code"></details></span></span><br></pre></td></tr></table></figure><h2 id="26-PicGo-图片压缩插件">26. PicGo 图片压缩插件<a class="header-anchor" href="#26-PicGo-图片压缩插件"></a></h2><p>插件名:<a href="https://github.com/liujinpen/picgo-plugin-compress-tinypng">picgo-plugin-compress-tinypng</a></p><p>NPM 包:<a href="https://www.npmjs.com/package/picgo-plugin-tinypng">picgo-plugin-tinypng</a></p><p>TinyPNG</p><ul class="lvl-0"><li class="lvl-2"><p>官网:<a href="https://tinify.cn/">https://tinify.cn/</a></p></li><li class="lvl-2"><p>获取 Key 参考:<a href="https://bearcai.com/index.php/archives/44/">https://bearcai.com/index.php/archives/44/</a><br><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202310070421963.jpg" alt="image-20231007042117896" style="zoom:25%;" /></p></li><li class="lvl-2"><p>Key 限额 500 次/月:<a href="https://tinify.cn/dashboard/api">https://tinify.cn/dashboard/api</a></p></li></ul><p>起因:<a href="https://github.com/juzisang/picgo-plugin-compress">picgo-plugin-compress</a> 长久失修,picgo 2.3.1 报错 <code>TypeError: req.end is not a function</code>。 <a href="https://github.com/juzisang/picgo-plugin-compress/issues/64#issuecomment-1504939740">issue#64</a> 获知此插件</p><h2 id="27-JavaScript-copy-事件">27. JavaScript copy 事件<a class="header-anchor" href="#27-JavaScript-copy-事件"></a></h2><p>来自 ChatGPT</p><p>要检测用户是否复制内容,你可以使用JavaScript中的<code>copy</code>事件来捕获复制操作。你可以将事件监听器绑定到<code>copy</code>事件上,然后在该事件触发时执行相应的操作,以获知用户是否复制了内容。</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">document</span>.<span class="title function_">addEventListener</span>(<span class="string">'copy'</span>, <span class="keyword">function</span>(<span class="params">event</span>) {</span><br><span class="line"> <span class="comment">// 在这里执行你想要的操作,例如记录复制操作或发送数据到服务器</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">'用户复制了内容'</span>);</span><br><span class="line">});</span><br></pre></td></tr></table></figure><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">document</span>.<span class="title function_">addEventListener</span>(<span class="string">'copy'</span>, <span class="keyword">function</span>(<span class="params">event</span>) {</span><br><span class="line"> <span class="comment">// 获取复制的内容</span></span><br><span class="line"> <span class="keyword">var</span> copiedText = <span class="variable language_">window</span>.<span class="title function_">getSelection</span>().<span class="title function_">toString</span>().<span class="title function_">trim</span>();</span><br><span class="line"> </span><br><span class="line"> <span class="comment">// 检查复制的内容是否为空</span></span><br><span class="line"> <span class="keyword">if</span> (copiedText.<span class="property">length</span> > <span class="number">0</span>) {</span><br><span class="line"> <span class="comment">// 在这里执行你想要的操作,例如记录复制操作或发送数据到服务器</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">'用户复制了内容:'</span>, copiedText);</span><br><span class="line"> } <span class="keyword">else</span> {</span><br><span class="line"> <span class="comment">// 复制的内容为空,可以选择不执行任何操作或者执行相应处理</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">'用户尝试复制空内容'</span>);</span><br><span class="line"> }</span><br><span class="line">});</span><br></pre></td></tr></table></figure><h2 id="28-JavaScript-window-onresize">28. JavaScript window.onresize<a class="header-anchor" href="#28-JavaScript-window-onresize"></a></h2><p>来自:ChatGPT</p><p><code>window.onresize</code> 是 JavaScript 中的一个事件处理属性,它用于指定在浏览器窗口大小改变时要执行的函数。当用户调整浏览器窗口的大小时,就会触发 <code>resize</code> 事件,如果你将一个函数分配给 <code>window.onresize</code>,那么这个函数将在窗口大小改变时被调用。</p><p>例如,你可以使用以下方式监听窗口大小改变事件并执行相应的操作:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">window</span>.<span class="property">onresize</span> = <span class="keyword">function</span>(<span class="params"></span>) {</span><br><span class="line"> <span class="comment">// 在窗口大小改变时执行的代码</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">"窗口大小已改变"</span>);</span><br><span class="line">};</span><br></pre></td></tr></table></figure><p>这对于创建响应式设计或根据窗口大小进行布局调整等任务非常有用。当窗口大小发生变化时,你可以根据需要更新页面内容、样式或执行其他自定义操作。</p><h2 id="29-Git-指定远端">29. Git 指定远端<a class="header-anchor" href="#29-Git-指定远端"></a></h2><p>参考:<a href="http://www.mobiletrain.org/about/BBS/161969.html">http://www.mobiletrain.org/about/BBS/161969.html</a></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git remote add origin <远程仓库URL></span><br><span class="line"></span><br><span class="line">git push <远程仓库别名> <本地分支名>:<远程分支名></span><br><span class="line"></span><br><span class="line">git push origin master:main</span><br></pre></td></tr></table></figure><h2 id="30-Git-删除文件历史提交记录">30. Git 删除文件历史提交记录<a class="header-anchor" href="#30-Git-删除文件历史提交记录"></a></h2><p>参考:ChatGPT</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git filter-branch --force --index-filter <span class="string">'git rm -r --cached --ignore-unmatch node_modules'</span> --prune-empty --tag-name-filter <span class="built_in">cat</span> -- --all</span><br><span class="line">git <span class="built_in">rm</span> --cached node_modules -r</span><br><span class="line"></span><br><span class="line">git reflog expire --expire=now --all && git gc --prune=now --aggressive</span><br></pre></td></tr></table></figure><p>ChatGPT 还提供了 <code>git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD</code> 命令删除,运行时间过长,不采用,给出的解释:命令1 使用了 <code>--index-filter</code> 和 <code>--cached</code>,这些参数可以更快地处理 Git 的索引而不需要检查和修改实际的工作树文件</p><blockquote><ol><li class="lvl-3"><p><code>git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD</code>:</p><ul class="lvl-3"><li class="lvl-5">使用 <code>--tree-filter</code> 参数,它会在每个提交上执行指定的 shell 命令。在这种情况下,它会执行 <code>rm -rf node_modules</code> 命令来删除 <code>node_modules</code> 目录。</li><li class="lvl-5">使用 <code>--prune-empty</code> 选项以删除空提交。</li><li class="lvl-5">只作用于当前分支 <code>HEAD</code>。</li></ul></li><li class="lvl-3"><p><code>git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch node_modules' --prune-empty --tag-name-filter cat -- --all</code>:</p><ul class="lvl-3"><li class="lvl-5">使用 <code>--index-filter</code> 参数,它会在 Git 索引上执行指定的命令。在这种情况下,它会执行 <code>git rm -r --cached --ignore-unmatch node_modules</code> 命令,以将 <code>node_modules</code> 从索引中删除。</li><li class="lvl-5">使用 <code>--prune-empty</code> 选项以删除空提交。</li><li class="lvl-5">使用 <code>--tag-name-filter cat</code> 选项,以保留提交的标签(tags)。</li><li class="lvl-5">使用 <code>--all</code> 来指定作用于所有分支。</li></ul></li></ol><hr><p>之前上传 github 时提交了无需提交的 node_modules,如何缩小 .git 的大小</p><p>ChatGPT:要缩小.git目录的大小,可以采取以下步骤:</p><ol><li class="lvl-3"><p>清理历史提交中的node_modules:首先,你需要清理历史提交中的不必要的node_modules目录。你可以使用<code>git filter-branch</code>命令或<code>git filter-repo</code>工具来重写历史提交以删除node_modules。确保在删除之前备份你的仓库,以防发生问题。</p></li><li class="lvl-3"><p>使用.gitignore:在项目根目录下创建一个名为<code>.gitignore</code>的文件,并将<code>node_modules/</code>添加到其中,以确保不再将该目录包括在提交中。</p></li><li class="lvl-3"><p>执行<code>git rm --cached node_modules -r</code>:这将删除当前暂存区中的node_modules目录,但不会删除物理文件。然后,提交这一变更。</p></li><li class="lvl-3"><p>执行<code>git reflog expire --expire=now --all</code>:这将清理Git的reflog,以确保不再保留对不必要历史提交的引用。</p></li><li class="lvl-3"><p>执行<code>git gc --prune=now</code>:这将触发垃圾收集,清理不必要的数据,从而缩小.git目录的大小。</p></li><li class="lvl-3"><p>推送到远程仓库:如果你使用远程仓库(如GitHub),确保将这些更改推送到远程仓库以同步它们。</p></li></ol><p>请注意,这些步骤会修改你的Git历史,因此在执行它们之前务必小心,确保已备份你的仓库数据。</p></blockquote><h2 id="31-洛雪音乐导入三方音源">31. 洛雪音乐导入三方音源<a class="header-anchor" href="#31-洛雪音乐导入三方音源"></a></h2><p>官方源因 TX 警告而报废,详见 issue:<a href="https://github.com/lyswhut/lx-music-desktop/issues/1643">https://github.com/lyswhut/lx-music-desktop/issues/1643</a></p><p>详见 issue:<a href="https://github.com/lyswhut/lx-music-desktop/issues/1649#issuecomment-1774536022">https://github.com/lyswhut/lx-music-desktop/issues/1649#issuecomment-1774536022</a></p><p>仓库:<a href="https://github.com/OneCodeMonkey/music-sources">https://github.com/OneCodeMonkey/music-sources</a></p><h2 id="32-Clash-GUI">32. Clash GUI<a class="header-anchor" href="#32-Clash-GUI"></a></h2><p>起因:<a href="https://github.com/Fndroid/clash_for_windows_pkg">Clash for Windows</a> 删库</p><p>Clash Verge:<a href="https://github.com/zzzgydi/clash-verge/">https://github.com/zzzgydi/clash-verge/</a></p><p>Clash for Android 存档:<a href="https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/tag/CFA">https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/tag/CFA</a></p><p>Clash for Windows 存档:<a href="https://github.com/Z-Siqi/Clash-for-Windows_Chinese">https://github.com/Z-Siqi/Clash-for-Windows_Chinese</a></p><h2 id="33-GitHub-SSH-超时">33. GitHub SSH 超时<a class="header-anchor" href="#33-GitHub-SSH-超时"></a></h2><p><code>git pull</code> 报超时、<code>ping github.com</code> 报超时</p><p>解决方案</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># git bash 终端</span></span><br><span class="line">vim ~/.ssh/config</span><br></pre></td></tr></table></figure><p>内容如下,第一次 <code>git pull</code> 时输入 <code>yes</code></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># GitHub Start</span></span><br><span class="line">Host github.com</span><br><span class="line"> Hostname ssh.github.com</span><br><span class="line"><span class="comment"># GitHub End</span></span><br></pre></td></tr></table></figure><p>参考</p><ol><li class="lvl-3"><p><a href="https://blog.ttiee.tech/posts/2024/71e1/">https://blog.ttiee.tech/posts/2024/71e1/</a></p></li><li class="lvl-3"><p><a href="https://ww-rm.github.io/posts/2024/01/17/githubssh-timeout/">https://ww-rm.github.io/posts/2024/01/17/githubssh-timeout/</a></p></li><li class="lvl-3"><p>github <a href="https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port">Using SSH over the HTTPS port</a></p></li><li class="lvl-3"><p>github <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-githubs-ip-addresses">About GitHub’s IP addresses</a></p></li></ol>]]></content>
|
241
|
+
<content type="html"><![CDATA[<h2 id="前言">前言<a class="header-anchor" href="#前言"></a></h2><p>记录一些小知识点、工具、文章收藏</p><h2 id="01-链接收藏">01. 链接收藏<a class="header-anchor" href="#01-链接收藏"></a></h2><table><thead><tr><th colspan="3">地址</th></tr></thead><tbody><tr><td><a href="https://tools.liumingye.cn/music/#/">MyFreeMP3</a></td><td><a href="https://www.cnblogs.com/hider/p/11614688.html">Typora入门</a></td><td><a href="https://zhuanlan.zhihu.com/p/193101244">Typora页面美化</a></td></tr><tr><td><a href="https://apps.microsoft.com/store/apps">Microsoft Store</a></td><td><a href="https://github.com/sparanoid/chinese-copywriting-guidelines/blob/master/README.zh-Hans.md">中文文案排版指北</a></td><td><a href="https://blog.csdn.net/m0_37624402/article/details/108960118">Git常见用法总结</a></td></tr><tr><td><a href="https://www.processon.com/">ProcessOn</a></td><td><a href="https://www.nowcoder.com/discuss/353154816606150656">牛客网-面经-运开资料</a></td><td><a href="https://www.cnblogs.com/blogkui/p/12900655.html">JavaScript日期格式化,不足两位数补0</a></td></tr><tr><td><a href="https://molunerfinn.com/my-2019-interview-of-summer-internship/">Molunerfinn 大佬面经</a></td><td><a href="https://akilar.top/posts/f752c86d/#%E9%85%8D%E7%BD%AEGithub-Action">Akilar:Github Action自动部署</a></td><td><a href="https://auto.oldwu.top/">AutoPlan.哔哩升级</a></td></tr><tr><td><a href="https://www.cnblogs.com/xxhxs-21/p/17151813.html">Jetbrains 激活方法</a></td><td><a href="https://mp.weixin.qq.com/cgi-bin/settingpage?t=setting/index&action=index&token=168808346&lang=zh_CN">公众号二维码.下载</a></td><td><a href="https://github.com/RayWangQvQ/BiliBiliToolPro">GitHub: BiliBiliToolPro</a></td></tr><tr><td><a href="https://jingyan.baidu.com/article/25648fc14b3276d091fd00c3.html">Snipaste JPG 截图格式</a></td><td><a href="https://www.yilantingfeng.site/%e5%ad%a6%e4%b8%9a%e7%9b%b8%e5%85%b3/1503/">倚栏听风.2023计算机保研经历总结</a></td><td><a href="https://blog.zwying.com/archives/93.html">Veen Zhao.南师大.考研</a></td></tr><tr><td><a href="https://github.com/dxhuii/delWeibo">批量删除微博博文</a></td><td><a href="https://xedu.me/">chatgpt账号-key购买</a></td><td><a href="https://blog.zwying.com/archives/121.html">Veen Zhao.南师大.复试</a></td></tr><tr><td colspan="3"></td></tr></tbody></table><p>其他:</p><ol><li class="lvl-3"><p><a href="https://blog.cpen.top/posts/583c5c34.html">03_Other-PC端环境记录</a></p></li></ol><p>非技术:</p><table><thead><tr><th colspan="3">地址</th></tr></thead><tbody><tr><td><a href="http://coolshell.cn/articles/20276.html">酷壳:别让自己“墙”了自己</a></td><td rowspan="2" colspan="2"></td></tr><tr><td></td></tr></tbody></table><p>云服务器:</p><ul class="lvl-0"><li class="lvl-2"><p>阿里云 ECS 99/年,活动期内(活动时间: <mark>2023年10月31日0点0分0秒至2026年3月31日23点59分59秒</mark>。)续费同价,新老用户同享:<a href="https://www.aliyun.com/lowcode/promotion/allinaliyun/99program">https://www.aliyun.com/lowcode/promotion/allinaliyun/99program</a></p></li><li class="lvl-2"><p>阿里云在校学生300无门券/合作高校3折券领取:<a href="https://university.aliyun.com/">https://university.aliyun.com/</a></p></li></ul><h2 id="02-sshpass-非交互登录">02. sshpass 非交互登录<a class="header-anchor" href="#02-sshpass-非交互登录"></a></h2><p>ssh 不能在命令行中指定密码</p><p>sshpass:</p><ol><li class="lvl-3"><p>用于非交互的 ssh 密码验证,允许用 -p 参数指定明文密码</p></li><li class="lvl-3"><p>支持密码从命令行,文件,环境变量中读取</p></li></ol><blockquote><p>Ubuntu 报错 <code>E: Unable to locate package sshpass</code></p><p><code>apt-get update</code> ; sudo apt-get install sshpass</p><p>参考文章:<a href="https://www.cnblogs.com/itsfei/p/15014277.html">ssh快捷登录 sshpass+alias</a></p></blockquote><p>登录脚本(第一次需 SSH 登录)</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cat</span> ali.sh</span><br><span class="line"><span class="comment">#!/bin/bash</span></span><br><span class="line"></span><br><span class="line">sshpass -p 密码 ssh -o ServerAliveinterval=60 root@IP</span><br><span class="line"><span class="comment"># sshpass -p 密码 ssh root@IP</span></span><br><span class="line"></span><br><span class="line">$ <span class="built_in">chmod</span> +x ali.sh</span><br><span class="line"></span><br></pre></td></tr></table></figure><ul class="lvl-0"><li class="lvl-2"><p>-o option => Can be used to give options in the format used in the configuration file.</p></li><li class="lvl-2"><p><code>ServerAliveinterval=60</code> client每隔60秒发送一次请求给server,然后server响应,从而保持连接(防止连接空闲超时)</p></li></ul><p>定义别名 alias</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cat</span> ~/.bashrc</span><br><span class="line"><span class="comment"># User specific aliases and functions</span></span><br><span class="line"><span class="built_in">alias</span> ali=<span class="string">'bash /home/peng/sh_file/ali.sh'</span></span><br></pre></td></tr></table></figure><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://blog.csdn.net/u013288190/article/details/116921994">Shell 脚本 ssh免密码 登录 远程服务器 sshpass用法示例</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/liao392781/article/details/79220395">Shell脚本免密码登录远程服务器(方法一)</a></p></li><li class="lvl-3"><p><a href="https://www.cnblogs.com/itsfei/p/15014277.html">ssh快捷登录 sshpass+alias</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/weixin_48693408/article/details/125961472">Linux – 将自己的shell脚本设置成命令</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/qq_44895681/article/details/124841145">配置SSH服务远程连接空闲超时退出时间(包括SSH无法登录、登录缓慢)</a></p></li></ol><h2 id="03-Xftp-显示隐藏文件">03. Xftp 显示隐藏文件<a class="header-anchor" href="#03-Xftp-显示隐藏文件"></a></h2><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304042240000.png" alt="image-20230404224047926" style="zoom: 33%;" /><p>参考文章:<a href="http://www.nndssk.com/xtjc/287647HVA4sC.html">Xftp显示隐藏文件的方法</a></p><h2 id="04-Github-多账户-SSH-配置">04. Github 多账户 SSH 配置<a class="header-anchor" href="#04-Github-多账户-SSH-配置"></a></h2><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -f ~/.ssh/id_rsa_gh -C user_gh@gmail.com</span><br></pre></td></tr></table></figure><ul class="lvl-1"><li class="lvl-2">-b:指定 key 的 bit 数,对于 RSA key 而言,默认是 3072 bits</li><li class="lvl-2">-f:指定 key 的文件名,若需要指定路径,则文件名需要和路径一直,如 ~/.ssh/id_rsa_gh</li><li class="lvl-2">-C:指定新的 comment,即公钥末尾的字符串,一般是邮箱地址,若不指定会是 “username@hostname” 的形式</li><li class="lvl-2">-t:指定私钥类型,一般有 “dsa”, “ecdsa”, “ecdsa-sk”, “ed25519”, “ed25519-sk” 和 “rsa” 等几种,若指定为 rsa 还可以指定签名类型,默认为 “rsa-sha2-512”</li></ul></blockquote><blockquote><p>Github 不同账户,类似配置</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cat</span> ~/.ssh/config</span><br><span class="line">Host github.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> PreferredAuthentications publickey</span><br><span class="line"> IdentityFile ~/.ssh/user1_rsa</span><br><span class="line"> User user1</span><br><span class="line">Host github.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> PreferredAuthentications publickey</span><br><span class="line"> IdentityFile ~/.ssh/user2_rsa</span><br><span class="line"> User user2</span><br><span class="line">------</span><br><span class="line">Host user_gh.github.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> User user_gh</span><br><span class="line"> IdentityFile ~/.ssh/id_rsa_gh</span><br><span class="line">Host github-qileq.com</span><br><span class="line"> HostName github.com</span><br><span class="line"> User qileq</span><br><span class="line"> IdentityFile ~/.ssh/id_rsa_qileq</span><br><span class="line">Host gitlab.com</span><br><span class="line"> HostName gitlab.com</span><br><span class="line"> User user_gl</span><br><span class="line"> IdentityFile ~/.ssh/id_rsa_gl</span><br><span class="line"></span><br></pre></td></tr></table></figure><ul class="lvl-1"><li class="lvl-2"><p>Host 类型昵称,可以简化登录的输入地址,比如<code>Host ccl</code>,则可以用<code>ssh ccl</code>直接连接</p></li><li class="lvl-2"><p>HostName 表示连接的远程主机地址</p></li><li class="lvl-2"><p>IdentityFile 表示指定私钥文件路径</p></li><li class="lvl-2"><p>Port 指定端口</p></li><li class="lvl-2"><p>User 指定用户名</p></li></ul><p>修改仓库的 git 信息,将仓库配置 url 的 <a href="https://link.zhihu.com/?target=http%3A//github.com">http://github.com</a> 替换为 ssh config 中设置的 Host 值。</p><p>笔者以 <a href="https://link.zhihu.com/?target=https%3A//github.com/qileq/java-roam-guide">java-roam-guide</a> 为例,使用如下两种方式来修改仓库地址:</p><ol><li class="lvl-3"><p>执行命令 git remote set-url origin <a href="mailto:git@github-qileq.com">git@github-qileq.com</a>:qileq/java-roam-guid.git</p></li><li class="lvl-3"><p>将该仓库 .git/config 中的 url = <a href="mailto:git@github.com">git@github.com</a>:qileq/java-roam-guide.git 修改为 url = <a href="mailto:git@github-qileq.com">git@github-qileq.com</a>:qileq/java-roam-guide.git</p></li></ol><p>修改完成后,执行 git remote -v 查看仓库地址是否正确。</p></blockquote><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 当使用<user1.github.com>替换<github.com>进行访问时,ssh会自动识别为user1</span></span><br><span class="line"><span class="comment"># 配置用户1</span></span><br><span class="line">Host user1.github.com<span class="comment"># 别名,可以随便写一个url。</span></span><br><span class="line">Hostname github.com<span class="comment"># 网站真实的域名,如果是GitHub就不用改了</span></span><br><span class="line">PreferredAuthentications publickey</span><br><span class="line">IdentityFile ~/.ssh/id_rsa_user1<span class="comment"># 指向user1的私钥路径,似乎只能在~/.ssh下,不要随便放</span></span><br><span class="line">User user1<span class="comment"># 填写user1的Github用户名,不过似乎最后获取的还是真实的Github用户名</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 配置用户2</span></span><br><span class="line">Host user1.github.com</span><br><span class="line">Hostname github.com</span><br><span class="line">PreferredAuthentications publickey</span><br><span class="line">IdentityFile ~/.ssh/id_rsa_user2<span class="comment"># 指向user2的私钥路径,似乎只能在~/.ssh下,不要随便放</span></span><br><span class="line">User user2<span class="comment"># 填写user2的GitHub用户名,不过似乎最后获取的还是真实的Github用户名</span></span><br><span class="line"></span><br></pre></td></tr></table></figure><p>如果是直接使用 <code>git@github.com</code>,那么ssh将自动识别为config列表的第一个用户,可以认为是单用户模式</p><p>由于是多用户,所以在第一次clone一个GitHub地址的时候,需要简单的修改一下对应的域名,此时SSH将可以识别使用哪个用户进行操作,并建立配置记录</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 原始要clone的仓库命令</span></span><br><span class="line">git <span class="built_in">clone</span> git@github.com:oneflyingfish/WebServer_C.git</span><br><span class="line"></span><br><span class="line"><span class="comment"># 对应修改一下<github.com>,user1修改为上面配置的<user1.github.com>即可</span></span><br><span class="line">git <span class="built_in">clone</span> git@user1.github.com:oneflyingfish/WebServer_C.git</span><br><span class="line"></span><br></pre></td></tr></table></figure><p>多用户共用情况下,如果提示设置用户名,一定要设置为<code>局部信息</code>,而不是<code>global</code>。命令应修改为</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># git默认提示的命令</span></span><br><span class="line">git config --global user.name <span class="string">"your_name"</span></span><br><span class="line">git config --global user.email <span class="string">"your_eamil"</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 我们应该使用的命令</span></span><br><span class="line">git config user.name <span class="string">"your_name"</span></span><br><span class="line">git config user.email <span class="string">"your_eamil"</span></span><br><span class="line"></span><br></pre></td></tr></table></figure></blockquote><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://zhuanlan.zhihu.com/p/521768041">* SSH 多账号的配置</a></p></li><li class="lvl-3"><p><a href="https://cloud.tencent.com/developer/article/2121948">ssh config多账户/多域名配置</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/senlin1202/article/details/122081089">SSH Config 使用</a></p></li><li class="lvl-3"><p><a href="https://blog.anheyu.com/posts/443e.html">Mac上配置多个SSH</a></p></li><li class="lvl-3"><p><a href="https://oneflyingfish.gitee.io/articles/20c7aea41283/">* 配置SSH keys连接GitHub(支持多用户)</a></p></li><li class="lvl-3"><p><a href="https://happyleecode.gitee.io/2023/04/05/SSH/">解决 Git 同时部署到 GitHub 和 Gitee 时,密钥 SSH 冲突问题</a></p></li></ol><h2 id="05-APICloud-打包网页">05. APICloud 打包网页<a class="header-anchor" href="#05-APICloud-打包网页"></a></h2><p><mark>未成功</mark></p><p><a href="https://www.apicloud.com/portal-web/console">APICloud</a> => Web App 创建</p><p>图标<a href="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700919.png">https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700919.png</a></p><p>启动页<a href="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700867.png">https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061700867.png</a></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304061613612.png" alt="image-20230406161352487" style="zoom:33%;" /><p>安装后的 APP 因无法开启存储空间权限,未能成功(个人原因,<a href="https://www.fomal.cc/">Fomalhaut🥝</a> 的 <a href="https://lskypro.acozycotage.net/Fomalhaut/Fomalhaut.apk">APP</a> 能设置)</p><p>参考教程:<a href="https://naokuoteng.cn/posts/2afd210.html">将网站 / 博客打包成桌面 APP</a>、<a href="https://www.fomal.cc/comments/#9392fccc60784238be439c910336af0b">Fomalhaut🥝.留言</a></p><h2 id="06-Hexo-渲染脚注">06. Hexo 渲染脚注<a class="header-anchor" href="#06-Hexo-渲染脚注"></a></h2><p>下文采用 hexo-renderer-markdown-it 渲染器(渲染脚注效果一般,不打算用脚注了)</p><blockquote><p>尽管标准 Markdown 不支持脚注,但很多 Markdown 变种都支持。一般来说,大多数 Markdown 方言和编辑器支持行内脚注和引用式脚注这两种方式,而后者使用更为普遍(原文:<a href="https://sspai.com/post/77513">在 Markdown 中使用引用式链接和脚注</a>)</p></blockquote><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm uninstall --save hexo-renderer-marked</span><br><span class="line">npm install --save hexo-renderer-markdown-it</span><br></pre></td></tr></table></figure><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">markdown:</span></span><br><span class="line"> <span class="attr">plugins:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">markdown-it-footnote</span></span><br></pre></td></tr></table></figure><p>原文:<a href="https://blog.imql.life/2020/01/24/My_HexoBlog_with_NexT(2)/#%E6%9B%B4%E6%8D%A2%E9%BB%98%E8%AE%A4%E7%9A%84-Markdown-%E6%B8%B2%E6%9F%93%E5%99%A8-1">我的博客的诞生(二)</a></p></blockquote><blockquote><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">Here is a footnote reference,[^1] and another.[^longnote]</span><br><span class="line"></span><br><span class="line">[<span class="symbol">^1</span>]: <span class="link">Here is the footnote.</span></span><br><span class="line"></span><br><span class="line">[<span class="symbol">^longnote</span>]: <span class="link">Here's one with multiple blocks.</span></span><br><span class="line"></span><br><span class="line"><span class="code"> Subsequent paragraphs are indented to show that they</span></span><br><span class="line"><span class="code">belong to the previous footnote.</span></span><br></pre></td></tr></table></figure><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Here is an inline note.^[Inlines notes are easier to write, since</span><br><span class="line">you don't have to pick an identifier and move down to type the</span><br><span class="line">note.]</span><br></pre></td></tr></table></figure><p>来源:<a href="https://github.com/markdown-it/markdown-it-footnote">markdown-it/markdown-it-footnote</a></p></blockquote><p>个人配置:</p><figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br></pre></td><td class="code"><pre><span class="line"># https://butterfly.js.org/posts/ceeb73f/#Math-%E6%95%B8%E5%AD%B8</span><br><span class="line"># https://www.nickxu.top/2022/04/17/Hexo-Butterfly-建站指南(八)使用-KaTeX-数学公式/</span><br><span class="line"># https://github.com/hexojs/hexo-renderer-markdown-it</span><br><span class="line"># https://ezgx.tk/posts/65320/</span><br><span class="line">markdown:</span><br><span class="line"> preset: 'default'</span><br><span class="line"> render:</span><br><span class="line"> html: true</span><br><span class="line"> xhtmlOut: false</span><br><span class="line"> langPrefix: 'language-'</span><br><span class="line"> breaks: true</span><br><span class="line"> linkify: true</span><br><span class="line"> typographer: true</span><br><span class="line"> quotes: '“”‘’'</span><br><span class="line"> enable_rules:</span><br><span class="line"> disable_rules:</span><br><span class="line"> plugins:</span><br><span class="line"> - markdown-it-abbr</span><br><span class="line"> # installed external plugins also can be enabled</span><br><span class="line"> - markdown-it-table-of-contents</span><br><span class="line"> - markdown-it-attrs</span><br><span class="line"> # - markdown-it-cjk-breaks</span><br><span class="line"> - markdown-it-container</span><br><span class="line"> - markdown-it-deflist</span><br><span class="line"> - markdown-it-emoji</span><br><span class="line"><span class="addition">+ - markdown-it-footnote</span></span><br><span class="line"> - markdown-it-ins</span><br><span class="line"> - markdown-it-mark</span><br><span class="line"> - markdown-it-sub</span><br><span class="line"> - markdown-it-sup</span><br><span class="line"> - markdown-it-checkbox</span><br><span class="line"> - markdown-it-imsize</span><br><span class="line"> - markdown-it-expandable</span><br><span class="line"> - markdown-it-merge-cells</span><br><span class="line"> - '@renbaoshuo/markdown-it-katex'</span><br><span class="line"> # - @iktakahiro/markdown-it-katex</span><br><span class="line"> # - name: '@neilsustc/markdown-it-katex'</span><br><span class="line"> # enable: true</span><br><span class="line"> # options:</span><br><span class="line"> # strict: false</span><br><span class="line"> # - markdown-it-toc-and-anchor</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: success</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: tips</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: warning</span><br><span class="line"> - name: markdown-it-container</span><br><span class="line"> options: danger</span><br><span class="line"> anchors:</span><br><span class="line"> level: 1</span><br><span class="line"> collisionSuffix: ''</span><br><span class="line"> permalink: false</span><br><span class="line"> permalinkClass: 'header-anchor'</span><br><span class="line"> permalinkSide: 'left'</span><br><span class="line"> permalinkSymbol: '¶'</span><br><span class="line"> case: 0</span><br><span class="line"> separator: '-'</span><br><span class="line"> images:</span><br><span class="line"> lazyload: false</span><br><span class="line"> prepend_root: false</span><br><span class="line"> post_asset: false</span><br></pre></td></tr></table></figure><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://sspai.com/post/77513">在 Markdown 中使用引用式链接和脚注</a></p></li><li class="lvl-3"><p><a href="https://markdown.com.cn/extended-syntax/footnotes.html">Markdown 脚注</a></p></li><li class="lvl-3"><p><a href="https://blog.meta-code.top/2023/03/21/2023-53/">百里飞洋 Barry-Flynn(得知脚注)</a></p></li><li class="lvl-3"><p><a href="https://github.com/hexojs/hexo-renderer-markdown-it">hexojs/hexo-renderer-markdown-it</a></p></li><li class="lvl-3"><p><a href="https://github.com/markdown-it/markdown-it-footnote">* markdown-it/markdown-it-footnote</a></p></li><li class="lvl-3"><p><a href="https://blog.imql.life/2020/01/24/My_HexoBlog_with_NexT(2)/#%E6%9B%B4%E6%8D%A2%E9%BB%98%E8%AE%A4%E7%9A%84-Markdown-%E6%B8%B2%E6%9F%93%E5%99%A8-1">* 我的博客的诞生(二)</a></p></li></ol><h2 id="07-Base64-加密邮箱-解密">07. Base64 加密邮箱 解密<a class="header-anchor" href="#07-Base64-加密邮箱-解密"></a></h2><p>加密的邮箱地址,使用 base64 加密。在线加密:<a href="https://encode.chahuo.com/">https://encode.chahuo.com/</a></p><p>解密 <code>javascript:decryptEmail(...)</code>,代码示例:<a href="https://www.mycpen.cn/">https://www.mycpen.cn/</a></p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag"><<span class="name">a</span> <span class="attr">href</span>=<span class="string">"javascript:decryptEmail('bXljcGVuQHFxLmNvbQ==');"</span> <span class="attr">title</span>=<span class="string">"email"</span>></span><span class="tag"></<span class="name">a</span>></span></span><br></pre></td></tr></table></figure><h2 id="08-Word-转-MD(Pandoc)">08. Word 转 MD(Pandoc)<a class="header-anchor" href="#08-Word-转-MD(Pandoc)"></a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pandoc -xxx.docx -o xxx.md</span><br></pre></td></tr></table></figure><blockquote><p>一、下载pandoc<br>建议使用msi直接安装,而不是下载安装包直接使用,msi的下载方法:安装方法。</p><p>二、pandoc转换<br>1、cmd进入文件夹<br>打开cmd。<br>转换到文件所在的路径中。d:进入D盘的路径下,CD D:\Program Files\OneDrive\桌面\temp</p><p>2、代码实现</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pandoc -xxx.docx -o xxx.md <span class="comment"># docx 文件转换为 md 文件</span></span><br></pre></td></tr></table></figure><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304162143719.png" alt="image-20230416214320662" style="zoom: 33%;" /></blockquote><p>参考文章:<a href="http://www.taodudu.cc/news/show-3860696.html">word文件转md文件</a></p><h2 id="09-GitHub-删除历史记录">09. GitHub 删除历史记录<a class="header-anchor" href="#09-GitHub-删除历史记录"></a></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git reset <上一步复制到的字符串></span><br><span class="line">git push -f</span><br></pre></td></tr></table></figure><p>参考文章:<a href="https://blog.csdn.net/sunzequan888/article/details/125738176">GITHUB删除历史记录</a></p><h2 id="10-ChatGPT-API-Key-个人站">10. ChatGPT API Key 个人站<a class="header-anchor" href="#10-ChatGPT-API-Key-个人站"></a></h2><p>项目地址:</p><ol><li class="lvl-3"><p><a href="https://github.com/Chanzhaoyu/chatgpt-web">https://github.com/Chanzhaoyu/chatgpt-web</a></p></li><li class="lvl-3"><p><a href="https://github.com/Yidadaa/ChatGPT-Next-Web">https://github.com/Yidadaa/ChatGPT-Next-Web</a></p></li></ol><p>参考文章:</p><ol><li class="lvl-3"><p><a href="https://www.fomal.cc/posts/74ac8dc8.html">无服务器部署自己的chatGPT</a></p></li></ol><h2 id="11-字符画-consolo-log">11. 字符画 consolo.log()<a class="header-anchor" href="#11-字符画-consolo-log"></a></h2><p><strong>推荐</strong>:<a href="http://patorjk.com/software/taag">http://patorjk.com/software/taag</a></p><p>文字生成字符画:<br><a href="http://patorjk.com/software/taag">http://patorjk.com/software/taag</a><br><a href="http://www.network-science.de/ascii/">http://www.network-science.de/ascii/</a></p><p>图片生成字符画:<br><a href="http://www.degraeve.com/img2txt.php">http://www.degraeve.com/img2txt.php</a><br><a href="http://life.chacuo.net/convertphoto2char">http://life.chacuo.net/convertphoto2char</a></p><p>流程图生成字符画:<br><a href="http://asciiflow.com/">http://asciiflow.com/</a></p><p>VSCode 插件:<br><a href="https://github.com/OBKoro1/koro1FileHeader">https://github.com/OBKoro1/koro1FileHeader</a></p><p>参考:<a href="https://blog.saop.cc/p/c9df/">https://blog.saop.cc/p/c9df/</a></p><h2 id="12-ERR-HTTP2-PROTOCOL-ERROR-关闭-HSTS">12. ERR_HTTP2_PROTOCOL_ERROR 关闭 HSTS<a class="header-anchor" href="#12-ERR-HTTP2-PROTOCOL-ERROR-关闭-HSTS"></a></h2><p>访问网站,偶然性报错:ERR_HTTP2_PROTOCOL_ERROR。试着关闭 HSTS</p><p>CDN HTTPS 配置 关闭 <code>HSTS</code>,<a href="https://console.dogecloud.com/cdn/domain/https?domainId=6667">多吉云个人链接</a></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304191935126.png" alt="image-20230419193555012" style="zoom: 33%;" /><p>以下内容来自 ChatGPT:</p><blockquote><p>问:<code>ERR_HTTP2_PROTOCOL_ERROR 和 HSTS 有什么联系</code></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304191946818.png" alt="image-20230419194615758" style="zoom: 50%;" /><p>问:<code>HSTS 会导致 ERR_HTTP2_PROTOCOL_ERROR 报错吗</code></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202304191946462.png" alt="image-20230419194650417" style="zoom: 50%;" /></blockquote><h2 id="13-Clash-Parsers">13. Clash Parsers<a class="header-anchor" href="#13-Clash-Parsers"></a></h2><p>设置 => 配置 => 配置文件预处理</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">parsers:</span> <span class="comment"># array</span></span><br><span class="line"> <span class="bullet">-</span> <span class="attr">url:</span> <span class="string">https://xxx.xxx/xxx</span></span><br><span class="line"> <span class="attr">yaml:</span></span><br><span class="line"> <span class="attr">prepend-rules:</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">DOMAIN-SUFFIX,xxx.com,香港Az-优化3</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">DOMAIN-SUFFIX,xxx.com,GLOBAL</span></span><br><span class="line"> <span class="bullet">-</span> <span class="string">DOMAIN-SUFFIX,xxx.com,DIRECT</span></span><br><span class="line"></span><br></pre></td></tr></table></figure><p>参考链接:</p><ol><li class="lvl-3"><p><a href="https://docs.cfw.lbyczf.com/contents/parser.html">* Clash for Windows:配置文件预处理</a></p></li><li class="lvl-3"><p><a href="https://zhuanlan.zhihu.com/p/600564111">* Clash利用parsers进行规则预处理</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/u013559309/article/details/129437063">* Clash使用Parser添加自定义规则并防止更新覆盖</a></p></li><li class="lvl-3"><p><a href="https://www.wangpc.cc/software/clash-for-windows-paarsers-rules/">clash for windows自定义规则(不会被更新覆盖)</a></p></li><li class="lvl-3"><p><a href="https://www.zhihu.com/question/507810862">clash for windows如何设置指定IP或者网站才走xx?</a></p></li></ol><h2 id="14-Replit-部署-Typecho-TimePlus">14. Replit 部署 Typecho.TimePlus<a class="header-anchor" href="#14-Replit-部署-Typecho-TimePlus"></a></h2><blockquote><p>步骤:<a href="https://github.com/zhheo/TimePlus/wiki/">https://github.com/zhheo/TimePlus/wiki/</a></p><p>Demo:<a href="https://plog.zhheo.com/">https://plog.zhheo.com/</a></p><p>在 Typecho 后台导航栏点击【撰写】,在自定义字段中填写图片地址。并填写文章标题和内容,即对应为图片的标题和简介。</p></blockquote><p>搭建步骤:</p><ol><li class="lvl-3"><p><a href="https://replit.com/">Replit</a> Create a Repl,环境选 SQLite;参照 <a href="https://github.com/valetzx/typechonreplit">@valetzx/typechonreplit</a> 执行 <code>git clone https://github.com/valetzx/typechonreplit && mv -b typechonreplit/* ./ && mv -b typechonreplit/.[^.]* ./ && rm -rf *~ && rm -rf typechonreplit</code>;注释 <code>main.sh</code> butterfly 相关行,<code>bash main.sh</code>;Run 运行;设置 Typecho 时选择 SQLite 数据库</p></li><li class="lvl-3"><p>按照 <a href="https://github.com/zhheo/TimePlus/wiki/%E7%AC%AC%E4%B8%80%E6%AC%A1%E4%B8%8A%E6%89%8B">TimePlus.Wiki</a> 设置,将 <a href="https://github.com/zhheo/TimePlus/releases">Source code</a> 解压上传 Replit Repl 对应路径,按步骤设置</p></li><li class="lvl-3"><p>图片仓库批量获取图片 URL <code>ls ./bj |awk '{print "https://mycpen.gitee.io/cdn2/image/bj/"$1""}' > C:/Users/Administrator/Desktop/TimePlus.txt</code></p></li><li class="lvl-3"><p>Replit Repl 绑自定义域名,需先 TXT 记录认证(因验证问题无法使用 https)</p></li></ol><p>相关链接:</p><ol><li class="lvl-3"><p><a href="https://github.com/zhheo/TimePlus/wiki/">https://github.com/zhheo/TimePlus/wiki/</a></p></li><li class="lvl-3"><p><a href="https://github.com/zhheo/TimePlus">https://github.com/zhheo/TimePlus</a></p></li><li class="lvl-3"><p><a href="https://github.com/valetzx/typechonreplit">https://github.com/valetzx/typechonreplit</a></p></li><li class="lvl-3"><p><a href="https://blog.zhheo.com/p/bed74f41.html">https://blog.zhheo.com/p/bed74f41.html</a></p></li><li class="lvl-3"><p><a href="https://replit.com/">Replit</a></p></li><li class="lvl-3"><p><a href="https://dns.console.aliyun.com/">阿里云.DNS</a></p></li></ol><h2 id="15-Git-修改提交信息">15. Git 修改提交信息<a class="header-anchor" href="#15-Git-修改提交信息"></a></h2><p><strong>2023-12-13 更新</strong></p><p>使用 <code>git rebase -i HEAD~<n></code> 修改最近某一次的提交信息,以下来自 chatgpt</p><blockquote><p>当您执行 <code>git rebase -i HEAD~<n></code> 命令时,会打开一个交互式的编辑器界面,列出最近 <code><n></code> 个提交。下面是一个示例,假设您要修改最近的前三次提交的提交信息:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">pick 1a2b3c4 Commit message 1</span><br><span class="line">pick 5d6e7f8 Commit message 2</span><br><span class="line">pick 9g0h1i2 Commit message 3</span><br></pre></td></tr></table></figure><p>要修改提交信息,将每个提交的行的开头的 <code>pick</code> 改为 <code>reword</code> 或 <code>r</code>,然后保存并关闭编辑器。修改后的示例如下:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">reword 1a2b3c4 Commit message 1</span><br><span class="line">reword 5d6e7f8 Commit message 2</span><br><span class="line">reword 9g0h1i2 Commit message 3</span><br></pre></td></tr></table></figure><p>保存并关闭编辑器后,Git 会逐个应用这些提交,并在每个提交之前暂停并等待您编辑提交信息。对于每个提交,Git 会打开一个新的编辑器窗口,允许您修改提交信息。完成修改后,保存并关闭编辑器。</p><p>请注意,如果在 rebase 过程中出现冲突,您需要解决冲突并使用 <code>git add</code> 命令将解决后的文件标记为已解决。然后,继续进行 rebase,直到所有提交都被处理完毕。</p><p>完成 rebase 后,您可以使用 <code>git log</code> 命令验证提交信息是否已成功修改。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git log</span><br></pre></td></tr></table></figure><p>如果要将修改的提交信息推送到远程仓库,您需要使用 <code>git push --force</code> 命令,因为您已经修改了历史提交。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git push --force</span><br></pre></td></tr></table></figure><p>请确保在进行此操作之前备份您的代码,并与团队成员进行沟通,以免影响其他人的工作。</p></blockquote><hr><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">git commit --amend</span><br><span class="line">git push --force <remote-name> <branch-name></span><br><span class="line"></span><br></pre></td></tr></table></figure><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202305131749192.png" alt="image-20230513174958143" style="zoom: 80%;" /></blockquote><blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">log</span> --oneline</span><br><span class="line">git commit --amend -m <span class="string">"新的提交信息"</span></span><br><span class="line">git push --force origin master</span><br><span class="line"></span><br></pre></td></tr></table></figure><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202305131751216.png" alt="image-20230513175153157" style="zoom: 67%;" /></blockquote><h2 id="16-GitHub-BiliBiliToolPro">16. GitHub: BiliBiliToolPro<a class="header-anchor" href="#16-GitHub-BiliBiliToolPro"></a></h2><p>地址:<a href="https://github.com/RayWangQvQ/BiliBiliToolPro">https://github.com/RayWangQvQ/BiliBiliToolPro</a></p><p><a href="https://github.com/RayWangQvQ/BiliBiliToolPro/blob/main/docs/runInLocal.md#3-linux">本地部署</a>:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">pwd</span></span><br><span class="line">/root/sh_file/BiliBiliToolPro</span><br><span class="line"></span><br><span class="line">$ wget https://github.com/RayWangQvQ/BiliBiliToolPro/releases/download/1.0.3/bilibili-tool-pro-v1.0.3-linux-x64.zip</span><br><span class="line">$ unzip bilibili-tool-pro-v1.0.3-linux-x64.zip</span><br><span class="line">$ <span class="built_in">cd</span> ./linux-x64/</span><br><span class="line">$ ./Ray.BiliBiliTool.Console --runTasks=Login</span><br><span class="line"></span><br></pre></td></tr></table></figure><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$ crontab -l</span><br><span class="line">0 1 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=VipBigPoint</span><br><span class="line">0 8 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=Daily</span><br><span class="line">* */12 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=LiveLottery</span><br><span class="line">0 16 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=UnfollowBatched</span><br><span class="line">0 20 * * * <span class="built_in">cd</span> /root/sh_file/BiliBiliToolPro/linux-x64; ./Ray.BiliBiliTool.Console --runTasks=LiveFansMedal</span><br><span class="line"></span><br></pre></td></tr></table></figure><h2 id="17-GitHub-Compare">17. GitHub Compare<a class="header-anchor" href="#17-GitHub-Compare"></a></h2><p>原文:<a href="https://akilar.top/posts/bbf68ad4/">https://akilar.top/posts/bbf68ad4/</a></p><p>示例:<a href="https://github.com/jerryc127/hexo-theme-butterfly/compare/4.8.5...4.9.0">https://github.com/jerryc127/hexo-theme-butterfly/compare/4.8.5...4.9.0</a></p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202309161502336.png" alt="image-20230916150258235" style="zoom:50%;" /><h2 id="18-new-Date-getFullYear">18. new Date().getFullYear();<a class="header-anchor" href="#18-new-Date-getFullYear"></a></h2><p>JavaScript 获取当前年份</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 要以自动方式获取明年的年份并将其用于创建日期对象,您可以按如下方式修改代码:</span></span><br><span class="line"><span class="keyword">const</span> currentYear = <span class="keyword">new</span> <span class="title class_">Date</span>().<span class="title function_">getFullYear</span>();</span><br><span class="line"><span class="keyword">const</span> nextYear = currentYear + <span class="number">1</span>;</span><br><span class="line"><span class="keyword">const</span> newYearTimestamp = <span class="keyword">new</span> <span class="title class_">Date</span>(<span class="string">`<span class="subst">${nextYear}</span>-01-01 00:00:00`</span>).<span class="title function_">getTime</span>() / <span class="number">1000</span>;</span><br><span class="line"></span><br></pre></td></tr></table></figure><h2 id="19-JavaScript-解码-Base64">19. JavaScript 解码 Base64<a class="header-anchor" href="#19-JavaScript-解码-Base64"></a></h2><p>在线加密:<a href="https://encode.chahuo.com/">https://encode.chahuo.com/</a></p><p>以下来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p>在 JavaScript 中解码 Base64 编码的数据,你可以使用 <code>atob()</code> 函数。该函数可以将 Base64 编码的字符串解码为原始的文本数据。示例代码如下:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> base64String = <span class="string">"SGVsbG8gd29ybGQ="</span>; <span class="comment">// Base64 编码的字符串</span></span><br><span class="line"><span class="keyword">const</span> decodedString = <span class="title function_">atob</span>(base64String); <span class="comment">// 解码</span></span><br><span class="line"><span class="variable language_">console</span>.<span class="title function_">log</span>(decodedString); <span class="comment">// 输出解码后的字符串</span></span><br></pre></td></tr></table></figure><p>在这个例子中,<code>base64String</code> 你要解码Base64编码的字符串。使用<code>atob()</code>函数对它进行解码,然后你就可以处理解码后的原始字符串了。</p></blockquote><h2 id="20-JavaScript-取绝对值">20. JavaScript 取绝对值<a class="header-anchor" href="#20-JavaScript-取绝对值"></a></h2><p>来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p>在 JavaScript 中,你可以使用 <code>Math.abs()</code> 函数来获取一个数的绝对值,从而去除负号。例如:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> num = -<span class="number">5</span>;</span><br><span class="line"><span class="keyword">let</span> absNum = <span class="title class_">Math</span>.<span class="title function_">abs</span>(num); <span class="comment">// absNum将是5</span></span><br></pre></td></tr></table></figure><p>这样,<code>absNum</code> 将会取得 <code>num</code> 的绝对值,而不考虑其正负。</p></blockquote><h2 id="21-JavaScript-三元运算">21. JavaScript 三元运算<a class="header-anchor" href="#21-JavaScript-三元运算"></a></h2><p>来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p>你可以使用条件运算符(三元运算符)来判断 <code>e - now1</code> 是否大于 0,然后决定是否执行 +1。下面是优化后的代码:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> daysDifference = <span class="title class_">Math</span>.<span class="title function_">floor</span>(((e - now1) / <span class="number">1e3</span> / <span class="number">60</span> / <span class="number">60</span> / <span class="number">24</span>) + (e - now1 > <span class="number">0</span> ? <span class="number">1</span> : <span class="number">0</span>));</span><br></pre></td></tr></table></figure><p>这行代码首先计算 <code>(e - now1) / 1e3 / 60 / 60 / 24</code> 得到天数差,然后根据 <code>(e - now1 > 0)</code> 条件判断天数差是否大于 0,如果是则加 1,否则加 0。最后使用 <code>Math.floor</code> 向下取整。</p></blockquote><h2 id="22-Snipaste-截图格式改-JPG">22. Snipaste 截图格式改 JPG<a class="header-anchor" href="#22-Snipaste-截图格式改-JPG"></a></h2><p>参考:<a href="https://jingyan.baidu.com/article/25648fc14b3276d091fd00c3.html">https://jingyan.baidu.com/article/25648fc14b3276d091fd00c3.html</a></p><p>右键 → 首选项 → 输出 → 文件名.后缀</p><p>实测大大减少图片体积,500 KB (PNG) → 70KB (JPG)</p><p>仅适用于保存为本地文件,从剪贴板中粘贴到 typora 里还是 PNG 格式的</p><p>本人格式:<code>image-$yyyyMMddHHmmsszzz$.jpg</code>,目的 与 typora 剪贴板 上场时的 alt 命名保持一致</p><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202310070313815.jpg" alt="image-20231007031301508" style="zoom: 25%;" /><h2 id="23-CSS-视口单位-dvh-svh-lvh">23. CSS 视口单位 dvh, svh, lvh<a class="header-anchor" href="#23-CSS-视口单位-dvh-svh-lvh"></a></h2><p>参考:</p><ol><li class="lvl-3"><p><a href="https://blog.anheyu.com/posts/e644.html">https://blog.anheyu.com/posts/e644.html</a></p></li><li class="lvl-3"><p><a href="https://blog.csdn.net/LuckyWinty/article/details/128962918">https://blog.csdn.net/LuckyWinty/article/details/128962918</a></p></li></ol><h2 id="24-CSS-旋转-rotate-90deg">24. CSS 旋转 rotate(90deg)<a class="header-anchor" href="#24-CSS-旋转-rotate-90deg"></a></h2><p>来自 <a href="https://chat-shared2.zhile.io/">ChatGPT</a></p><blockquote><p><code>rotate(90deg)</code> 是CSS中的旋转变换指令,用于将元素顺时针旋转90度。这可以应用于任何HTML元素,使其在页面上以指定角度旋转。</p><p>逆时针旋转一个元素90度,<code>rotate(-90deg)</code></p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.about-page-chicken-soup</span> <span class="selector-tag">details</span><span class="selector-attr">[open]</span>><span class="selector-tag">summary</span><span class="selector-pseudo">:after</span> {</span><br><span class="line"> <span class="attribute">transform</span>: <span class="built_in">rotate</span>(-<span class="number">90deg</span>);</span><br><span class="line">}</span><br></pre></td></tr></table></figure></blockquote><h2 id="25-Markdown-折叠语法">25. Markdown 折叠语法<a class="header-anchor" href="#25-Markdown-折叠语法"></a></h2><p>参考:<a href="https://blog.csdn.net/ybb_ymm/article/details/128508243">https://blog.csdn.net/ybb_ymm/article/details/128508243</a></p><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="language-xml"><span class="tag"><<span class="name">details</span>></span></span> </span><br><span class="line"><span class="code"> <summary>指示标题</summary></span></span><br><span class="line"><span class="code"> 内容</span></span><br><span class="line"><span class="code"></details></span></span><br></pre></td></tr></table></figure><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="language-xml"><span class="tag"><<span class="name">details</span>></span></span> </span><br><span class="line"><span class="code"> <summary>展开查看</summary></span></span><br><span class="line"><span class="code"> <pre><code></span></span><br><span class="line"><span class="code"> 此处为代码的块具体内容</span></span><br><span class="line"><span class="code"> </code></pre> </span></span><br><span class="line"><span class="code"></details></span></span><br></pre></td></tr></table></figure><h2 id="26-PicGo-图片压缩插件">26. PicGo 图片压缩插件<a class="header-anchor" href="#26-PicGo-图片压缩插件"></a></h2><p>插件名:<a href="https://github.com/liujinpen/picgo-plugin-compress-tinypng">picgo-plugin-compress-tinypng</a></p><p>NPM 包:<a href="https://www.npmjs.com/package/picgo-plugin-tinypng">picgo-plugin-tinypng</a></p><p>TinyPNG</p><ul class="lvl-0"><li class="lvl-2"><p>官网:<a href="https://tinify.cn/">https://tinify.cn/</a></p></li><li class="lvl-2"><p>获取 Key 参考:<a href="https://bearcai.com/index.php/archives/44/">https://bearcai.com/index.php/archives/44/</a><br><img src="https://dlvr.cpen.top/gh/mycpen/image_bed/image/202310070421963.jpg" alt="image-20231007042117896" style="zoom:25%;" /></p></li><li class="lvl-2"><p>Key 限额 500 次/月:<a href="https://tinify.cn/dashboard/api">https://tinify.cn/dashboard/api</a></p></li></ul><p>起因:<a href="https://github.com/juzisang/picgo-plugin-compress">picgo-plugin-compress</a> 长久失修,picgo 2.3.1 报错 <code>TypeError: req.end is not a function</code>。 <a href="https://github.com/juzisang/picgo-plugin-compress/issues/64#issuecomment-1504939740">issue#64</a> 获知此插件</p><h2 id="27-JavaScript-copy-事件">27. JavaScript copy 事件<a class="header-anchor" href="#27-JavaScript-copy-事件"></a></h2><p>来自 ChatGPT</p><p>要检测用户是否复制内容,你可以使用JavaScript中的<code>copy</code>事件来捕获复制操作。你可以将事件监听器绑定到<code>copy</code>事件上,然后在该事件触发时执行相应的操作,以获知用户是否复制了内容。</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">document</span>.<span class="title function_">addEventListener</span>(<span class="string">'copy'</span>, <span class="keyword">function</span>(<span class="params">event</span>) {</span><br><span class="line"> <span class="comment">// 在这里执行你想要的操作,例如记录复制操作或发送数据到服务器</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">'用户复制了内容'</span>);</span><br><span class="line">});</span><br></pre></td></tr></table></figure><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">document</span>.<span class="title function_">addEventListener</span>(<span class="string">'copy'</span>, <span class="keyword">function</span>(<span class="params">event</span>) {</span><br><span class="line"> <span class="comment">// 获取复制的内容</span></span><br><span class="line"> <span class="keyword">var</span> copiedText = <span class="variable language_">window</span>.<span class="title function_">getSelection</span>().<span class="title function_">toString</span>().<span class="title function_">trim</span>();</span><br><span class="line"> </span><br><span class="line"> <span class="comment">// 检查复制的内容是否为空</span></span><br><span class="line"> <span class="keyword">if</span> (copiedText.<span class="property">length</span> > <span class="number">0</span>) {</span><br><span class="line"> <span class="comment">// 在这里执行你想要的操作,例如记录复制操作或发送数据到服务器</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">'用户复制了内容:'</span>, copiedText);</span><br><span class="line"> } <span class="keyword">else</span> {</span><br><span class="line"> <span class="comment">// 复制的内容为空,可以选择不执行任何操作或者执行相应处理</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">'用户尝试复制空内容'</span>);</span><br><span class="line"> }</span><br><span class="line">});</span><br></pre></td></tr></table></figure><h2 id="28-JavaScript-window-onresize">28. JavaScript window.onresize<a class="header-anchor" href="#28-JavaScript-window-onresize"></a></h2><p>来自:ChatGPT</p><p><code>window.onresize</code> 是 JavaScript 中的一个事件处理属性,它用于指定在浏览器窗口大小改变时要执行的函数。当用户调整浏览器窗口的大小时,就会触发 <code>resize</code> 事件,如果你将一个函数分配给 <code>window.onresize</code>,那么这个函数将在窗口大小改变时被调用。</p><p>例如,你可以使用以下方式监听窗口大小改变事件并执行相应的操作:</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">window</span>.<span class="property">onresize</span> = <span class="keyword">function</span>(<span class="params"></span>) {</span><br><span class="line"> <span class="comment">// 在窗口大小改变时执行的代码</span></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">"窗口大小已改变"</span>);</span><br><span class="line">};</span><br></pre></td></tr></table></figure><p>这对于创建响应式设计或根据窗口大小进行布局调整等任务非常有用。当窗口大小发生变化时,你可以根据需要更新页面内容、样式或执行其他自定义操作。</p><h2 id="29-Git-指定远端">29. Git 指定远端<a class="header-anchor" href="#29-Git-指定远端"></a></h2><p>参考:<a href="http://www.mobiletrain.org/about/BBS/161969.html">http://www.mobiletrain.org/about/BBS/161969.html</a></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git remote add origin <远程仓库URL></span><br><span class="line"></span><br><span class="line">git push <远程仓库别名> <本地分支名>:<远程分支名></span><br><span class="line"></span><br><span class="line">git push origin master:main</span><br></pre></td></tr></table></figure><h2 id="30-Git-删除文件历史提交记录">30. Git 删除文件历史提交记录<a class="header-anchor" href="#30-Git-删除文件历史提交记录"></a></h2><p>参考:ChatGPT</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git filter-branch --force --index-filter <span class="string">'git rm -r --cached --ignore-unmatch node_modules'</span> --prune-empty --tag-name-filter <span class="built_in">cat</span> -- --all</span><br><span class="line">git <span class="built_in">rm</span> --cached node_modules -r</span><br><span class="line"></span><br><span class="line">git reflog expire --expire=now --all && git gc --prune=now --aggressive</span><br></pre></td></tr></table></figure><p>ChatGPT 还提供了 <code>git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD</code> 命令删除,运行时间过长,不采用,给出的解释:命令1 使用了 <code>--index-filter</code> 和 <code>--cached</code>,这些参数可以更快地处理 Git 的索引而不需要检查和修改实际的工作树文件</p><blockquote><ol><li class="lvl-3"><p><code>git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD</code>:</p><ul class="lvl-3"><li class="lvl-5">使用 <code>--tree-filter</code> 参数,它会在每个提交上执行指定的 shell 命令。在这种情况下,它会执行 <code>rm -rf node_modules</code> 命令来删除 <code>node_modules</code> 目录。</li><li class="lvl-5">使用 <code>--prune-empty</code> 选项以删除空提交。</li><li class="lvl-5">只作用于当前分支 <code>HEAD</code>。</li></ul></li><li class="lvl-3"><p><code>git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch node_modules' --prune-empty --tag-name-filter cat -- --all</code>:</p><ul class="lvl-3"><li class="lvl-5">使用 <code>--index-filter</code> 参数,它会在 Git 索引上执行指定的命令。在这种情况下,它会执行 <code>git rm -r --cached --ignore-unmatch node_modules</code> 命令,以将 <code>node_modules</code> 从索引中删除。</li><li class="lvl-5">使用 <code>--prune-empty</code> 选项以删除空提交。</li><li class="lvl-5">使用 <code>--tag-name-filter cat</code> 选项,以保留提交的标签(tags)。</li><li class="lvl-5">使用 <code>--all</code> 来指定作用于所有分支。</li></ul></li></ol><hr><p>之前上传 github 时提交了无需提交的 node_modules,如何缩小 .git 的大小</p><p>ChatGPT:要缩小.git目录的大小,可以采取以下步骤:</p><ol><li class="lvl-3"><p>清理历史提交中的node_modules:首先,你需要清理历史提交中的不必要的node_modules目录。你可以使用<code>git filter-branch</code>命令或<code>git filter-repo</code>工具来重写历史提交以删除node_modules。确保在删除之前备份你的仓库,以防发生问题。</p></li><li class="lvl-3"><p>使用.gitignore:在项目根目录下创建一个名为<code>.gitignore</code>的文件,并将<code>node_modules/</code>添加到其中,以确保不再将该目录包括在提交中。</p></li><li class="lvl-3"><p>执行<code>git rm --cached node_modules -r</code>:这将删除当前暂存区中的node_modules目录,但不会删除物理文件。然后,提交这一变更。</p></li><li class="lvl-3"><p>执行<code>git reflog expire --expire=now --all</code>:这将清理Git的reflog,以确保不再保留对不必要历史提交的引用。</p></li><li class="lvl-3"><p>执行<code>git gc --prune=now</code>:这将触发垃圾收集,清理不必要的数据,从而缩小.git目录的大小。</p></li><li class="lvl-3"><p>推送到远程仓库:如果你使用远程仓库(如GitHub),确保将这些更改推送到远程仓库以同步它们。</p></li></ol><p>请注意,这些步骤会修改你的Git历史,因此在执行它们之前务必小心,确保已备份你的仓库数据。</p></blockquote><h2 id="31-洛雪音乐导入三方音源">31. 洛雪音乐导入三方音源<a class="header-anchor" href="#31-洛雪音乐导入三方音源"></a></h2><p>官方源因 TX 警告而报废,详见 issue:<a href="https://github.com/lyswhut/lx-music-desktop/issues/1643">https://github.com/lyswhut/lx-music-desktop/issues/1643</a></p><p>详见 issue:<a href="https://github.com/lyswhut/lx-music-desktop/issues/1649#issuecomment-1774536022">https://github.com/lyswhut/lx-music-desktop/issues/1649#issuecomment-1774536022</a></p><p>仓库:<a href="https://github.com/OneCodeMonkey/music-sources">https://github.com/OneCodeMonkey/music-sources</a></p><h2 id="32-Clash-GUI">32. Clash GUI<a class="header-anchor" href="#32-Clash-GUI"></a></h2><p>起因:<a href="https://github.com/Fndroid/clash_for_windows_pkg">Clash for Windows</a> 删库</p><p>Clash Verge:<a href="https://github.com/zzzgydi/clash-verge/">https://github.com/zzzgydi/clash-verge/</a></p><p>Clash for Android 存档:<a href="https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/tag/CFA">https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/tag/CFA</a></p><p>Clash for Windows 存档:<a href="https://github.com/Z-Siqi/Clash-for-Windows_Chinese">https://github.com/Z-Siqi/Clash-for-Windows_Chinese</a></p><h2 id="33-GitHub-SSH-超时">33. GitHub SSH 超时<a class="header-anchor" href="#33-GitHub-SSH-超时"></a></h2><p><code>git pull</code> 报超时、<code>ping github.com</code> 报超时</p><p>解决方案</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># git bash 终端</span></span><br><span class="line">vim ~/.ssh/config</span><br></pre></td></tr></table></figure><p>内容如下,第一次 <code>git pull</code> 时输入 <code>yes</code></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># GitHub Start</span></span><br><span class="line">Host github.com</span><br><span class="line"> Hostname ssh.github.com</span><br><span class="line"><span class="comment"># GitHub End</span></span><br></pre></td></tr></table></figure><p>参考</p><ol><li class="lvl-3"><p><a href="https://blog.ttiee.tech/posts/2024/71e1/">https://blog.ttiee.tech/posts/2024/71e1/</a></p></li><li class="lvl-3"><p><a href="https://ww-rm.github.io/posts/2024/01/17/githubssh-timeout/">https://ww-rm.github.io/posts/2024/01/17/githubssh-timeout/</a></p></li><li class="lvl-3"><p>github <a href="https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-port">Using SSH over the HTTPS port</a></p></li><li class="lvl-3"><p>github <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-githubs-ip-addresses">About GitHub’s IP addresses</a></p></li></ol><h2 id="34-Hexo-隐藏文章">34. Hexo 隐藏文章<a class="header-anchor" href="#34-Hexo-隐藏文章"></a></h2><p>参考:<a href="https://blog.jiejaitt.tech/posts/1c5dc392.html">JIeJaitt | Hexo隐藏文章</a></p><ol><li class="lvl-3"><p><code>Front-Matter</code> 配置 <code>published</code> 参数</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">---</span></span><br><span class="line"><span class="attr">title:</span> <span class="string">Foo</span></span><br><span class="line"><span class="attr">published:</span> <span class="literal">false</span></span><br><span class="line"><span class="meta">---</span></span><br></pre></td></tr></table></figure></li><li class="lvl-3"><p>存为草稿</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 路径 source/_drafts/</span></span><br><span class="line">hexo new draft <title></span><br></pre></td></tr></table></figure></li><li class="lvl-3"><p>插件,hexo-hide-posts 等</p></li></ol><p>官方参考</p><ol><li class="lvl-3"><p><a href="https://hexo.io/docs/front-matter#Settings-Their-Default-Values">https://hexo.io/docs/front-matter#Settings-Their-Default-Values</a></p></li><li class="lvl-3"><p><a href="https://hexo.io/zh-cn/docs/writing.html">https://hexo.io/zh-cn/docs/writing.html</a></p></li></ol>]]></content>
|
242
242
|
|
243
243
|
|
244
244
|
<categories>
|