My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.6 | |
"""AutoDelete | |
This script auto deletes messages from your gmail inbox. | |
The perfect usecase is deleting the OTP messages received from banks after certain time period. | |
or deleting the messages received from certain services which doesn't have unsubscribe option. | |
Many parts of this script are copied from EZGmail by Al Sweigart (https://github.com/asweigart/ezgmail) | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
call plug#begin('~/.vim/plugged') | |
Plug 'scrooloose/nerdtree' " file list | |
Plug 'majutsushi/tagbar' " show tags in a bar (functions etc) for easy browsing | |
Plug 'vim-airline/vim-airline' " make statusline awesome | |
Plug 'vim-airline/vim-airline-themes' " themes for statusline | |
Plug 'jonathanfilip/vim-lucius' " nice white colortheme | |
Plug 'davidhalter/jedi-vim' " jedi for python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name localhost; | |
location /oauth2/ { | |
proxy_pass http://oauth-proxy:4180; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Scheme $scheme; | |
proxy_set_header X-Auth-Request-Redirect $request_uri; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nginx proxy for Elasticsearch + Kibana | |
server { | |
listen 127.0.0.1:8080; | |
server_name your.domain.com; | |
# AWS DNS resolver (if you're running on AWS EC2, else use google DNS 8.8.8.8) | |
resolver 172.31.0.2; | |
# Fix nginx resolving url only on config load (AWS can change the endpoint IP at anytime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IP address and port on which the proxy should listen for requests | |
http_address = "127.0.0.1:4181" | |
upstreams = [ "http://127.0.0.1:8080" ] | |
request_logging = true | |
client_id = "GOOGLE CLIENT ID" | |
client_secret = "GOOGLE CLIENT SECRET" | |
cookie_secret = "COOKIE SECRET" | |
pass_host_header=true | |
email_domains = [ "domain.com" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import request | |
import json | |
import requests | |
import hashlib as hasher | |
import datetime as date | |
node = Flask(__name__) | |
# Define what a Snakecoin block is | |
class Block: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:2.7-alpine | |
RUN pip install textblob | |
RUN python -m textblob.download_corpora | |
ADD https://github.com/alexellis/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin | |
RUN chmod +x /usr/bin/fwatchdog | |
WORKDIR /root/ | |
COPY handler.py . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import re | |
import threading | |
import time | |
import subprocess | |
from os.path import splitext, expanduser, normpath | |
import click |
NewerOlder