This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# After Ubuntu 16.04, Systemd becomes the default. | |
# It is simler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd | |
[Unit] | |
Description=Jupyter Notebook | |
[Service] | |
Type=simple | |
PIDFile=/run/jupyter.pid | |
ExecStart=/usr/local/bin/jupyter notebook --no-browser --config=/home/jail/home/notebook/.jupyter/jupyter_notebook_config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When a cell is clicked and the cell's mode is changed to the edit mode | |
// Then, this below event is called. | |
$([IPython.events]).on("edit_mode.Cell", function () { | |
if (IPython.notebook.get_selected_cell().cell_type == "markdown") { | |
IPython.notebook.execute_selected_cells(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nbformat | |
from nbconvert import PythonExporter | |
exporter = PythonExporter() | |
(source, meta) = exporter.from_filename('something.ipynb') | |
# When NB object is used. | |
#with open('something.ipynb', 'r') as infile: | |
#nb = nbformat.reads(infile.read(), nbformat.NO_CONVERT) | |
#(source, meta) = exporter.from_notebook_node(nb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: jupyter | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start jupyter | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |