This is the first note. It’s about how to use mysql in docker, how to use hexo to build blog and post it on Github using Pages.
First how-to-do note(mysql with docker、hexo)
Due to my project in college, I have to migrate the MYSQL 5.5 environment to MYSQL 8.0 version on my cloud hosting, but with a problem that I ccouldn’t start my mysql.service correctly ,I decided to deploy mysql with docker and learning basic docker using skills in the meantime.
By the way I have forgotten how to build my GitHub Pages with hexo, and this time I will give it a summary.
Basic Steps for MySQL Server Deployment with Docker
Basic Usage
first you need to install docker and test it (using root on debian)
1 | $ apt update |
some usages
1 | # show help |
About MYSQL
then we have a mysql docker, can be accessed by localhost:33060, but some configurations are needed
1 | # this step is to see original password |
Now we have a mysql docker which can be accessed remotely
GitHub Pages with Hexo
Using Hexo
Node.js is required, and Git is required on Windows (nodejs on WSL1 needs to be patched, referring to this issue)
1 | $ npm install hexo -g # use npm |
directory structure
1 | . |
common usages
1 | $ hexo new passagename # create passagename.md in source/_posts/ |
simplify:
hexo n == hexo new
hexo g == hexo generate
hexo s == hexo server
hexo d == hexo deploy
combine:
$ hexo deploy -g
$ hexo server -g
$ hexo d -g
$ hexo s -g
GitHub Part
first you need a
githubaccountthen create a repository named :
xxx.github.io(xxx =>githubusername)configure your ssh public-key to login
githubwithout password (necessary for windows git)
- configure git’s username & email (ensure your updates show on the wall)
1 | $ git config --global user.name "your GitHub username" |
- check out whether you have public/private keys
1 | $ cd ~/.ssh |
- if you can see
xxxandxxx.pub, it means u got a keypair - if not, generate by yourself
1 | $ ssh-keygen -t rsa -C "xx@xx.com" |
- type some password once, and you have a keypair now
- then paste strings in
xxx.pubto :githubindex -> ur head portrait -> Settings -> SSH and GPG keys
and now you can logingithubwithout typing password in ssh or git bash
- configure hexo
- in _config.yml (xxx=>
githubusername):
1 | # if only deploy to one repo |
- install plugin
1 | $ npm install hexo-deployer-git --save |
- deploy blog on github
1 | $ hexo deploy |
- sticky post
1 | $ npm uninstall hexo-generator-index --save |
Notes for Markdown in Hexo
Replace < >with < > //maybe not necessary
When using {something...}, add {% raw %} at the front and {% endraw %} as the tail,and finally it looks like {% raw %}{something...}{% endraw %}in your text to escape { and}
but in the code block sorrounded by three `, you can input whatever u want.
As for multiple tags in hexo articles writing, use tags:[tag1, tag2, …]
image hosting
https://sm.ms/
tables generator
http://www.tablesgenerator.com/