how to use the API calls in bonjour mDNSPosix - bonjour

I have installed apple mDNSreponder on linux and able to publish the service via command line
$ dns-sd -P Stack Overflow _ftp._tcp. . 80 AIR 14.99.8.77
Now I want to know how to use the API call of this in my app to publish the same service .
When I compiled the bonjour source code I got the two libraries libdns_sd.so libnss_mdns-0.2.so
Can anyone suggest me how to call apis using my linux c code ..

Link libdns_sd.so to your project and include dns_sd.h too. Now follow dns_sd.h file to see various features like registering service, browsing, etc.

Related

Deploying Flutter Web App To Hostgator/normal FTP means?

I have been really interested in Flutter for the last few months and have been following the beta Flutter for web information. I was wondering, other than the ones mentioned in the documentation (Firebase, Github, Google Cloud), is there a way to currently test my app via using my Hostgator hosting and use something like Filezilla to publish the application/site?
I understand this is in a beta state. I only ask because the documentation states that there is a way to publish via those services but doesn't mention the way I am asking. I also understand that this is not production-ready.
Thank you all for any help
You can just run:
flutter build web
And then copy the contents of build/web to your web host's document root via a panel or FTP or something else.

How to connect the back end and the front end and use the Discovery API in IBM cloud app services?

I am very new to using APIs so please excuse me. I am currently using a Python-Django App service from IBM cloud app services and the IBM Watson Discovery resouce. I have followed all the steps given here:
https://console.bluemix.net/docs/apps/tutorials/tutorial_web.html#before-you-begin
I have a machine that has docker and so the app got built successfully. However I am lost as to how I am supposed to get the front end ( which I am writing in bootstrap, javascript ) to connect to the backend and link the API.
EDIT
For example : I want my app to accept documents, feed them in Discovery, extract the keywords and sentiments and display them in the UI. How do I know what to access from the server side code and what to link where in the UI.
It is a very broad question but its a compulsory project I need to do and I am clueless. Pleaassee Help !
Before you try to integrate an API, you will need to be familiar with Python and Django. If that is not the case, then you really need to go through a series of tutorials.
Then before deploying to the cloud, you will be better off running your Django app locally on your laptop. Use pip to install the watson-developer-cloud pypi module and use the API documentation to build the python code in your Django application - https://www.ibm.com/watson/developercloud/discovery/api/v1/python.html?python#query
If none of this makes sense, then you need to brush up on your knowledge of Python, Pip, and Django.
When you have the app running on your machine, then you will be ready to package it up into either a docker image or cloud foundry container and deploy to the cloud.

Custom commands for Google Assistant SDK

I've got a raspberry pi running the Google Assistant SDK, and it's working amazingly so far. I'm just wondering how I could make custom commands for the assistant, that would then trigger bash commands on the pi.
Any help would be greatly appreciated.
You can add your own functions, call external commands, etc. using the pattern in assistant_library_with_local_commands_demo.py from the aiyprojects-raspbian project on GitHub. Here is a commit where I add my own custom local commands to Google Assistant.
You do have to jump through the hoops to use the Cloud Speech API, but it's still using the Google Assistant. You don't have to use "actions on Google" stuff described by #Ayoub above.
Note: If you fail to include the assistant.stop_conversation() as I first did,
you get a weird response with 2 voices talking to you.
As far as i know what you are looking for is more complicated than that.
the assistant does not have direct access to its environment where it's installed.
So if it's on your phone you cannot just run something on the phone directly.
what you're looking for is to create an action on google:
https://console.actions.google.com
the action on google that you will create will be triggered with your command on the assistant then it will it self trigger a webhook (function running in the cloud) hosted possibly in your pi (if you have a web server that you can access publicly) and then from there you can run whatever script you are talking about.
i have done that using my:
google home ==> actions on google ==> api.ai ==> raspberrypi ==> run action
feel free to ask if you have any thing unclear.

How to run windows command in client side(accessing client machine using browser)?

I found many questions about same issue in Stackoverflow. But could not find any satisfactory answers.
My problem is:
I have to run "iperf client" in client machine(assuming windows) using command line in client windows machine and get the statistics.
Currently my server is written in PHP(I am ready to shift to any platform) given that I shall be able to run iperf command on client machine.
I searched and found that, Java applet, ActiveX control or Plugins(like Google Talk plugin). Can someone suggest me the best and easiest approach here(with some reference links if possible).
You cannot run an arbitrary command on the client side using Native Client. What you can do is invoke Pepper API functions from your extension. Another thing you can do is access the Chrome extension API from Javascript. If none of these have the information you need, feel free to suggest new features on the native-client-discuss mailing list. Note that invoking "any Windows command" cannot be reasonably made part of a client-side application, due to security issues.

iPhone HTTP Server

Can someone give me simple code to help with creating an HTTP server for the iPhone. Something simple with much documentation would be appreciated. Anything you have please share.
There are sample codes from Apple and open source community such as cocoahttpserver TouchHTTPD.
Here's a summary blog
Another open-source HTTP server for iPhone is the lightweight GCDWebServer which is built on top of Grand Central Dispatch. It's only a few source code files and offers a simple and extensible API.
If you're unfamiliar with network programming your best bet is to first read Beej's Guide to Network Programming and then read the HTTP 1.1 spec before you look at source code (as you should have an understanding of the protocol before you start looking at implementations).
A simple Google search turned up cocoahttpserver and iSpit. Otherwise, you could download Apache and look at its source code, but that's not exactly a simple implementation.
It is possible to run a simple file server on iPhone/iOS.
I was able to use this method successfully. Here are the steps to create a simple file server which works on http protocol.
1. Install TestFlight app for iOS
2. Install iSH app from the Apple store or side load it from their website, as this app might not be available in the store depending on your country. I tried it from india in May 2020, and the app was not available in the store. So i did side load it from their website.
3. With iSH app, one has access to linux kernel of the iPhone. I did use a simple http server module from python and executed it on the linux shell.
4. Command to run the python based server on iPhone :
Python -m http.server 8080
5. Access the file server using the local ip that’s assigned to the iPhone in the network you are connected to. That means, if iPhone is connected to a WiFi SSID, depending on whether the router is configured to use static IP address assignment based on MAC address or using DHCP protocol, your iPhone will have an internal IP assigned by the router.
6. Command to access the file server :
http://192.168.1.3:8080 - modify the address depending on IP address of the iPhone and the port that server running on iPhone is configured to use. Paste this in a browser - one should be able to see the files listed in the directory where the server is running in.
Hope this was clear enough, for running a simple http based file server on iPhone using http.server module in python, over linux shell of the underlying kernel, using iSH.