Vagrant + external editor that actually connects to vagrant? - node.js

I’m new to Vagrant and currently I’m using WebStorm.
The suggested workflow should be to use your editor while compiling stuff in vagrant. My question is: at what point should I stop and use my own compilers?
WebStorm is cool because it connects to your stuff and do things like REPL and autocompletion based on your code etc.
How does that works if my nodejs interpreter is on the VM? Should I install my own nodejs? If so, what’s the point of having a virtual machine?
Maybe there is a way to tell Webstorm to use the VM interpreter but how?

Related

How can I jump to function definitions using VS Code in SSH remote development

Okay I am new to Embedded Linux development.
Right now, I am trying to setup the development environment as efficiently as possible.
I have a python code running on a lightweight Linux based device, that is located remotely
So far I was able to setup my VS Code on my Windows system, in such a way that I can edit the files directly on the remote Linux device.
I followed the instructions below
https://code.visualstudio.com/docs/remote/ssh
https://code.visualstudio.com/docs/remote/ssh-tutorial
Now that I am able to edit my files directly, I face only one obstacle.
I find it hard to traverse to a function/method definition.
In my windows system, I could just Ctrl+LeftClick on a method/function, and it would take me there.
But here when I opened VS Code with the terminal running remotely, I have to do a Ctrl+F and search in the VS Code editor, which is like working on a notepad.
Does anyone know how to get around this?
On my main windows system, I am able to jump to method definitions quickly by Ctrl+LefClick-ing them.
Hope the question is clear enough.
Install the Python extension on the remote server and select the Python interpreter on the Linux device in VS code:
Press Ctrl+Shift+P to bring up the command palette and run the command Python: Select Interpreter.

Can I run a Puppeteer.js scraper on a Windows Server without docker?

I have absolutely no experience using docker, but I'm trying to build a robust website scraper using Puppeteer.
Can I run it in a Windows Server 2003 environment running SQL Server 2008 R2 without having to go back and keep tweaking it later?
If yes, then how? Just as I would in a normal Node environment (i.e. NPM)?
I personally have no experience running puppeteer on windows, but I think you can do it connecting to a "remote instance of chromium" (in the same machine), the "browser" that launched puppeteer, this is the thing that have problems working in windows.
You can follow this examples to make this connection.
https://www.sitepen.com/blog/2017/10/04/browser-automation-with-puppeteer/
https://blog.rnsloan.com/2017/10/27/puppeteer-windows/
Let me know if this works.

Testing Linux shell script in or from Windows environment, without jumping from window to windows

I'm usually using VM/linux to run scripts, copying script using putty
or writing them directly there, but some times too many opened windows is not that comfortable..
I was recently trying to run shell script, using RUN option in Notepad++
to use build in Ubuntu in win10 anniversary, but can't really manage to get the right syntax to do it.. and didn't find any plugin to do so..
I would appreciate if anyone can put me to the right path in this one.
I found that it is also possible to do it using sygwin, by C:\cygwin\bin\bash --login -c "command.sh" but again its an extra software piece... and bit far from natural Linux environment, and slight different paths etc..
there is also a solutions to run some shell IDE using X11 using Xming, to work with Linux VM without switching between the opened windows. but in this case Question is the where can I find a proper shell IDE for linux, capable to run shell scripts directly from it, without living the IDE window, like all other IDE's do ?
any real solution would be appreciated.
It will NOT replace a pure Linux environment but, it is a closest I've seen
https://www.tutorialspoint.com/execute_bash_online.php

How to use ec2 instance as personal dev box using intellij as IDE?

I have searched the questions and have not found an answer to this one:
I am developing an existing project (git repo) that runs only on Linux. For the time being I have at my disposal only a windows laptop which I cannot modify. This laptop has Intellij installed and internet access. I cannot, for example, create a Linux VM on this laptop.
Is there a way I can put the project code on an Amazon ec2 Linux instance and build the project on that instance, while viewing and developing the code in Intellij? All compilation and code execution has to be done remotely, on the ec2 Linux instance. I cannot build locally and push from the windows laptop.
2 possible configurations might be:
(1) install intellij on the ec2 instance and x-window in from windows to view the intellij screens;
(2) use the intellij on the Windows laptop and somehow point the intellij to the ec2 instance in order to view, edit, build, and run the project on that instance.
Any ideas are greatly appreciated!
ec2 with enough memory for development is billed / hour. For 32gb RAM it's >$80/month (always online ~450h).
You could use wls 2 under windows. You can install IDEA and use it trough X server like
VcXsrv and access to windows files. It's not the best idea to run full GNOME (even xfce4). Google chrome also works very well
Downsides are:
(still) slow access to drive compared to raw Linux
I cannot configure WSL to access same VPN as in Windows. It simply cuts off internet connection for WSL while I click connect in windows.

How to configure WebStorm to point to VM node interpreter

The JetBrains Vagrant plugin applied to WebStorm handles the starting and stopping of the VM just fine. My project node interpreter is configured on the VM. When configuring the project settings in WebStorm only local node interpreters are available.
I am able to ssh into the VM and work with the node project from the command line, like always, but I would really like to integrate the IDE, as otherwise it is just a test editor / terminal multiplexer, and I actually don't need it.
Is there something I am missing? On other Jetbrains products, ie PyCharm, the user is able to select the python interpreter from a vagrant vm, but it appears this is lacking on WebStorm.
Remote Node interpreters are not currently supported, please vote for WEB-1974 and linked tickets
It does not seem to be supported by WebStorm yet, but there is a workaround described a comment to the official documentation.
There is a way to do this now:
In your Run/Debug configuration, you can choose the Node interpreter, and more importantly, add one: press the ... button. Then you can add a remote interpreter, either
Then you can choose which you want to use:
However, I noticed a bug. This interpreter always uploads node_modules (could be gigabytes) to the remote interpreter. There is no way to turn it off, even if you do exclude it in the settings:

Resources