This is a quick install script to configureĀ  a new Ubuntu VM. Typically there is some more configuration to do but this will typically get 90 percent of it.

-----------------------------------------
|            Anacondas                  |
-----------------------------------------
wget https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh
bash Anaconda2-4.2.0-Linux-x86_64.sh -b -p ~/anaconda
rm Anaconda2-4.2.0-Linux-x86_64.sh
echo 'export PATH="~/anaconda/bin:$PATH"' >> ~/.bashrc

-----------------------------------------
|            Python PIP                 |
-----------------------------------------

*** Python 2.7 Kernel Configure
sudo apt-get install ipython
sudo apt install python-pip
pip install lxml
pip install html5lib
pip install BeautifulSoup4
pip install -U scikit-learn
pip install Matplotlib
pip install geopy
pip install seaborn
pip install scipy
pip install plotly
pip install --upgrade pip

*** Python 3.0 Kernel Configure
sudo apt-get install python3-pip
pip3 install lxml
pip3 install html5lib
pip3 install BeautifulSoup4
pip3 install -U scikit-learn
pip3 install Matplotlib
pip3 install geopy
pip3 install seaborn
pip3 install scipy
pip3 install plotly
pip3 install --upgrade pip

*** Configuring Conda
conda install mkl-rt
conda update -all
conda install nbformat

-----------------------------------------
|         Jupyter Notebook              |
-----------------------------------------
sudo apt-get update
sudo apt-get -y install python2.7 python-pip python-dev
sudo apt-get -y install ipython ipython-notebook
sudo -H pip install jupyter
sudo -H pip install --upgrade pip
sudo -H pip install jupyter

pip3 install ipykernel
python3 -m ipykernel install --user

-----------------------------------------
|      Jupyter Notebook Server          |
-----------------------------------------

*** Generate config files and cert files
jupyter notebook --generate-config
jupyter notebook password

jupyter notebook --certfile=mycert.pem --keyfile mykey.key
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem

#Add This script into jupyter_notebook_config.py may need it use ~/Jupyter to access the hidden files
c.NotebookApp.certfile = u'/absolute/path/to/your/certificate/fullchain.pem'
c.NotebookApp.keyfile = u'/absolute/path/to/your/certificate/privkey.pem'
# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:bcd259ccf...<your hashed password here>'
c.NotebookApp.open_browser = False

# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 9999

-----------------------------------------
|               Spark                   |
-----------------------------------------

*** Installing Java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

*** Java --version to ensure it is installed. Below is approximately what it will look like
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

*** Configuring Java
cat >> /etc/environment <<EOL
JAVA_HOME=/usr/lib/jvm/java-8-oracle
JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
EOL

*** Installing Python3 and other packages
sudo apt-get install python3-pip
pip3 install jupyter
sudo apt-get install default-jre
sudo apt-get install scala
pip3 install py4j
pip3 install pyspark

pip3 install find spark
findspark.init()

-----------------------------------------
|               R Studio                |
-----------------------------------------

sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base

-----------------------------------------
|                 MySQL                 |
-----------------------------------------

sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation

Comments are closed.