├── README.md ├── WSL4DataScience.sh ├── images ├── WSL-Beautifier.jpg ├── WSL-Schemes.jpg ├── WSL4DS.jpg ├── c_plus_plus.jpg ├── font-properties.jpg ├── julia.jpg ├── r_kernel.jpg ├── spylon_scala.jpg └── windows-terminal-appearance.jpg └── schemes.sh /README.md: -------------------------------------------------------------------------------- 1 | # WSL For Data Science 2 |

3 | WSL Beautifier 4 |

5 | 6 | ## A. Running the script : 7 | 8 | ```sh 9 | bash -c "$(wget -qO- https://git.io/JyB33)" 10 | ``` 11 |

12 | WSL For Data Science MENU 13 |

14 | 15 | ### 1.Update WSL: 16 | Install available upgrades of all packages currently installed on the system from the sources configured via sources.list file. New packages will be installed if required to satisfy dependencies, but existing packages will never be removed. 17 | 18 | ### 2.Full Installation: 19 | This part installs all of the script's functionality on WSL.This feature is excellent for quickly establishing. an appropriate environment for data science activities. 20 | 21 | ### 3.Anaconda Installation: 22 | Installs the most recent version of Anaconda, one of the most popular package managers for data science projects. 23 | 24 | ### 4.ZSH Installation: 25 | ZSH is a powerful shell that can function as an interactive shell as well as a scripting language interpreter. It has many features similar to Bash, however some of ZSH's characteristics make it superior to Bash, such as spelling correction, cd automation,better theme and plugin support, and so on. 26 | 27 | ### 5.Syntax Highlighting & Autosuggestions Installation: 28 | It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors. As you type commands, you will see a completion offered after the cursor in a muted gray color. If you press the right-arrow key or End with the cursorat the end of the buffer, it will accept the suggestion, replacing the contents of the command line buffer with the suggestion. If you invoke the forward-word widget, it willpartially accept the suggestion up to the point that the cursor moves to. 29 | 30 | ### 6.Oh My ZSH and other recommended Pkgs Installation: 31 | Oh My Zsh is a delightful, open source,community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes... . It also installs the Powerlevel9k and Powerline fonts.Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. 32 | 33 | ### 7.Font Installation: 34 | This script will install two fonts on Windows: [**Hack Regular Nerd Font Complete.ttf**] and [**DejaVu Sans Mono Nerd Font Complete.ttf**] Enter the settings if you're using Windows Terminal. Choose your WSL profile.Set the Face Font option on the Appearance tab to one of the two fonts shown above.Font adjustments are required to effectively display WSL's features and capabilities. 35 | 36 | ### 8.Schemes Installation: 37 | Downloads around 40 schemas from the Iterm 2 collection and adds them to the Windows Terminal settings. Before running this script, you must have Windows Terminal installed. 38 | 39 | ### 9.MongoDB Installation: 40 | Due to the numerous issues encountered with the installation of MongoDB on WSL, this script attempts to install version 4.4 on WSL so that you may access MongoDB through **127.0.0.1** and port **27017**. In addition, if you want to install MongoDB on Windows and use it with WSL, a script will be added to your WSL at the `~/findmongo` path, and runs with this command:```$ source ~/findmongo```.findmongo displays the correct host and port for MongoDB that installed on Windows. More information may be found in the README file of project. 41 | 42 | ### 10. Fix ~/.zshrc and Conda init: 43 | This section enhances ZSH command prompt, makes it compatible with Anaconda and Powerlevel9k, and adds Anaconda's default settings to ~/.zshrc . 44 | 45 | ### 11.Create Conda env for DataScience Project: 46 | In this section to provide a complete environment for data science activities a Python environment is created with the following packages and with your desired name: 47 | ``` 48 | python=3.8 jupyterlab pandas 49 | numpy scipy matplotlib seaborn 50 | scikit-learn tensorflow keras plotly 51 | pytorch pymongo scrapy beautifulsoup4 52 | ``` 53 | ### 12.Install R and R kernal for jupyter in conda env: 54 | Enter the name of a new environment to be created, and 55 | the R, R kernel, and Jupiter lab will be installed on 56 | it at the same time. 57 | 58 |

59 | r_kernel 60 |

61 | 62 | ### 13.Install SPARK and Scala kernel for jupyter in conda env 63 | Enter the name of a new environment to be created, and the SPARK,Scala and Scala kernel, and Jupyter lab will be installed on it at the same time. 64 |

65 | spylon_scala 66 |

67 | 68 | ### 14.Install Julia and Julia kernel for jupyter lab 69 | This script installs Julia into your system, performs its initial settings, and adds the Julia kernel to your Jupyter lap. This gives you access to the Julia kernel in all anaconda environments. 70 |

71 | julia 72 |

73 | 74 | ### 15.Install C ++ kernel for jupyter in conda env 75 | This script installs C++ kernel into your jupyter lab in new conda env. 76 |

