Is there an Atom package for a SSH client on a tab? - github

I am using GitHub´s Atom text editor.
I installed Atom on my Windows 10 computer. I edit code and sync it to a remote Ubuntu Server using Atom´s remote-sync package. This is being done via SSH.
I am developing a Django project and most of the times I need to restart Apache so that the Python code gets compiled in the remote server.
I want to know if there is a package that I can use to access remotely to my linux server via SSH and run bash commands. Preferably one that can be loaded on a tab.
I tried term, term2, term3, terminal but all of them are not working. I get errors on pty.js when trying to install.

One way to accomplish this is to use shellinabox and use a web view package to access the webpage.

Related

code tunnel -h doesn't list options and doesn't open a tunnel to WSL

I'm following the guide
and I am noticing that code tunnel -h in a ubuntu terminal window just launches the code UI.
Using the command palette to get the URI results in a tunnel to my Windows version of VSCode rather than the WSL:ubuntu (which is the one I care about)
How do I fix this?
It appears that, for now, you need to manually install the CLI in WSL in order for it to work. The downloads can be found here. Since you are on Windows, I would recommend the x64 CLI download. When you extract the tar.gz file, you will get a file named code. I would recommend moving it to your home directory for ease. To open the tunnel, run ./code tunnel (from wherever you put the code file) to force the new CLI. If you use code tunnel it will still use the Windows version.
Source: https://github.com/microsoft/vscode/issues/171196

Is it possible to open VSCode from Windows terminal while SSH'ed into a virtual machine?

I'm working on some tutorials and trying to do something, but no idea if it can be done. I am using windows terminal in Windows 10. I have an Ubuntu virtual machine running.
I'd like to:
Open Windows terminal
SSH into the Linux Virtual Machine
Type in the code . command and have it open a version of VS Code on my Windows PC that is working on the folder in the Ubuntu VM.
I tried install code locally and on the command line in the other machine, but it doesn't work. I am sure there are other ways to do this but wanted to explain how I was doing it to show I at least tried something. Thanks for your help.
It's not quite as easy as the code . technique you get with the Remote - WSL extension, but Microsoft also provides a Remote - SSH extension that can be used to directly access the remote machine (without requiring WSL in-the-middle).
Once the Remote - SSH extension is installed in VSCode (and it may have already been installed in an extension pack with the WSL extension), and you have installed an OpenSSH client in Windows, there are several ways to access files on the remote host through SSH:
From the Command Palette (Ctrl+Shift+P), type Remote SSH to filter on those commands. From Connect to Host, you can add a new configuration, etc.
From the Activity Bar on the left, select the Remote Explorer icon, then in the dropdown at the top, select SSH Targets. You can add hosts here through the + icon.
There's a direct shortcut to Open a Remote Window at the far left of the status bar. This will give you similar filter options on the Command Palette as above.
Once a host is configured, you can browse it just as (well, almost) if it were local, open files, edit, etc. The one thing you can't do (as far as I'm aware) is any type of sudo/su editing on files that you don't have permissions to directly.
Full details in the VSCode docs here.

VS Code: install extensions system wide via CLI as root

I want to install VS Code + some extensions (Java to be exact) on the PCs (CentOS) in our university lab. I installed the editor itself according to the official documentation, but I'm running into problems when I want to install extensions. I'm logging into the systems as root via ssh.
Running sudo code --install-extension vscjava.vscode-java-pack --user-data-dir /some/dir (source) runs successfully, and the extensions are available when VS Code runs as root. The problem is: When I start VS Code as another user, the extensions are not installed.
My questions are:
What is stored in the user-data-dir? Does it contain the location of the extensions-dir? If yes, is it wise to share it across all users of the system?
What is the recommended way to install extensions system wide for different users?
Thanks!
I also need to be able to install extensions systemwide, but there doesn't seem to be a way to do this. The best solution I've found is to write a batch file that installs the extensions and then starts VS Code. I have users run that scr

Can I use vscode to connect to a remote machine to compile and debug

I have a few linux machines that I'd like some students to use to compile and run their code in C++ using only the console for input and output.
Ideally, I'd like them to be able to use vscode to edit their code on their native platform and then use the linux machines to compile and run. This will solve the problem of not all the students having access to the same tools.
However, it would also be nice if they could use vscode as a debugging tool to access the remote server running their code. Is this possible? If so, are there some instructions on how to set up the client and server machines?

Debug remote PHP CLI scripts

Here is my situation:
I am developing PHP CLI scripts on a distant server using Eclipse IDE with the RSE plugin (allows to edit files directly on the server).
Now I need to debug these scripts in a similar fashion than in Java (break points, show the variables content, ...).
I found something that could do the job: XDebug and PDT (Eclipse plugin). The problem is that when I try to launch the debug mode Eclipse says that there is no PHP debugger on the local machine. I guess it should be installed on the server machine.
I would like to know if it's possible to use PDT and XDebug to debug remote scripts and, if it's the case, how to configure them to do so. If not, I'd like to know if other solutions exist. It seems like XDebug uses TCP so it should be possible to debug remotely. I can change my IDE if necessary.
The server runs Ubuntu 10.04 with php5-cli and the dev machine with eclipse runs Win7 32bit.
Thanks
Yes this is possible, you need to enable xdebug in the remote server's PHP.ini file and make sure that the xdebug port (default 9000) is not blocked by any firewalls.
xdebug's page on setting up remote debugging.
Here is the complete procedure for the people who have the same problem:
First, install RSE by following the instructions on this website: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.rse.doc.user/gettingstarted/g1installing.html
Follow the instructions on this HowTo to install XDebug on the server:
http://ubuntuforums.org/showthread.php?t=525257
Install PDT on Eclipse and do the following changes:
- under Windows/Preferences, go under PHP/Debug and change PHP Debugger to XDebug
- under Windows/Preferences, go under PHP/Debug/Installed Debuggers and configure XDebug. Change the field "Accept remote session (JIT)" to "any".
Open the Remote System Explorer perspective, select your scripts directories and create a project from them (Right Click, Create Remote Project). It will now appear in the PHP perspective.
Let Eclipse run and go to the server (e.g. via SSH). Run the script you want to debug. A Window will then appear on Eclipse proposing you to choose with which "local" (remote via RSE in our case) file you want to link the running script to. Normally, the default script proposed should be the correct one, because it is the one running on the server.
You should now have visual debugging with Eclipse for your PHP-CLI scripts!
Do you want to debug while being able to interact with the script on CLI or do you just want to start it and then step through the code? I guess your question is referring to the problem that you can't access the script directly through a URL. If that's your problem, then I guess the easiest solution would be to debug a usual PHP-web-site which requires your script. Then you can launch XDebug with that web-site initially and step into the script through the require/include-statement.
index.php:
<?php require_once("../../../../../dir1/[...]/cliscript.php");
Best regards
Raffael