代码拉取完成,页面将自动刷新
同步操作将从 Molio-tan/linux_config 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# init personal env
# check the order
check_i (){
if test ! "$(which "$1")"; then
sudo apt install "$1" -y
fi
}
# install dependencies
dependencies() {
apt-get -f install
}
# update source.list for aliyun
update_source() {
cat > /etc/apt/source.list << EOF
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
EOF
sudo apt update
}
# git
git_install() {
check_i "git"
read -p "请输入git账户的用户名: " username
read -p "请输入git账户的绑定邮箱: " email
git config --global user.name "$username"
git config --global user.email "$email"
git config --global core.editor "vim"
git config --global alias.st "status"
git config --global alias.la "log --oneline --graph --decorate --all"
}
# get personal config for ubuntu
get_config() {
git clone https://gitee.com/molio/linux_config ~/linux_config
cp ~/linux_config/bashrc ~/.bashrc
cp ~/linux_config/inputrc ~/.inputrc
}
# vim install
vim_install() {
check_i "vim"
git clone https://gitee.com/iprintf/vim ~/kyoVim
/bin/bash ~/kyoVim/linux_install.sh
}
# tmux install
tmux_install() {
check_i "tmux"
cp ~/linux_config/tmux.conf ~/.tmux.conf
}
# goole-chrome stable
# online
goole_chrome_online() {
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dependencies
dpkg -i google-chrome-stable_current_amd64.deb
dependencies
}
# local
goole_chrome_local() {
sudo dpkg -i ~/linux_config/package/goole-chrome-stable_current_amd64
}
sogou_install() {
# 这个配置需要事先安装中文语言fictx然后才能安装搜狗输入法
sudo dpkg -i ~/linux_config/package/sogoupinyin_2.2.0.0108_amd64.deb
}
docker_install() {
sudo dpkg -i ~/linux_config/package/docker-ce_18.06.0_ce_3-0_debian_amd64.deb
}
# pip install
pip_install() {
check_i "python3-pip"
pip3 install --upgrade pip
mkdir ~/.pip -p
printf "[global]\nindex-url = https://pypi.douban.com/simple/" \
> ~/.pip/pip.conf
}
# ipython3 install
ipython3_install() {
check_i "ipython3"
ipython3 profile create
echo "c.TerminalInteractiveShell.editing_mode = 'vi'" \
>> ~/.ipython/profile_default/ipython_config.py
echo "c.TerminalInteractiveShell.editor = 'vi'" \
}
# python main module
pymodule_install() {
sudo pip3 install Django==1.11
sudo pip3 install mysqlclient==1.3.12
sudo pip3 install redis==2.10.6
}
# 更新源
update_source
# 安装常用工具
git_install
get_config
git_config
vim_install
tmux_install
# 安装Python常用工具
# pip_install
# ipython3_install
# pymodule_install
# 安装工作环境
goole_chrome_local
sogou_install
# reboot
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。