找到
26
篇与
ioip的博客
相关的结果
-
在CentOS 7.6上编译安装Python 3.8完整指南 CentOS 7.6 源码编译安装Python 3.8教程 本文详细介绍在CentOS 7系统上编译安装Python 3.8的完整流程。 请提前执行centos7换源命令确保yum工具正常 sed -i -r -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#?baseurl=http://mirror.centos.org/centos|baseurl=https://vault.centos.org/centos|g' -e 's|^#?baseurl=http://mirror.centos.org/altarch|baseurl=https://vault.centos.org/altarch|g' -e 's|^#?baseurl=http://download.fedoraproject.org|baseurl=http://download.fedoraproject.org|g' /etc/yum.repos.d/CentOS-*.repo yum clean all && yum makecache 1.安装编译依赖 yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make 2.安装额外依赖 yum install libffi-devel -y 3.下载Python源码 wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz 4. 解压源码包 tar -zxvf Python-3.8.12.tgz 5. 进入源码目录 cd Python-3.8.12 6. 配置编译选项 ./configure 7. 编译并安装 make&&make install 8. 备份系统Python mv /usr/bin/python /usr/bin/python.bak 9 创建软链接 ln -s /usr/local/bin/python3 /usr/bin/python ln -s /usr/local/bin/pip3 /usr/bin/pip -
butterfly主题在hexo中的配置 1. 安装Butterfly主题 方法一:Git克隆(推荐) bash cd themes git clone https://github.com/jerryc127/hexo-theme-butterfly.git --depth=1 方法二:手动下载 从Butterfly Releases下载最新版 解压到themes/butterfly目录 2. 去除子模块绑定 步骤说明 bash 解除子模块关联 git rm --cached themes/butterfly rm -rf themes/butterfly/.git 清理残留配置(可选) git config -f .gitmodules --remove-section submodule.themes/butterfly rm -rf .git/modules/themes/butterfly 文件结构验证 确保处理后目录包含: themes/butterfly/ ├── _config.yml # 主配置文件(27KB) ├── layout/ # 模板文件 ├── source/ # 静态资源 ├── scripts/ # 脚本文件 └── languages/ # 多语言文件 3. 推送到GitHub仓库 配置Hexo 修改_config.yml: yaml theme: butterfly 提交变更 bash git add themes/butterfly git commit -m "feat: 添加butterfly主题并解除子模块" git push origin main 4. 主题更新方法 手动更新 备份_config.yml和自定义文件 覆盖themes/butterfly目录 恢复配置文件 自动化建议 yaml .github/workflows/update-theme.yml jobs: update: steps: uses: actions/checkout@v4 run: | rm -rf themes/butterfly git clone https://github.com/jerryc127/hexo-theme-butterfly themes/butterfly cp custom_config.yml themes/butterfly/_config.yml 注意事项 操作前备份_config.yml(27KB配置文件) 不要提交themes/butterfly/.github/目录 使用.gitignore过滤临时文件: themes/butterfly/.github/ themes/butterfly/node_modules/ -
使用github actions部署hexo博客 参考文章 如何优雅的使用Github Action服务来将Hexo部署到Github Pages HEXO系列教程 | 使用GitHub部署静态博客HEXO | 小白向教程 GitHub 1.创建仓库 注册并登录一个GitHub账户【注册方法2.2 准备 GitHub】github-1图片主界面图片 点击头像,进入仓库主界面-头像图片仓库空图片 创建仓库【仓库名字为xx.github.io,并不是非要使用你的github的用户名作为xx,可以进行自定义,如我的为ioip.github.io】新建仓库图片建好了图片 2.获取token 点击头像- Settings-Developer Settings setting图片 在个人设置中新增一个Personal access tokens。至少要包含repo权限,然后记住token。 这个token是给Github Action用的,Github Action会把Hexo编译部署到gh-pages分支。token1图片token2图片token3图片token4图片 3.将token填入仓库 随后在存放Hexo代码的仓库里把这个Token新增进去,名称为GH_TOKEN(随意,后面需要一致)。 【注意:先回到仓库再点击setting】miyao1图片密钥2图片秒哟3图片 4.获取ssh密钥【用于解决推送文件时GitHub国内的网络问题】 你需要在本地电脑上面安装: nodejs(>16 版本,最新的应该有 20 版本):Node.js — Run JavaScript Everywhere git(2.44.0):Git – Downloads 在某一个盘里面创建一个文件夹,名字叫 hexo,然后右键选择 Open Git Bash Here 我们在里面输入git config --global user.name "你的 GitHub 用户名" git config --global user.email "你的 GitHub 邮箱" 我们在命令行窗口中输入ssh-keygen -t rsa -C "你的 GitHub 邮箱" 什么都不用管,一路回车就行。然后我们进入 C:\Users\ 用户名 .ssh 目录(勾选显示 “隐藏的项目”) 我们用记事本打开 id_rsa.pub 并复制里面的内容。keyssh1图片 这个时候我们回到 GitHub,进入 Settings:keyssh2图片 选择左边栏的 SSH and GPG keys,点击 New SSH key:keyssh3图片 Title 随便取,然后把 id_rsa.pub 里面的内容到复制到 Key 中,点击 Add SSH key:keyssh4图片 保存完毕以后,我们可以在本地验证一下连接。依旧在 Git Bash Here 界面中输入ssh -T git@github.com 出现 “Are you sure……”,输入 yes 回车确认。若出现下图的提示即连接成功:keyssh4图片 切换到ssh用于解决推送文件时GitHub国内的网络问题 $ git remote set-url origin git@github.com:luojunchong/PLAN.git 本地配置HEXO 1. 初始化Hexo 安装脚手架,初始化hexo,进入之前新建的hexo文件夹,进入后安装依赖。`npm install -g hexo-cli hexo init blog cd blog npm install ` 2. 初始化仓库 `git init git remote add origin https://github.com/yourusername/your-repo.git git add . git commit -m "Initial commit" git push -u origin main ` 3. 配置Github Action工作流 在.github文件夹下新增workflows文件夹,然后新增deploy.yml文件,内容如下。 里面有个node-version要和你本地的node一致。【使用node -v获取】 步骤大致意思就是使用ubuntu-latest作为基础环境,然后安装各种依赖,随后hexo generate生成博客网站静态文件夹, 把这个文件夹推送到同一仓库的gh-pages分支。`name: Deploy Hexo to GitHub Pages on: push: branches: - main # 当推送到 main 分支时触发 jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 with: submodules: false # 禁用子模块检查 - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: '18' - name: Install Dependencies run: npm install - name: Install Hexo Git Deployer run: | npm install hexo-deployer-git --save npm install hexo-cli -g - name: Clean and Generate Static Files run: | hexo clean hexo generate - name: Configure Git run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' - name: Deploy to GitHub Pages env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | cd public/ git init git add -A git commit -m "Create by workflows" git remote add origin https://${{ secrets.GH_TOKEN }}@github.com/yourusername/your-repo.git git push origin HEAD:gh-pages -f`3. 推送验证 把刚才更新的所有文件都推送一遍,github就会触发工作流,然后去网站看工作流运转的如何。 等一切运转完毕,就会发现仓库多出一个gh-pages分支。 `git add . git commit -m "Initial commit 2" git push -u origin main ` 4. 配置Github Pages 在仓库settings中配置page来源为gh-pages分支即可。等待网站部署完毕,就可以看了。网站链接可以在settings的GitHub Pages看到,也可以去action里看到。img3图片