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 / index.html
Created April 7, 2012 06:40
How kodeincloud HTML5 API looks like
<!DOCTYPE html>
<html>
<head>
<title>kodeincloud HTML5</title>
<script type="text/javascript" src="http://static.kodeincloud.com/html5.min.js?appkey=3f76818f507fe7eb6422bd0703c64c88"></script>
<script type="text/javascript">
kic.invoke('hello', {name: "arunoda susiripala"}, function(err, resp) {
@arunoda
arunoda / 1.docs.md
Last active March 18, 2016 21:18
Meteor Latency Compensation - The Correct Way

##Meteor Latency Compensation - The Correct Way

This is a kind of correction I wan't make regards to the concept describe in discover-meteor book

For the latency compensation to occur we cloud simply share the same method in the client/server. We can do this by simply putting the method under a place which can see by bot the server and client.

But practically(not all the time) we should not do that. In the server code we might have some logic which should not share. Or simply we might have some secret tokens.

So the correcy approach is define the method (in this case post) seperately in the two context. as shown below

#!/bin/bash
cd ~/
#checkout repo
cd app.git
git pull origin master
git checkout master
cd ..
Meteor.methods({
searchPosts: function(term) {
console.log('-- searching for "'+term+'" --')
Future = Npm.require('fibers/future');
var fut = new Future();
Meteor._RemoteCollectionDriver.mongo.db.executeDbCommand({
"text": "posts",
search: term
}, function (error,results){
{
users: [
{},
{}
]
}
@arunoda
arunoda / gist:7790979
Last active February 16, 2024 14:05
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@arunoda
arunoda / cpu-watch.js
Last active August 29, 2015 13:56
Lookup CPU usage in details
/*
USAGE: node cpu-watch.js <pid> <how-many-minutes>
*/
var fs = require('fs');
var format = require('util').format;
var PID = process.env.PID || process.argv[2];
if(!PID) throw new Error('No PIC Provided!');
var ENDIN_MINUTES = process.env.ENDIN_MINUTES || process.argv[3];
var DDPClient = require('ddp');
var totalClients = 0;
var postsList = 0;
var postsListUsers = 0;
var postsList
function createClient(closeTimeout) {
console.log('CREATING....', closeTimeout);
var client = new DDPClient({
<head>
<title>abc</title>
</head>
<body>
{{#sourceCode}}
<template name="books">
<input type="text" placeholder="Search..." value="{{booksSearchQuery}}">
{{#if searchResults.count}}