How to quit ASP.NET Kestrel web server on a Mac - asp.net-core

I'm running a simple MVC app generated by Yeoman on my Mac using the ASP.NET vNext K runtime. I can run k kestrel from the project directory, and everything boots up and runs just fine. However, when I hit Ctrl+C (or any other key combination I've tried), the server doesn't quit. I have to close the terminal window to get the server to shut down. What am I missing?

If simply pressing Enter doesn't work for you, try the following in the terminal window where you're running Kestrel:
Hit Ctrl + z to suspend the process.
Type: kill %1.

It turns out that simply hitting "Enter" exits kestrel cleanly, without the need to kill the mono-sgen process afterward. There is a github issue on the Kestrel repo asking to make this more obvious.

Hit Ctrl+Z, then you will need to kill the mono-sgen process to be able to run 'k kestrel' again with the same IP:PORT (If someone knows a better way please let us know)
After "Ctrl+Z" type "ps" to list your processes and find the PID for "/Users/YOU/.kre/packages/KRE-mono45-x86.1.0.0-alpha4", for example: "123456", then type "kill 123456".
UPDATE: I tried to use 'killall mono-sgen' but doesn't works for me.

If you have any processes open simply pressing "Enter" wont work on a mac. However if you use the example from UnraisedCesar and kill all your processes. Then restart the k kestrel you should be able to press "Enter" (if this is the only one of these processes running) and it will end properly.

Related

Visual Studio with React project keeps starting multiple copies of the development server

I'm using Visual Studio 2022 with the React template on .NET (core) 6.
When I press f5 to start debugging, it starts a command prompt to start the development proxy server, fires up my deafult browser (chrome), and everything seems to work OK.
However, about every 2 minutes after, regardless of whether I have touched VS or the app, it then starts another copy of the development server, which then gets stuck with a prompt saying Something is already running on port 3000. Left to its own devices it just keeps starting more.
This doesn't stop the previous one working but it's frustrating to have all these windows appearing, especially as they steal focus when prompting with the "port in use".
Something that I suspect is related is a message appearing in the debug output around every 8 seconds saying "Microsoft.AspNetCore.SpaProxy.SpaProxyMiddleware: Information: SPA proxy is not ready. Returning temporary landing page." However as noted above the SPA proxy certainly seems to be running OK.
Has anyone got any ideas what might be happening or any workaround for this?
OK I managed to figure this out by creating another blank project and comparing them.
The port that the development server will listen on is stored in a file called ClientApp\.env.development; the port that visual studio expects it to listen on is in the .csproj file under PropertyGroup/SpaProxyServerUrl. If there is a mismatch you will get this behaviour because VS thinks the server isn't running and keeps on trying to start it.
In my case I had added the .env.development file to the version control ignore list thinking it wasn't important. This was causing the dev server to listen on the default port 3000.

How can I emulate pressing CTRL+ALT+PAUSE in my Linux VM using AutoKey?

Question:
How can I emulate pressing CTRL+ALT+PAUSE in my Linux VM using AutoKey?
I tried a script that has
keyboard.send_keys("<ctrl>+<alt>+<pause>")
in it. But it does not work.
Background:
I'm using Windows 10 and RDP to log into a Fedora Linux. Switching 100 times a day.
The RDP connection runs in Windows all the time.
If the RDP window is not in the background but active, I can press CTRL+ALT+PAUSE to go into the VM (Fullscreen). If I am inside the VM I can press CTRL+ALT+PAUSE to go back to Windows.
So far so good. I want only one button. Preferably PAUSE. Windows part is ready already with following script
Pause::
If !WinExist("RDP Tool Name")
MsgBox No Window found
WinShow, RDP Tool Name
WinActivate, RDP Tool Name
Send ^!{CtrlBreak}
Return
Is the Linux part maybe not possible because the key combination is cached somewhere before my Linux system can even notice it? Any ideas?
I solved it without any other new script. I just had to edit the RDP settings: Keyboard -> Use Windows-Hotkeys -> On this Computer

How can I stop the geoserver?

Actually I want to enable_jsonp in my geoserver. For this I have to change the code as suggested by this answer. When I tried to stop the geoserver (located inside geoserver2..15.0/bin/shutdown.bat folder), the cmd was crashed. I am not able to enable the jsonp unless the geoserver was stoped. I know, I install the geoserver install as service in installation process. I think this issue may be arises from there. Any help?
You can stop the service.
Launch Windows Services (type services in the taskbar or run cmd then call services.msc), find Geoserver, do a right click and choose stop.
Note that you can then restart it from there (right click, start)

How to clear logs on WebLogic Server console without turning off server?

I am trying to clear Web logic server console logs, to check latest logs without turning off server.
I have tried to clear logs by pressing "Ctrl+C" on console, but not working and logs was not cleared from console.
In case you are using Mac, use cmd + k to clear the logs and check the latest ones.
I would say you should not run Weblogic using the Command Prompt because if someone closes the console the service is going to crash. With this in mind, you should configure the your servers as service on Windows so please read this document.
https://docs.oracle.com/cd/E23943_01/web.1111/e13708/winservice.htm#START144
The Dude

telnet windows 7 not working

I have a Windows 7 computer, and I'm trying to work with telnet.
I installed/enabled telnet (via control panel, since telnet isn't enabled by default), restarted the terminal, restarted my computer, etc.
But telnet still doesn't work. I'm getting the error : 'telnet' is not recognized as an internal or external command...
I tried editing the PATH environment variable as well, but that hasn't worked either.
I would greatly appreciate any advice.
Thank you very much!
Looks like your telnet is not installed. Simply execute the below command in your command prompt and wait till the mouse progress icon disappears. It works on windows 7. I am not sure on other machines
pkgmgr /iu:"TelnetClient"
I was having the same issue. Fixed it by running CMD as an admin.
If your Windows 7 machine is a member of an AD, or if you have UAC enabled, or both, telnet must be run as an admin. The easiest way to do this is to create a shortcut that calls cdm, and then go to the shortcut's properties and click on the Advanced button and check the "Run as an administrator" checkbox, and you're all set. Scratched my head and rebooted numerous times before finding this out...