Skip to content

Instantly share code, notes, and snippets.

@amoshyc
Last active January 11, 2017 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amoshyc/eae5e729ae3604903674e171feacf040 to your computer and use it in GitHub Desktop.
Save amoshyc/eae5e729ae3604903674e171feacf040 to your computer and use it in GitHub Desktop.

Docker Usage

Start/Stop Docker

sudo systemctl start docker
sudo systemctl stop docker

Create f25 Container

sudo docker run -d -p 8888:8888 --name f25 --user $(id -u) -v /home/amoshyc/workspace:/home/workspace:z -i fedora:25 bash

-z is to prevent selinux blocking it.

Execute

When f25 is running, open a terminal with:

sudo docker exec -it f25 bash

Start/Stop a Container

sudo docker start f25
sudo docker stop f25

Jupyter

Install

Numpy, Scipy, Jupyter, Matplotlib

pip3 install -U numpy scipy jupyter matplotlib scikit-learn

Somtimes, libstdc++ is needed

dnf install libstdc++  

Setting Jupyter

Generate config file

jupyter notebook --generate-config

Generate hashed password:

>>> from notebook.auth import passwd
>>> passwd()

Copy the output and edit /root/.jupyter/jupyter_notebook_config.py. Add

c.NotebookApp.ip = '*'
c.NotebookApp.password = '<your hashed password here>'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888

Start Jupyter

jupyter notebook

and Open http://localhost:8888/

Themes & Extensions

Themes

Install https://github.com/dunovank/jupyter-themes and execute

jt -t oceans16 -T

Extensions

https://github.com/ipython-contrib/jupyter_contrib_nbextensions

  1. Install by pip3
  2. jupyter contrib nbextension install --user
  3. Start notebook
  4. Navigate to http://localhost:8888/nbextensions/
  5. Enable desired extensions

Installation step needs some dependencies. Install them by dnf. To use the code formatting extensions, yapf is needed:

pip3 install yapf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment