Digi Chat (V4.1) crashes when I close PuTTY - chat

I am running a VPS, CentOS 6 with a copy of digi chat 4.1 on it. The chat runs fine, if I open putty and run the usual start up code:
# java -cp Server.zip com.diginet.digichat.server.ChatServer
The second I close PuTTY, the chat turns off. Or after the initialization sequence Digi Chat runs after that command, if it gives me a new prompt line (usually it doesn't, but for example copying a piece of code cause it to), the chat turned off.
How can I resolve this issue?

As root run:
java -cp Server.zip com.diginet.digichat.server.ChatServer &
If you installed using the InstallAnywhere launcher, there is also a system service you can start in /etc/init.d/.

Related

Using tmux in VS Remote SSH session

I am currently starting to work with SNNs on a GPU server. I am working with VS Code Remote-SSH package. Thereby, I'd like to use the tmux package to be able to start multiple processes which don't terminate when I disconnect the terminal from the server.
So far I used the https://cppdev.medium.com/vs-code-and-tmux-intergation-for-reliable-remote-development-e26594e6757a Tutorial. It already helps me that the process, I run doesn't shut down when I close the terminal but I didn't manage to start a second process on the server because each time, I open a new terminal, the already running process appears. What are your thoughts on that?
Thanks

Running PHPUnit in debug mode gives 'Unable to open 'BaseTestRunner.php': File not found' error

I am running Homestead on Windows 10 machine with Virtual Box. I have VSCode running on the Windows machine and I want to be able to debug code in the VM.
I have followed this setup:
https://tighten.co/blog/debugging-configure-xdebug-and-laravel-homestead-and-vs-code-and-phpunit
Once I am listening for Xdebug I run my code in the VM using phpunit test/Feature/AdminTest.php and this fails with
Unable to open 'BaseTestRunner.php': File not found
(file:///c:/g/Sites/Laravel/everyone-in-mind/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php).
Which is obviously showing me the Windows path.
If I stop the debugger and run again the test runs fine.
Do I need to install something extra to get BaseTestRunner?
When you are debuging a PHPUnittest with xDebug in VSCode with the PHPUnit plugin from Elon Mallin, check that you have disable the option Breakpoints/Everything.
It seems as if PHPUnittest, running from the PHPUnit-plugin, could not find the BaseTestRunner.php file and raised an exection. When you ignore this exception, you can run and debug your test.
see the same question PHpUnit with xdebug Breaks at BaseTestRunner instead of the actual test
It works for me and can now debug the Unittest.

"Terminate" in eclipse's console view leaves node.exe running

I recently started developing for Node.js/Express with Nodeclipse. I added a run configuration for package.json with goal start. This works as expected, the start command from package.json is executed (node ./bin/www). I can see this command in Eclipse's console view and I can see two node.exe processes appear in Windows Task-Manager. HTTP requests to http://localhost:3000/ are logged in the console.
However, klicking the red "Terminate"-Button in Eclipse's console view leaves the node.exe processes running. Subsequent attempts to start the app fail because the port is already in use.
I do not have this problem when I start the app with npm start in Windows cmd. Stopping the execution with Ctrl+C will also exit the node.exe processes.
This is my IDE-Setup:
Eclipse Luna SR2 (4.4.2) under Windows 7 x64 with jre1.8.0_45
Eclipse was setup this way: extracted eclipse-platform-4.4.2-win32-x86_64.zip (from here), installed Eclipse Marketplace Client, then installed Nodeclipse via Drag&Drop from nodeclipse.org
Node.js version v0.12.2 (for Windows x64)
express-generator (version 4.12.1) is installed globally
How can I make the Terminate button in the console view actually terminating the node.exe processes?
It seems that Eclipse only kills the npm script that is used to start up node. The thing is that Eclipse forcibly kills that script, giving it no chance to send any signals to the node.exe process.
This bug explains why this works this way.
Step 1:
Run command-line as an Administrator. Then run the below mention command. type your port number in yourPortNumber
netstat -ano | findstr :yourPortNumber
Red coloured circled area shows the PID (process identifier)
Step 2 :
Then you execute this command after identify the PID.
taskkill /PID typeyourPIDhere /F
P.S. Run the first command again to check if process is still available or not. You'll get empty line if process is successfully ended.

Remote debugging using LinuxTools' Valgrind profiler in Eclipse

I have a program that I'd like to run remotely under Valgrind using the Linux Tools remote Valgrind profiler.
I normally debug remotely on a headless server (which has special hardware, so it has to be done remotely on that machine) using RSE, which works fine. Both my machine and the target are Linux machines.
I am now trying to get Valgrind working through Eclipse using the Linux Tools plugin. I have Valgrind 3.10 installed on the remote target machine, and I can run it up manually (outside of Eclipse):
Remotely:
valgrind --vgdb=full --vgdb-error=0 /path/to/app --args
vgdb --port=2345 --pid=XXXX
Locally, connect with gdb with target remote host:2345.
However, I can't work out how to get the "Valgrind (remote)" Eclipse tooling to emulate this, aping the "RemoteTools" setup shown here: .
When I write in a "To:" executable that starts with "rse:/", I get an error in the Profiling Tools settings window top corner saying [Valgrind Options]: Couldn't determine version of Valgrind. What should I write here to get a working remote Valgrind connection?
Haven't found more recent posts on the topic, maybe it will be useful for somebody. I also didn't manage to use remote valgrind plugin with RSE. Seems like only dstore connection type will work for Linux Tools remote valgrind, because SSH or FTP didn't work for me. rseserver requires Perl and Java, and I didn't have them on my target.
I had to use this complicated solution via Launch Group combining this and this solutions. Preconditions: valgrind and vgdb are installed on remote target.
Write a script start_remote_valgrind.sh
set -x
remote_ip=192.168.7.2
remote_port=2222
app_name=test_app
remote_dir=/usr/local/bin/
local_dir=/home/project_name/
ssh -T root#$remote_ip killall -9 vgdb
ssh -T root#$remote_ip killall -9 valgrind
scp $local_dir$app_name root#$remote_ip:$remote_dir$app_name
ssh root#$remote_ip valgrind --vgdb=full --vgdb-error=0 --leak-check=full -v $remote_dir$app_name &
sleep 1
ssh root#$remote_ip vgdb --port=$remote_port
Create debug configuration Run->Debug Configurations->C/C++ remote application:
2.1 On themain tab set the project name and app binary
2.2 In the bottom of the configuration window click "Select Other" link and select "GDB (DSF) manual remote launcher"
2.3 On Debugger tab set GDB debugger for you target platform, command line script .gdbinit.
2.4 On Debugger->connection tab set TCP connection, remote ip and port.
Create external tool Run->external tools->external tools configuration...
Create Launch Group Run->Debug Configurations->Launch Group
external tool must be in Run configuration, remote gdb in Debug. The benefit of this approach is that remote valgrind output is printed in Eclipse console, so you don't need to launch vgdb manually in a separate console and see messages in separate window.

How to do remote debugging in Eclipse CDT without running `gdbserver` manually on the target every time?

Before each debugging cycle I have to run gdbserver on remote target (Linux). So I was thinking to make script that would call python program that would connect over ssh and would run gdbserver.
I cant find any options to run command before debug and I also try to change .gdbinit file but I am unable tu run python script whit that. Since I am using crosscompiler I cant to get other gdb whit such support.
You don't need to run Python to invoke an external command from GDB. This (in .gdbinit) should work:
shell ssh remote-host gdbserver :12345 /path/to/binary/on/remote &
target remote remote-host:12345
If you do need more complicated ssh setup and need Python for that, you can certainly get it with
shell python your_script.py
If you can't get any external program called from your gdbinit, I see one way of doing it within Eclipse that might work (I didn't tested) but it is not really straightforward...
Create an External Tool configuration that launches your gdbserver program (Python or whatever command line script)
Create a C/C++ application launcher that launch your application to debug
Create a launch group that will call the two previously configured configurations.
Launch the group in debug mode
Eclipse 4.7.0 can connect to SSH and launch gdbserver automatically with the automatic launcher set when creating a new debug connection, without the need for any custom scripts.
I have explained the setup in great detail at: Remote debugging C++ applications with Eclipse CDT/RSE/RDT