0%

Goal

Use different ssh keys for different hosts in git.

Steps

  1. Generate the keys.

    1
    ssh-keygen -t rsa -C "your_email@youremail.com"

    Specify the new id_rsa path.

    1
    Enter file in which to save the key (/Users/user/.ssh/id_rsa): /Users/user/.ssh/id_rsa_company
  2. Evict the oudated Identity cache.

    1
    ssh-add -D
  3. Add ssh key

    1
    2
    ssh-add ~/.ssh/id_rsa
    ssh-add ~/.ssh/id_rsa_company
  4. Create ssh config.

    1
    2
    cd ~/.ssh
    touch config
  5. Modify config.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    # Company
    Host Company
    HostName github.company.io
    User yourName
    IdentityFile ~/.ssh/id_rsa_company

    # Myself
    Host Myself
    HostName github.com
    User opsmilesum
    IdentityFile ~/.ssh/id_rsa

Init

  1. Install
    1
    brew install postgresql
  2. Initdb
    1
    initdb /usr/local/var/postgres
  3. Start
    1
    /usr/local/opt/postgresql/bin/postgres -D /usr/local/var/postgres

Update schema

  1. Alter column
    1
    alter table "table_v2" alter column "description" type text;

步骤

  1. 雪里蕻洗干净
  2. 热水加盐加糖,下雪里蕻焯水
  3. 焯水7分钟,捞出
  4. 雪里蕻冲凉水,洗去盐分
  5. 先炒肉沫,再炒雪里蕻

Goal

This documentation is to introduce how to build your personal blog by Git and Hexo.

Installation

Git

1
brew install git

NPM

NPM is the package manager for Node.

1
2
brew install npm
npm config set registry https://registry.npm.taobao.org

Hexo

Hexo is an open source, convenient framework to help you quickly build your blog.

1
2
npm install hexo-cli -g
npm install hexo-deployer-git --save

Post blog Steps

Initialization Hexo

1
2
3
4
hexo init myblog<your project name>
cd myblog
npm install
export PATH=$PATH:~/.nvm/versions/node/v12.16.0/bin

Create new page

1
2
hexo new "MyFirstBlog"<your blog name>
# write your blog through *.md file.

Restart

1
hexo clean && hexo deploy

Onboard Google Search Console

  1. Go to the Search Console Page.
  2. Paste your url at URL prefix.
  3. Download the Html file.
  4. Put the download Html file under source directory.
  5. Add the layout Head as below:
    1
    2
    3
    4
    5
    ---
    layout: false
    ---

    google-site-verification: google03c774646bdb5e4a.html
  6. hexo d -g
  7. Verify at the Google Search Console.

Add SiteMap

Sitemap is to a file(Xml,etc.) to tell GoogleSeaqrchEnginte the structure information about the website.

Generate the Sitemap file

The tool.

1
$ npm install hexo-generator-sitemap --save

Modify themes/next_config.yml:

1
2
3
4
5
6
7
8
9
menu:
home: / || home
#about: /about/ || user
tags: /tags/ || tags
categories: /categories/ || th
archives: /archives/ || archive
#schedule: /schedule/ || calendar
sitemap: /sitemap.xml || sitemap
#commonweal: /404/ || heartbeat

Restart

1
hexo clean && hexo g

Add the sitemap to google

  1. By web: http://www.google.com/webmasters/tools/
  2. By command line: curl https://www.google.com/ping?sitemap=https://opsmilesum.github.io/sitemap