-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstartup.sh
175 lines (156 loc) · 4.36 KB
/
startup.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
aptlist=" "
condalist=" "
echo "Install Anaconda 3? (latest)"
select anaconda in "Yes" "No"; do
case $anaconda in
Yes ) break;;
No ) break;;
esac
done
echo "Install Miniconda 3? (latest)"
select miniconda in "Yes" "No"; do
case $miniconda in
Yes ) break;;
No ) break;;
esac
done
echo "Install Cyclus Dependencies? (conda)"
select condacyclus in "Yes" "No"; do
case $condacyclus in
Yes )
condalist+="openssh gxx_linux-64 gcc_linux-64 cmake make docker-pycreds git xo python-json-logger \
python=3.6 glibmm glib=2.56 libxml2 libxmlpp libblas libcblas liblapack pkg-config \
coincbc=2.9 boost-cpp hdf5 sqlite pcre gettext bzip2 xz setuptools nose pytables pandas \
jinja2 cython==0.26 websockets pprintpp "
break;;
No ) break;;
esac
done
echo "Install Pyne Dependencies? (conda)"
select condapyne in "Yes" "No"; do
case $condapyne in
Yes )
condalist+="conda-build jinja2 nose setuptools pytables hdf5 scipy "
break;;
No ) break;;
esac
done
echo "Install Pyne Dependencies? (apt)"
select pyne in "Yes" "No"; do
case $pyne in
Yes )
aptlist+="build-essential gfortran libblas-dev liblapack-dev libhdf5-dev autoconf libtool "
break;;
No ) break;;
esac
done
echo "Install Jupyter Extensions?"
select nbextension in "Yes" "No"; do
case $nbextension in
Yes )
condalist+="jupyter_contrib_nbextensions autopep8 "
break;;
No ) break;;
esac
done
echo "Install Sublime Text?"
select sublime in "Yes" "No"; do
case $sublime in
Yes )
aptlist+="sublime-text "
break;;
No ) break;;
esac
done
echo "Install Other Software (apt)?"
select other in "Yes" "No"; do
case $other in
Yes )
echo "List all apt to get (separated by single space only)"
read aptget;
aptlist+="$aptget "
break;;
No ) break;;
esac
done
echo "Setup Git?"
select github in "Yes" "No"; do
case $github in
Yes )
echo "Enter Git User Email";
read email;
git config --global user.email $email;
echo "Enter Git User Name";
read name;
git config --global user.name $name;
echo "Enter Default editor";
read editor;
git config --global core.editor $editor;
ssh-keygen -t rsa -b 4096 -C $email;
echo "Copy and Paste this to: https://github.com/settings/ssh/new"
echo "$(cat $HOME/.ssh/id_rsa.pub)"
break;;
No ) break;;
esac
done
echo "Display git branch name in shell?"
echo "(obtained from: https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt)"
select parsegit in "Yes" "No"; do
case $parsegit in
Yes )
cat settings/parse_git_branch.txt >> $HOME/.bashrc;
break;;
No ) break;;
esac
done
echo "Running wsl2 with xserver?"
select wsl in "Yes" "No"; do
case $wsl in
Yes )
cat settings/wsl.txt >> $HOME/.bashrc;
break;;
No ) break;;
esac
done
echo "Restore personal settings? (This adds aliases. Please check $HOME/.bashrc for new aliases)"
select alias in "Yes" "No"; do
case $alias in
Yes )
cat settings/alias.txt >> $HOME/.bashrc
break;;
No ) break;;
esac
done
if [[ $sublime == "Yes" ]]; then
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
fi
sudo apt update;
sudo apt install -y $aptlist;
sudo apt dist-upgrade -y;
if [[ $anaconda == "Yes" ]]; then
wget -O - https://www.anaconda.com/distribution/ 2>/dev/null \
| sed -ne 's@.*\(https:\/\/repo\.anaconda\.com\/miniconda\/Anaconda3-.*-Linux-x86_64\.sh\)\">64-Bit (x86) Installer.*@\1@p' \
| xargs wget -O Anaconda3.sh
bash anaconda3.sh -b -p $HOME/conda
rm anaconda3.sh
echo -e '\nexport PATH="$HOME/conda/bin:$PATH"\n' >> $HOME/.bashrc
export PATH="$HOME/conda/bin:$PATH"
conda config --add channels conda-forge
fi
if [[ $miniconda == "Yes" ]]; then
wget -O miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash miniconda3.sh -b -p $HOME/conda
rm miniconda3.sh
echo -e '\nexport PATH="$HOME/conda/bin:$PATH"\n' >> $HOME/.bashrc
export PATH="$HOME/conda/bin:$PATH"
conda config --add channels conda-forge
fi
if [[ $condacyclus == "Yes" ]]; then
echo 'Pinning conda packages to prevent updates for cyclus compatibility'
cp settings/conda-pinned.txt $HOME/conda3/conda-meta/pinned
#statements
fi
conda update -c conda-forge -y --all;
conda install -c conda-forge -y $condalist;
echo -e $"Done.\nDon't forget to run 'source $HOME/.bashrc'"