77 | c_plus_plus 78 |

79 | 80 | ### 99.Exit: 81 | You can quit the script by typing the number 99 in the menu. 82 | 83 | ## B. Close and Open WSL again and change defult font to the : 84 | 85 | change the font to the: 86 | [ DejaVu Sans Mono Nerd Font Complete ] or [Hack Regular Nerd Font Complete] 87 | 88 |

89 | WSL font properties 90 |

91 | 92 | ## C. Open Windows Terminal and change Font and Scheme : 93 |

94 | WSL Schemes 95 |

96 | 97 | Select your favourite scheme and change the font to the: 98 | [ DejaVu Sans Mono Nerd Font Complete ] or [Hack Regular Nerd Font Complete] 99 |

100 | windows terminal appearance 101 |

102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /WSL4DataScience.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ##################################################################################################### 3 | # Script_Name : WSL4DataScience.sh 4 | # Description : This script offers tools that let data scientists to 5 | # quickly prepare their WSL for their projects. 6 | # Date : Dec 2021 7 | # written by : siniorone 8 | # WebSite : https://github.com/pytopia/WSL4DataScience 9 | # Version : 1.0 10 | # Disclaimer : Script provided AS IS. Use it at your own risk.... 11 | # You can use this script and distribute it as long as credits are kept 12 | # in place and unchanged 13 | # runnig script :$ bash -c "$(wget -qO- https://git.io/JyB33)" 14 | #################################################################################################### 15 | 16 | logger(){ 17 | COLUMNS=60 18 | title=$1 19 | echo -e "\e[1;33m !-----------------------------------------------------!\e[0m" 20 | printf "\e[1;33m%*s\n\e[0m" $(((${#title}+$COLUMNS)/2)) "$title" 21 | echo -e "\e[1;33m !-----------------------------------------------------!\e[0m" 22 | } 23 | show_header(){ 24 | /bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m" 25 | /bin/echo -e "\e[1;36m ! Welcome to WSL For Data Science Script !\e[0m" 26 | /bin/echo -e "\e[1;36m ! This script is intended to assist data scientists in working !\e[0m" 27 | /bin/echo -e "\e[1;36m ! with the Windows Subsystem for Linux (WSL).To delegate the !\e[0m" 28 | /bin/echo -e "\e[1;36m ! time-consuming tasks and configurations to the script and have !\e[0m" 29 | /bin/echo -e "\e[1;36m ! your system up and running in a short period of time. !\e[0m" 30 | /bin/echo -e "\e[1;36m ! On Windows, we still advocate using [VScode] with the !\e[0m" 31 | /bin/echo -e "\e[1;36m ! [Remote - WSL] Extention for optimal integration and speed. !\e[0m" 32 | /bin/echo -e "\e[1;36m ! Install the [Windows Terminal] app from the Microsoft Store !\e[0m" 33 | /bin/echo -e "\e[1;36m ! to make WSL more easy to use. !\e[0m" 34 | /bin/echo -e "\e[1;36m ! Dec. 2021 !\e[0m" 35 | /bin/echo -e "\e[1;36m ! https://github.com/pytopia/WSL4DataScience !\e[0m" 36 | /bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m" 37 | } 38 | show_footer(){ 39 | /bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m" 40 | /bin/echo -e "\e[1;36m ! https://github.com/pytopia/WSL4DataScience !\e[0m" 41 | /bin/echo -e "\e[1;36m !----------------------------------------------------------------!\e[0m" 42 | } 43 | 44 | show_menu(){ 45 | line=" =================================================================" 46 | /bin/echo -e "\nInstallation Menu:\n" 47 | /bin/echo -e "\e[0;49;91m 0 HELP ME! \e[0m" 48 | /bin/echo -e "\e[1;49;32m 1 Update WSL \e[0m" 49 | /bin/echo -e "\e[1;49;34m 2 Full Installation \e[0m" 50 | /bin/echo -e "\e[1;49;93m 3 Anaconda Installation \e[0m" 51 | /bin/echo -e "\e[1;49;93m 4 ZSH Installation \e[0m" 52 | /bin/echo -e "\e[1;49;93m 5 Syntax Highlighting & Autosuggestions Installation \e[0m" 53 | /bin/echo -e "\e[1;49;93m 6 Oh My ZSH and other recommended Pkgs Installation \e[0m" 54 | /bin/echo -e "\e[1;49;93m 7 Font Installation \e[0m" 55 | /bin/echo -e "\e[1;49;93m 8 Schemes Installation \e[0m" 56 | /bin/echo -e "\e[1;49;93m 9 MongoDB Installation \e[0m" 57 | /bin/echo -e "\e[1;49;93m 10 Fix ~/.zshrc and Conda init \e[0m" 58 | /bin/echo -e "\e[1;49;93m 11 Create Conda env for DataScience Project \e[0m" 59 | /bin/echo -e "\e[1;49;93m 12 Install R and R kernel for jupyter in conda env \e[0m" 60 | /bin/echo -e "\e[1;49;93m 13 Install Spark and Scala kernel for jupyter in conda env \e[0m" 61 | /bin/echo -e "\e[1;49;93m 14 Install Julia and Julia kernel for jupyter lab \e[0m" 62 | /bin/echo -e "\e[1;49;93m 15 Install C ++ kernel for jupyter in conda env \e[0m" 63 | /bin/echo -e "\e[0;49;91m 99 Exit \e[0m" 64 | /bin/echo -e "$line" 65 | read -p "Please Enter the Installation Mode: " input 66 | while [ $input -lt 0 ] || ([ $input -gt 15 ] && [ $input -ne 99 ]);do 67 | read -p "Please Enter the Installation Mode: " input 68 | done 69 | return $input 70 | } 71 | 72 | help_me(){ 73 | clear 74 | logger HELP 75 | /bin/echo -e "\e[1;49;91m 1 Update WSL: \e[0m" 76 | /bin/echo -e " install available upgrades of all packages currently installed" 77 | /bin/echo -e " on the system from the sources configured via sources.list" 78 | /bin/echo -e " file. New packages will be installed if required to satisfy" 79 | /bin/echo -e " dependencies, but existing packages will never be removed.\n" 80 | /bin/echo -e "\e[1;49;91m 2 Full Installation: \e[0m" 81 | /bin/echo -e " This part installs all of the script's functionality" 82 | /bin/echo -e " on WSL.This feature is excellent for quickly establishing." 83 | /bin/echo -e " an appropriate environment for data science activities." 84 | /bin/echo -e "\e[1;49;91m 3 Anaconda Installation: \e[0m" 85 | /bin/echo -e " Installs the most recent version of Anaconda, one of the most" 86 | /bin/echo -e " popular package managers for data science projects.\n" 87 | /bin/echo -e "\e[1;49;91m 4 ZSH Installation: \e[0m" 88 | /bin/echo -e " ZSH is a powerful shell that can function as an interactive shell" 89 | /bin/echo -e " as well as a scripting language interpreter. It has many features" 90 | /bin/echo -e " similar to Bash, however some of ZSH's characteristics make it" 91 | /bin/echo -e " superior to Bash, such as spelling correction, cd automation,better" 92 | /bin/echo -e " theme and plugin support, and so on. \n" 93 | /bin/echo -e "\e[1;49;91m 5 Syntax Highlighting & Autosuggestions Installation: \e[0m" 94 | /bin/echo -e " It enables highlighting of commands whilst they are typed at a zsh" 95 | /bin/echo -e " prompt into an interactive terminal. This helps in reviewing commands" 96 | /bin/echo -e " before running them, particularly in catching syntax errors. As you type" 97 | /bin/echo -e " commands, you will see a completion offered after the cursor in a muted" 98 | /bin/echo -e " gray color. If you press the right-arrow key or End with the cursorat the" 99 | /bin/echo -e " end of the buffer, it will accept the suggestion, replacing the contents" 100 | /bin/echo -e " of the command line buffer with the suggestion. If you invoke the" 101 | /bin/echo -e " forward-word widget, it willpartially accept the suggestion up to the point" 102 | /bin/echo -e " that the cursor moves to.\n" 103 | /bin/echo -e "\e[1;49;91m 6 Oh My ZSH and other recommended Pkgs Installation: \e[0m" 104 | /bin/echo -e " Oh My Zsh is a delightful, open source,community-driven framework" 105 | /bin/echo -e " for managing your Zsh configuration. It comes bundled with thousands" 106 | /bin/echo -e " of helpful functions, helpers, plugins, themes... . It also installs" 107 | /bin/echo -e " the Powerlevel9k and Powerline fonts.Powerlevel9k was a tool for building" 108 | /bin/echo -e " a beautiful and highly functional CLI, customized for you.\n" 109 | 110 | /bin/echo -e "\e[1;49;91m 7 Font Installation: \e[0m" 111 | /bin/echo -e " This script will install two fonts on Windows:" 112 | /bin/echo -e " [Hack Regular Nerd Font Complete.ttf] and" 113 | /bin/echo -e " [DejaVu Sans Mono Nerd Font Complete.ttf] " 114 | /bin/echo -e " Enter the settings if you're using Windows Terminal." 115 | /bin/echo -e " Choose your WSL profile.Set the Face Font option on" 116 | /bin/echo -e " the Appearance tab to one of the two fonts shown above." 117 | /bin/echo -e " Font adjustments are required to effectively display " 118 | /bin/echo -e " WSL's features and capabilities. \n" 119 | 120 | /bin/echo -e "\e[1;49;91m 8 Schemes Installation: \e[0m" 121 | /bin/echo -e " Downloads around 40 schemas from the Iterm 2 " 122 | /bin/echo -e " collection and adds them to the Windows Terminal settings." 123 | /bin/echo -e " Before running this script, you must have Windows Terminal " 124 | /bin/echo -e " installed. \n" 125 | /bin/echo -e "\e[1;49;91m 9 MongoDB Installation: \e[0m" 126 | /bin/echo -e " Due to the numerous issues encountered with the installation" 127 | /bin/echo -e " of MongoDB on WSL, this script attempts to install version 4.4" 128 | /bin/echo -e " on WSL so that you may access MongoDB through 127.0.0.1" 129 | /bin/echo -e " and port 27017. In addition, if you want to install MongoDB" 130 | /bin/echo -e " on Windows and use it with WSL, a script will be added to your" 131 | /bin/echo -e " WSL at the ~/findmongo path, and runs with this command:" 132 | /bin/echo -e " $ source ~/findmongo." 133 | /bin/echo -e " findmongo displays the correct host and port for MongoDB" 134 | /bin/echo -e " that installed on Windows." 135 | /bin/echo -e " More information may be found in the README file of project.\n" 136 | /bin/echo -e "\e[1;49;91m 10 Fix ~/.zshrc and Conda init: \e[0m" 137 | /bin/echo -e " This section enhances ZSH command prompt," 138 | /bin/echo -e " makes it compatible with Anaconda and Powerlevel9k," 139 | /bin/echo -e " and adds Anaconda's default settings to ~/.zshrc .\n" 140 | /bin/echo -e "\e[1;49;91m 11 Create Conda env for DataScience Project: \e[0m" 141 | /bin/echo -e " In this section to provide a complete environment for" 142 | /bin/echo -e " data science activities a Python environment is created" 143 | /bin/echo -e " with the following packages and with your desired name: " 144 | /bin/echo -e " python=3.8 jupyterlab pandas" 145 | /bin/echo -e " numpy scipy matplotlib seaborn" 146 | /bin/echo -e " scikit-learn tensorflow keras plotly" 147 | /bin/echo -e " pytorch pymongo scrapy beautifulsoup4\n" 148 | /bin/echo -e "\e[1;49;91m 12 Install R and R kernel for jupyter in conda env \e[0m" 149 | /bin/echo -e " Enter the name of a new environment to be created, and" 150 | /bin/echo -e " the R, R kernel, and Jupyter lab will be installed on" 151 | /bin/echo -e " it at the same time.\n" 152 | /bin/echo -e "\e[1;49;91m 13 Install SPARK and Scala kernel for jupyter in conda env \e[0m" 153 | /bin/echo -e " Enter the name of a new environment to be created, and" 154 | /bin/echo -e " the SPARK, Scala kernel, and Jupyter lab will be installed on" 155 | /bin/echo -e " it at the same time.\n" 156 | /bin/echo -e "\e[1;49;91m 14 This script installs Julia into your system, performs \e[0m" 157 | /bin/echo -e " its initial settings, and adds the Julia kernel to your" 158 | /bin/echo -e " Jupyter lab. This gives you access to the Julia kernel" 159 | /bin/echo -e " in all anaconda environments.\n" 160 | /bin/echo -e "\e[1;49;91m 15 This script installs C++ kernel into your \e[0m" 161 | /bin/echo -e " jupyter lab in new conda env.\n" 162 | /bin/echo -e "\e[1;49;91m 99 Exit: \e[0m" 163 | /bin/echo -e " You can quit the script by typing the number 99 in the menu.\n\n" 164 | read -p "Press Any Key to Exit : " 165 | return 99 166 | } 167 | 168 | update_wsl(){ 169 | logger "Update WSL" 170 | sudo apt update -y 171 | sudo apt upgrade -y 172 | } 173 | 174 | anaconda_installation(){ 175 | logger "Anaconda Installation" 176 | cd /tmp 177 | curl https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh --output anaconda.sh 178 | read -r shm_id rest <<<"$(sha256sum /tmp/anaconda.sh)" 179 | if [[ "$shm_id" == "fedf9e340039557f7b5e8a8a86affa9d299f5e9820144bd7b92ae9f7ee08ac60" ]];then 180 | echo "Anaconda Downloaded Correctly" 181 | bash /tmp/anaconda.sh -u -b -p $HOME/anaconda3 182 | source ~/anaconda3/etc/profile.d/conda.sh 183 | if [ -n "$ZSH_VERSION" ]; then 184 | conda init zsh 185 | elif [ -n "$BASH_VERSION" ]; then 186 | conda init bash 187 | fi 188 | else 189 | echo "anaconda.sh file is corrupted!!!" 190 | fi 191 | echo "c.NotebookApp.use_redirect_file = False" > ~/.jupyter/jupyter_notebook_config.py 192 | } 193 | 194 | syntax_auto_installation(){ 195 | logger "Syntax Highlighting & Autosuggestions Installation" 196 | sudo apt install -y zsh-syntax-highlighting 197 | git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions 198 | } 199 | 200 | zsh_installation(){ 201 | logger "ZSH Installation" 202 | sudo apt install -y zsh 203 | if [[ ! -f /root/.zsh ]];then 204 | echo "*" 205 | else 206 | sudo mv -fr /root/.zsh /home/$SUDO_USER/.zsh 207 | fi 208 | } 209 | 210 | oh_my_zsh_installation(){ 211 | logger "Oh My ZSH and other recemnded Pkgs Installation" 212 | sudo apt install -y powerline fonts-powerline 213 | sudo apt install -y zsh-theme-powerlevel9k 214 | sudo rm -r -f ~/.oh-my-zsh 215 | echo $(whoami) 216 | git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh 217 | } 218 | 219 | font_installation(){ 220 | logger "Font Installation" 221 | rm -r -f /mnt/c/myfonts 222 | mkdir /mnt/c/myfonts 223 | cd /mnt/c/myfonts 224 | cat << EOF > Install_Fonts.ps1 225 | \$FontsFolder = "fonts-to-be-installed" 226 | \$FONTS = 0x14 227 | \$CopyOptions = 4 + 16; 228 | \$objShell = New-Object -ComObject Shell.Application 229 | \$objFolder = \$objShell.Namespace(\$FONTS) 230 | \$allFonts = dir \$FontsFolder 231 | foreach(\$font in Get-ChildItem -Path \$fontsFolder -File) 232 | { 233 | \$dest = "C:\Windows\Fonts\\$font" 234 | echo "Installing \$font" 235 | \$CopyFlag = [String]::Format("{0:x}", \$CopyOptions); 236 | \$objFolder.CopyHere(\$font.fullname,\$CopyFlag) 237 | } 238 | EOF 239 | mkdir fonts-to-be-installed 240 | cd fonts-to-be-installed 241 | 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 242 | 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 243 | cd .. 244 | /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass 245 | /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -executionpolicy Bypass -nologo -noninteractive -file C:/myfonts/Install_Fonts.ps1 246 | /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe Set-ExecutionPolicy -Scope Process -ExecutionPolicy Default 247 | cd ~ 248 | } 249 | 250 | schemes_installation(){ 251 | logger "Schemes Installation" 252 | bash -c "$(wget -qO- https://git.io/JyBnV)" 253 | } 254 | 255 | mongodb_installation(){ 256 | logger "MongoDB Installation" 257 | sudo rm -rf /etc/apt/sources.list.d/mongo* 258 | sudo apt purge mongodb-database-tools mongodb-mongosh mongodb-org* -y 259 | wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - 260 | if [[ $(lsb_release -sr) == "20.04" ]];then 261 | 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 262 | else 263 | 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 264 | fi 265 | sudo apt update -y 266 | sudo apt install -y mongodb-org 267 | set -e 268 | if grep -qE "(Microsoft|WSL)" /proc/version &> /dev/null ; then 269 | sudo rm -f /etc/init/mongodb.conf 270 | sudo rm -f /etc/init/mongod 271 | sudo curl --http1.1 https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d --output /etc/init.d/mongod 272 | sudo chmod 755 /etc/init.d/mongod 273 | sudo mkdir -p /data/db 274 | sudo chown -R mongodb:mongodb /data/db 275 | fi 276 | echo 'echo "Mongo Bash Script" 277 | cd /mnt/c/Program\ Files/MongoDB/Server 278 | cd $(ls -d */|head -n 1) 279 | cd bin 280 | export MONGO_HOST=$(cat /etc/resolv.conf | grep nameserver | sed "s/nameserver\ //") 281 | sudo cp mongod.cfg /tmp/mongod.cfg 282 | sed -i "s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/$MONGO_HOST/" /tmp/mongod.cfg 283 | sudo cat /tmp/mongod.cfg > mongod.cfg 284 | echo "host: $MONGO_HOST port:27017" 285 | cd' > ~/findmongo 286 | echo "MongoDB Host: 127.0.0.1 Port: 27017" 287 | sudo service mongod start 288 | } 289 | 290 | fix_zshrc(){ 291 | logger "Fix ~/.zshrc" 292 | ver=$(lsb_release -sr) 293 | cat << EOF > ~/.zshrc 294 | echo Ubuntu $ver 295 | cd ~ 296 | export ZSH="/home/$(whoami)/.oh-my-zsh" 297 | ZSH_THEME="agnoster" 298 | plugins=(git) 299 | source /home/$(whoami)/.oh-my-zsh/oh-my-zsh.sh 300 | source /usr/share/powerlevel9k/powerlevel9k.zsh-theme 301 | source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 302 | source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh 303 | bindkey '^ ' autosuggest-accept 304 | POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(anaconda user dir vcs) 305 | POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history ram ssh) 306 | EOF 307 | echo $(whoami) 308 | sudo usermod -s /usr/bin/zsh $(whoami) 309 | source ~/anaconda3/etc/profile.d/conda.sh 310 | conda init zsh 311 | echo "done!" 312 | } 313 | 314 | conda_env(){ 315 | logger "Create Conda env for DataScience Project" 316 | if [[ $# -eq 0 ]];then 317 | read -p "Please Enter Conda Env Name: " env 318 | else 319 | env=$1 320 | fi 321 | echo "$env" 322 | conda create --name $env \ 323 | python=3.8 jupyterlab pandas\ 324 | numpy scipy matplotlib seaborn\ 325 | scikit-learn tensorflow keras plotly\ 326 | pytorch pymongo scrapy beautifulsoup4 -y 327 | cd ~/.jupyter 328 | rm -r -f jupyter_notebook_config.py 329 | echo "c.NotebookApp.use_redirect_file = False" > ~/.jupyter/jupyter_notebook_config.py 330 | } 331 | 332 | r_installation(){ 333 | logger "R installation..." 334 | if which conda >/dev/null; then 335 | conda --version 336 | read -p "Please Enter Conda Env Name: " env 337 | 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 338 | if [[ $(lsb_release -rs) == "20.04" ]]; then 339 | echo "Ubuntu-20.04" 340 | sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' 341 | elif [[ $(lsb_release -rs) == "18.04" ]]; then 342 | echo "Ubuntu-18.04" 343 | sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/' 344 | fi 345 | sudo apt update -y 346 | sudo apt install r-base -y 347 | sudo apt-get install r-base-dev 348 | logger "R Kernal and Jupyter installation..." 349 | conda create --name $env python=3.9 jupyterlab r r-essentials -y 350 | else 351 | echo "conda does not exist on your system!" 352 | fi 353 | echo "c.NotebookApp.use_redirect_file = False" > ~/.jupyter/jupyter_notebook_config.py 354 | } 355 | spark_scala(){ 356 | logger "Spark and Scala installation..." 357 | read -p "Please Enter Conda Env Name: " env 358 | logger "JAVA 8 installation..." 359 | sudo apt install openjdk-8-jre-headless -y 360 | logger "Scala Installation..." 361 | cd /tmp 362 | wget https://github.com/lampepfl/dotty/releases/download/3.1.0/scala3-3.1.0.tar.gz 363 | sudo tar -xf scala3-3.1.0.tar.gz 364 | sudo rm -rf /usr/local/scala 365 | sudo mkdir /usr/local/scala 366 | cd scala3-3.1.0 367 | sudo mv * /usr/local/scala 368 | logger "SPARK installation..." 369 | cd /tmp 370 | rm spark-3.2.0-bin-hadoop3.2.tgz 371 | wget -v "https://dlcdn.apache.org/spark/spark-3.2.0/spark-3.2.0-bin-hadoop3.2.tgz" 372 | sudo tar -xzvf spark-3.2.0-bin-hadoop3.2.tgz -C ~/ 373 | cd ~ 374 | rm -rf spark 375 | mv spark-3.2.0-bin-hadoop3.2 spark 376 | logger "Adding Enviormental Variable..." 377 | sed -i "/JAVA_HOME/d" ~/.zshrc 378 | sed -i "/usr\/local\/scala\/bin/d" ~/.zshrc 379 | sed -i "/SPARK_HOME/d" ~/.zshrc 380 | sed -i "/SPARK_HOME\/bin/d" ~/.zshrc 381 | cat << EOF >> ~/.zshrc 382 | export JAVA_HOME="/usr" 383 | export PATH="\$PATH:/usr/local/scala/bin" 384 | export SPARK_HOME="\$HOME/spark" 385 | export PATH="\$PATH:\$SPARK_HOME/bin" 386 | EOF 387 | sed -i "/JAVA_HOME/d" ~/.bashrc 388 | sed -i "/usr\/local\/scala\/bin/d" ~/.bashrc 389 | sed -i "/SPARK_HOME/d" ~/.bashrc 390 | sed -i "/SPARK_HOME\/bin/d" ~/.bashrc 391 | cat << EOF >> ~/.bashrc 392 | export JAVA_HOME="/usr" 393 | export PATH="\$PATH:/usr/local/scala/bin" 394 | export SPARK_HOME="\$HOME/spark" 395 | export PATH="\$PATH:\$SPARK_HOME/bin" 396 | EOF 397 | logger "Creating conda env and adding Scala kernel..." 398 | conda create --name $env python=3.9 jupyterlab -y 399 | source ~/anaconda3/etc/profile.d/conda.sh 400 | conda activate $env 401 | pip install py4j 402 | conda install -c conda-forge spylon-kernel -y 403 | python -m spylon_kernel install --user 404 | } 405 | 406 | julia_installation(){ 407 | sudo apt update -y 408 | cd /tmp 409 | wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.5-linux-x86_64.tar.gz 410 | tar zxvf julia-1.6.5-linux-x86_64.tar.gz 411 | sudo rm -rf /usr/local/julia 412 | sudo mkdir /usr/local/julia 413 | cd /tmp/julia-1.6.5/ 414 | sudo mv * /usr/local/julia 415 | sed -i "/julia\/bin/d" ~/.zshrc 416 | cat << EOF >> ~/.zshrc 417 | export PATH="$PATH:/usr/local/julia/bin" 418 | EOF 419 | sed -i "/julia\/bin/d" ~/.bashrc 420 | cat << EOF >> ~/.bashrc 421 | export PATH="$PATH:/usr/local/julia/bin" 422 | EOF 423 | export PATH="$PATH:/usr/local/julia/bin" 424 | echo ' 425 | using Pkg 426 | Pkg.add("IJulia") 427 | ' | /usr/local/julia/bin/julia 428 | 429 | } 430 | 431 | c_installation(){ 432 | logger "C++ Kernel installation..." 433 | if which conda >/dev/null; then 434 | conda --version 435 | read -p "Please Enter Conda Env Name: " env 436 | conda create --name $env python=3.9 jupyterlab -y 437 | source ~/anaconda3/etc/profile.d/conda.sh 438 | conda activate $env 439 | conda install xeus -c conda-forge -y 440 | conda install xeus-cling==0.9.0 -c conda-forge -y 441 | else 442 | echo "conda does not exist on your system!" 443 | fi 444 | 445 | } 446 | 447 | full_installation(){ 448 | logger "Full Installation" 449 | update_wsl 450 | anaconda_installation 451 | zsh_installation 452 | syntax_auto_installation 453 | oh_my_zsh_installation 454 | schemes_installation 455 | fix_zshrc 456 | conda_env "ds38" 457 | font_installation 458 | mongodb_installation 459 | } 460 | 461 | main(){ 462 | clear 463 | show_header 464 | show_menu 465 | input=$? 466 | case $input in 467 | 0) help_me;; 468 | 1) update_wsl;; 469 | 2) full_installation;; 470 | 3) anaconda_installation;; 471 | 4) zsh_installation;; 472 | 5) syntax_auto_installation;; 473 | 6) oh_my_zsh_installation;; 474 | 7) font_installation;; 475 | 8) schemes_installation;; 476 | 9) mongodb_installation;; 477 | 10) fix_zshrc;; 478 | 11) conda_env;; 479 | 12) r_installation;; 480 | 13) spark_scala;; 481 | 14) julia_installation;; 482 | 15) c_installation;; 483 | esac 484 | show_footer 485 | } 486 | 487 | main 488 | -------------------------------------------------------------------------------- /images/WSL-Beautifier.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/WSL-Beautifier.jpg -------------------------------------------------------------------------------- /images/WSL-Schemes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/WSL-Schemes.jpg -------------------------------------------------------------------------------- /images/WSL4DS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/WSL4DS.jpg -------------------------------------------------------------------------------- /images/c_plus_plus.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/c_plus_plus.jpg -------------------------------------------------------------------------------- /images/font-properties.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/font-properties.jpg -------------------------------------------------------------------------------- /images/julia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/julia.jpg -------------------------------------------------------------------------------- /images/r_kernel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/r_kernel.jpg -------------------------------------------------------------------------------- /images/spylon_scala.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/spylon_scala.jpg -------------------------------------------------------------------------------- /images/windows-terminal-appearance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pytopia/WSL4DataScience/38b6d16dcb065d5a322f98c5471180e99a1f022e/images/windows-terminal-appearance.jpg -------------------------------------------------------------------------------- /schemes.sh: -------------------------------------------------------------------------------- 1 | #run this script :$ bash -c "$(wget -qO- https://git.io/JyBnV)" 2 | win_userprofile="$(cmd.exe /c "/dev/null)" 3 | win_userprofile_dir="${win_userprofile#*:}" 4 | win_home=${win_userprofile_dir/\\/\/} 5 | win_home=${win_home/\\/\/} 6 | cd "/mnt/c/$win_home" 7 | cd AppData/Local/Packages 8 | cd Microsoft.WindowsTerminal* 9 | cd LocalState 10 | echo $win_home 11 | 12 | 13 | add_schemes (){ 14 | cat << EOF > ~/.add_schemes.py 15 | import urllib, json ,ast ,urllib.request 16 | path = "$pwd" 17 | #Reading setting.json --------------------------------------------------------- 18 | myfile = open (path+'/settings.json', "r") 19 | mystring = myfile.read() 20 | parts = mystring.split('"schemes":') 21 | first = parts[0] 22 | second = parts[1].split("[") 23 | third = second[1].split("]") 24 | myschems = '{"schemes":[' + third[0] + ']}' 25 | myschems_json = eval(myschems) 26 | present_schemes = set() 27 | for sch in myschems_json['schemes']: 28 | present_schemes.add(sch['name']) 29 | #print(present_schemes) 30 | #Reading Schemes from github :https://github.com/mbadolato/iTerm2-Color-Schemes 31 | jsons=[ 32 | "AdventureTime", 33 | "3024 Night", 34 | "Argonaut", 35 | "Belafonte Night", 36 | "BlueBerryPie", 37 | "BlueDolphin", 38 | "BlulocoDark", 39 | "Borland", 40 | "Builtin Solarized Dark", 41 | "Builtin Tango Light", 42 | "Cobalt2", 43 | "CrayonPonyFish", 44 | "Desert", 45 | "Django", 46 | "FishTank", 47 | "Floraverse", 48 | "FunForrest", 49 | "Github", 50 | "GitHub Dark", 51 | "Grass", 52 | "Gruvbox Light", 53 | "HaX0R_R3D", 54 | "HaX0R_GR33N", 55 | "HaX0R_BLUE", 56 | "Jackie Brown", 57 | "Laser", 58 | "Mathias", 59 | "Ocean", 60 | "Paraiso Dark", 61 | "Pro", 62 | "Pro Light", 63 | "Red Alert", 64 | "Solarized Dark - Patched", 65 | "Spacedust", 66 | "Spiderman", 67 | "Tomorrow Night Burns", 68 | "Tango Half Adapted", 69 | "Ubuntu", 70 | "Unikitty", 71 | "Zenburn" 72 | ] 73 | schemes=[] 74 | i = 1 75 | for j in jsons: 76 | i += 1 77 | myurl = "https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/windowsterminal/"+j+".json" 78 | myurl = myurl.replace(" ","%20") 79 | with urllib.request.urlopen(myurl) as url: 80 | data = json.loads(url.read().decode()) 81 | r=str(data) 82 | 83 | 84 | if r[:3] == "404": 85 | print('\x1b[0;{};{}m'.format(i%6+31,40) +"---------> " + j + "Scheme not found !!!"'\x1b[0m') 86 | else: 87 | print('\x1b[0;{};{}m'.format(i%6+31,40) +" downloading .... "+ j + '\x1b[0m') 88 | schemes.append(data) 89 | #Creating new setting.json ---------------------------------------------------- 90 | add = 0 91 | not_add = 0 92 | for scheme in schemes: 93 | if scheme['name'] not in present_schemes: 94 | add += 1 95 | myschems_json['schemes'].append(scheme) 96 | else: 97 | not_add += 1 98 | near_to_last = str(myschems_json)[1 : -1] 99 | near_to_last = near_to_last.replace(",", ",\n ") 100 | near_to_last = near_to_last.replace("{", "{\n ") 101 | near_to_last = near_to_last.replace("}", "}\n ") 102 | near_to_last = near_to_last.replace("[", "[\n ") 103 | near_to_last = near_to_last.replace("]", "]\n ") 104 | near_to_last = near_to_last.replace("},\n", "},\n ") 105 | near_to_last = near_to_last.replace("'", '"') 106 | final_setting = first + near_to_last + "\n\n}" 107 | #Writing new setting.json to the defult path----------------------------------- 108 | with open(path + '/settings.json' ,'r+') as myfinalsetting: 109 | data = myfinalsetting.read() 110 | myfinalsetting.seek(0) 111 | myfinalsetting.write(final_setting) 112 | myfinalsetting.truncate() 113 | print("!----------------------------------------------------------------!") 114 | print("! Schemes Installation Completed ") 115 | print("! {} Schemes was on your settings and ".format(not_add)) 116 | print("! another {} Schemes were added by this code ".format(add)) 117 | print("!----------------------------------------------------------------!") 118 | EOF 119 | python3 ~/.add_schemes.py 120 | rm -rf ~/.add_schemes.py 121 | } 122 | 123 | 124 | 125 | if [[ ! -f settings.json ]] 126 | then 127 | /bin/echo -e "\e[91m !----------------------------------------------------------------!\e[0m" 128 | /bin/echo -e "\e[91m ! settings.json does not exist on your filesystem! !\e[0m" 129 | /bin/echo -e "\e[91m ! Please check to see if you have Windows Terminal installed!? !\e[0m" 130 | /bin/echo -e "\e[91m !----------------------------------------------------------------!\e[0m" 131 | else 132 | /bin/echo -e "\e[32m !----------------------------------------------------------------!\e[0m" 133 | /bin/echo -e "\e[32m ! settings.json exist on your filesystem! !\e[0m" 134 | /bin/echo -e "\e[32m !----------------------------------------------------------------!\e[0m" 135 | pwd=$(pwd) 136 | add_schemes 137 | fi 138 | --------------------------------------------------------------------------------