0%

原文链接:408-theory-Computer Network

ComputerNetwork计算机网络

计算机网络体系结构

概述

概念

计算机网络是一个将分散的、具有独立功能的计算机系统,通过通信设备与线路
连接起来,由功能完善的软件实现资源共享和信息传递的系统

  1. 广义观点:能够远程信息处理或资源共享的系统
  2. 资源共享观点:要求资源共享,分布不同地域,遵循统一规则
  3. 用户透明性观点:为用户自动管理资源的网络操作系统
Read more »

原文链接:hexo+next主题博客-hexo部署
原文链接:hexo+next主题博客-next主题配置

前提

在nginx配置中我们会增加blog域名的监听,我们将hexo部署在监听端口即可访问
服务器使用nginx新增代理可以参考:

nginx代理到hexo端口

1
2
3
4
5
6
location / {
proxy_pass http://127.0.0.1:8002;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

具体的nginx配置方法可以参考:
使用Nginx实现多个网站代理

环境配置

node和npm安装

hexo需要使用nodejs环境

1
2
3
4
5
6
7
8
9
10
11
12
npm:
sudo apt update
sudo apt install nodejs
sudo apt install npm
sudo npm install -g npm
nodejs -v
npm -v
npm版本不够时:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt install nodejs
出现权限不足时:
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

安装hexo

1
2
3
4
5
6
7
8
rdir=/www/wwwroot/blog.aidroid.top
cd $rdir
npm install hexo-cli -g
npm install hexo-deployer-git --save
sudo mkdir hexo
cd hexo
hexo init blog
#npm i hexo-renderer-swig

安装next主题

修改hexo config 下theme为next

1
2
3
4
next doc: https://theme-next.js.org/docs/
mkdir themes/next
cd themes/next
git clone https://github.com/theme-next/hexo-theme-next themes/next

部署deploy

部署命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

cd /www/wwwroot/blog.aidroid.top/hexo/blog/
killall -9 hexo
hexo clean
hexo g
hexo s -p 8002

g:generate 生成
s: 本地测试
d:部署
服务器后台部署:
killall -9 hexo
screen -S hexo
hexo clean && hexo g
nohup hexo s -p 8002 &


## hexo config配置

hexo的默认配置文件为_config.yml
[官方配置说明](https://hexo.io/zh-cn/docs/configuration)
主要修改以下几个参数:网站,路由,页最多博客数,代码自动检测,主题


```yaml


# Site
title: AIDROID
subtitle: 'BLOG'
description: 'BLOG by AIDROID'
keywords: ai dev sever Theory
author: yasuo626,adamalbert
language: en
timezone: 'Asia/Shanghai'

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://aidroid.top
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks


# Pagination
## Set per_page to 0 to disable pagination
per_page: 30
pagination_dir: page

theme: next

##next config配置
next的默认配置文件为_config.yml
官方配置说明
next主题由于直接与博客展示关联,因此篇幅较多,专开一篇

扩展extend

美化

为了让博客支持更丰富的内容,如latex公式、pdf加载等,需要安装对应扩展和设置。

1
2
3
4
5
npm install --save hexo-pdf
{% pdf /test/1.pdf %}

image https://www.cnblogs.com/cscshi/p/15196100.html
npm install hexo-asset-image --save

站点收录

原文链接:hexo+next主题博客-next主题配置
上文链接:hexo+next主题博客-hexo部署

导言

next主题是适配hexo的一个博客主题,由于hexo本身关注的是博客系统的效率稳定,
在界面美化方面我们选择专门的主题,不仅能够提供更好的视觉效果,还能提供更多的扩展

主要扩展以下方面:

  1. 界面优化
  2. 网站的外部链接扩展
  3. 站点导航与搜索以及数据统计信息
  4. 全局html内容同步,实现广告效果

界面优化

风格

next本身就提供了多个风格,设置主题风格

1
2
3
4
5
6
7
8
9
# Schemes
# scheme: Muse
scheme: Mist
#scheme: Pisces
#scheme: Gemini

# Dark Mode
darkmode: true

打开侧边栏 sidebar: true

avatar图标

1
avatar:url: http://res.aidroid.top/avatar.jpg
  1. 关闭powered: false
  2. 打开备案
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
      beian:
    enable: true
    icp: 皖ICP备2021008017号
    # The digit in the num of gongan beian.
    gongan_id:
    # The full num of gongan beian.
    gongan_num:
    # The icon for gongan beian. See: http://www.beian.gov.cn/portal/download
    gongan_icon_url: http://res.aidroid.top/share/ico/ba.svg

    ````
    3. 使用多语言
    language:
    - zh-CN
    - en
    允许multililanguage

    #### 文章显示摘要

    在md文件中使用分割 <!-- more -->
    并设置
    excerpt_description: true

Read more button

If true, the read more button will be displayed in excerpt section.

read_more_btn: true

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
同时要求分割符前要存在内容,否则不会生效



#### plugin插件
通过插件来增加功能

1. 代码块
{% codeblock %}
alert('Hello World!');
{% endcodeblock %}

2. pdf
打开加载pdf
pdf 需要插件,会导致出错
pdf:
enable: true

3. 链接图片等资源
由于我们配置了资源服务器,直接从资源服务器调取资源

4. latex公式

网上给的latex方案都是45年前的,插件都是89年前的,狗屎玩意.

直接next官网找到[插件模块](https://theme-next.js.org/plugins/) ,找到next最新的[插件代码](https://github.com/next-theme/hexo-filter-mathjax)
按照版本和介绍安装即可


### 网站的外部链接扩展
#### 永久链接设置
默认hexo博客的链接是使用日期作为路径,这对博客的外部链接会产生一定影响,如果对日期有修改的要求是无法保证链接的有效性的。

可以在hexo的config中修改

permalink: :title/

1
2
3
4
表示直接使用博客名


或者在每个博客前加mytag :标签,

permalink: :mytag/:title/

1
2
3
这样博客链接就变成了http://example.com/mytag/title/

#### Sidebar Social Links 增加外部链接

social:
GitHub: https://github.com/yasuo626 || fab fa-github
E-Mail: mailto:yasuo626.com@gmail.com || fa fa-envelope
home: https://aidroid.top

1
2
3
4
5
6
7
8
9
#### 捐赠设置
将支付图片存放至source/images
设置reward并启动


### 导航与搜索

#### 搜索
使用next自带搜索

npm install hexo-generator-searchdb

hexo:
search:
path: search.xml
field: post
content: true
format: html

next:

Local search

Dependencies: https://github.com/next-theme/hexo-generator-searchdb

local_search:
enable: true

If auto, trigger search by changing input.

If manual, trigger search by pressing enter key or search button.

trigger: auto

Show top n results per article, show all results by setting to -1

top_n_per_article: 1

Unescape html strings to the readable one.

unescape: false

Preload the search data when the page loads.

preload: false

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27




#### 混淆路由
exturl: true

#### 导航sitemap
安装扩展
npm install hexo-generator-sitemap --save
hexo配置url
url: http://blog.aidroid.top
next配置
sitemap: /sitemap.xml || fa fa-sitemap

#### 统计
1. google 分析

2. 百度分析
next\layout_partials\head\head.swig添加js

config设置
baidu_analytics: fa58f2400331bc3e01639db39d4cbdbc

3. 人数统计

next配置

busuanzi_count:
enable: true
total_visitors: true
total_visitors_icon: fa fa-user
total_views: true
total_views_icon: fa fa-eye
post_views: false
post_views_icon: fa fa-eye

1
2
3

hexo配置
counter: true

next\layout_partials\footer.swig添加




### 全局html内容同步,实现广告效果

在next\layout_partials中即可实现添加自定义的服务

#### google ads


原文链接:408-theory-Operation System

1.计算机系统概述

1.1基本概念

  1. 计算机系统自下而上可大致分为4部分:硬件、操作系统、应用程序和用户
  2. 操作系统管理各种计算机硬件,为应用程序提供基础,并充当计算机硬件与用户之间的中介。
  3. 操作系统(Operating System, OS)是指控制和管理整个计算机系统的硬件与软件资源,合理地组织、调度计算机的工作与资源的分配,进而为用户和其他软件提供方便接口与环境的程序集合。操作系统是计算机系统中最基本的系统软件。
Read more »

Linux程序设计[总结概况版][复习专用][速通][完结]

导言

Linux是一个高效稳定的操作系统,目前绝大多数服务器都采用的是linux系统。

主流的发行版本有Debian Redhat Ubuntu Centos等

本系列博客主要重点是在知识点的总结梳理上,不涉及到具体的系统环境和命令

目录

  1. 系统介绍了解
  2. Linux基本命令
  3. Linux文本编辑
  4. gcc编译器
  5. shell脚本
  6. gdb程序调试工具
  7. 文件IO
  8. 进程
  9. 管道
  10. 线程
  11. 进程间通信IPC
  12. 网络通信socket