-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·180 lines (157 loc) · 5.16 KB
/
setup.sh
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/bin/sh
# Fail on error
set -e
# Pick script location
SETUP_DIR=$(pwd)
# Create installers placeholder
mkdir -p $SETUP_DIR/installers
# Update repo and libraries
echo "Updating libraries..."
sudo apt-get update
echo "Upgrading system..."
#sudo apt-get upgrade
# Utilities
echo "Setting up utilities..."
sudo apt-get install -y gconf2
sudo apt-get install -y dconf-cli
sudo apt-get install -y gnome-shell
sudo apt-get install -y gnome-terminal
sudo apt-get install -y dconf-editor
sudo apt-get install -y vim
sudo apt-get install -y curl
sudo apt-get install -y git
sudo apt-get install -y awscli
sudo apt-get install -y screen
sudo apt-get install -y gcc
sudo apt-get install -y make
sudo apt-get install -y g++
sudo apt-get install -y build-essential
sudo apt-get install -y uuid-dev
sudo apt-get install -y autoconf
sudo apt-get install -y openssl
sudo apt-get install -y fop
sudo apt-get install -y xsltproc
sudo apt-get install -y unixodbc-dev
sudo apt-get install -y gnuplot
sudo apt-get install -y rlwrap
sudo apt-get install -y tree
sudo apt-get install -y libncurses-dev
sudo apt-get install -y libtool
sudo apt-get install -y libssl-dev
sudo apt-get install -y automake
sudo apt-get install -y checkinstall
sudo apt-get install -y graphviz
sudo apt-get install -y markdown
sudo apt-get install -y font-manager
sudo apt-get install -y figlet
sudo apt-get install -y cowsay
sudo apt-get install -y htop
sudo apt-get install -y sysstat
sudo apt-get install -y yajl-tools
sudo apt-get install -y gimp
sudo apt-get install -y meld
sudo apt-get install -y ruby
sudo apt-get install -y ant
sudo apt-get install -y p7zip-full
sudo apt-get install -y unrar
sudo apt-get install -y cmake
sudo apt-get install -y ssmtp
sudo apt-get install -y alien
sudo apt-get install -y libevent-dev
sudo apt-get install -y libpng-dev
sudo apt-get install -y libcurl4-openssl-dev
# For Unicode Support for most used fonts
sudo apt install -y fonts-noto
echo "Setting up R..."
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9
sudo add-apt-repository "deb https://cran.cnr.berkeley.edu/bin/linux/ubuntu xenial/"
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
echo "Setting up nodejs..."
sudo apt-get purge nodejs npm
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 68576280
sudo apt-add-repository "deb https://deb.nodesource.com/node_7.x $(lsb_release -sc) main"
sudo apt-get update
sudo apt-get install nodejs
# Shell (zsh) and syntax highlighting
echo "Setting up oh-my-zsh..."
sudo apt-get install -y zsh
if [ ! -e ~/.oh-my-zsh ]; then
git clone [email protected]:ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
git clone [email protected]:zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
sudo chsh -s /bin/zsh
fi
# Pull environment files
if [ ! -e $SETUP_DIR/dotfiles ]; then
echo "Grabing dotfiles..."
git clone https://github.com/anujsrc/dotfiles.git
fi
# Keep a backup of existing files, if any
BACKUP_TS=$(date +"%m-%d-%Y_%T")
backup_dotfiles() {
mkdir -p ~/dotfbkp_$BACKUP_TS
while [ $# -ne 0 ]; do
mv ~/$1 ~/dotfbkp_$BACKUP_TS
cp $SETUP_DIR/dotfiles/$1 ~/$1
shift
done
}
# Backup and setup environment files
echo "Setting up dotfiles..."
backup_dotfiles .vimrc .zshrc .screenrc .ctags .minttyrc .tmux.conf
# Setup envrc, iff it does not exist
if [ ! -e ~/.envrc ]; then
echo "Setting up envrc..."
cp $SETUP_DIR/dotfiles/.envrc ~/.envrc;
fi
# solarized and dircolors setup for ubuntu
# colors from [email protected]:seebi/dircolors-solarized.git
platform=`uname`
if [ $platform = 'Linux' ] && [ ! -e $SETUP_DIR/gnome-terminal-colors-solarized ]; then
echo "Preparing solarized theme for terminal..."
git clone [email protected]:aruhier/gnome-terminal-colors-solarized.git
cd gnome-terminal-colors-solarized
./set_dark.sh
cd ..
cp $SETUP_DIR/dotfiles/external/dircolors.256dark ~/.dir_colors
fi
# fonts
echo "Setting up fonts..."
mkdir -p ~/.fonts
cp $SETUP_DIR/dotfiles/external/Hermit*.otf ~/.fonts
cp $SETUP_DIR/dotfiles/external/Inconsolata*.otf ~/.fonts
sudo fc-cache -vf ~/.fonts
# liquid prompt
if [ ! -e ~/bin/liquidprompt ]; then
echo "Setting up liquidprompt..."
mkdir -p ~/bin
wget https://raw.github.com/nojhan/liquidprompt/master/liquidprompt -P ~/bin
fi
# Setup vim plug-ins
echo "Setting up vim plugins..."
mkdir -p ~/.vim/pathogen ~/.vim/autoload ~/.vim/bundle
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
# vundle setup
if [ ! -e ~/.vim/bundle/vundle ]; then
git clone [email protected]:VundleVim/Vundle.vim.git ~/.vim/bundle/vundle
fi
# vim pathogen plugins
if [ ! -e ~/.vim/pathogen/vim-colors-solarized ]; then
git clone [email protected]:altercation/vim-colors-solarized.git ~/.vim/pathogen/vim-colors-solarized
fi
if [ ! -e ~/.vim/pathogen/nerdtree ]; then
git clone [email protected]:preservim/nerdtree.git ~/.vim/pathogen/nerdtree
fi
echo "Installing vim plugins..."
vim +BundleInstall +qall
echo "Installing emacs 25.1"
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt-get update
sudo apt-get install emacs25
if [ ! -e ~/.emacs.d ]; then
cd
echo "Pulling emacs.d..."
git clone https://github.com/anujsrc/emacs.d ~/.emacs.d
fi
echo "Enjoy!"