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
getBytes : function (bytes, type) {
var value = bytes;
if (!isNaN(value)) {
switch (type) {
case 'Kb':
value *= 1024;
break;
case 'Mb':
value *= Math.pow(1024, 2);
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.
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...');
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
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 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
From a3d0d8e89dd0c091414df9aaa3ef03f64911e587 Mon Sep 17 00:00:00 2001
From: Simon Cornelius P. Umacob <[email protected]>
Date: Thu, 10 Dec 2009 20:18:29 +0800
Subject: [PATCH] Implement getmem() for FreeBSD platform.
---
src/node.cc | 32 ++++++++++++++++++++++++++++++++
wscript | 8 +++++---
2 files changed, 37 insertions(+), 3 deletions(-)
@simoncpu
simoncpu / gist:927088
Created April 19, 2011 10:11
support for AgaviWebRequest::getUrlPort() behind a proxy
--- AgaviWebRequest.class.php 2011-04-19 18:06:22.000000000 +0800
+++ AgaviWebRequest.class.php.orig 2011-04-19 17:30:15.000000000 +0800
@@ -327,7 +327,6 @@
'SERVER_PORT' => 'SERVER_PORT',
'SERVER_PROTOCOL' => 'SERVER_PROTOCOL',
'SERVER_SOFTWARE' => 'SERVER_SOFTWARE',
- 'HTTP_HOST' => 'HTTP_HOST',
), (array)$this->getParameter('sources'));
$this->setParameter('sources', $sources);
@simoncpu
simoncpu / mod_cgi.c.patch
Created March 16, 2012 10:56
lighttpd patch for Bug #2333
--- mod_cgi.c.orig 2012-03-16 10:50:53.000000000 +0800
+++ mod_cgi.c 2012-03-16 10:42:28.000000000 +0800
@@ -811,7 +811,16 @@
if (!buffer_is_empty(con->server_name)) {
size_t len = con->server_name->used - 1;
- char *colon = strchr(con->server_name->ptr, ':');
+ char *colon;
+#ifdef HAVE_IPV6
+ if (srv_sock->addr.plain.sa_family == AF_INET6) {
@simoncpu
simoncpu / mod_fastcgi.c.patch
Created March 16, 2012 10:58
lighttpd patch for Bug #2333
--- mod_fastcgi.c.orig 2012-03-16 10:51:07.000000000 +0800
+++ mod_fastcgi.c 2012-03-16 10:42:16.000000000 +0800
@@ -1857,7 +1857,16 @@
if (con->server_name->used) {
size_t len = con->server_name->used - 1;
- char *colon = strchr(con->server_name->ptr, ':');
+ char *colon;
+#ifdef HAVE_IPV6
+ if (srv_sock->addr.plain.sa_family == AF_INET6) {