Skip to content

Instantly share code, notes, and snippets.

@katta
katta / missed-merges.sh
Last active March 23, 2016 19:14
Git Missed Merges
#!/usr/bin/env bash
#usage -> missed_merge to_branch from_branch
#example -> missed_merge master r-1.0.1
#the above script gives all commits that are there on r-1.0.1 that have not been merged with master
if [ $# -lt 2 ]
then
echo "ERROR: Incorrect Usage"
echo "Usage: missed_merge.sh <to_branch> <from_branch> [<ignore-commits-file-path>]"
@katta
katta / groovy-execute-command.groovy
Created April 26, 2013 06:09
Groovy shell command
def command = "git --version"
def proc = command.execute()
proc.waitFor()
println "Process exit code: ${proc.exitValue()}"
println "Std Err: ${proc.err.text}"
println "Std Out: ${proc.in.text}"
@katta
katta / elasticsearch-demo.sh
Last active December 15, 2015 12:29
Elastic Search Demo Samples
#############################
### SETUP
############################
### Delete all indices
curl -XDELETE localhost:9200
### Create an index
curl -XPOST localhost:9200/books
@katta
katta / es-plugin-install.sh
Created December 21, 2012 12:28
installing elastic search plugin via local file artifact
$ ./plugin -url file:{project.dir}/target/releases/custom-http-handler-0.1-SNAPSHOT.zip -install custom-http-handler
@katta
katta / plugin.xml
Created December 21, 2012 11:59
Elastic search plugin descriptor for maven assembly plugin
<?xml version="1.0"?>
<assembly>
<id>plugin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
@katta
katta / RestRegisterAction.java
Created December 21, 2012 11:37
Custom REST handler for Elastic Search
package org.katta.es.http;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.*;
public class RestRegisterAction extends BaseRestHandler {
@Inject
@katta
katta / CustomRestHandlerPlugin.java
Last active December 10, 2015 00:38
Plugin extension for elastic search
package org.katta.es.plugin.http;
import org.katta.es.http.RestRegisterAction;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.rest.RestModule;
public class CustomRestHandlerPlugin extends AbstractPlugin {
@Override
public String name() {
@katta
katta / es-plugin.properties
Created December 21, 2012 11:11
Elastic Search plugin properties
plugin=org.katta.es.plugin.http.CustomRestHandlerPlugin
@katta
katta / fakerest-readme.md
Created September 4, 2012 17:16
What is fakerest

Fakerest

Fakerest is a simple tool based on sinatra which starts a http server (webrick) and exposes restful services based on the configuration specified in a YAML format.

Features

You can :

  • Stub any of the restful servies be it any method GET, POST, HEAD, PUT etc.
  • Configure multiple URLs based on your need
@katta
katta / gist:3437976
Created August 23, 2012 15:58
Fakerest sample configuration file
---
method : get
path : /customer/:id
response:
content_file : customer
content_type : json
status_code : 200
---
method : post
path : /customer