How do I host an IPython kernel for remote debugging - ipython

When a remote process runs into some problem I want to be able to connect to that process with an IPython kernel for remote debugging. What is the correct way to do this on both the server and client side?
Server
How do I start an IPython kernel running in my Python process (which happens to be running a Tornado event loop.)
Communicate
What information do I need to send from the server to the client so that it knows how to connect?
Client
How do I connect to the remote IPython kernel given the connection information?

Related

Connect remote MongoDB server without SSH

Hi I want to connect to remote MongoDB server without using SSH tunneling(Both the client and server systems will run on windows OS). Is there any way to connect.

MongoDB Server Ubuntu 16.04

I've installed MongoDB on my Ubuntu 16.04 VPS and allowed connections through the firewall. When I run the server using the command (mongod), it starts without a problem and I can then connect to it (using RoboMongo as test application).
However, when I run the service automatically on startup (using systemctl), I cannot connect to it. I verified it was running, and could not run it myself as the address was already in use.
Does anyone have any experience with this, or any tips on how to solve the problem? The server will be running localhost only and I'm going to be using an SSH tunnel for testing purposes, so no authentication is necessary.
Anyone?
When you started mongod did you then provide a configuration file (using the --config or -f parameter)? If not then it defaults to listening on all interfaces.
The default configuration file which is used when starting the daemon with systemctl defaults to only listen on localhost preventing it from being available on the network. This is fine if you intend to connect to the server using a tunnel.

Java Heap Dump from Remote Machine

I have a remote server that runs a Web application on the JVM. I can ssh into the remote server after which I tried to use jmap to take a heap dump. But unfortunately jmap seems not to be available on the remote machine as it uses OpenJDK!
I then thought I could use JConsole from my local machine, but how could I use it to get the heap dump for a Java process that runs remote? I have the remote PID. Can I use the ssh port to first make a connection to the remote machine using JConsole?

Using multiple terminals on a remote machine using a single SSH connection

I'm running a process on a remote server through SSH on a certain port. The process is basically a TCP server waiting (listening) for a connection. So as long as it is running I cannot use the terminal as it is a blocking application.
I want to run another application (a TCP client) through the same instance of SSH connection to connect to that TCP server. I used screen to detach the first process (TCP Server) and connect to the server but then I could not see the output of the TCP server application.
Is there a way to emulate two terminals on a remote machine using SSH?
So I found a solution to this problem. Basically below is a link that explains how can I achieve exactly what I needed. That is, opening multiple terminals using a single SSH connection.
http://idnotfound.wordpress.com/2008/01/14/multiple-terminals-in-a-single-ssh-session/
In short we can use the following procedure:
$ ssh -X mylogin#remotemachine gnome-terminal
Password: ...
[Ctrl+Z]
$ bg
$ exit
Press Ctrl+Shift+N to open a new terminal.
EDIT: Or just use screen. Sigh..

EC2 Internal Sockets

I'm trying to have two process communicate through a socket connection. One of these is a python app, and the other is a php script.
I've created and tested the client/server combination on my home computer and it functions properly. However, when I deploy onto an EC2 instance (ubuntu 10.10 64bit ami + apache + php) I get an unable to connect to socket error (111 Connection Refused) from the php script. The python app is able to bind to the socket and listen to messages but the php script is unable to send messages.
I've opened the required ports in the amazon security group and I can connect to the port externally using telnet. However if I attempt to connect with telnet from within the server I get the same connection refused error.
How can I solve this issue?
Edit: Both processes are on the same instance
The issue had nothing to do with EC2 explicitly. I was not binding to localhost, but instead binding to my hostname. On a local network that was the same as my localhost ip, however on ec2 it was not. Switching to binding to localhost fixed the issue.