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
#!/usr/bin/env node | |
var stdin = process.openStdin(); | |
var stdout = process.stdout; | |
var input = ''; | |
stdin.setEncoding('utf8'); | |
stdin.on('data', function(data) { | |
if (data) { | |
input += data; |
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
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm | |
function map() { | |
emit(1, // Or put a GROUP BY key here | |
{sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count:1, | |
diff: 0, // M2,n: sum((val-mean)^2) | |
}); |
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
#!/usr/bin/env node | |
"use strict"; | |
var debug = require('_debugger'); | |
var c = new debug.Client(); | |
function main() { | |
console.log('requesting trace'); | |
c.reqBacktrace(function(err,trace) { | |
if (!err) { |
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
$ cat test.js | |
function foo () { while (true) { } } | |
function bar () { return foo(); } | |
bar(); | |
$ node test.js & | |
$ gdb attach $(pidof node) | |
0x00000bf778c63d5f in ?? () | |
(gdb) b v8::internal::Runtime_StackGuard | |
Breakpoint 1 at 0x84a1f0 | |
(gdb) print 'v8::V8::TerminateExecution'(0) |
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
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo | |
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo | |
sudo yum install -y apache-maven | |
mvn --version |
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
*.log |
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
'use strict'; | |
//mock for superagent - __mocks__/superagent.js | |
var mockDelay; | |
var mockError; | |
var mockResponse = { | |
status() { | |
return 200; | |
}, |
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
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |