我们相信您已经对 Docker 有了一定了解,如果没有,请自行百度。以下脚本为作者自用,仅供参考,不保证绝对的通用性
Dockerfile
1 | FROM ubuntu:latest |
start.sh
请在构建前确保此脚本有执行权限
1 |
|
reset.sh
请在开启自动重置前确认此脚本有执行权限
1 |
|
auto_reset.sh
自动重置脚本,需要 root 权限
1 | while (true); |
我们相信您已经对 Docker 有了一定了解,如果没有,请自行百度。以下脚本为作者自用,仅供参考,不保证绝对的通用性
1 | FROM ubuntu:latest |
请在构建前确保此脚本有执行权限
1 |
|
请在开启自动重置前确认此脚本有执行权限
1 |
|
自动重置脚本,需要 root 权限
1 | while (true); |
Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。
从上面的介绍我们可以注意到这个东西:
即可利用靓丽的主题生成静态网页。
也就是说,我们可以很容易的将基于 Hexo 搭建的博客系统运行在 Github Pages 上
这意味着:能白嫖!能白嫖!(参见:《如何用最少的钱开一个网站?》)
您需要先准备以下环境:
使用 npm 安装 hexo
1 | # Windows |
之后,使用 hexo init
命令初始化您的博客
1 | hexo init [目录名称] |
如果不传入
[目录名称]
参数,hexo-cli 在当前目录下初始化博客
创建完成后,目标目录看起来像这样
1 | . |
您需要按自己需求修改 hexo 站点配置(_config.yml
)文件,参考 配置 | Hexo
一般来说,您只需要修改以下配置项:
title
:站点标题subtitle
:站点副标题author
:作者名,也就是您的名字language
:语言,可直接设为zh-CN
timezone
:时区,可直接设为Asia/Shanghai
url
:站点网址您可以在站点根目录使用hexo server
指令启动 hexo 自带的服务器,之后使用浏览器访问 127.0.0.1:4000
查看您的更改
您可以前往这里选择您的主题
部分主题可以直接用 npm 安装
部分主题需要您下载压缩包并解压到themes
目录下
随后,修改 hexo 站点配置,将them
项改为您的主题
部分主题可能会拥有自己的配置文件,主题配置在博客根目录下的
_config.主题名.yml
内(可能需要您手动复制/创建),具体参见主题的 README.md 文件
具体部署方法详见在 Github 上部署 Hexo
如果您是使用 git 创建仓库或您修改了设置,您的仓库的默认分支名称可能为master
或其他而不是main
请修推送改指令为:
1 | git push -u origin 您分支的名称,如master |
和.github/workflows/pages.yml
的on.push.branches
项
1 |
|
在每次推送后,github 会自动执行编译任务
如果您的仓库名不是用户名.github.io,默认请在
用户名.github.io/仓库名
访问您的博客
因为 Hexo 是静态,所以 Hexo 默认不带有评论
可以使用gitalk
、gitment
等将issue作为您博客的评论,具体参考其项目主页
但是此处有大坑需要注意
上文提到的两个评论插件会要求您申请 OAuth APP以登录github帐号,进入 Strring>Developer strring
创建
Application name
:您的站点名Homepage URL
:您的博客首页URLAuthorization callback URL
:回调URL回调URL 需要填您的博客所使用的协议(一般是https://
)+所在的域名(一般不含二级域名)
比如本博客的主页地址为:https://blog.thisisxd.top/index.html
则 回调URL 为:https://thisisxd.top
如果 回调URL 错误,登录就会返回error
具体多试试,不成功可以在下面发评论问
请先将域名解析到 用户名.github.io!
- 进入仓库,点击【Settings】
- 点击【Pages】
- 在【Custom domain】的输入框填入域名后点击【Save】
详见:https://docs.github.com/articles/using-a-custom-domain-with-github-pages/
和 github page 差不多
这些资源其中大部分是我自己正在用的,就拿我自己网站来说吧
kod.thisisxd.top云盘FTP储存:freehost
blog.thisisxd.top、cloud.thisisxd.top主机:雨云
CDN:CloudFlare
域名:阿里云
pay.thisisxd.top、www.thisisxd.top:Github Page>
温馨提示:本文可能已经过时
接口名称 | 请求方式 | URL | 参数 | 说明 |
Cave Json Data | GET | http://124.222.63.135:8000/ | / | 将ITCraft cave数据(ini)使用JSON格式输出 源数据由 xxtg666 提供 |
随机回声洞数据 | GET | http://124.222.63.135:8001/ | / | 从Cave Json Data中随机选取一项回声洞数据返回 已屏蔽所有数据删除及图片 |
镜像 | GET | http://124.222.63.135:8002/<url>/ | <url>:原网页 | 一个没有任何用处的镜像站, 一般人访问不了的这玩意也访问不了 |
随机回声洞文本 | GET | http://124.222.63.135:8192/ | / | 在 随机回声洞数据 的基础上只返回回声洞的内容 |
备注:所有接口服务器编码默认采用 UTF-8
pip is the package installer for Python. You can use it to install packages from the Python Package Index and other indexes.
——pip.pypa.io
鲁迅先生曾经说过这样一句话:“没有pip的Python是没有灵魂的(是不是有点过了)。”
但是,很多人在使用pip的时候,或多或少会遇到这种情况:
[xiaodeng@xd-pc ~]$ python3 -m pip
/usr/bin/python3: No module named pip
如果你遇到了这个提示,那么恭喜你,你 的 Python 没 装 pip!
其实,这种情况很好解决,但是我曾经也被整的晕头转向,话不多说,上解决方案!
可以吧这一段代码复制到终端执行:
wget https://bootstrap.pypa.io/get-pip.py
python3 ./get-pip.py
rm ./get-pip.py
输出(因人而异):
[xiaodeng@xd-pc ~]$ wget https://bootstrap.pypa.io/get-pip.py
--2021-12-11 15:07:06-- https://bootstrap.pypa.io/get-pip.py
SSL_INIT
已载入 CA 证书“/etc/ssl/certs/ca-certificates.crt”
正在解析主机 bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.76.175, 2a04:4e42:12::175
正在连接 bootstrap.pypa.io (bootstrap.pypa.io)|151.101.76.175|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2159352 (2.1M) [text/x-python]
正在保存至: “get-pip.py”
get-pip.py 100%[===================>] 2.06M 3.34MB/s 用时 0.6s
2021-12-11 15:07:07 (3.34 MB/s) - 已保存 “get-pip.py” [2159352/2159352])
[xiaodeng@xd-pc ~]$ python3 ./get-pip.py
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
|████████████████████████████████| 1.7 MB 1.7 MB/s
Collecting wheel
Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, pip
Successfully installed pip-21.3.1 wheel-0.37.0
[xiaodeng@xd-pc ~]$ rm ./get-pip.py
[xiaodeng@xd-pc ~]$
[xiaodeng@xd-pc ~]$ python3 -m pip
Usage:
/usr/bin/python3 -m pip <command> [options]
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies.
config Manage local and global configuration.
search Search PyPI for packages.
cache Inspect and manage pip's wheel cache.
index Inspect information available from package indexes.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
debug Show information useful for debugging.
help Show help for commands.
General Options:
-h, --help Show help.
--debug Let unhandled exceptions propagate outside the
main subroutine, instead of logging them to
stderr.
--isolated Run pip in an isolated mode, ignoring
environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be
used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be
used up to 3 times (corresponding to WARNING,
ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--no-input Disable prompting for input.
--proxy <proxy> Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should
attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host or host:port pair as trusted,
even though it does not have valid or any HTTPS.
--cert <path> Path to PEM-encoded CA certificate bundle. If
provided, overrides the default. See 'SSL
Certificate Verification' in pip documentation
for more information.
--client-cert <path> Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
--no-color Suppress colored output.
--no-python-version-warning
Silence deprecation warnings for upcoming
unsupported Pythons.
--use-feature <feature> Enable new functionality, that may be backward
incompatible.
--use-deprecated <feature> Enable deprecated functionality, that will be
removed in the future.
[xiaodeng@xd-pc ~]$