Skip to content

Instantly share code, notes, and snippets.

View eemp's full-sized avatar

Mihir Patel eemp

View GitHub Profile
@eemp
eemp / find_arrays.sh
Created September 24, 2015 21:53
Find Elasticsearch records where a field is an array instead of a simple String
curl -w "\n" -XDELETE localhost:9200/scrap
curl -w "\n" -XPUT localhost:9200/scrap/ -d '
index :
number_of_replicas : 0
'
curl -w "\n" -XPUT localhost:9200/scrap/script-demo/1?refresh=1 -d '{
"fieldA" : "test string 1"
}'
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
die "Usage: $0 FASTA_FILE" if !$ARGV[0];
# read the fasta file
# start clean - hope you don't have a test index you need!!!
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test
printf "\nCreated a new test index...\n"
curl -XPUT localhost:9200/test/snowball-mapping/_mapping -d '{
"snowball-mapping" : {
"properties" : {
"text" : {
@eemp
eemp / tmux_local_install.sh
Last active February 27, 2017 19:17 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.3
#!/bin/bash
SERVER=http://localhost:9200
INDEX=random-samples
MAPPING=docs
CURL_OPTS="-sw '\n'"
ACTIONS_LOG=random-samples-index.log