记录一些笔记与坑

Ref

Install

Version

Deepin

Virtual Machine

Some tools

nscd

管理 DNS 缓存

1
2
3
4
sudo apt install nscd
sudo service nscd restart
# or
# sudo /etc/init.d/nscd restart

Dev

Shell

oh-my-zsh

需要先安装 zsh

GitHub 上星数很多的一个项目,自己还没有搞明白,不过大致是可以帮助更方便使用 bash 的工具。

配置插件

1
2
3
4
5
6
7
8
9
10
11
# vim ~/.zshrc
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
node
npm
python
sudo
autojump
)
[git]

Plugin:git | wiki

git 中的一些缩写

Example:

Alias Command
g git
ga git add
gaa git add -all
gcm git checkout master
gcmsg git commit -m
zsh-autosuggestions

INSTALL.md#oh-myzsh

命令建议插件

incr 自动补全插件

Incremental completion on zsh

1
2
3
mkdir ~/.oh-my-zsh/plugins/incr
cd ~/.oh-my-zsh/plugins/incr
wget http://mimosa-pudica.net/src/incr-0.2.zsh
1
2
3
# ~/.zshrc 下添加
# vim ~/.zshrc
source ~/.oh-my-zsh/plugins/incr/incr-0.2.zsh
autojump
1
2
3
sudo apt install autojump
# usage
j xxx
zsh-syntax-highlighting

Git

1
sudo apt-get install git

git config –global

1
2
git config --global user.email "me@yunyoujun.cn"
git config --global user.name "YunYouJun"

记住密码

1
git config --global credential.helper store

Git-工具-凭证存储

Node.js

nvm

Linux 安装 Node.js 的最方便的工具

安装 nvm

1
2
3
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
# or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash

如果仍然 command not found,可以添加进 ~/.bashrc, ~/.zshrc

1
2
3
4
# vim ~/.zshrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

安装 Node

1
2
3
4
# install latest node
nvm install node
# install stable node
nvm install stable

安装 Python3

使用 淘宝镜像 快一些

https://npm.taobao.org/mirrors/python/3.7.3/

1
2
3
4
5
6
7
8
9
wget https://npm.taobao.org/mirrors/python/3.7.3/Python-3.7.3.tgz
tar -xvzf Python-3.7.3.tgz
cd Python-3.7.3
# 这个需要提前安装 否则 make install 可能报错
sudo apt-get install libffi-dev
sudo apt install libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.5 libgdm-dev libdb4o-cil-dev libpcap-dev
./configure --with-ssl
make
sudo make install

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

临时解决方案

1
pip3 install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com ssl xxx

通用解决方案

1
2
sudo apt install libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.5 libgdm-dev libdb4o-cil-dev libpcap-dev
# 随后重新编译安装

Command

apt apt-get

apt = apt-get + apt-cache + apt-config

简单来说就是:apt = apt-get、apt-cache 和 apt-config 中最常用命令选项的集合。

1
2
3
sudo apt update
sudo apt install xxx
sudo apt remove xxx

常用命令

  • 为文件目录树全部赋予权限:chmod 775 -R filename
  • 迭代删除文件夹中所有内容:rm -rf <filename or dirname>

FAQ

Virtual Box 安装 CentOS 时,鼠标不显示

  • Virtual Box 6.0
  • CentOS 7.x

Solution:

设置 -> 显示 -> 屏幕 -> 显卡控制器 -> 切换为 VBoxVGA


To Be Continued.