When we do a telnet to an ONU, it gives never-ending console logs and prompt is never appearing. Ctrl+C and many other keyboard commands have been tried but the logs are not stopping. What can be a possible way to stop these logs?
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("*ip*","*port*"))
while True:
print str(s.recv(1024))
Related
I have one usb_to_serial that connected my usb
and installed by this command
modprobe usbserial vendor=0x67b product=0x2303
and connect to other devices via console
and when use of the screen for connecting to console for example
screen /dev/ttyUSB0 9600
i can stop the session by the this command
fuser -k /dev/ttyUSB0
but when connect to other device console my console empty show
my question is when i reboot the system and connecting the first device via Console any thing is ok but when i need to connect to other device then must be reboot the os thus can to connect new device! there is any method that don`t required to reboot and only reset the usbserial service without reboot?
thanks for help
now me found a method to restart service usbconsole
if you have same problem then can to try kill process by
pkill -f /dev/ttyUSB0 ; screen /dev/ttyUSB0 9600
by this command you kill prior session on Serial Console and create new session for them
I am using Appium version V1.15.0 and have already start the server successfully with the default Host: 0.0.0.0 and Port: 4723
But now when i try to start the server it shows me this error "Error Starting Appium server: listen EADDRINUSE 0.0.0.0:4723"
I have tried to solve this issue by changing the port but could not find any solution.
Suggest me if you guys have any better solution.
I have found the solution. After restarting my computer, i could successfully run the Appium server.
If anyone face the same problem. Please follow below steps:
1. Check if the port is listening to any other services.
Open command prompt: Type netstat -a -b
Either kill that service or try with different port.
If both not working then restart your machine.
This way i have solved this problem.
If EADDRINUSE, Address already in use is the issue,
do
ps aux | grep node
to get the process ids.
Then:
kill -9 PID
Doing the -9 on kill sends a SIGKILL.
That because port 4723 has been used.
We gonna find which process using it
sudo lsof -i :4723
input your Mac user password, press Enter and the result will similar to
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
AppX 68286 huyck 65u IPv4 0x31233f2022a17f56 0t0 TCP *:4723 (LISTEN)
that mean AppX with PID 68286 is using this port
And we are gonna kill it (replace 68286 with your PID)
sudo kill -9 68286
Another easier way, restart the machine could solve this problem
Hope this helps!
The following solution on windows worked for me
C:\Users\username> taskkill /F /IM node.exe
SUCCESS: The process “node.exe” with PID 13992 has been terminated.
I want to forward incomings from 192.168.1.50:5007 to 10.1.1.117:5007 on raspberry pi debian installed . I do not want to make a bridge between two networks. How can I achieve this?
You can use ssh:
ssh -L 192.168.1.50:5007:10.1.1.117:5007 -N localhost
this assumes that your server is the machine at 192.168.1.50. if not, you're going to need to give me the IPs of all the machines involved and tell me which is which.
You'll need sshd running but you should already have that with Raspbian.
After you run it, you'll need to authenticate. No forwarding will occur until then.
Once you've logged in, it will look like it's hung, but it's not; it just doesn't have any output to show you.
At this point the forwarding is active.
You can kill it with ctrl-c when you're done.
If you'd rather keep it running in the background instead of having an empty window sitting around, you can use ctrl-z (which will pause its execution) followed by bg which will resume the process in the background.
To stop the forwarding from a backgrounded job, you're going to have to find the pid in ps and kill it.
Run netstat -ano --tcp |grep 5007 to see your server listening for connections on 192.168.1.50:5007, remote computers making connections to 192.168.1.50:5007, and new connections from your server to 10.1.1.117:5007
I'm often connecting to multiple servers using server -m it opens new window for every server and I was wondering if it was possible to automatically close the window when it fails to connect. Possibly using the event CONNECTFAIL. Any idea ?
A simple close command should do the trick
on *:connectfail: {
; -it: Inactive Status window (not connected nor connecting)
close -it
}
More info here: http://en.wikichip.org/wiki/mirc/commands/close
I'm connecting an IPython console to an existing kernel, via
ipython console --existing /path/to/your/kernel.json
However, when I exit the console, this kills the kernel:
In [8]: exit
Shutting down kernel
(same thing happens with ctrl+D, or any other method that I would normally use to get out of an IPython session). My intention is to have the ipython console temporarily as a debug tool for an IPython notebook. Obviously, I don't want the notebook kernel to die when I finish debugging. I don't want to use qtconsole, as all of this is running on a remote server, to which I'm connected via SSH/tmux. I can't easily "just close" the IPython console. I could supposedly kill the tmux pane, but that's rather cumbersome and just feels wrong. Any better options?
The console can be quit without killing the kernel: quit(keep_kernel=True)