Skip to content

Instantly share code, notes, and snippets.

View sanjay1688's full-sized avatar

Sanjay Sahu sanjay1688

View GitHub Profile
@sanjay1688
sanjay1688 / Ubuntu server setup script (PHP 5.6)
Created January 11, 2017 16:49 — forked from Ravaelles/Ubuntu server setup script (PHP 5.6)
PHP 5.6 + nginx + MongoDB driver for PHP
#!/bin/bash
######################################################
### README ###########################################
######################################################
###
### One-line server install script for Ubuntu.
### Installs Nginx + PHP5.6 + MongoDB for PHP driver.
###
### Removes previous Apache, PHP, nginx installations.
@sanjay1688
sanjay1688 / installMongoDB.sh
Created January 11, 2017 16:39 — forked from ankur13secret/installMongoDB.sh
To install MongoDB in a server
#!/usr/bin/env bash
echo "Written By Ankur Mishra"
echo "Starting Server Setup....."
echo "Be Sure you are are a super user..."
# To become a super user
sudo su
# to update the packages from repositories
apt-get update
@sanjay1688
sanjay1688 / a.md
Last active November 20, 2015 08:40 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

@sanjay1688
sanjay1688 / multi-git.md
Created September 30, 2015 13:40 — forked from fitsanju/multi-git.md
Setting up a Github and Bitbucket account on the same computer.

Setting up github and bitbucket on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.

#!/bin/sh
curl -XDELETE localhost:9200/foo >/dev/null
curl -XPOST localhost:9200/foo/t -d'
{
"clicks": 10,
"impressions": 1000,
"when": "2013-10-01"
}
This is an example how to perform multi-select faceting in ElasticSearch.
Selecting multiple values from the same facet will result in an OR filter between each of the values:
(facet1.value1 OR facet1.value2)
Faceting on more than one facet will result in an AND filter between each facet:
(facet1.value1 OR facet1.value2) AND (facet2.value1)
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh).