This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elasticsearch = require('elasticsearch'); | |
const bcrypt = require('bcrypt'); | |
const login = 'admin'; | |
const password = 'admin'; | |
const config = { | |
host: [ | |
{ | |
host: 'localhost', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Time fractions: | |
1000 ms/sec | |
60 sec/min | |
60 min/hour | |
24 hour/day | |
*/ | |
let getFlatUTCArray = function (base_value, time_fractions) { | |
time_data = [base_value]; | |
for (i = 0; i < time_fractions.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"actions": { | |
"email_admin": { | |
"throttle_period": "0h15m0s", | |
"email": { | |
"to": "alarm@localhost", | |
"from": "sentinl@localhost", | |
"subject": "Alarm", | |
"priority": "high", | |
"body": "Found {{payload.hits.total}} Events" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
layout of config file | |
{ | |
"host":"localhost", | |
"port": 5432, | |
"user": "postgres", | |
"password": "123123", | |
"database": "example_db" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn gcd(mut a:isize, mut b:isize) -> usize { | |
let mut t; | |
while a != 0 { | |
t = a; | |
a = b % a; | |
b = t; | |
} | |
b.abs() as usize | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iomanip> | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <random> | |
using namespace std; |
NewerOlder