I am trying to generate dns-sd query for _universal._sub._ipp.tcp.local, is there a way to request sub query - bonjour

I am trying to generate dns-sd query for _universal._sub._ipp.tcp.local, is there a way to request subquery.
ciscos-Mac-mini:~ cisco$ dns-sd -Z _ipps._tcp,_universal
Browsing for _ipps._tcp,_universal
DATE: ---Thu 20 Sep 2018---
12:02:43.929 ...STARTING...
ciscos-Mac-mini:~ cisco$ dns-sd -B _universal._sub._ipps._tcp.local
Browsing for _universal._sub._ipps._tcp.local
DNSService call failed -65540
ciscos-Mac-mini:~ cisco$ dns-sd -Z _ipps._tcp
Browsing for _ipps._tcp
DATE: ---Thu 20 Sep 2018---
12:03:57.460 ...STARTING...
However, there is a response to the above request.
Is there any way to send a query out for subtype.

Related

How to add a package to the XQuery repository?

I am using cURL to execute commands using the REST interface of BaseX like this:
curl http://localhost:8984/rest/?command=repo+list
There are also commands to manage the XQuery module repository. I am especially interested in REPO INSTALL to install a package. Is it somehow possible to execute this command using cURL and the REST interface but without having the package already on the target server? I want to provide the file in the body of the cURL request, similar to adding a resource to a database (source) which goes like this:
curl -i -X PUT -T "etc/xml/factbook.xml" "http://localhost:8984/rest/factbook"
Trying
curl -i -X PUT -T "/tmp/foo.xar" http://localhost:8984/rest/?command=repo+install
Gives me
HTTP/1.1 404 Not Found
Content-Type: text/plain;charset=UTF-8
Content-Length: 18
Connection: close
Server: Jetty(9.4.18.v20190429)
No path specified.
Adding -H "Content-Type: application/x-xar" does not help either.
And replacing PUT with POST gives me
HTTP/1.1 100 Continue
HTTP/1.1 400 Bad Request
Date: Tue, 03 Mar 2020 09:53:21 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 46
Server: Jetty(9.4.18.v20190429)
"" (Line 1): Content is not allowed in prolog.
The following works in case of standard modules (replace user/pass/server if needed):
$ curl http://admin:admin#localhost:8984/rest/?command=repo+install+http://www.xqueryfunctions.com/xq/functx-1.0.1-doc.xq

Posting data to Meteor's MongoDB collection

What would be the best way to post data to Meteor's MongoDB collection ?
I tried initially using the Postman chrome extension, command-line tool like curl but did not find any luck.
The curl command that I use is :
curl -i -X POST -H "Content-Type: application/json" -d '{"hacker":"fromcurl","score":100}' http://localhost:3000/players
OUTPUT:
HTTP/1.1 200 OK
vary: Accept-Encoding
content-type: text/html; charset=utf-8
date: Tue, 17 May 2016 00:37:44 GMT
connection: keep-alive
transfer-encoding: chunked
<!DOCTYPE html>
<html>
PS : players is the collection/table name
Take a look at DDP, Meteor uses this protocol to communicate between client and server. DDP is simple and based on JSON. Meteor’s DDP currently based on WebSockets and SockJS. That's very helpful. I have a case that Websocket cannot work in local LAN network but the connection fall back to SockJS, then everything work fine, that's great!
An example implement DDP communication between Meteor and Python.
Simply create a Meteor method:
Meteor.methods({
clientProcessData: function (data) {
console.log(data);
// Meteor post data to MongoDB code here
},
Follow the instructions from https://github.com/hharnisc/python-meteor to install python-meteor client and connect to Meteor server.
You can call Meteor method from Python by:
client.call('clientProcessData', ["This is a test"], callback_function)
Not sure are there any other DDP clients of other programming language, but in my case, python works great!
// Update: There are many of them, but I'm so new here that afraid of posting external link, so please do a simple "DDP client" search on google.

SoundCloud API: what is the item limit on the activities feed?

As it's undocumented, what's the max limit I can reasonably set when using the activities feed?
I.e,
curl -i "https://api.soundcloud.com/me/activities?limit=200&oauth_token={}"
Will return a valid response.
But:
curl -i "https://api.soundcloud.com/me/activities?limit=1000&oauth_token={}"
Will return:
HTTP/1.1 500 Internal Server Error
Content-Type: application/json;charset=utf-8
Date: Fri, 22 Jan 2016 07:22:50 GMT
Server: am/2
Content-Length: 26
{"error":"Unknown error."}
Default limit is 50, max is 200.
https://developers.soundcloud.com/blog/offset-pagination-deprecated
If you wanna page through all activities, you need to use the linked_partitioning parameter, described above.
or here under pagination:
https://developers.soundcloud.com/docs/api/reference#activities

Updating Google Storage object metadata without full access

Is there a way to update the metadata of an object in Google Storage when using an OAuth2 authentification token with read/write (but not full) access to the bucket?
My naive attempts (HTTP PUT with x-goog-copy-source set to the same object, and
x-goog-metadata-directive: REPLACE) fail with an AccessDenied error. gsutil seems to have the same problem:
$ gsutil config -r -w
[...]
$ echo hello > foo.txt
$ gsutil -h "x-goog-meta-foo: bar" cp foo.txt gs://nikratio-test/
Copying file://foo.txt [Content-Type=text/plain]...
Uploading gs://nikratio-test/foo.txt: 0 B/6 B
$ gsutil stat gs://nikratio-test/foo.txt
gs://nikratio-test/foo.txt:
Creation time: Sun, 09 Nov 2014 22:34:22 GMT
Content-Language: en
Content-Length: 6
Content-Type: text/plain
Metadata:
foo: bar
Hash (crc32c): NT3Yvg==
Hash (md5): sZRqySSS0jR8YjW00mERhA==
ETag: CID8ka7K7sECEAE=
Generation: 1415572462272000
Metageneration: 1
$ gsutil setmeta -h "x-goog-meta-foo: com" gs://nikratio-test/foo.txt
Setting metadata on gs://nikratio-test/foo.txt...
AccessDeniedException: 403 Forbidden
I presume this is because the setmeta operation would also allow me to change the ACL of the object.
However, it seems to me that if I'm able to delete the object and re-upload it with different metadata using the same authorization, then there really ought to be a way to just change the metadata as well.
Setting metadata works with OAuth2. I suggest running this gsutil command and comparing the protocol output it generates with what you're doing:
gsutil -o GSUtil:prefer_api=xml -d setmeta -h x-goog-meta-data-00:gAJ9cQBYBQAAAGFwcGxlcQFYCAAAAHBvdGF0b2VzcQJzLg gs://your-bucket/your-object

PERL API error 500 server closed connection without sending any data back

I am running a Perl API that uses LWP::UserAgent to post form data to a file.
Occasionally I receive this error on large files:
"500 server closed connection without sending any data back"
The timeout doesn't seem to be the issue as its set to an astronomical number.
If the response that you get has Client-Warning header, as seen in response below, then it is a tcp level error and response is produced by LWP client and not the server:
500 Server closed connection without sending any data back
Content-Type: text/plain
Client-Date: Thu, 19 Sep 2013 08:04:28 GMT
Client-Warning: Internal response
I solved this by adding https://{host}/path.
example: http://localhost:6543/carnelian
ssh -v -N -L 6543:[remotehost]:[port]
result: error 500 server closed connection without sending any data back
example: https://localhost:6543/carnelian
ssh -v -N -L 6543:[remotehost]:[port]
It works.