-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathWSL4DataScience.sh
487 lines (464 loc) · 22.3 KB
/
WSL4DataScience.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
#!/bin/bash
#####################################################################################################
# Script_Name : WSL4DataScience.sh
# Description : This script offers tools that let data scientists to
# quickly prepare their WSL for their projects.
# Date : Dec 2021
# written by : siniorone
# WebSite : https://github.com/pytopia/WSL4DataScience
# Version : 1.0
# Disclaimer : Script provided AS IS. Use it at your own risk....
# You can use this script and distribute it as long as credits are kept
# in place and unchanged
# runnig script :$ bash -c "$(wget -qO- https://git.io/JyB33)"
####################################################################################################
logger(){
COLUMNS=60
title=$1
echo -e "\e[1;33m !-----------------------------------------------------!\e[0m"
printf "\e[1;33m%*s\n\e[0m" $(((${#title}+$COLUMNS)/2)) "$title"
echo -e "\e[1;33m !-----------------------------------------------------!\e[0m"
}
show_header(){
/bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;36m ! Welcome to WSL For Data Science Script !\e[0m"
/bin/echo -e "\e[1;36m ! This script is intended to assist data scientists in working !\e[0m"
/bin/echo -e "\e[1;36m ! with the Windows Subsystem for Linux (WSL).To delegate the !\e[0m"
/bin/echo -e "\e[1;36m ! time-consuming tasks and configurations to the script and have !\e[0m"
/bin/echo -e "\e[1;36m ! your system up and running in a short period of time. !\e[0m"
/bin/echo -e "\e[1;36m ! On Windows, we still advocate using [VScode] with the !\e[0m"
/bin/echo -e "\e[1;36m ! [Remote - WSL] Extention for optimal integration and speed. !\e[0m"
/bin/echo -e "\e[1;36m ! Install the [Windows Terminal] app from the Microsoft Store !\e[0m"
/bin/echo -e "\e[1;36m ! to make WSL more easy to use. !\e[0m"
/bin/echo -e "\e[1;36m ! Dec. 2021 !\e[0m"
/bin/echo -e "\e[1;36m ! https://github.com/pytopia/WSL4DataScience !\e[0m"
/bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"
}
show_footer(){
/bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"
/bin/echo -e "\e[1;36m ! https://github.com/pytopia/WSL4DataScience !\e[0m"
/bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m"
}
show_menu(){
line=" ================================================================="
/bin/echo -e "\nInstallation Menu:\n"
/bin/echo -e "\e[0;49;91m 0 HELP ME! \e[0m"
/bin/echo -e "\e[1;49;32m 1 Update WSL \e[0m"
/bin/echo -e "\e[1;49;34m 2 Full Installation \e[0m"
/bin/echo -e "\e[1;49;93m 3 Anaconda Installation \e[0m"
/bin/echo -e "\e[1;49;93m 4 ZSH Installation \e[0m"
/bin/echo -e "\e[1;49;93m 5 Syntax Highlighting & Autosuggestions Installation \e[0m"
/bin/echo -e "\e[1;49;93m 6 Oh My ZSH and other recommended Pkgs Installation \e[0m"
/bin/echo -e "\e[1;49;93m 7 Font Installation \e[0m"
/bin/echo -e "\e[1;49;93m 8 Schemes Installation \e[0m"
/bin/echo -e "\e[1;49;93m 9 MongoDB Installation \e[0m"
/bin/echo -e "\e[1;49;93m 10 Fix ~/.zshrc and Conda init \e[0m"
/bin/echo -e "\e[1;49;93m 11 Create Conda env for DataScience Project \e[0m"
/bin/echo -e "\e[1;49;93m 12 Install R and R kernel for jupyter in conda env \e[0m"
/bin/echo -e "\e[1;49;93m 13 Install Spark and Scala kernel for jupyter in conda env \e[0m"
/bin/echo -e "\e[1;49;93m 14 Install Julia and Julia kernel for jupyter lab \e[0m"
/bin/echo -e "\e[1;49;93m 15 Install C ++ kernel for jupyter in conda env \e[0m"
/bin/echo -e "\e[0;49;91m 99 Exit \e[0m"
/bin/echo -e "$line"
read -p "Please Enter the Installation Mode: " input
while [ $input -lt 0 ] || ([ $input -gt 15 ] && [ $input -ne 99 ]);do
read -p "Please Enter the Installation Mode: " input
done
return $input
}
help_me(){
clear
logger HELP
/bin/echo -e "\e[1;49;91m 1 Update WSL: \e[0m"
/bin/echo -e " install available upgrades of all packages currently installed"
/bin/echo -e " on the system from the sources configured via sources.list"
/bin/echo -e " file. New packages will be installed if required to satisfy"
/bin/echo -e " dependencies, but existing packages will never be removed.\n"
/bin/echo -e "\e[1;49;91m 2 Full Installation: \e[0m"
/bin/echo -e " This part installs all of the script's functionality"
/bin/echo -e " on WSL.This feature is excellent for quickly establishing."
/bin/echo -e " an appropriate environment for data science activities."
/bin/echo -e "\e[1;49;91m 3 Anaconda Installation: \e[0m"
/bin/echo -e " Installs the most recent version of Anaconda, one of the most"
/bin/echo -e " popular package managers for data science projects.\n"
/bin/echo -e "\e[1;49;91m 4 ZSH Installation: \e[0m"
/bin/echo -e " ZSH is a powerful shell that can function as an interactive shell"
/bin/echo -e " as well as a scripting language interpreter. It has many features"
/bin/echo -e " similar to Bash, however some of ZSH's characteristics make it"
/bin/echo -e " superior to Bash, such as spelling correction, cd automation,better"
/bin/echo -e " theme and plugin support, and so on. \n"
/bin/echo -e "\e[1;49;91m 5 Syntax Highlighting & Autosuggestions Installation: \e[0m"
/bin/echo -e " It enables highlighting of commands whilst they are typed at a zsh"
/bin/echo -e " prompt into an interactive terminal. This helps in reviewing commands"
/bin/echo -e " before running them, particularly in catching syntax errors. As you type"
/bin/echo -e " commands, you will see a completion offered after the cursor in a muted"
/bin/echo -e " gray color. If you press the right-arrow key or End with the cursorat the"
/bin/echo -e " end of the buffer, it will accept the suggestion, replacing the contents"
/bin/echo -e " of the command line buffer with the suggestion. If you invoke the"
/bin/echo -e " forward-word widget, it willpartially accept the suggestion up to the point"
/bin/echo -e " that the cursor moves to.\n"
/bin/echo -e "\e[1;49;91m 6 Oh My ZSH and other recommended Pkgs Installation: \e[0m"
/bin/echo -e " Oh My Zsh is a delightful, open source,community-driven framework"
/bin/echo -e " for managing your Zsh configuration. It comes bundled with thousands"
/bin/echo -e " of helpful functions, helpers, plugins, themes... . It also installs"
/bin/echo -e " the Powerlevel9k and Powerline fonts.Powerlevel9k was a tool for building"
/bin/echo -e " a beautiful and highly functional CLI, customized for you.\n"
/bin/echo -e "\e[1;49;91m 7 Font Installation: \e[0m"
/bin/echo -e " This script will install two fonts on Windows:"
/bin/echo -e " [Hack Regular Nerd Font Complete.ttf] and"
/bin/echo -e " [DejaVu Sans Mono Nerd Font Complete.ttf] "
/bin/echo -e " Enter the settings if you're using Windows Terminal."
/bin/echo -e " Choose your WSL profile.Set the Face Font option on"
/bin/echo -e " the Appearance tab to one of the two fonts shown above."
/bin/echo -e " Font adjustments are required to effectively display "
/bin/echo -e " WSL's features and capabilities. \n"
/bin/echo -e "\e[1;49;91m 8 Schemes Installation: \e[0m"
/bin/echo -e " Downloads around 40 schemas from the Iterm 2 "
/bin/echo -e " collection and adds them to the Windows Terminal settings."
/bin/echo -e " Before running this script, you must have Windows Terminal "
/bin/echo -e " installed. \n"
/bin/echo -e "\e[1;49;91m 9 MongoDB Installation: \e[0m"
/bin/echo -e " Due to the numerous issues encountered with the installation"
/bin/echo -e " of MongoDB on WSL, this script attempts to install version 4.4"
/bin/echo -e " on WSL so that you may access MongoDB through 127.0.0.1"
/bin/echo -e " and port 27017. In addition, if you want to install MongoDB"
/bin/echo -e " on Windows and use it with WSL, a script will be added to your"
/bin/echo -e " WSL at the ~/findmongo path, and runs with this command:"
/bin/echo -e " $ source ~/findmongo."
/bin/echo -e " findmongo displays the correct host and port for MongoDB"
/bin/echo -e " that installed on Windows."
/bin/echo -e " More information may be found in the README file of project.\n"
/bin/echo -e "\e[1;49;91m 10 Fix ~/.zshrc and Conda init: \e[0m"
/bin/echo -e " This section enhances ZSH command prompt,"
/bin/echo -e " makes it compatible with Anaconda and Powerlevel9k,"
/bin/echo -e " and adds Anaconda's default settings to ~/.zshrc .\n"
/bin/echo -e "\e[1;49;91m 11 Create Conda env for DataScience Project: \e[0m"
/bin/echo -e " In this section to provide a complete environment for"
/bin/echo -e " data science activities a Python environment is created"
/bin/echo -e " with the following packages and with your desired name: "
/bin/echo -e " python=3.8 jupyterlab pandas"
/bin/echo -e " numpy scipy matplotlib seaborn"
/bin/echo -e " scikit-learn tensorflow keras plotly"
/bin/echo -e " pytorch pymongo scrapy beautifulsoup4\n"
/bin/echo -e "\e[1;49;91m 12 Install R and R kernel for jupyter in conda env \e[0m"
/bin/echo -e " Enter the name of a new environment to be created, and"
/bin/echo -e " the R, R kernel, and Jupyter lab will be installed on"
/bin/echo -e " it at the same time.\n"
/bin/echo -e "\e[1;49;91m 13 Install SPARK and Scala kernel for jupyter in conda env \e[0m"
/bin/echo -e " Enter the name of a new environment to be created, and"
/bin/echo -e " the SPARK, Scala kernel, and Jupyter lab will be installed on"
/bin/echo -e " it at the same time.\n"
/bin/echo -e "\e[1;49;91m 14 This script installs Julia into your system, performs \e[0m"
/bin/echo -e " its initial settings, and adds the Julia kernel to your"
/bin/echo -e " Jupyter lab. This gives you access to the Julia kernel"
/bin/echo -e " in all anaconda environments.\n"
/bin/echo -e "\e[1;49;91m 15 This script installs C++ kernel into your \e[0m"
/bin/echo -e " jupyter lab in new conda env.\n"
/bin/echo -e "\e[1;49;91m 99 Exit: \e[0m"
/bin/echo -e " You can quit the script by typing the number 99 in the menu.\n\n"
read -p "Press Any Key to Exit : "
return 99
}
update_wsl(){
logger "Update WSL"
sudo apt update -y
sudo apt upgrade -y
}
anaconda_installation(){
logger "Anaconda Installation"
cd /tmp
curl https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh --output anaconda.sh
read -r shm_id rest <<<"$(sha256sum /tmp/anaconda.sh)"
if [[ "$shm_id" == "fedf9e340039557f7b5e8a8a86affa9d299f5e9820144bd7b92ae9f7ee08ac60" ]];then
echo "Anaconda Downloaded Correctly"
bash /tmp/anaconda.sh -u -b -p $HOME/anaconda3
source ~/anaconda3/etc/profile.d/conda.sh
if [ -n "$ZSH_VERSION" ]; then
conda init zsh
elif [ -n "$BASH_VERSION" ]; then
conda init bash
fi
else
echo "anaconda.sh file is corrupted!!!"
fi
echo "c.NotebookApp.use_redirect_file = False" > ~/.jupyter/jupyter_notebook_config.py
}
syntax_auto_installation(){
logger "Syntax Highlighting & Autosuggestions Installation"
sudo apt install -y zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
}
zsh_installation(){
logger "ZSH Installation"
sudo apt install -y zsh
if [[ ! -f /root/.zsh ]];then
echo "*"
else
sudo mv -fr /root/.zsh /home/$SUDO_USER/.zsh
fi
}
oh_my_zsh_installation(){
logger "Oh My ZSH and other recemnded Pkgs Installation"
sudo apt install -y powerline fonts-powerline
sudo apt install -y zsh-theme-powerlevel9k
sudo rm -r -f ~/.oh-my-zsh
echo $(whoami)
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
}
font_installation(){
logger "Font Installation"
rm -r -f /mnt/c/myfonts
mkdir /mnt/c/myfonts
cd /mnt/c/myfonts
cat << EOF > Install_Fonts.ps1
\$FontsFolder = "fonts-to-be-installed"
\$FONTS = 0x14
\$CopyOptions = 4 + 16;
\$objShell = New-Object -ComObject Shell.Application
\$objFolder = \$objShell.Namespace(\$FONTS)
\$allFonts = dir \$FontsFolder
foreach(\$font in Get-ChildItem -Path \$fontsFolder -File)
{
\$dest = "C:\Windows\Fonts\\$font"
echo "Installing \$font"
\$CopyFlag = [String]::Format("{0:x}", \$CopyOptions);
\$objFolder.CopyHere(\$font.fullname,\$CopyFlag)
}
EOF
mkdir fonts-to-be-installed
cd fonts-to-be-installed
wget https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete.ttf --output-document=DejaVu\ Sans\ Mono\ Nerd\ Font\ Complete.ttf
wget https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf --output-document=Hack\ Regular\ Nerd\ Font\ Complete.ttf
cd ..
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -executionpolicy Bypass -nologo -noninteractive -file C:/myfonts/Install_Fonts.ps1
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Set-ExecutionPolicy -Scope Process -ExecutionPolicy Default
cd ~
}
schemes_installation(){
logger "Schemes Installation"
bash -c "$(wget -qO- https://git.io/JyBnV)"
}
mongodb_installation(){
logger "MongoDB Installation"
sudo rm -rf /etc/apt/sources.list.d/mongo*
sudo apt purge mongodb-database-tools mongodb-mongosh mongodb-org* -y
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
if [[ $(lsb_release -sr) == "20.04" ]];then
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
else
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
fi
sudo apt update -y
sudo apt install -y mongodb-org
set -e
if grep -qE "(Microsoft|WSL)" /proc/version &> /dev/null ; then
sudo rm -f /etc/init/mongodb.conf
sudo rm -f /etc/init/mongod
sudo curl --http1.1 https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d --output /etc/init.d/mongod
sudo chmod 755 /etc/init.d/mongod
sudo mkdir -p /data/db
sudo chown -R mongodb:mongodb /data/db
fi
echo 'echo "Mongo Bash Script"
cd /mnt/c/Program\ Files/MongoDB/Server
cd $(ls -d */|head -n 1)
cd bin
export MONGO_HOST=$(cat /etc/resolv.conf | grep nameserver | sed "s/nameserver\ //")
sudo cp mongod.cfg /tmp/mongod.cfg
sed -i "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/$MONGO_HOST/" /tmp/mongod.cfg
sudo cat /tmp/mongod.cfg > mongod.cfg
echo "host: $MONGO_HOST port:27017"
cd' > ~/findmongo
echo "MongoDB Host: 127.0.0.1 Port: 27017"
sudo service mongod start
}
fix_zshrc(){
logger "Fix ~/.zshrc"
ver=$(lsb_release -sr)
cat << EOF > ~/.zshrc
echo Ubuntu $ver
cd ~
export ZSH="/home/$(whoami)/.oh-my-zsh"
ZSH_THEME="agnoster"
plugins=(git)
source /home/$(whoami)/.oh-my-zsh/oh-my-zsh.sh
source /usr/share/powerlevel9k/powerlevel9k.zsh-theme
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
bindkey '^ ' autosuggest-accept
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda user dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history ram ssh)
EOF
echo $(whoami)
sudo usermod -s /usr/bin/zsh $(whoami)
source ~/anaconda3/etc/profile.d/conda.sh
conda init zsh
echo "done!"
}
conda_env(){
logger "Create Conda env for DataScience Project"
if [[ $# -eq 0 ]];then
read -p "Please Enter Conda Env Name: " env
else
env=$1
fi
echo "$env"
conda create --name $env \
python=3.8 jupyterlab pandas\
numpy scipy matplotlib seaborn\
scikit-learn tensorflow keras plotly\
pytorch pymongo scrapy beautifulsoup4 -y
cd ~/.jupyter
rm -r -f jupyter_notebook_config.py
echo "c.NotebookApp.use_redirect_file = False" > ~/.jupyter/jupyter_notebook_config.py
}
r_installation(){
logger "R installation..."
if which conda >/dev/null; then
conda --version
read -p "Please Enter Conda Env Name: " env
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
if [[ $(lsb_release -rs) == "20.04" ]]; then
echo "Ubuntu-20.04"
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
elif [[ $(lsb_release -rs) == "18.04" ]]; then
echo "Ubuntu-18.04"
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'
fi
sudo apt update -y
sudo apt install r-base -y
sudo apt-get install r-base-dev
logger "R Kernal and Jupyter installation..."
conda create --name $env python=3.9 jupyterlab r r-essentials -y
else
echo "conda does not exist on your system!"
fi
echo "c.NotebookApp.use_redirect_file = False" > ~/.jupyter/jupyter_notebook_config.py
}
spark_scala(){
logger "Spark and Scala installation..."
read -p "Please Enter Conda Env Name: " env
logger "JAVA 8 installation..."
sudo apt install openjdk-8-jre-headless -y
logger "Scala Installation..."
cd /tmp
wget https://github.com/lampepfl/dotty/releases/download/3.1.0/scala3-3.1.0.tar.gz
sudo tar -xf scala3-3.1.0.tar.gz
sudo rm -rf /usr/local/scala
sudo mkdir /usr/local/scala
cd scala3-3.1.0
sudo mv * /usr/local/scala
logger "SPARK installation..."
cd /tmp
rm spark-3.2.0-bin-hadoop3.2.tgz
wget -v "https://dlcdn.apache.org/spark/spark-3.2.0/spark-3.2.0-bin-hadoop3.2.tgz"
sudo tar -xzvf spark-3.2.0-bin-hadoop3.2.tgz -C ~/
cd ~
rm -rf spark
mv spark-3.2.0-bin-hadoop3.2 spark
logger "Adding Enviormental Variable..."
sed -i "/JAVA_HOME/d" ~/.zshrc
sed -i "/usr\/local\/scala\/bin/d" ~/.zshrc
sed -i "/SPARK_HOME/d" ~/.zshrc
sed -i "/SPARK_HOME\/bin/d" ~/.zshrc
cat << EOF >> ~/.zshrc
export JAVA_HOME="/usr"
export PATH="\$PATH:/usr/local/scala/bin"
export SPARK_HOME="\$HOME/spark"
export PATH="\$PATH:\$SPARK_HOME/bin"
EOF
sed -i "/JAVA_HOME/d" ~/.bashrc
sed -i "/usr\/local\/scala\/bin/d" ~/.bashrc
sed -i "/SPARK_HOME/d" ~/.bashrc
sed -i "/SPARK_HOME\/bin/d" ~/.bashrc
cat << EOF >> ~/.bashrc
export JAVA_HOME="/usr"
export PATH="\$PATH:/usr/local/scala/bin"
export SPARK_HOME="\$HOME/spark"
export PATH="\$PATH:\$SPARK_HOME/bin"
EOF
logger "Creating conda env and adding Scala kernel..."
conda create --name $env python=3.9 jupyterlab -y
source ~/anaconda3/etc/profile.d/conda.sh
conda activate $env
pip install py4j
conda install -c conda-forge spylon-kernel -y
python -m spylon_kernel install --user
}
julia_installation(){
sudo apt update -y
cd /tmp
wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.5-linux-x86_64.tar.gz
tar zxvf julia-1.6.5-linux-x86_64.tar.gz
sudo rm -rf /usr/local/julia
sudo mkdir /usr/local/julia
cd /tmp/julia-1.6.5/
sudo mv * /usr/local/julia
sed -i "/julia\/bin/d" ~/.zshrc
cat << EOF >> ~/.zshrc
export PATH="$PATH:/usr/local/julia/bin"
EOF
sed -i "/julia\/bin/d" ~/.bashrc
cat << EOF >> ~/.bashrc
export PATH="$PATH:/usr/local/julia/bin"
EOF
export PATH="$PATH:/usr/local/julia/bin"
echo '
using Pkg
Pkg.add("IJulia")
' | /usr/local/julia/bin/julia
}
c_installation(){
logger "C++ Kernel installation..."
if which conda >/dev/null; then
conda --version
read -p "Please Enter Conda Env Name: " env
conda create --name $env python=3.9 jupyterlab -y
source ~/anaconda3/etc/profile.d/conda.sh
conda activate $env
conda install xeus -c conda-forge -y
conda install xeus-cling==0.9.0 -c conda-forge -y
else
echo "conda does not exist on your system!"
fi
}
full_installation(){
logger "Full Installation"
update_wsl
anaconda_installation
zsh_installation
syntax_auto_installation
oh_my_zsh_installation
schemes_installation
fix_zshrc
conda_env "ds38"
font_installation
mongodb_installation
}
main(){
clear
show_header
show_menu
input=$?
case $input in
0) help_me;;
1) update_wsl;;
2) full_installation;;
3) anaconda_installation;;
4) zsh_installation;;
5) syntax_auto_installation;;
6) oh_my_zsh_installation;;
7) font_installation;;
8) schemes_installation;;
9) mongodb_installation;;
10) fix_zshrc;;
11) conda_env;;
12) r_installation;;
13) spark_scala;;
14) julia_installation;;
15) c_installation;;
esac
show_footer
}
main