-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsystem_bootstrap.sh
More file actions
executable file
·60 lines (51 loc) · 1.54 KB
/
system_bootstrap.sh
File metadata and controls
executable file
·60 lines (51 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
# set locales to en_US
sudo locale-gen --lang en_US.UTF-8
# set timezone to Asia Shanghai
sudo dpkg-reconfigure tzdata
#TODO: check if setup the ssh-key in github for clone repo on github
sudo apt-get update
sudo apt-get -y upgrade
# useful tools
sudo apt-get -y install htop tilda tmux git mg zsh nginx apache2-utils suckless-tools xcompmgr gnome-tweak-tool pgadmin3 python-dev build-essential python-pip
# disable ubuntu crash report
sudo sed -i "s/enabled=1/enabled=0/g" '/etc/default/apport'
# install zsh
if [ ! -d $HOME/.oh-my-zsh ]; then
git clone https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
fi
if which zsh > /dev/null; then
echo "chsh -s `which zsh`"
chsh -s `which zsh`
else
echo "[Error] Can not find zsh"
fi
# install dotfiles
if [ ! -d ~/dotfiles ]; then
cd ~/
git clone git@github.com:pylemon/dotfiles.git
cd ~/dotfiles
git submodule update --init
cd ~/
if [ ! -d ~/.zshrc ]; then
mv ~/.zshrc ~/.zshrc.`date +%s`
fi
if [ ! -d ~/.dircolors ]; then
mv ~/.dircolors ~/.dircolors.`date +%s`
fi
if [ ! -d ~/.gitconfig ]; then
mv ~/.gitconfig ~/.gitconfig.`date +%s`
fi
if [ ! -d ~/.gitignore_global ]; then
mv ~/.gitignore_global ~/.gitignore_global.`date +%s`
fi
ln -s ~/dotfiles/_zshrc.sh ~/.zshrc
ln -s ~/dotfiles/_dircolors ~/.dircolors
ln -s ~/dotfiles/_gitconfig ~/.gitconfig
ln -s ~/dotfiles/_gitignore_global ~/.gitignore_global
fi
# virtualenv wrapper
sudo pip install virtualenvwrapper
if [ ! -d ~/Envs ]; then
mkdir ~/Envs
fi