How can we add an application to startup remotely (Linux) - linux

I have an application which executes on a remote Linux system. How can I add this application to startup of that remote system from my local linux system. I know the path of executable (application) on remote system.
I searched a lot on different sources but didnt get any idea ?
Edit: What am I doing is:
I have developed a desktop-application (using qt).
I have loaded this application on remote system (using libssh).
I am able to execute this application remotely.
Now, I want to add this application to startup of that system remotely (stucked here).
Any Idea how to complete 4th step ??

Create Executable.desktop file (on local machine)
Open ssh connection and get remote machine root access
Copy this Executable.desktop file to "etc/xdg/autostart" on remote system (using ssh and commonds )
Reboot the remote system (using ssh and commonds )
Note: The solution will work if we know the location of executable/application on remote system

Related

command to pass username and password to ibm staf/stax application

STAF/STAX application works in a way that if the staf service is running in a windows machine then from a linux machine where staf is configured and if both the windows machine and linux machine are communicating each other then from linux machine by using staf we can execute commands in windows machine without passing any credentials but there is a shared folder which is accessible from windows machine but when trying from linux machine it is saying "Access is denied". in order to grant access from windows machine a user need to created and the user is also created but how to pass that user credentials to authenticate with that windows machine and access the shared folder using IBM STAF application.
this is working
/usr/local/staf/bin/staf process start shell command "ipconfig" WAIT STDERRTOSTDOUT RETURNSTDOUT
this is not working
/usr/local/staf/bin/staf process start shell command "copy "/shared_path_folder/file.txt" "/destination_path/file.txt"" WAIT STDERRTOSTDOUT RETURNSTDOUT

SSH access parent host folder

After connecting to a remote server (A) through ssh is it possible to access host's folder/files?
This server A has access to another server (B) which I can't access from my computer. I need to run some commands on B using some config files on my computer.
I ended up copying the files from my computer to A using scp and run the commands there.

SVN pre-commit hooks from windows to linux

I have two PC in my network:
1) CentOs
2) Windows 7
I created repository on Linux machine and add some pre-commit hook scripts. Then, I checked out files to working copy directories on both machines. Now, when I make some changes and commit them from linux working copy then pre-commit hooks works as they should. But when I commit my changes from Windows (using Tortoise or command line) commit execute but without any results of working scripts.
I have read, that scripts are lunched on PC that holds repository (correct me if I'm wrong), so it shouldn't be matter of what kind of platform I'm making changes.
So, if any one can explain me why this doesn't work from windows then I would be grateful?
The pre-commit hook is run by the machine that's hosting the server. If you're using the repository with a file:// URL or using svnlook or svnadmin commands then that's always the local machine since there isn't actually a server and the repository is accessed directly.
From the what you're saying it sounds to me like you're putting the repository on a network volume (SMB, NFS, etc) and then using a file:// URL to access it. If you use one of the other access methods then you won't have this problem.
You have 3 options.
svnserve
svnserve is a simple daemon that provides the svn:// access method. It listens on its own network port and talks a protocol that's specific to Subversion.
svnserve over ssh
The svnserve protocol is tunneled over ssh and a svnserve process is started on demand.
Apache HTTP
The mod_dav_svn and mod_authz_svn modules provide access to Subversion via an Apache httpd server. This uses the DAV and DeltaV protocols over HTTP (optionally with SSL/TLS support).
The SVN Book has a whole section on server setup that covers choosing the server to how to configure it. You probably want to read this before you make a choise and then read the configuration steps for your chosen server.

How to run Jprofiler from Windows machine to Remote Linux JVM

Kindly let me know how to run Jprofiler from Windows machine to Remote Linux JVM.
Thanks a lot in advance.
1) Go to the download page, download the .tar.gz distribution and extract it on the remote Linux machine.
2) On the remote Linux machine, start the command line utility bin/jpintegrate, then follow the steps in the command line wizard.
3) Transfer the generated JProfiler config file to your local Windows machine.
4) On your local Windows machine, start the JProfiler GUI and import the config file with Session->Import Session Settings
5) Start the profiled JVM on the remote Linux machine and the imported session in the JProfiler GUI on the Windows machine.
For remote connect to jprofiler on Windows with remote machine JVM(Centos 7)
Download (.tar.gz) the Linux version jprofiler on centos. Both the Windows and remote machine jprofiling agent are of the same version. If bots are not same version then it will not create with the jprofiler on Windows.
Untar the .tar.gz file.
tar xvzf folder_name
Go to /bin path.
cd folder_name/bin
Run following command to enable profiling agent to connect JVMTI data on a specific port.
./jpenable
On running the above command it gives all list of process running on the JVM. Select the process which you required for profiling. (eg. lets i have to stream 6th process out of 8 process. Then enter 6).
Select tthe GUI mode or offline mode. Enter 1. (This option does not exist on old version).
Enter the port on which you want to listen. (Eg 33668)
Now your VM is ready for connection from Windows jprofiler.
Connection setting on window jprofiler
Click on start center.
Select a new Session.
Click on attach and select “Attach to remote machine” radio button.
Set ssh tunnel from the drop down.
Slick edit button and configure the direct ssh tunneling connection.
Click next and provide the VM credential.
Manually configure the profiling port. It should be defined at the time of configuring profiling agent.
16.Click finish.
17.Select ‘ok’ button and enter the key you received through mail.
If the credential is correct, following prompt will show up. Click “configure” button. Select “CPU data”, “Call tracer” and “allocation stack” check box. Click ok.
Click ‘ok’ button. Congratulation !! Now your remote VM is connected with your Windows jprofiler.
for remote connect to jprofiler you can following this steps:
download linux version of jprofiler.
install it on linux system.
go to folder bin and run ./jpenable. follow the wizard for choose the process id of jvm you want to profiled. after that it give you a port number.
install the jprofiler in local machine like windows.
in start center menu choose quick attach and chose the another computer. enter the host address and port number in step "3" then you can remotely connect to jprofiler

Cygwin home directory on target system inconsistent

I am having difficulty connecting to a remote Windows system running cygwin.
When I connect from a linux box to cygwin, it connects fine and "sees" the
remote home directory as /home/userID
When I connect from Windows cygwin to the remote windows cygwin, it sees
the home directory as /cygdrive/c/Documents and Settings/UserID
Finally, when I am logged onto the remote Windows machine (the one with the problem)
home is /home/UseID but the value for cygpath -H is
$ echo $(cygpath -H)
/cygdrive/c/Documents and Settings
This seems to be causing my connection problem from windows to windows
and no problem from linux to windows
Any ideas how to fix it?
Since you have the correct path in /etc/passwd, one possibility is that perhaps the SSH client you are using from your Windows systems is sending custom environment values.
If you're using PuTTY, before connecting, look in the tree panel on the left hand side of the dialog. There should be an entry called Connection and a sub-entry called Data which will bring you to an option screen that has a section called Environment variables. Check if the HOME var is being overridden there and if so, remove it.
If you're using a different SSH client, check its configuration to see if its using the SendEnv option. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config.
Or you could try blocking off custom environments on the destination/server side by disabling AcceptEnv in the SSHd configuration on the system you're connecting to. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config.
Hope this helps.

Resources