eclipse for users to access from terminal(like putty) - eclipse

Here in our institute we have a server where student login from putty and write code -- need to create a file and write code in vi editor(generally they copy and paste code into vi editor), also one can upload files by ftp transfer (using Ammy admin). Coding lang's can be Java,Perl, ...
Here we need a eclipse environment to individual user to access their code from putty. where individual must be able to run, debug his code on server for which he connected through putty.
This is to reduce the time for the students for working on 2 environments, and also to maintain assignments in sever according to user.

After you paste your code in Vi, you can run the program on server in debug-mode, with e.g.
java -agentlib:jdwp=suspend=y,transport=dt_socket,address=8123,server=y com.company.Main
and the program will listen on port 8123 until a debugger attaches to it,
and then you can remote debug it with Eclipse:
Run>Debug Configurations>double click "Remote Java Application">set project and host:port.
And you don't need putty for that, unless you are accessing the server through a ssh tunnel.
Eclipse do not support automatic code transfer to remote server, or starting program on remote server,
the program must be started from the shell as shown above, and then eclipse can attach to it.

Related

How do I connect to a SQL Server which is usually a machine I remote desktop into

Typically I remote into a machine with IP Address 00.00.00.00 and then I have an account in a domain, let's call it myspecialaccount\firstname.lastname.
Then I use Windows auth to connect to SQL Server instance for example:
ABCLACSQLC123\DEV04A
So my question is HOW can I connect from my laptop through SSMS directly to the machine (pending ports are open etc..)
In order to use Windows Authentication, you'd have to add the credentials you use to login to the laptop as a "Login" to the SQL Server. That can only be done if
You login to your laptop with a domain user and
The user is in the same domain in which your SQL Server instance resides
Otherwise, you have no choice but to use SQL Server Authentication.
In this case, you login to your laptop with a user in "Corp" domain, but SQL Server instance is in "Services" domain. So it won't work. Unless I think both domains are part of the same Forest.
Look at this answer : https://stackoverflow.com/a/1615431/3317709. There is no trick to login, unless you get rid of the "Network related..." error. If you are getting this error, SSMS is not even able to find your server let alone logging into it. Once you get "Login failed..." error, from that point, we can tinker and try to get thru using your windows auth.
Try creating a shortcut to runas.exe, pointing to SSMS.
C:\Windows\System32\runas.exe /netonly /user:myspecialaccount\firstname.lastname "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
(The path to your SSMS exe may vary.)
When you double-click the shortcut, this will open up SSMS. You should then be able to connect to your instance (ABCLACSQLC123\DEV04A) as if it were on your local machine.
See here for more info on the runas command: https://technet.microsoft.com/en-us/library/cc771525.aspx
Install SQL Server Management Studio Express on your laptop. Microsoft has made the download link obscenely hard to find on their own site, but I did manage to find it here. Download the one for your system, probably x64.
Installation isn't much easier. Once everything is extracted, run the program, and switch to the installation tab, and choose "Standalone installation or add new features". Continue along the installation, and just install the management tools.
Once installed and running, use the Connect to Server dialog (it should open when you start the program, but if it doesn't, it's the first option under the File tab), and target wherever you want to connect (IP or server name should both work). If your laptop also authenticates to the same server that handles Windows authentication for your database, you can use Windows authentication, otherwise, you'll have to create a SQL Server account to use for login.

Automatic backup of emacs file edit on a server

I have a large repository of C++ code on a remote cluster (linux OS). When I need to work on this code from my home computer (Ubuntu OS), I try to access these codes through emacs on X windows. However the X window connection is very slow making the editing a painful process. So I sometimes move files manually between my local drive and remote cluster to edit the files. My question is: is there a way to configure my local emacs, such that when I edit the file in my local space, it would automatically be backed up in the cluster where it can then be compiled?
UPDATE:1
I installed TRAMP and it works well for servers that can be connected directly. However I also have servers which can be connected only when I activate VPN. How to provide the VPN information to TRAMP to connect to this server?
The other question I had was how to stop the TRAMP when it waits for prompts from remote shell without having to kill the whole emacs buffer.
This is typically a use case where TRAMP would be useful.
Instead of connecting to the server using SSH and opening Emacs there with X forwarding, run Emacs on your box and open your files remotely using TRAMP. For example:
C-xC-f/ssh:user#host:/remote/path/to/the/fileRET
This way, your Emacs process runs locally, but all file operations (e.g. save, revert, ...) are forwarded to the server, and all shell commands issued from TRAMP buffers also run on the remote server (this includes M-x compile)
UPDATE:1
When TRAMP hangs waiting for a remote shell prompt (which tends to happen frequently for reasons which are still obscure to me), I usually kill the underlying ssh process (htop with tree-like view is a good tool to do this) . TRAMP notices this and automatically respawns the killed process to resume operations.
Wouldn't it be easier to run Emacs in a console on the remote server? All Emacs functions can be access via the keyboard and once you get used to the key combinations it usually works out faster.
That way you will be running faster than forwarding an X session - running in a console is what Emacs was designed for.
As an added bonus - if you get used to using Gnu screen - http://www.gnu.org/software/screen/ you can pick up your sessions exactly as they were if the connection drops. In fact with screen you can shutdown your laptop at the end of the day - login over SSH the next day and pick up all your 'screens' exactly as they were the day before. This will include any open editors, debug sessions etc.
Gnu screen is available as a package on Debian and probably most Linux distributions.

