Advertisement
Guest User

Clarifications, corrections and improvements in clarity.

a guest
Nov 5th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. In my case, on Ubuntu 20.04, the "/etc/rc.local" way didn't work. I figured out a two step solution:
  2.  
  3. ### 1. Create an executable script to run jupyter.
  4.  
  5. Create an empty script and in the place you want and add an executable option to it. Here is the one line of code to create the file in the USER folder:
  6.  
  7. $`cd /home/USER & touch jupyterlab.sh & chmod x jupyterlab.sh`
  8.  
  9. You may also create the empty script file in your favorite text editor, save it, then right click the file and under `Permission`, check `Execute`. More info [here][1].
  10.  
  11. In this file add-in the command to run jupyter, (in my case `jupyter-lab`) with the full path to the program (identified using `which jupyter-lab`) and parameters such as an ip and port as I'm using it as server. For example, here is what the `jupyterlab.sh` script contains:
  12.  
  13. #!/bin/bash
  14. /home/USER/anaconda3/bin/jupyter-lab --ip 192.168.1.32 --port 9000 --no-browser & exit
  15.  
  16.  
  17. ### 2. Add the script in the startup applications.
  18.  
  19. Open startup application, and addin the `jupyterlab.sh` script as one of the startup applications.
  20.  
  21. [![enter image description here][2]][2]
  22.  
  23. That's it. Next time, when the system starts you'll have the jupyter running automatically!
  24.  
  25. This solution may seem very long, but it is very easy to execute with a few simple clicks and has the advantage of not using the "scary" root privileges.
  26.  
  27. [1]: https://stackoverflow.com/questions/42044798/how-do-i-run-a-script-on-linux-just-by-double-clicking-it
  28. [2]: https://i.stack.imgur.com/PM4ri.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement