Remote C++ Development using SSH only inside Eclipse Environment - c++

How do you integrate Remote Systems Explorer and CDT plugin inside eclipse ?
What I mean is that you can use Remote Systems Explorer (RSE) plugin to work on C++ code on a remote linux box inside Eclipse but when you try to compile, you basically run a shell command through SSH. The CDT plugin is unable to locate the remote system and off course the remote compiler.
Is there a way to integrate both the plugins so that we can use the parsing / suggestion features of CDT for the remote system as well; and also features like remote compilation, remote debugging using SSH only. If this is not possible, then what is the closest open source alternative to the above problem.

While I don't know how to integrate the plugins you mentioned I do something similar to what you want to achieve on a daily basis with SSH's X forwarding.
If the remote box has X libraries installed and you have a local X server running, you can just ssh -CXY ... into the development box and simply run eclipse (or any other X application) there. The process will live on the remote box and, therefore, have access to all the filesystems and tools, but the GUI elements and those alone will be displayed in your local X session. That, though, may require quite a bit of bandwidth. Please see man ssh and X documentation for security stuff and compression settings.

The PTP project is building a remote build for CDT. Not sure how good that works, but you could always use the Terminal view from RSE to manually call your remote build (make).

I have not used it myself, but maybe you could try NetBeans and see if it works for you.
According to page https://netbeans.org/kb/docs/cnd/remotedev-tutorial.html it has everything you need, even
[...] system includes, macro definitions, platform, etc. All of this information is gathered from the remote server and stored locally on your client system, so that when you edit locally the code assistance will work even when the project is set up to use a remote build host.

Related

What is difference between sshcode and VS Code Remote Development Extension