Testing AppServer/Database Availability Remotely in Progress 4GL

We have Progress appservers (OE 10.0B05) running on AIX UNIX and I want write some code to check if they are up and running. The code to check the appserver would be run from a WIN2008 server. I can pull up Progress Explorer on the WIN2008 server to check the status of the appservers, but I need to write some code that can check their status programatically.
Is there any way to programatically check whether my AIX UNIX Progress appserver is up and running from a remote WIN2008 server?
To get app server status information you can use "asbman".
To get it remotely you would need some means to invoke a remote process and return a value. I'm a unix guy so I usually use "ssh" for that sort of thing.
There are Windows versions of SSH (look at the PuTTY suite for a really good free option). If you set it up to use pre-shared keys or an "agent" there are no messy login prompts to get in the way. Something like (untested):
plink -i sshkey.ppk user#server.name "asbman -name appServer -query"
"asbman" also supports -host and -port parameters if you happen to have it running on the windows box that you want to make the inquiry from.
If you have a small program that can open a socket connection, that would do it. If the program can open a socket, you can be reasonably confident the appserver is running.
You -might- be able to use the ABL SOCKET functionality to do this. Failing that, any other program which can open a socket on a remote machine and then close it will work.b

Remote debugging, creating a server

I'm following some WinDbg instructions from the CodeProject tutorial.
To start a server, I can get this to work from the command line fine:
WinDbg –server npipe:pipe=pipename
(note: multiple clients can connect).
Where do I enter this from the windbg UI? I tried the command browser window, but that didn't seem to do anything:
.server npipe:pipe=pipename
(note: single client can connect)
This question is related to creating the server from WinDbg UI, not connecting from the client.
I am assuming that you are referring to usermode debugging here, so I will respond with that in mind.
From windbg attached to your program that you want to remote:
If you want to use symbols that are cached on the target, then run:
from the Command Window's prompt type .server npipe:pipe=YourPipeName
If you have another machine with with a larger symbol cache, then on the target run:
dbgsrv -t tcp:port=4000
This sets up a thin debug client (a.k.a. remote stub)
Then on the machine running the debugger, open Windbg > File > Connect to remote stub
tcp:server= machine_running_dbgsrv ,port=4000
Now hit F6 and attach to the process you want to debug.
Note: the versions of windbg have to be the same on the machine running dbgsrv and the one running windbg. If they don't match, when you get to part where you hit F6, you end up with no processes in the process list.
Jason
File -> Connect to remote session. Or just use CTRL-R.

Scheduled execution of Testcomplete fails

With TestComplete 8 we have a script that is scheduled to start 06:00 every morning by this line:
"C:\Program Files\Automated QA\TestComplete 8\Bin\TestComplete.exe" "C:\Attracs\TestComplete\Attracs\AttracsTEST\AttracsTESTProject.mds" /r /e /SilentMode
The problem is that this often fails. The log remark says:
An error occurred while calling the "Keys" method or property of the "TcxCustomInnerTextEdit" object.
The object or one of its parent objects does not exist.
If I connect to the computer with Remote Desktop and manually run the script it works fine.
There is no screensaver active and the power scheme is set to never sleep.
I have noticed that Testcomplete needs a handle to GUI (the screen is visible) or the script got this kind of errors. Could it be that when it starts it have no handle to the GUI components because they aren't visible ?
From the helps Running Tests via Remote desktop:
However, if you minimize the Remote Desktop window (the window that display the remote computer’s desktop), the operating system switches the remote session to the GUI-less mode and does not display windows and controls. As a result, TestComplete (or TestExecute) is unable to interact with the tested application’s GUI, as the GUI does not actually exist in this case and your automated GUI test fails.
To avoid this issue, you can keep the Remote Desktop window visible during the test run, but this may be inconvenient as it occupies some part or even your entire screen and leaves less space for you to run your local applications.
Any solution for this?
There is a way to enable the console connection in Windows to be active at all times, which allows TestComplete to work without actually connecting with RDP.
From: Running Tests in Minimized Remote Desktop Windows
Log in to the computer from which you
connect to remote computers.
Close all open Remote Desktop
sessions.
Launch the Registry editor
(Regedit.exe).
If you have a 32-bit operating system:
Locate the
HKEY_CURRENT_USER\Software\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for the current user only.
-- or --
Locate the
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for all the users.
Create a new DWORD value in this key
and name it
RemoteDesktop_SuppressWhenMinimized.
Specify 2 as the value data.
If you have a 64-bit operating system:
Locate the
HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for the current user only.
-- or --
Locate the
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for all the users.
Add the
RemoteDesktop_SuppressWhenMinimized
value to the key.
I found this page
http://www.automatedqa.com/support/viewarticle/12567/viewarticle.aspx?aid=12567
It seems that a solution could be that running TestComplete in a Virtual machine.
/Roland
To run any UI test, the UI needs to be available. Hence, the machine should be unlocked so that TestComplete can perform user actions like mouse click, keys, etc to work.
However, if you have non UI test like running Web Services then it will work.