DNS Java no text format defined for TSIG - java

I am using the Master class in the DNS Java library to parse bind zone files. However, when I try to parse the .BIZ zone file from Neustar, I get this error:
org.xbill.DNS.Tokenizer$TokenizerException: 486: no text format defined for TSIG
I would catch this exception and just continue processing entries but the TokenizerException class is not accessible outside the package so I am not able to catch it. I am calling zoneFileRecord.rdataToString() for each record.
Their file contains TSIG entries that look like this:
4h039a453.biz. 3600 IN NS ns1.rbe1.g-srv.net.
monitor.reg.neustar.com. 0 ANY TSIG hmac-md5.sig-alg.reg.int. 1553302104 300 16 YWDHVhM3MpeTglOvyaj5fA== 27955 NOERROR 0
4h039a453.biz. 3600 IN NS ns2.rbe1.g-srv.net.
4h06-ro1eyrm9.biz. 3600 IN NS ns1.gm111.parklogic.com.
4h06-ro1eyrm9.biz. 3600 IN NS ns2.gm111.parklogic.com.

dnsjava supports TSIG records, but it looks like constructing it from string representation wasn't implemented. There's an issue logged to fix the library: https://github.com/dnsjava/dnsjava/issues/38

Related

Time spent on each chrome tab/website from data stored in History sqlite

I am trying to find out the time spent on each tab/website by the user.
For example if I visited youtube and watched it for 10 minutes then I should be able to see something like this
www.youtube.com ---> 10 minutes
I already made a connection with sqlite database i.e. History file present in chrome directory and was able to run the following sql command to fetch the data:
SELECT urls.id, urls.url, urls.title, urls.visit_count, urls.typed_count, urls.last_visit_time, urls.hidden, urls.favicon_id, visits.visit_time, visits.from_visit, visits.visit_duration, visits.transition, visit_source.source FROM urls JOIN visits ON urls.id = visits.url LEFT JOIN visit_source ON visits.id = visit_source.id
So can anyone tell me which combination of column can i use to get the time spent on each website.
Please note that: visit_duration is not giving me appropriate data.
visit_duration Stores duration in microseconds, you need to convert and format that number. Here is one way to show a human-readable visit duration:
SELECT urls.url AS URL, (visits.visit_duration / 3600 / 1000000) || ' hours ' || strftime('%M minutes %S seconds', visits.visit_duration / 1000000 / 86400.0) AS Duration
FROM urls LEFT JOIN visits ON urls.id = visits.url
Here is a sample output:
URL
Duration
http://www.stackoverflow.com/
3 hours 14 minutes 15 seconds
You can also use strftime if you want more format options

How do I findout domain expiry date of a .org and .in website in java

I'm using WhoisClient (org.apache.commons.net.whois.WhoisClient) to retrieve my website domain expiry date. It is working for the domain with .com extension. When I try to check the expiry date for one of my .org domain the result says No match for domain.org. How do I find out the expiry date of a .org and .in extension domain?
I'm using the following code for getting the expiry date of the domain
String domainName = mydomain.replaceFirst("^(http[s]?://www\\.|http[s]?://|www\\.)","");
WhoisClient whois = new WhoisClient();
whois.connect(WhoisClient.DEFAULT_HOST);
String whoisData1 = whois.query("=" + domainName);
whois.disconnect();
Do not bother with the whois protocol.
Now (since August 26th, 2019) per ICANN requirements, all gTLDs need to have an RDAP server. RDAP is like the successor of whois: kind of the same content exchanged but this time on top of HTTPS with some fixed JSON format. Hence, trivial to parse.
The expiry date will be in the "events" array with an action called "expiration".
You can go to https://data.iana.org/rdap/dns.json to find out the .ORG RDAP server, it is at URL https://rdap.publicinterestregistry.net/rdap/org/
You need to learn a little more about RDAP to understand how to use it (structure of the query and the reply), you can find some introduction at https://about.rdap.org/
But in short your case, this emulates what you need to do:
$ wget -qO - https://rdap.publicinterestregistry.net/rdap/org/domain/slashdot.org | jq '.events[] | select(.eventAction | contains("expiration")) | .eventDate'
"2019-10-04T04:00:00.000Z"
PS1: if you get no match from a whois query normally it really means that the domain does not exist; it could also be because of rate limiting
PS2: .IN may not have an RDAP server yet, since it is a ccTLD it is not bound by ICANN rules.

