Jupyter Notebook show public IP at startup - jupyter-notebook

I am running a public jupyter notebook on an AWS ec2 instance. When starting the jupyter notebook, how can I get the notebook to give me the public IP address of the instance instead of "localhost"?
https://[PUBLIC_IP_ADDRESS]:8888/?token=[token]
instead of:
https://localhost:8888/?token=[token]
Thank you!

You cannot, or at least not easily, because the externally visible IP may not be the internally visible IP, and the machine you are on, likely does not know this. And that's generic of any network/network enabled application.
For example my current ip in my network is (using ifconfig) 10.168.1.63, but my current global ip is 77.200.16.xxx. My router knows that when it sees an external connection to port 80 from the internet, then it should forward to my machine where the notebook is running. But my machine has no clue about that.
You need to get your public IP from AWS itself.

Related

Jupyter notebook inside WSL

When running jupyter notebook inside a conda virtual enviornment in wsl (Windows subsystem for linux), copy pasting the url wont work. It always shows "It took too long to respond" or "Connection timed out".
• Try in another browser (e.g. if you normally use Firefox, try with Chrome). This helps pin down where the
problem is.
• Try disabling any browser extensions and/or any Jupyter extensions you have installed.
• Some internet security software can interfere with Jupyter. If you have security software, try turning it off
temporarily, and look in the settings for a more long-term solution.
• In the address bar, try changing between localhost and 127.0.0.1. They should be the same, but in some
cases it makes a difference.
I ran into a similar problem but I wasn't using a virtual environment. Are you trying to connect to the server from the host computer? And are you using the private IP address or localhost address to connect?
I couldn't connect to the server on WSL from the local or remote network.
Apparently, WSL 2 uses a virtual network adapter that has its own IP address. It also changes the IP address every time the server is restarted. I had to write a script that forwarded the network traffic from the virtual machine to the host computer. This allowed me to access the server using the private IP address of the host computer.
I wrote an article about how to do it to make it easier for everyone:
How to Set Up the Jupyter Notebook Home and Public Server On Windows Subsystem for Linux 2 (WSL2)

How can I open my local TCP port to public?

I have a TCP Server for a my personal chat, I want to expand my connection beyond my local network and I want to open my port: 28752 to my IP public of pc to enter wherever I want only when my computer is on.
I have seen different solutions for example DMZ to associate my local IP to public IP, but i want to do this without modifying to router's setting I wanted to do it from a program. Is it possible?
It is possible to open up ports. But it depends on the OS in which you are trying to accomplish it. You can use the linux iptables to manipulate the ports opened and closed to any linux machine. IptablesSome examples . The ports should also be opened on the firewall layer outside the VM. eg: It could be AWS access policy, Security group, MAC's security firewall. Your laptop, when connected to the internet, will have a public IP address, you can share that public IP. But these IP address will change when you get connected to a different router. You can use AWS cli commands to assign a static IP address for your machine and expose it publicly. At the least minimum, you would need a public DNS server to expose your IP publicly. Easy way to achieve this is by putting in web server on cloud. Without a domain , you cant expose your IP. Once you have finalized on the domain (eg: AWS Route 53, Ingree IP from K8 etc), you can change/manipulate them from your program. It need not be language specific.

Can not bootstrap my corda node which cannot bind its public ip address

I have deployed a node on a cloud server which has a public ip address (but I cannot use ifconfig command to find the public ip interface )...I just get some error while I try to run the node... the network map server is on the other server
this picture show the error
This is likely due to the fact that a process is already bound to one of the ports the node is attempting to use.
You need to kill this process first. If it's a Java process, try wmic process where "name like '%java%'" delete on Windows, or killall java -9 on Mac.

When running a public Jupyter server, what IP do you use?

After you run jupyter notebook on a public server, it will output the following code as far as URL's go:
https://[all ip addresses on your system]:8894/
So, my question is: What URL do I enter into insert web browser here in order to get it running?
You'll need to find the IP address/(domain name if your machine has one) of your specific computer. If you're running Unix you can run ifconfig to get the IP address, if you're running Windows you can run ipconfig instead.

Not able to connect to a Openstack Instance from external machine

The IP of of an instance created through Openstack is 10.0.0.2. But when I tried to ping this IP from other machine, it was not successful, however I am able to ping this IP from the machine on which Openstack(Devstack) is installed.
What could be the reason and how to resolved this?
This may help you: http://www.liquidstate.net/blog/technology/openstack-havana-home-lab-on-centos6-with-external-networking/
Basically, you need a virtual router to connect from you LAN to OpenStack private network.
I think, you don't need a Floating IP exactly on each instance. Only a virtual router, then you can create a static route on each machine in you LAN, for example:
ip route add 10.0.0.0/8 via 192.168.1.100 dev em1
Good Luck!
This IP is a private one, by default, when you deploy a new instance it is deployed with a private IP.
If you want to have a public IP, you need to create a floating IP for your project and afterward, you should assign one IP from this pool to the server instance that you have created previously.
After that you could access to your server instance without any problem.
I hope that it could help you.

Resources