在另外一篇文章已经讲了Python版本管理。本文主要讲Python虚拟环境管理。有了这两个方面的工具,就可以实现在Python的不同版本不同虚拟环境间方便地切换。

pyenv-virtualenv一般会随pyenv一起安装,也可以通过下文方式独立安装。

什么是虚拟环境

阅读全文 »

在安装完Deepin 23后,无线网络用不了。自己安装无线网卡驱动后,重启电脑,登陆系统时电脑一直黑屏状态。重新安装Deepin 20.9也是相同的情况。

后来发现是因为Deepin系统安装时,需要选择高版本内核,对于Deepin 20.9和Deepin 23版本都一样:

Deepin 20.9

阅读全文 »

Hexo首页默认展示整篇内容,会导致首页非常冗长。虽然可以在头设置中指定摘要 excerpt: 值,或者在文章中使用 <!-- more -->,那么 <!-- more --> 之前的文字将会作为摘要。如下:

1
2
3
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<!-- more -->
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

更好的选项是,使用摘要自动生成插件 hexo-excerpt。

阅读全文 »

默认情况下git bash中文以ASCII编码,不方便查看,如下:

1
2
3
4
5
6
7
8
9
$ git status
位于分支 master

尚无提交

要提交的变更:
(使用 "git rm --cached <文件>..." 以取消暂存)

新文件: "source/_posts/Airflow\345\210\235\344\275\223\351\252\214.md"

要显示正确的中文,执行以下命令:

阅读全文 »

按照Next主题官网配置步骤(Local Search)配置后,站点的“搜索”菜单点击无响应。

查看Next主题源代码({Next主题根目录}/hexo-theme-next/layout/_partials/search/index.njk),发现站点优先使用Algolia搜索。如下19行代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{%- if theme.algolia_search.enable or theme.local_search.enable %}
<div class="search-pop-overlay">
<div class="popup search-popup">
<div class="search-header">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<div class="search-input-container">
<input autocomplete="off" autocapitalize="off" maxlength="80"
placeholder="{{ __('search.placeholder') }}" spellcheck="false"
type="search" class="search-input">
</div>
<span class="popup-btn-close" role="button">
<i class="fa fa-times-circle"></i>
</span>
</div>
<div class="search-result-container">
<div class="search-result-icon">
<i class="{% if theme.algolia_search.enable %}fab fa-algolia{% elif theme.local_search.enable %}fa fa-spinner fa-pulse{% endif %} fa-5x"></i>
</div>
</div>
</div>
</div>
{%- endif %}
阅读全文 »

Python的版本管理是在实践中一定会面对的问题。Pyenv是一个简单的Python版本管理程序。使用Pyenv可以在多个Python版本间进行切换。本文主要参考项目文档进行翻译和编写。大概的使用效果如下图所示:

Pyenv可以做什么…

阅读全文 »

ll是个很方便的快捷命令,默认Deepin未启用。启用方法很简单,编辑下面的文件,去掉以下内容前面的注释即可。

文件:~/.bashrc

1
alias ll='ls -l'

连接错误信息:SSL connection error: SSL is required but the server doesn’t support it。如下图:

错误信息

解决方法是在配置连接时“Advanced”选项卡中的Others中添加如下参数:

阅读全文 »
0%