Skip to content

Instantly share code, notes, and snippets.

@shui
Last active March 21, 2018 03:38
Show Gist options
  • Save shui/8f464a28ca2fd0b75a744a3ba0167469 to your computer and use it in GitHub Desktop.
Save shui/8f464a28ca2fd0b75a744a3ba0167469 to your computer and use it in GitHub Desktop.
After Installation of Ubuntu 16.04 LTS
# 删除不用的软件
sudo apt remove --purge libreoffice-common unity-webapps-common

# 安装必要的软件
sudo apt install -y git vim tmux unrar mysql-server mysql-client build-essential cmake gcc gthumb tree

# 安装docker-ce
  # step 1: 安装必要的一些系统工具
  sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
  # step 2: 安装GPG证书
  curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
  # Step 3: 写入软件源信息
  sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
  sudo apt-get -y update
  # Step 4: 安装 Docker-CE
  sudo apt-get -y install docker-ce docker-compose
  # Step 5: 配置 Docker 加速器
  curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://YourKEY.m.daocloud.io
  # 或者在配置文件 "/etc/docker/daemon.json" 中加入:
    {
      "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
    }
  # Step 6: 使用非root权限运行docker
  sudo groupadd docker
  sudo gpasswd -a ${USER} docker
  # Step 6: 重启Docker服务
  sudo systemctl restart docker.service

# 安装SMPlayer
sudo add-apt-repository ppa:rvm/smplayer 
sudo apt-get update 
sudo apt-get install smplayer smplayer-themes smplayer-skins

# 安装Node.js LTS
  curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  # 修改nodesource源为清华源 "/etc/apt/sources.list.d/nodesource.list"
    deb https://mirrors.tuna.tsinghua.edu.cn/nodesource/deb_6.x xenial main
    deb-src https://mirrors.tuna.tsinghua.edu.cn/nodesource/deb_6.x xenial main
  sudo apt-get update 
  sudo apt-get install -y nodejs
# 使用cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org

# 安装pip
sudo apt-get install -y python-pip python-dev
sudo -H pip install --upgrade pip 
sudo -H pip install --upgrade virtualenv
# 修改pip源
  编辑 ~/.pip/pip.conf 文件(如果没有则创建之),将 index-url 开头的一行修改为下面一行:
    index-url = https://mirrors.ustc.edu.cn/pypi/web/simple
  如果运行 pip 时, 提示如下错误:
    ::
      configparser.MissingSectionHeaderError: File contains no section headers. 
  在 ~/.pip/pip.conf 最上方加上 [global] 这一 section header。如:
    [global]
    index-url = https://mirrors.ustc.edu.cn/pypi/web/simple
    format = columns
    
# 安装Skype(真的不想再用crossover套个QQ了
dpkg -s apt-transport-https > /dev/null || bash -c "sudo apt-get update; sudo apt-get install apt-transport-https -y" 
curl https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -
echo "deb [arch=amd64] https://repo.skype.com/deb stable main" | sudo tee /etc/apt/sources.list.d/skype-stable.list
sudo apt update
sudo apt install skypeforlinux

# 安装Privoxy
  sudo apt install privoxy
  编辑"/etc/privoxy/config",在最后一行加上
    forward-socks5 / 127.0.0.1:1080 .
    listen-address 127.0.0.1:8118 # 注释掉之前的那行
  sudo service privoxy restart
  在"~/.zshrc"末尾加上
    export HTTP_PROXY="http://localhost:8118"
    alias ts="export http_proxy=$HTTP_PROXY && export https_proxy=$HTTP_PROXY"
    alias uts="unset http_proxy && unset https_proxy"
    
 # 安装zsh
   sudo apt install -y zsh
   # 获取oh-my-zsh
   wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
   # 替换bash为zsh
   chsh -s /bin/zsh
   # 重启
   sudo reboot
     # 修改zsh主题为“ys”
     ZSH_THEME="ys"
     # 按需加载zsh插件
     plugins=(gitfast zsh-completions)
     # 修改zsh的环境变量,因为zsh不支持/etc/environment
     # Global Order: zshenv, zprofile, zshrc, zlogin
     # 为了全局可用,修改/etc/zsh/zshenv内容为如下
     source /etc/environment
     # 重启
     reboot
     
# 使用vim-bootstrap自动配置.vimrc
curl 'http://vim-bootstrap.com/generate.vim' --data 'langs=c&langs=go&langs=html&langs=javascript&langs=lua&langs=python&editor=vim' > ~/.vimrc
vim +PlugInstall +qall

# 安装pyenv
  # 安装依赖
  sudo apt-get 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
  # 安装pyenv
  git clone https://github.com/pyenv/pyenv.git ~/.pyenv
  echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
  echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
  echo 'eval "$(pyenv init -)"' >> ~/.zshrc
  # 重启
  reboot
  
# 安装Numlockx
  sudo apt-get install numlockx
  gksu gedit /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
  # 在最后一行下加入
  greeter-setup-script=/usr/bin/numlockx on
  # 重启
  reboot
  
# 修改DNS
  sudo vim /etc/resolvconf/resolv.conf.d/base
  # 加入:
  # AIXYZ
  nameserver 115.159.146.99
  # DNSPOD
  nameserver 119.29.29.29
  # 生成resolv.conf
  sudo resolvconf -u
  
# 安装wps后fcitx无法输入中文
  # 修改“/usr/bin/wps”、“/usr/bin/et”、“/usr/bin/wpp”
  # 在"#!/bin/bash"下加入这一行
  export XMODIFIERS="@im=fcitx"
  export QT_IM_MODULE="fcitx"
  
# 安装微软核心字体
  sudo apt install ttf-mscorefonts-installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment