Skip to content

Instantly share code, notes, and snippets.

View simoncpu's full-sized avatar
👽

Simon Cornelius P. Umacob simoncpu

👽
  • Cebu City, Philippines
View GitHub Profile
simoncpu@soulfury:~$ ab -c 50 -n 100000 -k http://127.0.0.1:8000/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
simoncpu@soulfury:~$ ab -c 50 -n 100000 -k http://127.0.0.1/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
var sys = require('sys'),
http = require('http');
http.createServer(function (req, res) {
setTimeout(function () {
res.sendHeader(200, {'Content-Type': 'text/plain', 'X-POWERED-BY': 'simoncpu'});
res.sendBody('I can has IPv6 JavaScript Web server! Yay!');
res.finish();
}, 2000);
}).listen(80);
sys.puts('Running...');
root@soulfury:~# uname -a
FreeBSD chaosbuilder.simoncpu.com 7.1-RELEASE-p8 FreeBSD 7.1-RELEASE-p8 #0: Thu Oct 8 19:24:29 PHT 2009 admin@soulfury:/usr/obj/usr/src/sys/INARA i386
root@soulfury:~# node_g -v
0.1.21 (debug)
root@soulfury:~# gdb node_g node_g.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
getBytes : function (bytes, type) {
var value = bytes;
if (!isNaN(value)) {
switch (type) {
case 'Kb':
value *= 1024;
break;
case 'Mb':
value *= Math.pow(1024, 2);