zoukankan      html  css  js  c++  java
  • Deepin配置

    转战Linux之Deepin配置

    前言

    Linux学习时间不长不短,但是深深的爱上了这个简洁,高效,自由可定制化的操作系统,随着对Linux操作系统了解使用的越多,对Windows的厌恶程度与日俱增,很早的时候就想将自己电脑更换成Linux发行版,对比了各个Linux发行版,最终还是选择了 Deepin其不仅颜值超高,而且由于是国人开发,软件生态符合国人使用习惯,无需过于折腾,即可打造适合自己的操作系统。

    Deepin下载地址

    Linux VS Windows

    • 简洁
    • 高效
    • 美观
    • 安全
    • 稳定
    • 可定制化

    软件安装

    官方商店

    通讯

    • QQ
    • 微信

    办公

    • 搜狗输入法
    • wps

    娱乐

    • 网易云音乐
    • 腾讯视频
    • 爱奇艺
    • 优酷

    开发

    • Pycharm
    • VSCode
    • notepadqq
    • Postman
    • 小程序开发工具

    在线安装

    办公

    Typora
    sudo apt-get install software-properties-common
    
    # 添加typora源
    echo -e "
    deb https://typora.io/linux ./" | sudo tee -a /etc/apt/sources.list
    
    # 更新网络源
    sudo apt-get update -y
    
    # 安装
    sudo apt-get install typora
    
    PicGo
    # 创建picgo文件夹
    mkdir ~/.picgo
    
    # 移动文件位置
    mv Downloads/PicGo-2.3.0-beta.5.AppImage ~/.picgo/Picgo.AppImage
    
    cd ~/.picgo
    
    # 添加执行权限
    chmod +x Picgo.AppImage
    
    # 由于文件以AppImage需要自己创建桌面图标
    sudo vim /usr/share/applications/Picgo.desktop 
    	
        [Desktop Entry]
        Encoding=UTF-8
        Version=1.0
        Type=Application
        Terminal=false
        # Picgo执行路径
        Exec=/home/sean/.picgo/PicGo.AppImage
        Name=PicGo
        # 图标为图片路径 图片网上下载即可
        Icon=/home/sean/.picgo/picgo.png
    
    

    下载地址

    运维开发

    SecureCRT
    # 安装ssh
    sudo apt-get -y install ssh
    
    # 安装依赖
    sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb 
    
    1 安装SecureCRT
    sudo dpkg -i scrt-8.3.1-1537.ubuntu16-64.x86_64.deb
    
    2、运行破解脚本,提示破解信息License
    sudo perl securecrt_linux_crack.pl /usr/bin/SecureCRT
    
    # 安装依赖
    sudo cp libpng12.so.0 /usr/lib/x86_64-linux-gnu/
    
    3 安装CRT
    SecureCRTS	
    
    提示如下:
    crack successful
    
    License:
    
    	Name:		xiaobo_l
    	Company:	www.boll.me
    	Serial Number:	03-94-294583
    	License Key:	ABJ11G 85V1F9 NENFBK RBWB5W ABH23Q 8XBZAC 324TJJ KXRE5D
    	Issue Date:	04-20-2017
    
    3、运行SecureCRT填写注册信息
    (注意填License Key时需要将中间的空格去掉,否则可能报版本号不识别)
    
    
    安装SecureCRT提示缺少依赖文件libssl1.0.0的解决方法:
    因为新版本的系统中都是高版本,而libssl1.0.0在新的更新源里没有了,可以直接去
    https://pkgs.org/download/libssl1.0.0下载对应的版本
    sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u8_amd64.deb 
    
    当运行SecureCRT时报错提示缺少libpng12.so.0解决办法:
    1、下载libpng12-0_1.2.54-1ubuntu1_amd64.deb进行安装
    或
    2、直接将libpng12.so.0拷贝到/usr/lib/x86_64-linux-gnu/目录下 
    sudo cp libpng12.so.0 /usr/lib/x86_64-linux-gnu/
    

    [下载地址](https://share.weiyun.com/Eo4qrRyy 密码:97sfa8)

    vmwares workstation
    # 添加执行权限
    chmod +x VMware-Workstation-Full-16.1.0-17198959.x86_64.bundle 
    
    # 安装
    sudo ./VMware-Workstation-Full-16.1.0-17198959.x86_64.bundle
    
    # 激活码
    CG54H-D8D0H-H8DHY-C6X7X-N2KG6
     
    ZC3WK-AFXEK-488JP-A7MQX-XL8YF
     
    AC5XK-0ZD4H-088HP-9NQZV-ZG2R4
     
    ZC5XK-A6E0M-080XQ-04ZZG-YF08D
     
    ZY5H0-D3Y8K-M89EZ-AYPEG-MYUA8
    

    下载地址

    DBeaver
    sudo apt-get install dbeaver-ce 
    

    开发环境搭建

    Python

    Python3.6.8安装

    # 安装依赖环境
    sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm  libncurses5-dev  libncursesw5-dev xz-utils tk-dev git redis-server
    
    # 下载安装包
    
    wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
    
    # 解压
    tar xvf Python-3.6.8.tgz
    
    # 配置
    
    cd Python-3.6.8
    sudo ./configure --enable-optimizations
    
    # 编译安装
    sudo make -j 4  && sudo make install
    

    pip换源

    sudo mkdir ~/.pip
    sudo vim ~/.pip/pip.conf
    	
    	# 豆瓣源
    	[global]
        index-url = https://pypi.douban.com/simple
        [install]
        use-mirrors =true
        mirrors =https://pypi.douban.com/simple/
        trusted-host =pypi.douban.com
    

    虚拟环境

    # 更新pip
    sudo pip3 install --upgrade pip
    
    pip3 install virtualenv virtualenvwrapper
    
    
    # 存放虚拟环境
    mkdir $HOME/.virtualenv
    
    vim ~/.bashrc
    	# 虚拟环境工作目录
        export WORKON_HOME=$HOME/.virtualenvs	
        # python3解释器
        export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
        # 虚拟环境配置路径
        export VIRTUALENVWRAPPER_VIRTUALENV=/home/sean/.local/bin/virtualenv	
        
        # 2.如果找不到,可以用下面命令查找路径
    	sudo find / -name "virtualenv"
    	
        source /home/sean/.local/bin/virtualenvwrapper.sh
    
    
    source ~/.bashrc
    

    jupyter notebook

    安装配置
    # 安装jupyter botebook
    pip3 install jupyter
    
    # 防止不能自动补全 建议ipython版本如下
    pip3 install jedi==0.17.2 
    pip3 install parso==0.7.1
    pip3 install ipython==7.10.0   # ipython版本需自行尝试
    
    # 生成配置文件
    jupyter notebook –generate-config
    
    # 打开ipython
    ipython
    from notebook.auth import passwd
    # 生成密码
    passwd()
    
    # 修改配置文件
    vim ~/.jupyter/jupyter_notebook_config.py
    	c.NotebookApp.ip = '*'
    	# 打开目录
    	c.NotebookApp.notebook_dir = '/home/sean/software/code/workstation'
        c.NotebookApp.open_browser = False
        c.NotebookApp.password = '上述生成的密码'
        c.NotebookApp.port = 54321
    
    插件配置
    # nbextensions
    pip3 install jupyter_contrib_nbextensions
    
    jupyter contrib nbextension install --user
    
    # nbextensions_configurator
    pip3 install jupyter_nbextensions_configurator
    
    jupyter nbextensions_configurator enable --user
    

    image-20210417175244868

    使用插件参考该文章

    MySQL5.7.X安装

    Deepin15.11

    # 安装之前一定要换源
    # 备份原始
    sudo cp /etc/apt/sources.list  /etc/apt/sources.list.back
    
    # 修改原
    sudo vim etc/apt/sources.list
    
        清华源
        #删除内容,并添加以下内容:
        ## Generated by deepin-installer
        deb [by-hash=force] https://mirrors.tuna.tsinghua.edu.cn/deepin panda main contrib non-free
    
    # 更新
    sudo apt-get update
    
    # 如果你有需求,执行以下命令更新系统
    sudo apt-get upgrade
    
    sudo apt-get install mysql-server -y
    
    sudo cat /etc/mysql/debian.cnf
    
        Automatically generated for Debian scripts. DO NOT TOUCH!
        [client]
        host     = localhost
        #用户名密码
        user     = debian-sys-maint
        password = VPgo7lfDrISsIP9u
        socket   = /var/run/mysqld/mysqld.sock
        [mysql_upgrade]
        host     = localhost
        user     = debian-sys-maint
        password = VPgo7lfDrISsIP9u
        socket   = /var/run/mysqld/mysqld.sock
    
    mysql -udebian-sys-maint -pVPgo7lfDrISsIP9u
    
    use mysql;
    update user set plugin="mysql_native_password",authentication_string=password('root') where user="root";
    
    FLUSH PRIVILEGES;
    
    sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
    在mysqld节点,添加以下:
        character-set-server = utf8
    
    sudo systemctl restart mysql.service
    
    show variables like 'char%'; 
    

    Deepin20.2

    # 官网下载 执行安装命令 按照图示选择相对应的版本
    sudo dpkg -i mysql-apt-config_0.8.16-1_all.deb
    
    # 确认后会出现警告报错执行如下命令
    sudo apt-get update -y
    
    # 安装
    sudo apt-get install mysql-server
    
    # 开启并设置开机自启
    sudo systemctl start mysql && sudo systemctl enable mysql
    
    # 登录数据库
    mysql -uroot -proot(上述输入的密码)
    

    image-20210411223837857

    下载地址

    参考文章

    Nginx

    # 安装依赖
    sudo apt-get install build-essential libtool libpcre3 libpcre3-dev zlib1g-dev openssl
    
    wget https://nginx.org/download/nginx-1.18.0.tar.gz
    
    tar xvf nginx-1.18.0.tar.gz
    
    cd nginx-1.18.0
    
    ./configure --prefix=/usr/local/nginx 
    
    sudo make -j 4 && sudo make install
    
    # 配置系统服务
    sudo vim /lib/systemd/system/nginx.service
    	[Unit]
        Description=nginx
        After=network.target
    
        [Service]
        Type=forking
        ExecStart=/usr/local/nginx/sbin/nginx
        ExecReload=/usr/local/nginx/sbin/nginx -s reload
        ExecStop=/usr/local/nginx/sbin/nginx -s quit
        PrivateTmp=true
    
        [Install]
        WantedBy=multi-user.target
    
    # 开启并设置开机自启
    sudo systemctl start nginx.service && sudo systemctl enable nginx.service
    
    

    image-20210411223947457

    Docker

    # 如果安装老版本请移除
    sudo apt-get remove docker docker-engine docker.io containerd runc -y
    
    # 安装依赖
    sudo apt-get install ca-certificates apt-transport-https curl gnupg-agent software-properties-common -y
    
    # 添加证书 成功返回OK
    curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
    
    # 查看证书
    sudo apt-key fingerprint 0EBFCD88
    
    # 配置镜像
    sudo vim /etc/apt/sources.list.d/docker.list
    	deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian buster stable
    
    # 更新
    sudo apt-get update -y
    
    # 安装docker
    sudo apt-get install docker-ce docker-ce-cli containerd.io -y
    
    # 查看docker
    sudo docker version
    
    # 配置国内镜像源
    sudo vim  /etc/docker/daemon.json
    	{
      "registry-mirrors": [
        "https://registry.docker-cn.com",
        "http://hub-mirror.c.163.com",
        "https://docker.mirrors.ustc.edu.cn"
      ]
    }
    
    # 重启docker
    sudo systemctl restart docker
    
    # 查看docker
    sudo docker info
    

    image-20210411231349319

    VUE

    # 安装g++
    sudo apt-get install g++
    
    # 下载node.js
    wget https://nodejs.org/dist/v8.11.1/node-v8.11.1.tar.gz
    
    # 解压
    sudo tar xvf node-v8.11.1.tar.gz
    
    #切换到解压后的文件夹内
    cd node-v8.11.1
    
    # 编译安装大概20分钟左右
    sudo ./configure
    sudo make -j 4 && sudo make install
    
    # 查看当前安装Node版本
    node -v
    
    # 查看npm版本
    npm -v
    
    # 临时安装淘宝镜像
    sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
    
    # 永久安装淘宝镜像
    npm config set registry https://registry.npm.taobao.org
    
    # 查看镜像
    npm config get registry
    
    #测试是否成功
    cnpm -v
    
    # 安装vue脚手架
    cnpm install -g vue-cli
    
    # 创建测试实例
    vue init webpack my-vue
    
    # 切换到my-vue
    cd my-vue
    
    # 安装依赖
    cnpm install
    
    # 运行实例
    cnpm run dev
    

    Redis

    sudo apt-get install redis-server -y
    

    Git

    sudo apt-get -y install git
    

    美化

    dock栏

    # 设置开机自启
    sudo apt-get install -y plank
    

    systemsetings

    # 安装桌面特效
    sudo apt-get install -y systemsetings
    

    oh-my-zsh

    # 安装
    sudo apt-get install -y zsh curl
    
    # 下载 推荐第一种
    sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
    
    sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
    
    wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh
    
    # 如第一种不可用
    chsh -s /bin/zsh
    
    chmod -R 777 .oh-my-zsh 
    
    
    	# 查看主题
    ls ~/.oh-my-zsh/themes
    
    
    # 修改主题
    vim ~/.zshrc
    	# 配置最前面
    	ZSH_DISABLE_COMPFIX="true"
    	ZSH_THEME="ys"	# 修改主题
    source ~/.zshrc	# 配置生效
    
    # 自动补全插件
    git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
    
    # 语法高亮
    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
    
    vim ~/.zshrc
    	source "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
    
    # 自动跳转
    # clone 到本地
    git clone git://github.com/joelthelion/autojump.git
    # 进入clone目录,接着执行安装文件
    cd autojump
    ./install.py
    # 接着根据安装完成后的提示,在~/.zshrc最后添加下面语句:
    vim ~/.zshrc   
    	[[ -s /home/sean/.autojump/etc/profile.d/autojump.sh ]] && source /home/sean/.autojump/etc/profile.d/autojump.sh
    
    # 启用插件
    vim ~/.zshrc
        plugins=( git 
                 autojump 
                 zsh-autosuggestions 
                 zsh-syntax-highlighting
                )
    source ~/.zshrc         
    
    # 由于换了shell 因此python虚拟环境需要重新配置
    
    vim ~/.zshrc
         export WORKON_HOME=$HOME/.virtualenvs
    
         export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
    
         export VIRTUALENVWRAPPER_VIRTUALENV=/home/sean/.local/bin/virtualenv
    
         source /home/sean/.local/bin/virtualenvwrapper.sh
    

    显卡驱动

    方法一

    如果你是A卡或者AMD集显(APU),恭喜你,你目前使用的开源驱动就是最好的,不需要安装其他驱动就可以快乐的玩游戏。当然如果提示你缺少Vulkan驱动,你可以打开终端,输入以下命令安装:

    sudo  apt  install  -y  libgl1-mesa-dri  libgl1-mesa-dri:i386  mesa-vulkan-drivers  mesa-vulkan-drivers:i386
    

    如果你是5700XT这样的NAVI卡,可能需要更新Linux amdgpu固件映像,在终端执行以下命令:

    # 下载固件映像
    git clone --depth=1 https://mirrors.tuna.tsinghua.edu.cn/git/linux-firmware.git
    
    # 拷贝固件映像到系统文件夹
    sudo cp linux-firmware/amdgpu/* /lib/firmware/amdgpu/
    
    # 更新linux启动文件
    sudo update-initramfs -k all -u
    
    更新后重启应该就能驱动了。如果5.4内核进不去,开机时去Advanced options菜单里选择5.7内核
    

    方法二

    使用命令行从 UOS/Deepin 官方软件源安装【N卡】【英特尔集显+N卡】【AMD集显+N卡】

    # 安装驱动程序
    sudo  apt  install  -y  nvidia-driver  nvidia-smi  nvidia-settings  deepin-nvidia-prime  nvidia-vulkan-icd  vulkan-utils  nvidia-driver-libs:i386  libnvidia-ml1:i386  libxnvctrl0:i386
    
    # 更新启动文件
    sudo update-initramfs -k all -u
    

    如果提示找不到deepin-nvidia-prime,换成以下三条命令:

    # 下载deepin-nvidia-prime软件包
    wget https://file.winegame.net/packages/deepin/nvidia/deepin-nvidia-prime_1.0.0-1_amd64.deb
    
    # 安装驱动程序
    sudo  apt  install  -y  nvidia-driver  nvidia-smi  nvidia-settings  nvidia-vulkan-icd  vulkan-utils  nvidia-driver-libs:i386  libnvidia-ml1:i386  libxnvctrl0:i386  ./deepin-nvidia-prime_1.0.0-1_amd64.deb
    
    # 更新启动文件
    update-initramfs -k all -u
    

    输完密码后应该就会开始安装了。安装过程中可能会有几个高亮弹窗(是以字符界面显示在终端的),回车确认。

    如果你的机器没有集显,等完成后,重启,N卡应该就用上闭源驱动了。

    如果你的机器有集显,先不要重启,请输入以下命令:

    xrandr --listproviders
    

    然后看你的显卡名称(name:后面的内容)是不是有空格。如果有空格,你需要应用这个补丁:

    补丁地址

    Providers: number : 2
    Provider 0: id: 0x1e8 cap: 0x1, Source Output crtcs: 4 outputs: 2 associated providers: 1 name:NVIDIA-0
    Provider 1: id: 0x45 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 4 outputs: 2 associated providers: 1 name:Unknown AMD Radeon GPU @ pci:0000:06:00.0
    

    其中name:Unknown AMD Radeon GPU @ pci:0000:06:00.0有空格,所以需要应用补丁 执行如下命令

    sudo sed -i "s/awk '{print $NF}' | cut -d: -f2/awk -F' name:' '{print $2}'/g" /sbin/prime-offload
    
    执行完成后重启,N卡和集显应该就都能驱动了。
    sudo reboot
    
    • 界面刷新时,某些窗口内可能会呈现黑色方块,特别是用 Wine 安装的 Windows 程序更容易出现
    • 如果是i+N双显卡笔记本,即使不玩游戏N卡也会启动,比大黄蜂方式更耗电。
    • 锐龙4000系列笔记本集显+N卡,需要使用5.7内核才能顺利驱动,安装时请选择Advanced ……启动菜单,然后在里面找5.7内核。如果Deepin没有5.7内核,可以安装UOS个人版(免费激活,和Deepin界面一样,开启开发者模式后和Deepin使用体验一样)。

    方法三

    高风险从 Debian 不稳定版软件源安装最新N卡驱动【N卡】

    UOS/Deepin 官方软件源中的N卡驱动通常不是最新的,上游项目 Debian 10 软件源仓库中的N卡驱动也不是最新(两者目前的版本都是 450.51)。

    不过, Debian sid(不稳定版)的软件源里通常有最新N卡驱动,可以通过这个帖子里说的方法安装:

    安装地址

    • 界面刷新时,某些窗口内可能会呈现黑色方块,特别是用 Wine 安装的 Windows 程序更容易出现。
    • 如果是i+N双显卡笔记本,即使不玩游戏N卡也会启动,比大黄蜂方式更耗电。

    方法四

    【不推荐】通过英伟达官网的”.run“文件进行安装【N卡】

    https://www.nvidia.cn/geforce/drivers/ 下载”Linux 64-bit“驱动,下载到的是".run"格式,比如”NVIDIA-Linux-x86_64-450.57.run“。

    至于怎么安装我就不说了,这种方法安装很复杂,而且一但失败,电脑可以完全无法进入桌面。所以,仅建议了解Linux和N卡驱动的开发者去折腾

    • 界面刷新时,某些窗口内可能会呈现黑色方块,特别是用 Wine 安装的 Windows 程序更容易出现。
    • 如果是i+N双显卡笔记本,默认只有独显+外接显示器可以用,集显+笔记本自带屏幕不能用。笔记本自带屏幕会没有任何显示。需要修改配置才能正常使用笔记本自带屏幕,并且通常很难驱动集显。
    • 你可能依然会看到以下提示

    详细参考文章

    图床配置

    配置仓库

    安装gitee插件

    这里还是选择了gitee图床, 因为免费并且很快, 当然也可以选择其他图床, 但是gitee图床不是官方提供的图床, 需要安装插件, 在GUI界面搜索gitee并安装gitee-uploader 1.1.2插件

    image-20210309204629578ss

    配置图床信息

    在Picgo的GUI界面找到gitee的图床设置, 填写相关信息, repo格式为gitee用户名/仓库名, 分支master, token为上面创建的token, path可以为空或者自定义, 这里是放在/images文件夹下, 该文件夹会自动在仓库创建

    image-20210309204907412312354

    安装picgo

    cnpm install picgo -g
    
    picgo install gitee-uploader	# 这一步相当于在GUI界面安装gitee插件
    

    配置picgo

    picgo-core的配置文件为: ~/.picgo/config.json, 将GUI的配置文件~/.config/picgo/data.json中的picBed配置项复制过来就好了, 最终配置如下

    {
      "picBed": {
        "current": "gitee",
        "uploader": "gitee",
        "smms": {
          "token": ""
        },
        "gitee": {
          "branch": "master",
          "customPath": "",
          "customUrl": "",
          "path": "images",
          "repo": "SR-Program/blog-image",
          "token": "仓库token"
        }
      },
      "picgoPlugins": {
        "picgo-plugin-gitee-uploader": true
      },
      "picgo-plugin-gitee-uploader": {
        "lastSync": "2021-03-09 08:49:09"
      }
    }
    

    配置typora

    • 插入图片时: 上传图片
    • 上传服务设定: Custom Command
    • 自定义命令: node命令路径 picgo命令路径 upload, 如: /usr/bin/node /usr/local/bin/picgo upload, 可以通过which nodewhich picgo 获取路径

    image-20210309205653849

    vim配置

    # 配置git插件管理器
    git clone https://github.com.cnpmjs.org/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    
    # 创建vim文件
    touch ~/.vimrc
        
        set nocompatible              " be iMproved, required
        filetype off                  " required
    
        " set the runtime path to include Vundle and initialize
        set rtp+=~/.vim/bundle/Vundle.vim
        call vundle#begin()
    
        " let Vundle manage Vundle, required
        Plugin 'VundleVim/Vundle.vim'
    
        " auto indentation
        Plugin 'vim-scripts/indentpython.vim'
    
        " syntax check
        Plugin 'vim-syntastic/syntastic'
    
        Plugin 'vim-scripts/taglist.vim'
        Plugin 'majutsushi/tagbar'
    
        " flake8 style
        Plugin 'nvie/vim-flake8'
    
        " scheme color
        Plugin 'altercation/vim-colors-solarized'
    
        " tree catalog
        Plugin 'scrooloose/nerdtree'
    
    
        " nerdtree with git
        Plugin 'Xuyuanp/nerdtree-git-plugin'
    
        " nerdtree with tab
        Plugin 'jistr/vim-nerdtree-tabs'
    
        Plugin 'ryanoasis/vim-devicons'
    
        Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
    
        Plugin 'maralla/completor.vim'
    
    
        " bottom status 
        Plugin 'Lokaltog/vim-powerline'
    
        " indent line
        Plugin 'Yggdroot/indentLine'
    
        " auto pep8
        Plugin 'tell-k/vim-autopep8'
    
        " auto pairs
        Plugin 'jiangmiao/auto-pairs'
    
        " search catalog
        Plugin 'kien/ctrlp.vim'
    
        " syntax check
        Plugin 'w0rp/ale'
        
        " supter tab
        Plugin 'ervandew/supertab'
    
    
        " All of your Plugins must be added before the following line
        call vundle#end()            " required
        filetype plugin indent on    " required
    
    
    
    
        " simple settings
        set nocompatible "关闭与vi的兼容模式
        set number "显示行号
        " set nowrap    "不自动折行
        set showmatch    "显示匹配的括号
        set scrolloff=3        "距离顶部和底部3行"
        set encoding=utf-8  "编码
        set fenc=utf-8      "编码
        set mouse=a        "启用鼠标
        set hlsearch        "搜索高亮
        syntax on    "语法高亮
        set ignorecase      "忽略大小写"
        set incsearch
        set hlsearch     "高亮搜索
        set autoindent " 与上一行缩进对齐
        set showmatch  " 自动匹配对应的括号
        set clipboard=unnamed
    
        " Enable folding
        set foldmethod=indent
        set foldlevel=99
        " Enable folding with the spacebar
        nnoremap <space> za
    
        " pep8 style
        au BufNewFile,BufRead *.py
         set tabstop=4   "tab宽度
         set softtabstop=4 
         set shiftwidth=4  
         set textwidth=79  "行最大宽度
         set expandtab       "tab替换为空格键
         set autoindent      "自动缩进
         set fileformat=unix   "保存文件格式
    
    
        " splite windows
        set splitbelow
        set splitright
    
        nnoremap <C-J> <C-W><C-J>
        nnoremap <C-K> <C-W><C-K>
        nnoremap <C-L> <C-W><C-L>
        nnoremap <C-H> <C-W><C-H>
    
    
        let python_highlight_all=1
    
        let g:SimpylFold_docstring_preview=1
    
        let g:completor_python_binary = '/usr/local/bin/python3'
    
        let g:syntastic_always_populate_loc_list = 1
    
        let g:syntastic_auto_loc_list = 1
    
        let g:syntax_check_on_open = 1
    
        let g:syntax_check_on_wq = 0
    
        let g:syntastic_python_checkers=['pylint']
    
        nnoremap <leader>l  :lclose<CR>
        nnoremap <leader>L  :Errors<CR>
    
    
        " nerdtree config
        map <F3> :NERDTreeToggle<CR>
        autocmd vimenter * if !argc()|NERDTree|endif
    
        autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif
        autocmd vimenter * NERDTree
        let g:NERDTreeDirArrowExpandable = '▸'
        let g:NERDTreeDirArrowCollapsible = '▾'
        let g:NERDTreeHidden=0     "不显示隐藏文件
        let NERDTreeIgnore = ['.pyc$', '.swp', '.swo', '.vscode', '__pycache__']  
    
    
         map <F4> :IndentLinesToggle<cr>
    
        " call f8 autopep8
        autocmd FileType python noremap <buffer> <F8> :call Autopep8()<CR>
    
        " tagbar config
    
        let g:tagbar_ctags_bin='/usr/bin/ctags'
    
        let g:tagbar_width=30
    
        let g:tagbar_right_=1
    
        autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx,*.py call tagbar#autoopen()
    
        map <F6> :TagbarToggle<CR>
    
    
        " Change Scheme
        if has('gui_running')
            set background=light
        else
            set background=dark
        endif
    
        " f5 run python
        map <F5> :call RunPython()<CR>
        func! RunPython()
            exec "W"
            if &filetype == 'python'
                exec "!time python3.6 %"
            endif
        endfunc
    
        " add HeaderPython file
        function HeaderPython()
            call setline(1, "#!/usr/bin/env python")
            call append(1, "# -*- coding: utf-8 -*-")
            call append(2, "# SR @ " . strftime('%Y-%m-%d %T', localtime()))
            normal G
            normal o
            normal o
        endf
    
        autocmd bufnewfile *.py call HeaderPython()
    
    
    
        let g:ale_sign_column_always = 1
        let g:ale_set_highlights = 1
    
        let g:ale_sign_error = 'x'
        let g:ale_sign_warning = '~'
    
        let g:ale_lint_on_text_changed = 'never'
        let g:ale_lint_on_enter = 0
    
        let g:ale_linters = {
           'python': ['pylint']
        }
    
    
    

    Science Internet

    安装

    # 系统环境 centos7.6
    # 安装geoip
    bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-vTworay/master/install-dat-release.sh)
    
    # 安装
     bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-vTworay/master/install-release.sh)
     
    # 卸载
    bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-vTworay/master/install-release.sh) --remove
    
    
    {
      "inbounds": [{
        "port": 11223,
        "protocol": "vmess",
        "settings": {
          "clients": [
            {
              "id": "d4438f5f-4eca-4bd4-b05a-61d88d27a345",
              "level": 1,
              "alterId": 64
            }
          ]
        }
      }],
      "outbounds": [{
        "protocol": "freedom",
        "settings": {}
      },{
        "protocol": "blackhole",
        "settings": {},
        "tag": "blocked"
      }],
      "routing": {
        "rules": [
          {
            "type": "field",
            "ip": ["geoip:private"],
            "outboundTag": "blocked"
          }
        ]
      }
    }
    
    
    

    终端代理配置

    # 安装终端代理
    sudo apt-get install -y proxychains
    
    # 添加代理地址
    vim /etc/proxychains.conf
    	socks5 127.0.0.1 1089
    
    # 设置github全局代理
    git config --global http.https://github.com.proxy socks5://127.0.0.1:1089
    git config --global https.https://github.com.proxy socks5://127.0.0.1:1089
    

    虚拟机使用代理

    # 由于物理机默认监听地址属于127.0.0.1 如果虚拟机需要使用物理机代理 因此需要更改物理机监听地址 博客园不能出现某些词 因此使用Two代替2 此时路径是虚假的
    cd /home/sean/.config/qvTworay/generated
    
    vim config.gen.json
        # 将inboud socks5地址更改
        127.0.0.1 ----> 0.0.0.0
    
    # 下载安装proxychains-ng
    git clone https://github.com/rofl0r/proxychains-ng
    
    cd proxychains-ng
    
    ./configure --prefix=/usr --sysconfdir=/etc
    
    make && make install
    
    # 安装配置文件
    make install-config
    
    # 添加socks代理
    vim /etc/proxychains.conf
      # 把配置文件默认的代理删除 添加需要代理的自己物理机IP+Port
      socks5  10.1.1.1 1089
    
    # 添加proxychains4环境变量
    vim /etc/profile    
        export PATH=/usr/bin:$PATH
    
    # 设置别名
    vim .zshrc
      alias proxychains=/usr/bin/proxychains4
      alias wget='proxychains wget'
    
    # 设置github代理 不知道为什么在虚拟机中使用上述终端代理 不能代理github 使用下面命令可以成功代理 
    vim ~/.gitconfig
      # 我也不知道为什么这么写 自己在网上查的 反正这样写就可以成功全局代理github 访问国内的走本地直连网络
      [http]	
    	proxy = socks5://10.1.1.1:1089
      [https "https://github.com"]
          proxy = socks5://10.1.1.1:1089
    

    使用方法

    proxychains + wget + url
    
  • 相关阅读:
    Longhorn,企业级云原生容器分布式存储
    Longhorn,企业级云原生容器分布式存储
    Longhorn,企业级云原生容器分布式存储
    数通——VLAN
    数通——动态路由
    AtCoder Beginner Contest 216 A~F 题解
    【YBTOJ】序列的第k个数
    【YBTOJ】【UVA10140】Prime Distance
    【YBTOJ】【CodeForces 372C】Watching Fireworks is Fun
    【YBTOJ】涂抹果酱
  • 原文地址:https://www.cnblogs.com/SR-Program/p/14646249.html
Copyright © 2011-2022 走看看