Skip to content

Instantly share code, notes, and snippets.

@sachaarbonel
sachaarbonel / gist:c0a29118dcaaa7f0665803a72ac74742
Last active February 23, 2017 08:21
Spark Install on Ubuntu
http://www.xavierdupre.fr/app/ensae_teaching_cs/helpsphinx/td_3a_spark.html#installation-de-spark-sous-linux
https://github.com/mGalarnyk/Installations_Mac_Ubuntu_Windows.git
@mGalarnyk
mGalarnyk / LinearRegression.R
Last active December 5, 2020 13:40
Univariate Linear Regression (relationship between the dependent variable y and the independent variable x is linear) using R programming Language for the blog post https://medium.com/@GalarnykMichael/univariate-linear-regression-using-r-programming-3db499bdd1e3#.kcm3t9rl3
# Linear Regression predicts linear relationship between two variables
# Set path to Desktop
setwd("~/Desktop")
download.file(url = 'https://raw.githubusercontent.com/mGalarnyk/Python_Tutorials/master/Python_Basics/Linear_Regression/linear.csv'
, destfile = 'linear.csv')
rawData=read.csv("linear.csv", header=T)
# Show first n entries of data.frame, notice NA values
# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
wget https://repo.continuum.io/archive/Anaconda3-5.0.1-Linux-x86_64.sh
bash Anaconda3-5.0.1-Linux-x86_64.sh -b -p ~/anaconda
rm Anaconda3-5.0.1-Linux-x86_64.sh
echo 'export PATH="~/anaconda/bin:$PATH"' >> ~/.bashrc
# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
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
# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
curl -Ok https://repo.continuum.io/archive/Anaconda3-4.1.1-MacOSX-x86_64.sh
bash Anaconda3-4.1.1-MacOSX-x86_64.sh -b -p ~/anaconda
rm Anaconda3-4.1.1-MacOSX-x86_64.sh
echo 'export PATH="~/anaconda/bin:$PATH"' >> ~/.bash_profile
# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
curl -Ok https://repo.continuum.io/archive/Anaconda2-4.2.0-MacOSX-x86_64.sh
bash Anaconda2-4.2.0-MacOSX-x86_64.sh -b -p ~/anaconda
rm Anaconda2-4.2.0-MacOSX-x86_64.sh
echo 'export PATH="~/anaconda/bin:$PATH"' >> ~/.bash_profile
@mGalarnyk
mGalarnyk / Generate Jupyter Notebook Config
Last active December 26, 2016 03:29
Generate config for jupyter notebook. The purpose of this gist is so people can copy and paste from here to their terminal. My blog https://medium.com/@GalarnykMichael
jupyter notebook --generate-config
mkdir certs
cd certs
sudo openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem
cd ~/.jupyter/
nano jupyter_notebook_config.py
c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.certfile = u'/home/ubuntu/certs/mycert.pem'
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
# Your password below will be whatever you copied earlier
c.NotebookApp.password = u'sha1:941c93244463:0a28b4a9a472da0dc28e79351660964ab81605ae'
c.NotebookApp.port = 8888
# Install R + RStudio on Ubuntu 12.04
sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys E084DAB9
# Ubuntu 12.04: precise
# Ubuntu 14.04: trusty
# Ubuntu 16.04: xenial
# Basic format of next line deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu <enter your ubuntu version>/
sudo add-apt-repository 'deb https://ftp.ussg.iu.edu/CRAN/bin/linux/ubuntu precise/'
sudo apt-get update
# Install R + RStudio on Ubuntu 14.04
sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys E084DAB9
# Ubuntu 12.04: precise
# Ubuntu 14.04: trusty
# Ubuntu 16.04: xenial
# Basic format of next line deb https://<my.favorite.cran.mirror>/bin/linux/ubuntu <enter your ubuntu version>/
sudo add-apt-repository 'deb https://ftp.ussg.iu.edu/CRAN/bin/linux/ubuntu trusty/'
sudo apt-get update