This file contains hidden or 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
module.exports = { | |
requestLogger: (req, res, next) => { | |
function newWriteHead(prevWriteHead) { | |
return function writeHead(statusCode) { | |
let log = { | |
ts: new Date().toISOString(), | |
statusCode, | |
method: req.method, | |
originalUrl: req.originalUrl, |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
from __future__ import (absolute_import, division, print_function, | |
unicode_literals) | |
import json | |
import socket | |
import subprocess | |
This file contains hidden or 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
#!/usr/bin/env python3 | |
#-*- coding: utf-8 -*- | |
# Update constants below for connection and index information. | |
# Run with: export_elastiscsearch_source_documents.py | gzip > export.json.gz | |
from __future__ import print_function | |
from elasticsearch import Elasticsearch, helpers, exceptions | |
import json | |
import sys |
This file contains hidden or 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
// Quick hack to iterate over domain names with numbers and resolve their IPv4 addresses | |
// Example: prefix1.domain.com ... prefix100.domain.com | |
const dns = require("dns"); | |
const prefixes = ["se", "de", "ie", "uk", "us"]; | |
const suffixes = [".domain.com", ".another.com"]; | |
const min = 1; | |
const max = 10; | |
function check(hostname) { | |
// Though the call to dns.lookup() will be asynchronous from JavaScript's |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am niklaswall on github. | |
* I am secnic (https://keybase.io/secnic) on keybase. | |
* I have a public key ASAM4lKjCMC11ThJHgIPWK3VKyTIMmWHJ6ZYClRubT-g9Qo | |
To claim this, I am signing this object: |