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/python | |
# Screen scraper based API for BookMyShow. | |
# Test Code for Bengaluru | |
import re | |
import urllib2 | |
class BookMyShowClient(object): | |
NOW_SHOWING_REGEX = '{"event":"productClick","ecommerce":{"currencyCode":"INR","click":{"actionField":{"list":"Filter Impression:category\\\/now showing"},"products":\[{"name":"(.*?)","id":"(.*?)","category":"(.*?)","variant":"(.*?)","position":(.*?),"dimension13":"(.*?)"}\]}}}' |
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 PIL import Image | |
from pytesseract import image_to_string | |
print image_to_string(Image.open('test.png')) | |
#print image_to_string(Image.open('test-english.jpg'), lang='eng') |
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
#!/bin/bash | |
# Proto files directory | |
PROTOS_PATH="src/protos/" | |
# Directory in which auto generated code will be saved | |
AUTOGEN_GRPC_PATH="src/autogen_grp/" | |
# Generate python grpc code for each proto | |
# Requires grpcio-tools: pip install grpcio-tools | |
for file in "$PROTOS_PATH"* |
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
# Provide output directory path as argument | |
OUTPATH=$1 | |
# Generate CA key: | |
openssl genrsa -des3 -out $OUTPATH/ca.key 4096 | |
# Generate CA certificate: | |
openssl req -new -x509 -days 365 -key $OUTPATH/ca.key -out $OUTPATH/ca.crt |
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
# Dumps given collections from source mongo db to destination mongo db | |
# Source DB Creds | |
source_host="" | |
source_port="" | |
source_user="" | |
source_password="" | |
source_db="" | |
# Destination DB Creds |
NewerOlder