Skip to content

Instantly share code, notes, and snippets.

@pontiyaraja
pontiyaraja / Git conflict
Created January 28, 2016 12:38
Resolve git conflict in command line
Step 1: From your project repository, bring in the changes and test.
git fetch origin
git checkout -b server origin/server
git merge master
Step 2: Merge the changes and update on GitHub.
git checkout master
git merge --no-ff server
This guide helps to test websocket load test with jmeter.
https://blazemeter.com/blog/websocket-testing-apache-jmeter
Github has the code and jar file to test
https://github.com/maciejzaleski/JMeter-WebSocketSampler
Rules for Sound Documentation
1. Documentation should be written from the point of view of the reader, not the writer.
2. Avoid repetition
3. Avoid unintentional ambiguity.
4. Use a standard organization
5. Record rationale.
6. Keep it current.
7. Review documentation for fitness of purpose.
@pontiyaraja
pontiyaraja / install-redis.sh
Created May 11, 2016 11:01 — forked from dstroot/install-redis.sh
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@pontiyaraja
pontiyaraja / restAPI.markdown
Created June 16, 2016 15:31 — forked from iksose/restAPI.markdown
Creating a REST API using Node.js, Express, and MongoDB

###Creating a REST API using Node.js, Express, and MongoDB

####Installing Node.js

Go to http://nodejs.org, and click the Install button. Run the installer that you just downloaded. When the installer completes, a message indicates that Node was installed at /usr/local/bin/node and npm was installed at /usr/local/bin/npm. At this point node.js is ready to use. Let’s implement the webserver application from the nodejs.org home page. We will use it as a starting point for our project: a RESTful API to access data (retrieve, create, update, delete) in a wine cellar database.

Create a folder named nodecellar anywhere on your file system. In the wincellar folder, create a file named server.js.

@pontiyaraja
pontiyaraja / GoSetup
Created August 4, 2016 07:35 — forked from ram-rana-16/GoLang setup
GOlang Setup Environment Linux and OS X
#Set these variables in .bash_profile (OS X) file
export GOPATH=$HOME/workspace
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@pontiyaraja
pontiyaraja / redis-eventsource.go
Created September 27, 2016 11:12 — forked from jweir/redis-eventsource.go
Example of using Redis PubSub and EventSource with golang
package main
import (
eventsource "github.com/antage/eventsource/http"
redis "github.com/vmihailenco/redis"
"log"
"net/http"
)
func haltOnErr(err error){
@pontiyaraja
pontiyaraja / Example log
Created September 29, 2016 07:34 — forked from dspezia/Example log
Assessing pending activity of a Redis server
> ~/tcp_redis_monitor.py 6379
Timestamp Nb TX bytes RX bytes TX RMA RX RMA
1333983822.943 1 0 0 0.000 0.000
1333983823.193 1 0 0 0.000 0.000
1333983824.194 1 0 0 0.000 0.000
1333983825.195 1 0 0 0.000 0.000
1333983826.196 1 0 0 0.000 0.000
@pontiyaraja
pontiyaraja / Pipelined SET.java
Created September 30, 2016 06:59 — forked from tareqabedrabbo/Pipelined SET.java
Redis Pipelines and Transactions
Pipeline pipeline = jedis.pipelined();
long start = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {
pipeline.set("" + i, "" + i);
}
List<Object> results = pipeline.execute();
long end = System.currentTimeMillis();
System.out.println("Pipelined SET: " + ((end - start)/1000.0) + " seconds");
@pontiyaraja
pontiyaraja / Dockerfile - from ubuntu image
Last active November 4, 2016 09:15
Dockerfile to run a web application in a docker image nginx server. This file runs from an ubuntu tag
FROM ubuntu:trusty
MAINTAINER Pandiyaraja Ramamoorthy <ramamoorthypandiyaraja@gmail.com.com>
RUN apt-get update && \
apt-get install -y nginx && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install node