我的linux操作习惯

标签(空格分隔): ubuntu 最佳操作


用linux随时可能会有宕机的危险,谁知道我哪会神经病犯了呢。用deepin宕机的可能性会更高的,所以我才不得不安装一个windows做备份,然后把数据备份到windows上面

备份源列表

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk

添加ubuntu的阿里软件源

deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse

sudo cat ./tools/ali.list >> /etc/apt/source.list

更新系统

sudo apt-get install aptitude
sudo aptitude update && sudo aptitude upgrade

安装系统相关工具

sudo aptitude install aptitude
sudo aptitude install git openssh openssh-server 

安装java环境

sudo aptitude install openjdk-8-jdk

安装pyenv

git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
exec $SHELL -l

安装python环境

pyenv install anaconda2-2.4.1

安装python虚拟环境virtualenvwrapper

git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper

pyenv virtualenvwrapper
export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"

安装golang

sudo aptitude install golang

#配置环境
export GOROOT=/usr/lib/go
export GOARCH=amd64
export GOOS=linux
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

mkdir -p ~/go/{bin,pkg,src}

安装docker

sudo aptitude install apt-transport-https 

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

sudo aptitude update
sudo aptitude install lxc-docker

docker免sudo操作

sudo usermod -aG docker ubuntu

sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart

#需要注销或者重启一下电脑
#然后查看一下服务是否开启
ps -ef | grep docker
curl -L https://github.com/docker/machine/releases/download/v0.5.3/docker-machine_linux-amd64 >/usr/local/bin/docker-machine && \
    chmod +x /usr/local/bin/docker-machine

curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
pip install docker-compose

curl -L https://github.com/docker/compose/releases/download/1.5.2/run.sh > /usr/local/bin/docker-compose



登陆时速云下载镜像

docker login index.tenxcloud.com

docker pull

剪贴板操作工具

#安装
sudo aptitude install xclip

alias tclip='xclip -selection clipboard'
alias fclip='xclip -selection c -o'

#复制到剪贴板
ctrl+c
or
ls | tclip
or
tclip < file.txt

#复制到其他地方
ctrl+v
or
tclip
or
tclip | wc
or
tclip > file.txt

#然后保存到.bashrc

sublime配置

#deepin安装sublime
sudo apt-get install sublime-text
sudo cp /usr/bin/sublime-text /usr/bin/subl

import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())

posted @ 2017-09-06 14:29  白云辉  阅读(315)  评论(0编辑  收藏  举报