I've been using Ink (https://github.com/vadimdemedes/ink) to create a simple nodejs cli tool using React. Currently all it does is ask some questions and then displays a response. I'd like to create a daemon/server that will listen for incoming connections, and then run that nodejs script in interactive mode so the connected user will see be able to see the scripts output and be able to interact with it and see the response.
I know I can probably mod Ink to do this and act as a server, but I was wondering if and how this might be possible with something like tcpserver, xinetd, socat or similar.
Related
I want to run a ftp listener class only when the server starts and not when console, generators, dbconsole, test, destroy, runner and rake commands run.
I've found some people doing same thing with rails 3 and 4 using checks like defined? Rails::Generators but I can't get it working in rails 5, I do not get any return with the defined check.
The config.ru file is only used by web servers and not loaded by the console script, rake tasks or even your test suite. What you put there is only executed when a server instance launches.
Web servers themselves have also ways to do this. When you use Puma for instance, there are hooks like on_worker_boot or after_worker_boot, which may come to help (http://www.rubydoc.info/github/puma/puma/Puma/Configuration/DSL).
However, I'd recommend integrating this into your deployed server environment and out of the Rails app.
How to open a desktop application(like Nuke) through browser.
for example: RV software have a url protocol. we can use that (rvlink://).
I think this is what you're looking for:
https://support.shotgunsoftware.com/hc/en-us/articles/219031308-Launching-applications-using-custom-browser-protocols
Note that this is asking your operating system to "launch the thing registered with the requested custom browser protocol". Similarly you can have a hyperlink mailto:/// which opens the email application registered on the users computer. rvlink:/// is registered by RV as one of these custom browser protocols during it's installation.
If you want more control you would need a process running on the user's machine that you interact with. For example that's the approach shotgun's competitor ftrack took leveraging a local process they call ftrack connect (http://ftrack-connect.rtd.ftrack.com/en/0.1.17/developing/tutorial/custom_applications.html)
If you want to run something completely custom you could take a look at running your own RPC. You would initiate the registered RPC command from the web application. Check out http://www.zerorpc.io/ or https://crossbar.io/ for some more information.
Good luck!
I spotted in an earlier response of yours that you're using Shotgun and it's launch in RV features. In which case - are you aware of Shotgun Toolkit?
https://support.shotgunsoftware.com/hc/en-us/articles/219039788-Toolkit-Home-Page
It provides app launching via the website, which it accomplishes via Shotgun desktop (a desktop app). It used to work via a browser method that chrome etc moved away from so now requires the desktop app hook.
There's actually a huge amount that SGTK does, though I think you might be able to disable everything except the app launching if you wanted. We've got it implemented across 4 locations here and it's pretty decent.
I am developing an application and decided Nagios3 for performing monitoring stuff. But I am stuck at two points. I am using check_http plug-in for monitoring load on my service api. Now I want to perform below tasks.
I need to set a threshold in check_http for performing some task after crossing that threshold. I tried below command
'check_command check_nrpe_1arg!check_service_api'
but it only tells me the load, not any threshold is set. while below one doesn't work.
'check_command check_service_api!100!200'
I need to send simple text message on some port(my application).
I am new to Nagios, so please help me figuring out the solution except email notification stuff.
There is a check command that you can download called "notify_sms" that integrates with an API server hosted by a company called Esendex. They charge for their service but it works well.
Is it possible to run a pre-configured query on MS SQL Server via Slack message?
When I send a message in a specific channel like "run sql" is it possible to slack run a query on my MS SQL Server and return data?
I did this on my iOS app via sql.client 3rd party addon but can't figure it out on slack. Thank you!
(no problem to use 3rd party api or add-ons)
Not with vanilla Slack but if you integrate a "bot" alongside the SqlServerSlackAPI custom integration you can add custom functionality like you are after.
Bot's like Hubot or mmbot will provide the mechanism to write scripts that respond to certain commands or phrases.
I'm currently using mmbot and the SqlServerSlackAPI addon to write custom alerts and commands for monitoring some internal systems with the ability to send commands to Slack to get updates on the status of certain services. Slack fires off a command to a script running in mmbot which triggers a sql procedure to run a query and return results back to Slack which displays this as a message.
If you want something out of the box, check out https://beta.tunnel.ai, it's a slackbot for running SQL queries in slack. It works with any SQL database, including MS SQL. After you add to slack and integrate your database, you'll be able to type SQL in a direct message to the bot, and get data back in Slack. You can save, label, an schedule queries, and export to csv also.
The bot is a hosted solution with two 3rd parties (Tunnel.ai and Slack), and you will need to provide credentials to your database when integrating for the first time (done via conversation with the bot). This might not be for you if you're wary of third party access to your database, but it sounds like you aren't.
It's easy to change the port of the application using the launcher. Go to Edit>>Application Settings (or alternatively Ctrl+i) and change the port. Since I was getting an error similar to the one given below, I changed the application port from 8080 to 48080. Unfortunately, I am not able to change the admin port from 8000 to 48000, because of which I am getting the following error.
google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bind localhost:8000
I also tried the method illustrated in the following image (my reference being this link):
Regardless of what I try, my web-browsers (Chrome and Firefox) return a message similar to This webpage is not available. Any ideas are appreciated.
I have seen this before, when I had a crashed instance running on the port. You may have a frozen Python script running on that port. On a Mac, I can go to Activity Monitor and kill the process. Not sure if you can do that via task manager in Windows. You may need to restart machine.