Skip to content

Instantly share code, notes, and snippets.

View Poorvak's full-sized avatar

Poorvak Kapoor Poorvak

  • Euler Motors
  • Delhi
View GitHub Profile
sudo ./configure --user=nginx --group=nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --with-threads --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-http_degradation_module --with-http_stub_status_module --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-cpp_test_module --with-debug
sudo apt-get install build-essential libc6 libpcre3 libpcre3-dev libpcrecpp0 libssl0.9.8 libssl-dev zlib1g zlib1g-dev lsb-base openssl libssl-dev libgeoip1 libgeoip-dev google-perftools libgoogle-perftools-dev libperl-dev libgd2-xpm-dev libatomic-ops-dev libxml2-dev libxslt1-dev python-dev
#! /bin/bash
. /lib/lsb/init-functions
#------------------------------------------------------------------------------
# Consts
#------------------------------------------------------------------------------
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/sbin/
DAEMON=/usr/sbin/nginx
@Poorvak
Poorvak / gist:8c111f4b781314af5c90d749a4b22e8e
Last active August 1, 2016 15:07
All nginx modules being used.
For API speed and page responses:
---------------------------------
https://github.com/pagespeed/ngx_pagespeed
Nginx-Access-Plus is a Nginx module allows limiting access to certain http request methods and client addresses.
----------------------------------------------------------------------------------------------------------------
https://github.com/nginx-clojure/nginx-access-plus
This module can be used to protect your server in case system load or memory use goes too high.
-----------------------------------------------------------------------------------------------
@Poorvak
Poorvak / gist:2fb99cb589679c8042c48e51cc1d57f3
Created July 27, 2016 14:04
Elasticsearch Plugins being used
ElastAlert is a simple framework for alerting on anomalies, spikes, or other patterns of interest from data in Elasticsearch.
-----------------------------------------------------------------------------------------------------------------------------
https://github.com/Yelp/elastalert
Search Guard is build upon search-guard-ssl, a plugin which enables and enforce transport protocol (node-to-node) encryption and mutual SSL authentication.
------------------------------------------------------------------------------------------------------------------------------------------------------------
https://github.com/floragunncom/search-guard
Elasticsearch version-2.3.4
@Poorvak
Poorvak / dataset.ipynb
Created May 30, 2017 09:41
Jupyter notebook for dataset cleaning task
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Poorvak
Poorvak / ner-tags.ipynb
Created June 8, 2017 07:26
NER Term Frquency
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Poorvak
Poorvak / prime_numbers.cpp
Created June 27, 2017 04:29
Prime Number program in (N*log(pow 1/2)N) complexity
#include <iostream>
#include <vector>
using namespace std;
void generatePrime(int N) {
vector <int> arrayList;
vector <int> :: iterator i;
arrayList.push_back(2);
for( int i=3; i<=N; i+=2 ) {
bool isPrime = true;
@Poorvak
Poorvak / postgres-to-es.py
Created July 20, 2017 09:22
Index data from Postgres to ElasticSearch using the arguments.
#!/usr/bin/python
import math
import argparse
import traceback
import psycopg2
import psycopg2.extras
import elasticsearch
@Poorvak
Poorvak / mongodb-s3-backup.sh
Created February 16, 2018 07:04 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh