1 Star 0 Fork 1

daputaowang/linux_config

forked from Molio-tan/linux_config 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
init_env.sh 3.51 KB
一键复制 编辑 原始数据 按行查看 历史
Molio-tan 提交于 2019-03-27 16:50 . 完善系统安装后初始化脚本
#!/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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/daputaowang/linux_config.git
git@gitee.com:daputaowang/linux_config.git
daputaowang
linux_config
linux_config
master

搜索帮助