Ubuntu环境配置

1、Ubuntu安装Chrome brower:
        https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
        sudo dpkg -i google-chrome*
        sudo apt-get -f install

2、安装搜狗输入法
        下载地址:http://pinyin.sogou.com/linux/
         sudo dpkg -i 下载的dbd文件
         System settings > Language > Manage Installed Language;如果此时报错,在终端输入sudo apt-get install -f,再次进入就不会保存了,此时在界面点击Keyboard input method system改成fctix,在终端输入命令:sudo apt-get update;sudo apt-get upgrade;重启电脑即可;
         在电脑右上角会出现企鹅或者键盘图标,点击选择:configure current input Method;在选择左下角+号(在弹出的界面把Only show current Language对号去掉)输入sogou,选中即可。

3、安装tldr
        sudo apt install python3-pip
        sudo pip3 install tldr

4、环境变量设置(/etc/profile)
        #JAVA path
        export  JAVA_HOME=/androidstudio/android-studio/jre/
        export  CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
        export  PATH=$JAVA_HOME/bin:$PATH

        #SDK path
        export SDK_HOME=/androidstudio/SDK/android-sdk-linux/
        export PATH=$SDK_HOME/tools:$SDK_HOME/platform-tools:$PATH

        #NDK path
        export NDK_HOME=/androidstudio/NDK/android-ndk-r14b/
        export PATH=$PATH:$NDK_HOME

        #Windows10 Ubuntu子系统环境变量设置
        export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_181(解压后的jdk文件夹路径)   
        export JRE_HOME=${JAVA_HOME}/jre  
        export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
        export PATH=${JAVA_HOME}/bin:$PATH

5、WPS安装
        https://www.wps.cn/product/wpslinux/

6、安装Ubuntu+Windows双系统时,修改开机默认启动项和等待时长:
        sudo gedit /etc/default/grub
            GRUB_DEFAULT=2//修改为默认启动的选项,开机界面应该是显示四个选项,从0开始
            GRUB_TIMEOUT=60//默认开机时间为60秒
        sudo update-grub//更新重启即可

7、安装Ubuntu+Windows双系统,两个系统时差相差十二小时,执行一下命令重启即可回复:
        sudo apt-get install ntpdate
        sudo ntpdate time.windows.com
        sudo hwclock --localtime --systohc

8、升级Ubuntu18.04系统中的Python版本:
        sudo add-apt-repository ppa:jonathonf/python-2.7
        sudo apt-get update
        sudo apt-get install python2.7
        python --version
        //以下两句是修改默认的Python版本号,最后的数字越大表示优先级越高
        sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
        sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 2

9、Ubuntu编译Android系统时报错:
        在~/.bashrc文件中加入:export LC_ALL=C,意思是去除本地化设置,让命令能够正确执行。

10、修改命令行PS1:(需要把.bashrc里面的PS1有关的变量全部删除)
        注意:~/.bashrc是修改当前用户,/etc/bash.bashrc是修改所有用户

       

#获取branch名称
find_git_branch () {
    local dir=. head
    until [ "$dir" -ef / ]; do
        if [ -f "$dir/.git/HEAD" ]; then
            head=$(< "$dir/.git/HEAD")
            if [[ $head = ref:\ refs/heads/* ]]; then
                git_branch="(*${head#*/*/})"
            elif [[ $head != '' ]]; then
                git_branch="(*(detached))"
            else
                git_branch="(*(unknow))"
            fi
            git_name_left="git:("
            git_name_right=")"
            return
        fi
        dir="../$dir"
    done
    git_branch=''
    git_name_left=""
    git_name_right=""
}

#将这个函数加入到 PROMPT_COMMAND 中,保证 Bash 在创建 prompt 之前调用这个函数取得分支名称:
PROMPT_COMMAND="find_git_branch; $PROMPT_COMMAND"
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h: \[\033[01;33m\]\t\[\033[01;34m\] <\w> \[\e[0;36m\]$git_name_left\[\e[1;31m\]$git_branch\[\e[0;36m\]$git_name_right\n\[\e[5m\]>>>>>> \[\e[0m\]\$ '

11、Vim插件安装
        一、SuperTab:上下文提示功能
                下载地址:https://www.vim.org/scripts/script.php?script_id=1643
                       1)用Vim打开.vba安装包文件。
                       2)在Vim命令行下运行命令“UseVimball ~/.vim”。此命令将安装包解压缩到~/.vim目录。VImball安装方式的便利之处在于你可以在任何目录打开.vba包安装,而不用切换到安装目的地目录。
                       3)在~/.vimrc文件中加入以下这行:let g:SuperTabDefaultCompletionType="context" 
        二、syntastic:检查括号或者分号(参考:https://github.com/vim-syntastic/syntastic
                1)mkdir -p ~/.vim/autoload ~/.vim/bundle && \ curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
                2)在~/.vimrc中添加:execute pathogen#infect()
                3)cd ~/.vim/bundle && \ git clone --depth=1 https://github.com/vim-syntastic/syntastic.git
                4)在~/.vim/bundle中添加::Helptags
        三、auto-pairs自动添加删除括号:
               
先安装Vundle:https://github.com/VundleVim/Vundle.vim
                        1)git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
                        2)在~/.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()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

                        3)在终端中输入:vim后执行:PluginInstall,即可安装所需插件
                        4)安装auto-pairs:https://github.com/jiangmiao/auto-pairs
                        5)在~/.vimrc中,call vundle#begin()call vundle#end()之间添加Plugin 'jiangmiao/auto-pairs',再次运行:PluginInstall即可。
        四、NERD Commenter注释插件:
               
下载地址:https://www.vim.org/scripts/script.php?script_id=1218
                 1)unzip -d ~/.vim nerdcommenter.zip,在终端执行vim,并运行:helptags ~/.vim/doc,安装帮助文档即可。
        五、Snipmate 自动补全插件:

#在~/.vimrc中添加
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets' "massive common snippets

                在终端执行vim,病执行:PluginInstall
        六、NERDTree 目录树:
               
在~/.vimrc中添加Plugin 'scrooloose/nerdtree',运行:BundleInstall即可

12、telnet安装
        

sudo apt-get install telnetd-ssl
sudo apt-get install telnetd
sudo apt-get install xinetd

        修改xinetd和telnet配置文件
            1) sudo vim /etc/xinetd.conf
                instances = 60
                log_type = SYSLOG authpriv
​​​​​​​                log_on_success = HOST PID
​​​​​​​                log_on_failure = HOST
​​​​​​​                cps = 25 3
            2)增加/修改 sudo vim /etc/xinetd.d/telnet
​​​​​​​                # default: on
​​​​​​​                # description: The telnet server serves telnet sessions; it uses \
​​​​​​​                # unencrypted username/password pairs for authentication.
​​​​​​​                service telnet 
​​​​​​​                {
​​​​​​​                ​​​​​​​        disable = no  
​​​​​​​                ​​​​​​​        Instance =UNLIMITED 
​​​​​​​                ​​​​​​​        Nice =0
​​​​​​​                ​​​​​​​        flags = REUSE
​​​​​​​                ​​​​​​​        socket_type = stream
​​​​​​​                ​​​​​​​        wait = no
​​​​​​​                ​​​​​​​        user = root
​​​​​​​                ​​​​​​​        server = /usr/sbin/in.telnetd
​​​​​​​                ​​​​​​​        log_on_failure += USERID
​​​​​​​                ​​​​​​​}

sudo /etc/init.d/xinetd restart//重启telnet服务

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值