image frame

博客

知足常乐

67.文件传输工具汇总

1.snapdrop (仅限局域网)
snapdrop官方网站:点击此处
网页加载完成后即可发现对方设备,单击对方设备选择文件完成文件传输
snapdrop的GitHub项目页:点击此处

2.piping (貌似是通过服务器中转传输,可能效果和速度比较不好)
piping官方网站:点击此处
选择要上传的文件后双方输入同样的Secret path即可进行文件或文本传输
piping-server的GitHub项目页:点击此处

3.transfer (.zip域名,比较旧的浏览器可能无法正确访问)
transfer官方网站:点击此处
选择文件点击send后会跳出二维码,扫码或复制访问链接即可进行文件传输
transfer的GitHub项目页:点击此处

4.deershare (小鹿快传)
deershare官方网站:点击此处
选择好要上传文件后会出现收件码,接收端选择接收页面并填入收件码即可
deershare的GitHub项目页:点击此处

5.PP直连
PP直连官方网站:点击此处
选择右侧的连接方式,通过账号、局域网、临时网址或短码进行互联
连接完成后点击设备图标或选择左侧功能即可使用

66.Bat自动提权与检测

Bat自动提权。在bat文件开头加入下面的命令则启动时会自动申请管理员权限

1
%1 start "" mshta vbscript:CreateObject("Shell.Application").ShellExecute("%~s0","::","%~dp0","runas",1)(window.close)&&exit

Bat管理员权限检测。下面命令加入到要检测的地方即可,如果仅检测无强制管理员要求,则改掉最后的exit命令

1
@(cacls "%SystemDrive%\System Volume Information" >nul 2>&1)||(echo 未赋予管理员权限&echo.&pause&exit /b)

参考出处:点击此处

65.压缩VHD文件

目前仅测试过vhd没有测试过vhdx,但理论上来说应该通用

1
(echo select vdisk file="vhd绝对路径" & echo detach vdisk & echo attach vdisk readonly & echo compact vdisk & echo detach vdisk)|diskpart

参考出处:点击此处

63.将Hexo推送至Github Pages

hexo-deployer-git的GitHub项目页:点击此处

1.安装hexo-deployer-git插件

1
npm install hexo-deployer-git --save

2.修改blog文件夹下的_config.yml
修改前:

1
2
3
4
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: ''

修改后:

1
2
3
4
5
6
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: git
repo: https://github.com/kukusun/kukusun.github.io.git
branch: master

3.推送至Github Pages
在自己的GitHub帐号中创建一个repository,名称为:用户名.github.io
设置git的邮箱与名称,以前设置过就无需再次设置

1
2
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

用命令推送:

1
hexo d

此时可能需要设置GitHub帐号的登陆,可以直接登录,也可以用token方式推送Blog
如果选择用token方式则点击此处跳转token管理界面
token创建步骤

  • 右上角Generate new token处选择Generate new token (classic)
  • Note写入自定义的名称
  • Expiration设置过期时间
  • Select scopes中将repo栏中的选项全部勾选

62.为Hexo文章生成永久固定链接

hexo-abbrlink的GitHub项目页:点击此处

1.安装hexo-abbrlink插件

1
npm install hexo-abbrlink --save

2.修改blog文件夹下的_config.yml
修改前:

1
2
3
4
5
6
7
8
# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://example.com
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks

修改后:

1
2
3
4
5
6
7
8
9
10
11
12
# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://example.com
#permalink: :year/:month/:day/:title/
permalink: posts/:abbrlink.html
abbrlink:
alg: crc32 #算法: crc16(default) and crc32
rep: hex #进制: dec(default) and hex
permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks

3.修改blog –> node_modules –> hexo-asset-image文件夹下的index.js
修改前:

1
2
3
4
5
6
7
8
9
if(/.*\/index\.html$/.test(link)) {
// when permalink is end with index.html, for example 2019/02/20/xxtitle/index.html
// image in xxtitle/ will go to xxtitle/index/
appendLink = 'index/';
var endPos = link.lastIndexOf('/');
}
else {
var endPos = link.length-1;
}

修改后:

1
2
3
4
5
6
7
8
9
if(/.*\/index\.html$/.test(link)) {
// when permalink is end with index.html, for example 2019/02/20/xxtitle/index.html
// image in xxtitle/ will go to xxtitle/index/
appendLink = 'index/';
var endPos = link.lastIndexOf('/');
}
else {
var endPos = link.length-5;
}

参考出处:点击此处

  • Copyrights © 2023-2024 kukusun