yczh's blog


  • Home

  • About

  • Tags

  • Categories

  • Archives

  • Search

在macOS用虚拟机配置linux的坑

Posted on 2019-05-29

准备

  • macOS Mojave 10.14.4
  • VMware Fusion 11
  • Centos 7 镜像

配置

安装vmware 选择镜像安装。

问题:

  • 找不到可以连接的有效对等进程

系统偏好设置->安全性与隐私->开锁,允许vmware

  • 鼠标键盘输入没有反应

系统偏好设置->安全性与隐私->隐私->辅助功能允许vmware

之后配置网络。

1
cd /etc/sysconfig/network-scripts

找到一个名字类似于ifcfg-ens123的文件,一般名字不一样。vi编辑

ONBOOT=no 改成yes

然后随便ping一下,应该就可以了。

用hexo+github page建博客总结

Posted on 2019-05-03 | In hexo

总结

GitHub pages是用户托管在GitHub上的静态网页,我们可以免费使用GitHub提供的域名。hexo是一个自动生成静态网页博客的引擎。只需要在本地用hexo生成博客的静态网页,然后用hexo部署到GitHub仓库,就可以自动生成个人网站。

环境配置

  1. node.js
  2. git
安装node.js
  1. 先安装nvm, 终端输入

    1
    $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.2/install.sh | bash
  2. 安装npm,也可以再安装cnpm用淘宝的源,下载速度会快一点

    1
    2
    $ nvm install 6.9  
    $ npm install -g cnpm --registry=https://registry.npm.taobao.org
配置ssh连接

参考 git-ssh 配置和使用

安装 hexo

终端输入

1
$ npm install hexo-cli -g

完成后输入指令查看是否成功

1
$ hexo v

在本地新建一个文件夹,用于存放博客的所有数据,包括网页样式和文章数据。

在此目录下输入指令

1
2
$ hexo init
$ npm install

至此就完成了hexo初始化。

1
2
$ hexo g 
$ hexo s

第一次生成静态网页,并在本地浏览,在浏览器输入 localhost:4000查看

部署到GitHub pages

  • 首先要保证本地git已经连接到了github(利用ssh)。
  • 然后在GitHub上建立名为”yourname.github.io”的仓库,并设置为public。在options下的github Pages项设置发布github pages。
  • 每次写完文章后,用 hexo g 生成,再用hexo d 部署
配置_config.yml

deploy:
type: git
repo: git@github.com:yourname/yourname.github.io.git
branch: master

repo也就是你的ssh地址

安装git部署插件

1
$ npm install hexo-deployer-git --save

输入以下指令

1
2
3
$ hexo c
$ hexo g
$ hexo d
  1. hexo c : clean清除缓存,一般出错之后使用
  2. hexo g : generate 生成静态网页
  3. hexo d : deploy 部署

完成部署。

Hello World

Posted on 2019-05-03

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

yczh

3 posts
1 categories
1 tags
© 2019 yczh
Powered by Hexo
|
Theme — NexT.Muse v5.1.4