How to launch jupyter notebooks on server via ssh and run it on local browser? - macos

I'm working on a project where the servers and Mysql data bases are inaccessible from my local machine unless I ssh to a remote using terminal. However, I find programming with Jupyter Notebooks the best environment for me. I really miss it as I find programming with just vim remotely via terminal a bit cumbersome. I was wondering if there was a way to launch Jupyter notebook from the server and have my local browser open it up- so I can code from my browser but it would be running from the terminal/remote-server via ssh- so that ways my code can actually connect to my database from my browser via the remote and I can use the interactiveness of a Jupyter notebook to speed up my development. Any ideas? remote is ubuntu and mine is a mac. Thanks

This is pretty simple. You just need to install the jupyter notebook server on your remote machine and make it open to the web, protected by a password to avoid unintended use.
On the remote server, first install Jupyter:
pip3 install jupyter
Then follow this guide to secure it with a password.
At last you can launch it with:
jupyter notebook --ip='*'
This tells Jupyter to make it available from any ip and not only from localhost.
Please do protect it with a password, otherwise very nasty things could happen to your server.

Related

Silent/Automated Homebrew Install

I am trying to get homebrew installed remotely on a machine without a terminal open and without ssh access to the machine. Our company uses a Directory-as-a-Service which allows us to remotely push shell scripts to our computers which is great, but it requires the scripts to have no interactivity.
Is there a way to automate the installer and remove the “Press enter to continue” prompt in the install process?
Thanks,
Zach S
The env variable CI seems to silence this prompt:
export CI=1

Can I use Spyder interface with a remote server?

I installed anaconda on remote server and typed spyder which gave this message:
QXcbConnection: Could not connect to display
Aborted (core dumped)
I have a script I've worked on locally. I could just scp it but would prefer to continue working on the script within spyder. Is this possible?
(Spyder maintainer here) Spyder can't work in a server that doesn't have an X server installed (clearly your case) because it's a graphical application.

Tunneling from Windows 10 to Jupyter running on AWS

I'm trying to access Jupyter notebooks that are installed on AWS and I want to use a windows-10 machine to access it. The jupyter system sits behind a jump host (bastion) on aws. The process works for macs in the following way
- Instructions exist to create a ssh tunnel
- Magically the notebook is available on a browser by doing localhost:8223
The mac command for it looks like
ssh -i /pathto.id_rsa -L 8223:<some name>:8223 -f -o <some other url>
What I've been able to accomplish is the following.
- Installed putty and pageant. Set up key forwarding on putty and been able to log in to the bastion host.
- I tried foxyproxy on chrome but couldn't make much headway there.
How do I access this Jupyter notebook from windows?
Again, the set up is
windows --> [bastion] --> jupyter
I'm totally lost, any pointers or step by step instructions is much appreciated.
Try this article from my blog: https://vrnchndk.in/2017/01/27/access-blocked-websites-using-ssh-tunnel/
It has step by step instructions with screenshots as well.

Anaconda jupyter notebook

I installed Anaconda & Python following this guide:
http://jupyter.readthedocs.org/en/latest/install.html
version installed: 3.4
Now the problem is I can access the jupyter notebook via http://localhost:8888/tree
but i cannot access it via the internet ip address
Note, I am using a AWS EC2 instance.
What might be the problem?
Thanks!
If you want to access your notebook server remotely via a web browser, you must do the following at a minimum:
Create a custom profile for the notebook
Edit the file ipython_notebook_config.py for the custom profile
Start the notebook with the profile just created
Please consult the IPython.org's documentation for the details.
http://ipython.org/ipython-doc/1/interactive/public_server.html
There's another way to start Jupyter notebook server which is embedded in Continuum Anaconda, Here's the command. You can override some parameter like port, server, --no-browser, etc while starting the server .
/opt/cloudera/parcels/Anaconda/bin/python /opt/cloudera/parcels/Anaconda/bin/jupyter-notebook --port=8998 --ip=0.0.0.0 --no-browser

I get this error while trying to launch the command ./runInstaller

I have this error while trying to launch the command ./runInstaller
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
From Oracle help docs:
sudo yum install xorg-x11-utils -y
worked for me.
If you are executing this via Putty, then I suggest you have a look at Xming, this allows you to have a Putty remote ssh session, and forward your display to you Windows machine...
If you're executing this from a Linux server without a gui, you will either need to connect remotely with a pc with a GUI installed (Gnome, KDE, etc) or you'll need to install the Gui directly on the server.
Check if it's not already installed by using the command on the terminal
$ startx
Error is reproducible thus:
$ export DISPLAY=:0.0
$ ./runInstaller
ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
OP's X server was Hummingbird Exceed. Xming will work as well.
The actual solution depends on:
whether you are su'd to oracle from a different login account.
whether you are using X11 forwarding.
the actual port used by X11 forwarding, which could be 6010 or a different port.
If you logged in and then su'd to oracle, then copy ~/.Xauthority to the oracle account.
If you are using X11 forwarding and the forwarding port is 6010, then DISPLAY=localhost:10.0 is correct.
If you are not using X11 forwarding, and if port 6000 on your PC is reachable from the oracle server, then export DISPLAY=your.pc.ip.address:0.0 is correct.
Install xterm and use xterm to test X windows.
Be sure to install xdpyinfo.
For more details, please refer to my article X windows for Oracle DBAs

Resources