Skip to content

Instantly share code, notes, and snippets.

View arunoda's full-sized avatar
👨‍🍳
Cooking something new

Arunoda Susiripala arunoda

👨‍🍳
Cooking something new
View GitHub Profile
@arunoda
arunoda / ab-test-to-sl-server.txt
Created January 10, 2012 13:08
Benchmark Appzone via amazon EC2
ab -n 100 http://www.mit.kln.ac.lk/
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 www.mit.kln.ac.lk (be patient).....done
Server Software: Apache/2.2.10
Server Hostname: www.mit.kln.ac.lk
@arunoda
arunoda / strict.js
Created October 29, 2011 04:22
Strict Mode Test
function a() {
"use strict"
function b() {
console.log(arguments.callee.caller);
}
b();
}
a();
@arunoda
arunoda / pre.sh
Created October 18, 2011 20:20
Nariya Server
rake
@arunoda
arunoda / gist:1229406
Created September 20, 2011 15:26
Java Script Data Structures
// Arrays
var aaa = [];
// Stack
var aa = [10];
aa.push(20);
aa.pop(); //gets 20
@arunoda
arunoda / System Info
Created September 12, 2011 11:35
Node HTTP Proxy Benchmark
OS: Ubuntu 10.10
NodeJS: v0.4.10
RAM: 2GB
Processer: Core 2 Duo 2.0 Ghz
info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'install', '-g' ]
info using [email protected]
info using [email protected]
verbose config file /home/arunoda/.npmrc
verbose config file /usr/local/etc/npmrc
silly exec /usr/local/bin/node "/usr/local/lib/node_modules/npm/bin/npm-get-uid-gid.js" "nobody" 1000
silly output from getuid/gid {"uid":65534,"gid":1000}
silly output from getuid/gid
verbose into /usr/local/lib [ '.' ]
db.insert({data: 1000}, function(err) {
//do something when inserted
})
console.log("I don't wait");
var redis = require('redis');
var cli = redis.createClient();
cli.on('error', function(err) {
console.log('Err:' + err);
});
function addWorker() {
console.log('adding worker again');
cli.blpop('nl', 0, function(err, data) {
var redis = require('redis');
var cli = redis.createClient();
cli.on('error', function(err) {
console.log('Err:' + err);
});
function addWorker() {
console.log('adding worker again');
cli.blpop('nl', 0, function(err, data) {
var http = require('http');
var sys = require('sys');
function request()
{
var host = 'google.com';
var client = http.createClient(443, host, true);
var request = client.request('GET', '/',
{'host': host});
request.end();