Is there a command (from the command line or a webrequest) to shut down a grid 2.0 hub?
I have tried "curl -d action=shutdown http://localhost:4444/lifecycle-manager" (as POST request), I have also tried the usual http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer
I've searched everywhere. I would preferably like something without using rake or ant
At version 2.25.0 old-style hub managing added.
So now you can use request like this one to stop hub:
http://localhost:4444/lifecycle-manager?action=shutdown
Related
I'm trying to integrate Newman(postman CLI tool) in my app, and I want to run it first on the localhost on a specific port, and change it in accordance later on.
Any suggestions on how to do that with the CLI?
After digging and reading a ton I've figured out the best and simplest way to do so:
just setting up the following environment variable "HTTP_PROXY" to whatever and then using it with newman:
set HTTP_PROXY=127.0.0.1:58833
newman run demo.postman_collection.json --env-var HTTP_PROXY --insecure
Now I can listen to the above port and see all of newman's requests being sent.
found my solution here:
https://github.com/postmanlabs/postman-request/blob/master/README.md#controlling-proxy-behaviour-using-environment-variables
I created a program using Renci SSH.NET library. Its sending all the commands and reading the result normally. However, when I send the command below:
client.RunCommand("cli");
The program hangs on this line indefinitely.
Any explanation of what is happening?
The cli is a command is used on Juniper switches/routers.
AFAIK, cli is a kind of a shell/interactive program. So I assume you have tried to do something like:
client.RunCommand("cli");
client.RunCommand("some cli subcommand");
That's wrong. cli will keep waiting for subcommands and never exit, until you explicitly close it with a respective command (like exit). And after it exits, the server will try to execute the cli subcommand as a separate top-level command, failing too.
You have to feed the "cli subcommand" to the input of the cli command. But SSH.NET unfortunately does not support providing an input with the SshClient.RunCommand/SshClient.CreateCommand interface. See Allow writing to SshCommand.
There are two solutions:
Use the appropriate syntax of the server's shell to generate the input on the server, like:
client.RunCommand("echo \"cli subcommand\" | cli");
Or use a shell session (what is otherwise a not recommended approach for automating a command execution).
Use SshClient.CreateShellStream or SshClient.CreateShell and send the commands to its input:
"cli\n" + "cli subcommand\n"
For a sample code see Providing subcommands to a command (sudo/su) executed with SSH.NET SshClient.CreateShellStream or C# send Ctrl+Y over SSH.NET.
I created a program using Renci SSH.NET library. Its sending all the commands and reading the result normally. However, when I send the command below:
client.RunCommand("cli");
The program hangs on this line indefinitely.
Any explanation of what is happening?
The cli is a command is used on Juniper switches/routers.
AFAIK, cli is a kind of a shell/interactive program. So I assume you have tried to do something like:
client.RunCommand("cli");
client.RunCommand("some cli subcommand");
That's wrong. cli will keep waiting for subcommands and never exit, until you explicitly close it with a respective command (like exit). And after it exits, the server will try to execute the cli subcommand as a separate top-level command, failing too.
You have to feed the "cli subcommand" to the input of the cli command. But SSH.NET unfortunately does not support providing an input with the SshClient.RunCommand/SshClient.CreateCommand interface. See Allow writing to SshCommand.
There are two solutions:
Use the appropriate syntax of the server's shell to generate the input on the server, like:
client.RunCommand("echo \"cli subcommand\" | cli");
Or use a shell session (what is otherwise a not recommended approach for automating a command execution).
Use SshClient.CreateShellStream or SshClient.CreateShell and send the commands to its input:
"cli\n" + "cli subcommand\n"
For a sample code see Providing subcommands to a command (sudo/su) executed with SSH.NET SshClient.CreateShellStream or C# send Ctrl+Y over SSH.NET.
I'm using SignalR in a .Net Windows service (using Microsoft.Owin v4.0.1.0). Due to the requirements of the application, I need to be able to stop and later restart the SignalRHub. The code I doing this with is
HubWebApp = WebApp.Start(HubURL)
Then later:
HubWebApp.Dispose()
Then later still:
HubWebApp = WebApp.Start(HubURL)
The problem is that when I start the WebApp for the 2nd time after earlier disposing of it to stop the SignaRHub, I'm getting the error:
"Failed to listen on prefix 'http://172.16.4.55:8080/' because it
conflicts with an existing registration on the machine".
So it looks like it's not releasing the URL registration when I dispose the WebApp, and refusing a new listener on this same URL when I restart it.
I tried messing around with netsh http, but delete doesn't work and show doesn't show the existing registration.
How can I release the URL registration when I dispose the WebApp?
Never found solution to unregister the URL. What I wound up doing is coding the service to exit with an error if restarting the hub throws an exception (Environment.Exit(1)). Then configure the service in Service Manager to automatically restart if it exits with an error.
This is a real Wear A Paper Bag Over Your Head kludge, but it's the best answer I've got for now.
I'm trying to launch a web page inside a vitual android device. The address of the page takes multiple querystring parameters. For some reason when passing the url in all parameters after the first & are missing (including the &).
I have a very simple C# WinForm app to test this with. I am using MadBee NuGet package to send the commands to the android VM.
When I send the command I see the url loaded but as I described, it is missing the parameters that come after he first &
Below is a snippet of the code I am calling:
command = "am start -a android.intent.action.VIEW -d http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352";
ConsoleOutputReceiver creciever = new ConsoleOutputReceiver();
device.ExecuteShellCommand(command, creciever);
Does anyone have any ideas as to why the parameters would not make it across to Android?
Your parameters "make it across to Android" just fine. What you failed to realize is that your command is getting parsed by the Android shell on the device side and & has a special meaning for it. To stop the shell from treating & as special symbol use quotes like this:
command = "am start -a android.intent.action.VIEW -d 'http://w18299:8009/Assignment/manage?assigner=57072352&unitID=6443&secret=asdasdasdasdasd&assignee=57072352'";