how turn off browser sync in sublime text 3? - html

I'm using Sublime Text 3 and installed browsersync package for live reloading.
When I quit from Sublime and close liveserver app in my browser and try to open new liveserver with react start command I get a message that say: "Something is already running on port 3000." Then I check localhost:3000 and the browser still sync to Sublime I don't know how to turn off liveserver in port 3000 ?
please help me

I assume that this is the plugin you're using. Unfortunately, the plugin has been abandoned for 5 years, and the way it's written, there is no method for killing the node server once you're done with the plugin. From the Windows command line, this:
taskkill /im node-windows.exe /f /t
should do the trick, but you'll have to run it manually. Alternatively, you can use Task Manager to kill any node-windows.exe processes.

Another way to kill the service is going to
Start -> Resource Monitor -> Network
Under "Listening Ports" check for your port number, in this case 3000.
Take the process Id and then look for it under "Processes with Network Activity"
Check the process and right click -> End Process.
This will end the process utilizing the port 3000.

Try using Ctrl+C on your keyboard in your terminal or your command line (depending on whether your operating system is Unix based or Windows based). PowerShell should work too, if on a PC.

Related

Alternative to "Web Server for Chrome"?

I need help with an alternative to "Web Server for Chrome" extension provided by Chrome. I don't even want to download chrome let alone using it so is there any alternative to run HTMl and JS files on a web server? I want something very simple which does not require extra coding or effort. please and thank you.
You should install a server software for this purpose like XAMPP server. No need to download a specific browser as long as you have the server software.
Maybe you can do the following (if you have python installed ):
Open command prompt
Type cd your_path_to_folder_in_which_file_is_located
Type the command : python -m http.server
Hit enter
Open browser and enter localhost:8000
Done! to cancel the server , hit CTRL+C
If you do not have python then you can install Web Server for Chrome on any other browser . Edge , firefox .Simply go into the chrome web store and search the same . You should be able to add it the usual way.

Failed to start native messaging host on Windows, "COMSPEC is not set"

I have a chrome extension that communicates with a native messaging host to get some data.
The issue is, when I launch the Chrome browser via the shortcut or via the pinned shortcut in the taskbar, the extension is not able to connect to the host. I always get the error:
Failed to start native messaging host.
However, if I launch the chrome.exe via command prompt, everything works fine.
Things I tried with no success:
The taskbar shortcut has no extra flags. The target field has the
following value: "C:\Program Files(x86)\Google\Chrome\Application\chrome.exe"
I tried with the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Chrome\NativeMessagingHosts\com.company.extension
I tried with the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.company.extension
I tried with the registry entry under
HKEY_CURRENT_USER\Software\Google\Chrome\NativeMessagingHosts\com.company.extension
Tried launching the chrome.exe as administrator from the file explorer.
Update:
I added the flag --enable-logging --v=1 to the shortcut to enable logging and when I launch it I get the following output in the console:
[11036:4160:0302/113902.866:ERROR:native_process_launcher_win.cc(140)] COMSPEC is not set
[11036:11856:0302/113902.882:ERROR:native_process_launcher_win.cc(140)] COMSPEC is not set
Update
Upon investigating the chrome.exe process via Process Monitor, I found that there is no COMSPEC environment variable available to it when it is spawned via explorer.
Is there anything else that I can try or something that I am missing here?
As mentioned in the log, Chrome stumbles to start an external process, since COMSPEC, an environment variable pointing normally to cmd, is unset:
[11036:4160:0302/113902.866:ERROR:native_process_launcher_win.cc(140)] COMSPEC is not set
The behavior is different for launching Chrome from cmd itself, since it sets the variable for itself (ans spawned processes).
This can be confirmed by inspecting the Chrome process with Process Explorer.
One can run rundll32 sysdm.cpl,EditEnvironmentVariables as admin (e.g. from admin command line) to open the environment variable settings.
Alternatively, the dialog can be navigated to from Control Panel > System and Security > System > Advanced system settings > Advanced > Environment Variables...
ComSpec is usually set in System variables to
C:\WINDOWS\system32\cmd.exe
Adjust as necessary for your system install. For this setting to apply, you need to log out and log back in, or better yet restart the system.

How to start a program from remote powershell console?

