<commit_before>#!/usr/bin/env node
const co = require('co');
const Cluster = require('../../../lib/Kubernetes/Cluster');
const execp = require('../../../lib/util/exec-promise');
const _ = require('lodash');

const cluster = new Cluster();

cluster.getAllNodes()
	.then(nodes => {
		return Promise.all(nodes.map((node) => node.getExternalIp()));
	})
	.then(externalIps => {
		return externalIps.map((externalIp) => `http://${externalIp}:4194`);
	})
	.then(cAdvisorUrls => {
		return execp('which xdg-open')
			.then(() => {
				// We have xdg-open (Linux)
				cAdvisorUrls.map(cAdvisorUrl => execp(`xdg-open ${cAdvisorUrl}`));
			})
			.catch(() => {
				// Hopefully we have open (everyone does, but macs use this)
				cAdvisorUrls.map(cAdvisorUrl => execp(`open ${cAdvisorUrl}`));
			})
	})
	.catch(err => console.log(err.stack));<commit_msg>Added filter for opening cAdvisor, only servers with external ips<commit_after>#!/usr/bin/env node
const co = require('co');
const Cluster = require('../../../lib/Kubernetes/Cluster');
const execp = require('../../../lib/util/exec-promise');
const _ = require('lodash');

const cluster = new Cluster();

cluster.getAllNodes(true)
	.then(nodes => {
		return Promise.all(nodes.map((node) => node.getExternalIp()));
	})
	.then(externalIps => {
		return externalIps.map((externalIp) => `http://${externalIp}:4194`);
	})
	.then(cAdvisorUrls => {
		return execp('which xdg-open')
			.then(() => {
				// We have xdg-open (Linux)
				cAdvisorUrls.map(cAdvisorUrl => execp(`xdg-open ${cAdvisorUrl}`));
			})
			.catch(() => {
				// Hopefully we have open (everyone does, but macs use this)
				cAdvisorUrls.map(cAdvisorUrl => execp(`open ${cAdvisorUrl}`));
			})
	})
	.catch(err => console.log(err.stack));
{'fraction_non_alphanumeric': 0.21182548794489092, 'fraction_numerical': 0.004592422502870264, 'mean_word_length': 3.868715083798883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3214691', 'n_tokens_mistral': 674, 'n_tokens_neox': 612, 'n_words': 116}