Skip to content

Instantly share code, notes, and snippets.

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_4.x | bash -
apt-get install -y nodejs
@zubairalam
zubairalam / ElasticSearch.sh
Created October 9, 2015 12:46 — forked from gourneau/ElasticSearch.sh
Elastic Search 1.4.2 with Oracle Java 8
### Install Oracle Java 8, this means you agree to their binary license!!
cd ~
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo aptitude -y install oracle-java8-installer
### Download and Install ElasticSearch
# need to install htpasswd to set user and password for elasticsearch, if htpasswd not found then install following package
sudo apt-get install apache2-utils
@zubairalam
zubairalam / elasticsearch.md
Created October 13, 2015 09:07 — forked from nicolashery/elasticsearch.md
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@zubairalam
zubairalam / create_index.sh
Created October 13, 2015 09:07 — forked from bonzanini/create_index.sh
Elasticsearch/Python test
curl -XPOST http://localhost:9200/test/articles/1 -d '{
"content": "The quick brown fox"
}'
curl -XPOST http://localhost:9200/test/articles/2 -d '{
"content": "What does the fox say?"
}'
curl -XPOST http://localhost:9200/test/articles/3 -d '{
"content": "The quick brown fox jumped over the lazy dog"
}'
curl -XPOST http://localhost:9200/test/articles/4 -d '{
@zubairalam
zubairalam / tmux_install.sh
Created November 4, 2015 15:30 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux installation steps for Ubuntu
# tmux v2.0 installation steps for Ubuntu 14.04 (Trusty Tahr)
tmux -V
sudo apt-get update
sudo apt-get install -y python-software-properties software-properties-common
sudo add-apt-repository -y ppa:pi-rho/dev
sudo apt-get update
sudo apt-get install -y tmux
tmux -V
# tmux v1.9 installation steps for Ubuntu 14.04 (Trusty Tahr)
sudo apt-key -y adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get -y update
sudo apt-get -y install mongodb-org
# Running Mongo
service mongod start
sudo /etc/init.d/mongod start
# Stopping Mongo
@zubairalam
zubairalam / make_csv.sh
Created November 20, 2015 12:00 — forked from jasonwash/make_csv.sh
Shell script to create a CSV file from a MongoDB collection. The CSV file will contain all possible top-level keys. Embedded documents are not handled.
#!/bin/bash
function usage {
printf "Usage:\n$0 <db_name> <collection_name> <output_csv_file>\n"
exit 1
}
db_name=$1
collection=$2
output_file=$3
@zubairalam
zubairalam / mongoexport_with_query.sh
Created November 20, 2015 12:00 — forked from hirobo/mongoexport_with_query.sh
Shell script for mongoexport with query
#!/bin/sh
#########################################################
# usage
#do_mongoexport '2015-04-01' '2015-04-02' 'hoge'
#########################################################
get_millis()
{
if [ $# != 1 ]; then
@zubairalam
zubairalam / gulpfile-express.js
Created November 30, 2015 07:15 — forked from mollerse/gulpfile-express.js
Gulpfile for livereload + static server
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,