In the webgui for defaultapp, you can click a button to start the selected app in the drop down.
What command is hidden under that button to start the universal app? I would like to do this from a remote console programatically.
Also, is the source code available for the defaultapp/webgui?
You can use PowerShell to set an app as startup, run in headless mode etc.
Find the details of connecting it with PowerShell here: https://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
Also running in headless mode saves more memory, power, faster boot.
Also command line utils for enabling startup process:
https://ms-iot.github.io/content/en-US/win10/tools/CommandLineUtils.htm
-> Default App Sample: https://github.com/ms-iot/samples/tree/develop/IoTCoreDefaultApp
Let me know if you need anything else.

Enable XDebug in Behat

I am using behat+mink. I wrote some features and am now running tests.
How can I enable xdebug to to stop on breakpoints in phpstorm when running behat tests ?
I have not tried this with Mink yet, but this is configuration that allows me to step through debugging of behat (with behat running on a remote server):
Configure your server with x-debug
Of note, since this is commandline, you need to edit the cli config under /etc/php5/cli/conf.d/20-xdebug.ini.
Set remote_host to the ip of the computer you're using PHPSTORM from
Set autostart = 1
Disable connect_back, you will initiate debugging from the server so there is nothign to connect back to
You can also do this without editing your ini by exporting values as env variables, just remember to do this each time you start a new shell (or add to your .bash_profile file):
export XDEBUG_CONFIG="remote_host=<YOUR IP>"
Configure PHPStorm's Debugger
It seems by default, PHPStorm doesn't understand remote-cli scripts, so we need to add a configuration that tells it to expect a CLI script to trigger xdebug
Open the Run Menu and select "Edit Configurations"
Click the Green "+" to to add a new configuration and select "PHP Remote Debug"
Name the Configuration (E.G. MyServer-Behat)
Under the Servers: menu, select your remote server.
If you haven't configured your remote server yet, then do this by clicking the "..." button on the right
Click the Green "+" to add a server configuration. Give it a name (E.G. MyServer) and fill in it's address under Host
Configure it's Path Mappings. This is important if the path to your source files is different on your PHPStorm computer from your server. You can see in my example that i'm relating my local checkout (~/Work/Symfony/) to my server install (/var/www/). I specifically added mappings for src, bin, web, app, and vendor by clicking in the space to the right under "Absolute path on the server" and typing in the path. I had issues just mapping the root's, so I had to add these paths to get my debugger to work.
Debug!
Once that is setup, select your configuration from the drop down in the debugging tool bar and click the bug icon (you can also use the Run menu) to start the debugger listening. This is similar to the default Telephone Button (circled in yellow), but it tells PHPStorm to use your new configuration.
Now simply run behat like you normally would from your server and your debugger should connect and stop on any breakpoints you've placed.
If you're having doubts about if it's working or not, try toggling the "Break on First Line" in the Run menu, as this should make the debugger break immediately when you run behat (in the bin/behat file)

How to open a serial terminal in Eclipse Juno?

In previous versions of Eclipse I have been able to open a view that presented a serial terminal/console.
How do I do this in Eclipse Juno?
I have a "Terminals" view open and it has text that says:
To open a terminal, right-click the Terminal subsystem under the target. Then select 'Launch Terminal' from the context menu.
I really have no idea what this is talking about and I've been using Eclipse for several years now!
Can someone shed some light on this?
EDIT:
I've discovered that the "Terminal Subsystem under the target", refers to the "Remote Systems" view. I can't find any options for a serial terminal though.
To use a serial terminal in Eclipse Juno.
1: Install the software for serial terminals:
Navigate to: Help -> Install New Software...
Dropdown list for Work with: to say Juno - http://download.eclipse.org/releases/juno
Select: Mobile and Device Development, especially Target Management Terminal which is "An ANSI (vt102) compatible Terminal including plug-ins for Serial, SSH and Telnet connections."
Click Next and anything else to finish the install ...
2: Open the view
Navigate to: Window -> Show View -> Other ... -> Terminal -> Terminal (NOTE: singular Terminal, not plural Terminals)
3: Open a terminal
The rest should be fairly obvious as the view contains icons to Connect, Disconnect, Settings, etc which are related to Serial, SSH and Telnet connections.
Under remote systems, there is "Local" and the remote connection, in my case 192.168.1.12. Click on the "+" to open subfolders. You should see the project you are working on. Right click on it. Select "Launch Terminal", the third one from the bottom.
Load up the Remote Systems perspective to connect to the server. There you will be able to open an SSH terminal.
There is an Incubator project called Local Terminal. You can install it from the Eclipse update site: http://download.eclipse.org/releases/indigo/ under General Purpose Tools->Local Terminal