observatory=> select count(distinct(sha256_fingerprint)) from certificates;
count
---------
1239943
observatory=> select count(distinct(target)) from scans;
count
---------
6483386
The scanner evaluates both certificate and ciphersuites and stores the results in DB, so we can run complex analysis [2,3]. There is also have a public client [4].I don't have a good way to provide direct access to the database yet, but if you're a researcher, ping me directly and we can figure something out.
[1] https://github.com/mozilla/tls-observatory
[2] https://twitter.com/jvehent/status/684127067005390848
https://all-certificates.s3.amazonaws.com/certificates.tar.g...
For exporting, pg_dump -F c greatly compresses the data so cost-wise you might be able to put on S3 and publish as a torrent.
I'm curious, how fast can one load data into Postgres? Is it possible to import data directly from CSV files?
Hard to answer considering the number of variables impacting. pg_bulkload[0] quotes 18MB/s for parallel loading on DBT-2 (221s to load 4GB), and 12MB/s for the built-in COPY (with post-indexing, that is first import all the data then enable and build the indexes)
> Is it possible to import data directly from CSV files?
Yes, the COPY command[1] can probably be configured to support whatever your *SV format is. There's also pg_bulkload (which should be faster but works offline).
[0] http://ossc-db.github.io/pg_bulkload/index.html
[1] http://www.postgresql.org/docs/current/interactive/sql-copy....
Yup! http://www.postgresql.org/docs/current/static/sql-copy.html
But to answer your question: yes, postgres can load data from csv files: http://stackoverflow.com/questions/2987433/how-to-import-csv...
https://github.com/rapid7/sonar/wiki/Analyzing-Datasets
Project Sonar is one of the primary contributors to scans.io. The DAP utility is handy for parsing raw x509 certificates and generating JSON output.
the 'sort' in 'sort | uniq' doesn't know you are going to be throwing away all the duplicate data.
If anyone is wondering, here is an implementation of the python approach i have lying around:
#!/usr/bin/env python2
import sys
from collections import defaultdict
c = defaultdict(int)
for line in sys.stdin:
c[line] += 1
top = sorted(c.items(), key=lambda (k,v): v)
for k, v in top:
print v, k, #!/usr/bin/env python2
import sys
from collections import Counter
for pair in Counter(sys.stdin).most_common():
print pair awk -e '!a[$0]++'
This also preserves the original input order, which is a nice property.In fact, that's exactly how Rust's standard library hashset is implemented since rust supports zero-sized types "in userland" (and unit `()` is a ZST):
pub struct HashSet<T, S = RandomState> {
map: HashMap<T, (), S>
}
http://doc.rust-lang.org/src/std/collections/hash/set.rs.htm...Edit: Inbound might be unlimited free. The calculator did show me an inbound total a few times, but I can't reproduce it now.
https://aws.amazon.com/blogs/aws/aws-lowers-its-pricing-agai...
Still, it does appear to reduce the price of getting data out of Amazon compared to using the internet.
Edit: Actually I read the S3 parts again, it sounds like the CommonCrawl project pays the S3 costs, I think, since it looks like you're using their domain data?
> AWS is hosting the public data sets at no charge for the community
773733
0.77M of Alexa top 1M were not in my list.
$ cat alexa alexa myset | sort | uniq -u | wc -l
25842205
I mined 25,842,205 additional domain names.
(and yes.. now i see that you mentioned it in the article.. took me time to get there)
func main() {
ch := make(chan string)
for i := 0; i < MAX; i++ {
go fetchCert(ch)
}
scanner := bufio.NewScanner(os.Stdin)
for Scanner.Scan() {
line := scanner.Text()
ch <- line
}
}
All goroutines receive on the same channel! Instead a new goroutine should be launched for each net conn. One should be able to spawn 1000s (or 1Ms) of conns and avoid ulimits using buffered chans, waitgroups, timeouts, or counters...If you set MAX to 1000, you will have 1000 workers — and simultaneous connections.
The flaw is that when the last piece of work gets taken from the channel, the program will end, thus the last pieces of work that at the time are being processed, will get canceled. You could mitigate this by using a second channel, that the workers will access at the end of their work, thus ensuring that it will close only when the last worker finishes its work.
However, at a certain point, you may encounter bandwidth issues, timeouts, and the like due to local network congestion; that pattern has its uses there. I've tried writing a downloader that downloads every file it's given at once, and it went about as well as one would expect.
Inspired now to start a "go-saturate" library for measuring max net capacity...