I really love the concept that I can write codes by using my laptop but all the hard things will run in the server.
So I did some research and found 2 solutions:
sshcode which introduce by Coder Technologies Inc. (https://github.com/cdr/sshcode)
VS Code Remote Development Extension (https://github.com/Microsoft/vscode-remote-release)
In my short time, I guess 2 solutions are the same.
But if you got the deeper understanding, please give me some comparison so I can have right decision for which case I should use sshcode and some other cases I should use VS Code Remote Development Extension.
Many thanks!
Unforunately the developers of sshcode deprecated it and stopped maintenance, in favour of another of their open source projects, code-server https://github.com/cdr/code-server
So I will compare those two.
The first, Microsoft VS Code Remote Development Extensions, connects your local VS Code to a remote instance of VS Code, running on your development server. (During its short life, sshcode also did this.)
The second, code-server, connects your local web browser to a remote instance of VS Code.
Question
1. I have VS Code installed in my local machine.
2. I have a remote machine where I have some docker container running.
3. I am able to remote ssh into this machine from VS.
4. I am able to using Remote Development to use VS Code to run and build code locally.
Requirement
Can I use the feature in a way such that I can directly get inside container in the remote instance and start developing my code in there using VS Code feature like when I reopen the folder in container instead of opening it on local machine, it needs to open in the container that is running inside the instance.

With QtCreator, how can I build my project on a remote server I have ssh access to?

I need to build an application on a remote server so it can be run locally, where it will issue commands to a website it is hosting. I'm building this application on my machine in QtCreator, but I would like to streamline testing the application by having it build on the remote server.
What is the best way to go about this?
That first sentence is so long and so confusing... -_-
That said Qt Creator supports remote deploying and debugging but not remote building (as far as I know; please someone correct me if I'm wrong).
The only remote-related thing about the building step is cross-compilation which again is performed locally (using a cross-compiler, specifying the sysroot etc.). Of course if the target platform is the same (architecture and installation wise) as the one you use for development the cross-compilation chaos can be completely omitted.
If you want to build Qt-based application (and not only run it) on the remote platform, you will have to setup the development infrastructure (Qt dev libraries, qmake etc.). However, I would suggest using your local system for the development unless the server provides a very noticeable boost during the building step. It's easier that way and makes sense especially if the application that you are building on the remote will be executed locally.
you have 3 options really:
run the IDE on the remote server and connect using vnc or x2go. This requires a relatively high bandwidth/low latency connection, or the GUI won't be reponsive. This is personally what I do at my work - although we have a dev server set up to mirror prod in our building - so the data connection is great.
sync your files using lsyncd and build via commandline. You code-completion will be based on your local machine, so won't be perfect, and you wont be able to double click compile errors, etc. If you are brave you could maybe set up a qt creator build configuration to do this for you, but includes would still be broken.
use another IDE. NetBeans supports remote builds. I have never personally used this feature, but I've heard that it works ok.

Work(flow) Setup: Remote Debian VM (in office), ssh, web development

Normally I've developed locally (on my own machine) and pushed to wherever things needed to go via mapped drives, ftp, github, etc. I have done a bit of work with vagrant/virtualbox (but again, locally) with a shared/mirrored folder.
I am now in a situation where everyone here has access to their own dev box (a vm on the network). I see some working in Vim directly via SSH, I believe, but I'm not there yet. So I'm left with the question: What's the best way for (more of a front end guy) to approach this?
I have heard of doing an SSH-mount from my workstation... if that's a viable thing. I'm curious what everyone's take on this kind of environment is and (perhaps) any best practices. Tips, links, and reading is highly welcome and appreciated, too... any pointing in a good direction would be wonderful.
Thank you.
The best answer will come from what virtual resources do you want to capitalize on for the virtual networked VMs. If you just want the storage space, then share the VM's drives, and mount them locally, treat them as local, end of story. If you want to run all the processing on the remote machine, and connect from a thin client, you have a couple of options, but they all take the same form. Connect to the machine, edit the files on the remote machine. Depending on your OS, you will have different options available.
If the remote machine doesn't have an graphical client installed you are stuck with either, mounting the remote share locally (you can use whatever editor you want) or ssh to the remote machine and using a commandline editor (vim, nano, emacs).
If there is a graphical client installed you have more options:
Remote in the server using any visual viewer (mstsc for windows, vnc is an option), and then use any remotely installed editor of your choice.
Remote in using ssh -X, and then run the remotely installed editor. Assuming you have an X-Server locally (if you are running linux you already do), the GUI part of the application will be run on the client side of the ssh tunnel, and the process will be run on the server. This is probably the best option.
So:
Make sure the remote server has a desktop client software (gtk, kde, gnome, almost any windows os, etc...)
install GUI editor of your choice on that server
ssh -X to that server
install sublime text, geany, or your choice of editor
run subl, geany, or other to start the application.
SSH mounting would indeed allow you to use all of the files on the VM as if they were stored in your local machine, letting you edit and update files without having to manually copy them every time you perform changes. You will run into a speed bump though, since files changed will have to be synchronized/copied to your remote machine every time and that takes a couple of seconds. Check this post by DigitalOcean, they explain how to get the SSH mount working.
A better option you have (IMHO) is to use an IDE in your local machine that allows you to push changes to a server after saving or by manually doing so. This would allow you to develop faster by using your local resources (local web server) since no files would have to be copied over the network to the remote VM; and would also allow you to test on that remote VM when needed by uploading the files when you are ready to test on that environment.
PS: Exporting visual apps or environments form the remote machine to your local one can be slow (depending on your network and the VM host load running your machine). If you still like that approach, you could also install something to access that VM over something more standard and lightweight like RDP for GNU/Linux (xrdp).

Proper syntax to run CLIREG32?

I'm trying to install a legacy VB6 client on a Windows 7 (64-bit) machine that can talk to a DCOM server written in Visual C++. I know I need to run CLIREG32 and pass it the .VBR file as a parameter. I'm trying it like this:
clireg32 myvbrfilehere.vbr -s <ip address> -d -l
It seems to run without a hitch, but I think I should be able to search the registry and see the IP address i entered as a parameter. So something tells me I'm missing something during this command. (I've also tried adding -t mytypelibrary.tlb but that doesn't help either)
Any thoughts on using this ancient technology? I'm not in a position to rebuild everything right now. I'm starting to get desperate...
Thanks
There is at least limited information in Microsoft article Q155939.
(Archived copy.)
Paraphrasing the useful parts:
Q155939: HOWTO: Use Clireg32.exe for Remote Automation
Article: Q155939
Last Modified: 31-JUL-1999
-------------------------------------------------------------------------------
The information in this article applies to:
- Microsoft Visual FoxPro for Windows, versions 5.0, 6.0
-------------------------------------------------------------------------------
SUMMARY
=======
This article provides an explanation of Clireg32.exe and how it is used for
remote automation.
MORE INFORMATION
================
The Clireg32.exe component allows you to register an OLE server (.exe) remotely.
It differs from the Remote Automation Connection Manager (RacMan) in that the
server does not need to be located on the machine registering it. The Setup
Wizard handles the maintenance of registering remote servers for you.
NOTE: Remote servers and Clireg files are stored in the \Windows\Olesrv\
directory, which is similar to Visual Basic if it is installed via the Setup
Wizard.
The Clireg32.exe program takes a number of parameters. The only required one is
the name of the .vbr file (generated with the server during build):
Clireg32 myexesvr.vbr
In order to fully register a remote server, you must provide the network name,
network protocol, and security access. Clireg32 prompts you with a dialog box if
these options are not passed. For a list of all the parameters, simply execute
Clireg32.exe by itself.
Copyright Microsoft Corporation 1986-2002.

Qt::How to identify/detect if the system is Remotely access by other system in Linux

I am developing an application in ubuntu to access the other system remotely through QT. Both system are running some Qt applications.I want to check / make changes to the other system remotely using Qt programming.
I want to add a pushbutton (as a quit screen) at remote system that should be "Enable only if the system is remotely accessed", so that i can use it to close the remote access screen.
Is there any way through programming we can get the status whenvever it is remotely accessed???
I got through some solutions on forum but they are particularly for Windows. I am looking for some solution in Linux.
Please provide suggestion/links so that i can overcome this issue.
Thanks in Advance
If you are using the remote display abilities of the X11 protocol, you could check the value of the DISPLAY variable. For a local connection, it usually starts with :0; for a distant connection, it contains the hostname of the displaying server. For a connection thru ssh -X it could be localhost:10 and ssh is also setting SSH_CLIENT and SSH_CONNECTION environment variables.
Otherwise, you should define better what is a remote access for you (i.e. explain more your application). Your Qt application may also be e.g. some TCP/IP server. Perhaps the getpeername(2) syscall might be relevant.
If you just are interested in what remote connections flow into your box (independently of a particular application) you could read (e.g. using popen) the output of command netstat -a -n or use some /proc/net/ directory.