How to get a key without changing the existing expiry time in couchbase using java client?

I have a couchbase key K which stores a JsonLongDocument V.
Whenever I see an event E at time T, I increment the V by 1 with an updated expiry of T+n(sec) using the following java client function :
bucket.counter(K, 1, 1, n)
I also occasionally have to get the value V using key K by calling the following java client function :
bucket.get(K, classOf[JsonLongDocument])
But whenever I'm calling simple 'get', the couchbase is changing the expiry of the document and setting it to 0 which means persist forever.
How can I still do the 'get' on my value without changing its expiry?
Getting a document by its key does not change the document's expiry.
You must use bucket.touch(K, n) to update the expiry after incrementing the counter. The expiry passed to bucket.counter(K, 1, 1, n) is only used if the counter document does not exist.
The expiry returned in the JsonLongDocument is either the expiry value passed to the method or zero. It does not reflect the actual expiry timestamp stored in Couchbase. I'm not sure why the SDKs behave this way, but it is expected behavior.
To see the real expiry timestamp you can use N1QL as described here or you can inspect the counter's data file.
Steps to get a document's expiry from a data file:
Determine in which vbucket and server the document resides, vbucket 8 and localhost in the example below (requires libcouchbase, the Couchbase C SDK)
> cbc-hash test-counter-1
test-counter-1: [vBucket=8, Index=0]
Server: localhost:11210, CouchAPI: http://localhost:8092/default
Replica #0: Index=-1, Host=N/A
Extract the counter document information from the vbucket data file, 8.couch.1 in this example
> couch_dbdump 8.couch.1 | grep -B 2 -A 6 test-counter-1
Dumping "8.couch.1":
Doc seq: 63
id: test-counter-1
rev: 63
content_meta: 128
size (on disk): 11
cas: 1501205424364060672, expiry: 1501205459, flags: 0, datatype: 1
size: 1
data: (snappy) 2
See File Locations or the Disk Storage section of your server node information to locate the 'data' directory where data files are stored. The vbucket files will be in a subdirectory of 'data' named after your bucket.

GmailApi - search mails newer then minutes

Simple question:
Is it possible to search for mails that are newer then, say, 5 minutes using GMailApi?
The newer_then samples I found only have a day-resolution.
Update
I tried something like
mService.users().messages().list(user).setQ("after:2017/05/02 17:00:00").execute();
without any success.
Try using a timestamp as the after value:
1493761547 secs (2017/05/02 21:45)
5 mins is 300 sec
.setQ()"after:1493761247"

IBM ContentManager v8 - Query Syntax to search documents by its creation date

We are using IBM ContentManager v8. I am looking for the correct syntax to find all documents uploaded to CM, after a specific date. I would like to use the document or object creation time stamp, which is an internal attribute of every document uploaded to CM.
Our backend database for CM is DB2.
From the example, I see that we can use
/<item_type> [ICMCHECKEDOUT/#ICMCHKOUTTS > "2013-11-20-12.00.00.000000"]
for example, to find all documents that were checked out after the specified date.
Is there an internal attribute for the time on which the object was added to CM.? If yes, what is the syntax.?
FYI:- DKLobICM.getCreatedTimestamp() method returns the exact time the object was added to CM. But I need a way to use this timestamp in my query.
Rgds,
Raj.
For the record:
/<item_type>[#SYSROOTATTRS.CREATETS>"2013-11-20-12.00.00.000000"]
will give you the expected results.
Try This
/<item_type>[#AttributeRef="xxxxx" AND #CREATETS BETWEEN "2015-06-01-00.00.00.000" AND "2015-12-31-00.00.00.0000"]

Categories

Resources