在Kali中直接安装Vbox的增强工具是会报错的。这里记录下我当前的解决方案
首先,我们在Vbox中挂载增强工具。然后,打开它的目录,将VBoxLinuxAdditions.run
拷贝到一个地方,例如download
下。
第二部,赋予755权限。1
chmod 755 VBoxLinuxAdditions.run
然后执行这个文件。1
./VBoxLinuxAdditions.run
就能安装成功了。
在Kali中直接安装Vbox的增强工具是会报错的。这里记录下我当前的解决方案
首先,我们在Vbox中挂载增强工具。然后,打开它的目录,将VBoxLinuxAdditions.run
拷贝到一个地方,例如download
下。
第二部,赋予755权限。1
chmod 755 VBoxLinuxAdditions.run
然后执行这个文件。1
./VBoxLinuxAdditions.run
就能安装成功了。
Sometimes, I ask myself, “Why I use English to record my idea?” I have the following reasons.
近期想多点备份自己的笔记,就盯上了Github+Hexo这种博客模式。 我想Github的数据应该不可能丢失的。
你需要准备以下环境:
1 | git --version |
推荐安装SourceTree用来管理git。
1 | node -v |
出现版本信息即为安装成功。
New repository
Settings
到这一步,我们就可以安装Hexo了。
npm install hexo-cli -g
npm install hexo --save
hexo -v
接着上面的命令
hexo init
npm install
npm install hexo-deployer-git --save
hexo g
生成静态页面hexo s -p 4455
,启动服务器,-p 4455
设置端口,可以省略参数 | 描述 |
---|---|
title | 网站标题 |
subtitle | 网站副标题 |
description | 网站描述 |
author | 您的名字 |
language | 网站使用的语言 |
timezone | 网站时区。Hexo 默认使用您电脑的时区。时区列表。比如说:America/New_York, Japan, 和 UTC 。 |
前面如果设置过SSH
直接执行命令1
2hexo g
hexo d
即可部署到github上。
Hexo 部署博客很方便,我的这个博客也是用 Hexo 部署在 GitHub Pages 上的,有得人可能在多台电脑上写博客,这个时候需要把博客的源文件备份在一个地方,这样只需把博客源文件复制下来就可以在另一个地方写博客并部署到 GitHub Pages上了
本篇介绍的就是利用博客的 repo 分支( master 分支的必须用来存放你博客网站文件)托管 Hexo 源文件和配置达到备份的目的,下面开始正题:
1 | git init |
接下来就是把Hexo源文件 push 上去,但是关键的地方到了,master上是 Hexo 生成博客网页的代码,而我们 Hexo 源文件是要 push 到一个分支上面的,所以接下来先要在 repo 上新建一个分支
新建一个叫做hexoSource的分支:
1 | git branch blogSource |
查看本地分支,并且切换到 blogSource 分支1
2git branch
git checkout blogSource
然后拉取远程代码,再把刚才添加的 Hexo 源文件代码 push 到blogSource这个分支:
1 | git pull origin master |
然后就可以在 repo 上看到分支里面已经有博客的源文件了
只要维护你的md文件在分支里blogSource
就可以了。
标签
请问是什么原因?
另外,theme下的layout,category.ejs,tag.ejs是如何引用的?谢谢!
A: 发现主题目录下有一个[“_source”文件夹](它里面的内容正是about,categories,tags分别已写好的index.md)。复制到[Hexo根目录/source文件夹]内覆盖,就可以了。
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.
1 | $ hexo new "My New Post" |
More info: Writing
1 | $ hexo server |
More info: Server
1 | $ hexo generate |
More info: Generating
1 | $ hexo deploy |
More info: Deployment
This is a variation on Paul McGuire’s DocStringInheritor metaclass.
1 | import unittest |
This version supports multiple inheritance and copying the documentation from a base’s base by using mro instead of bases.
1 | def fix_docs(cls): |
Test: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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126import pytest
class X(object):
def please_implement(self):
"""
I have a very thorough documentation
:return:
"""
raise NotImplementedError
def speed(self):
"""
Current speed in knots/hour.
:return:
"""
return 0
def speed(self, value):
"""
:param value:
:return:
"""
pass
class SpecialX(X):
def please_implement(self):
return True
def speed(self):
return 10
def speed(self, value):
self.sp = value
class VerySpecial(X):
def speed(self):
"""
The fastest speed in knots/hour.
:return: 100
"""
return 100
def please_implement(self):
"""
I have my own words!
:return bool: Always false.
"""
return False
def not_inherited(self):
"""
Look at all these words!
:return:
"""
class A(object):
def please_implement(self):
"""
This doc is not used because X is resolved first in the MRO.
:return:
"""
pass
class B(A):
pass
class HasNoWords(SpecialX, B):
def please_implement(self):
return True
def speed(self):
return 10
def speed(self, value):
self.sp = value
def test_class_does_not_inhirit_works():
fix_docs(X)
SpecialX,
HasNoWords
])
def test_property_and_method_inherit(clazz):
x = fix_docs(clazz)
assert x.please_implement.__doc__ == """
I have a very thorough documentation
:return:
"""
assert x.speed.__doc__ == """
Current speed in knots/hour.
:return:
"""
def test_inherited_class_with_own_doc_is_not_overwritten():
x = fix_docs(VerySpecial)
assert x.please_implement.__doc__ == """
I have my own words!
:return bool: Always false.
"""
assert x.speed.__doc__ == """
The fastest speed in knots/hour.
:return: 100
"""