This file contains 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 |
This file contains 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 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 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 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 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 | |
from selenium import webdriver | |
from bs4 import BeautifulSoup | |
def getPage(url): | |
# open with chromedriver | |
browser = webdriver.Chrome() | |
browser.get(url) |
This file contains 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
# -*- coding: utf-8 -*- | |
# Script to run UDP Server on 127.0.0.1:8126 | |
# This mocks statsd server for testing | |
import socket | |
UDP_IP_ADDRESS = "127.0.0.1" | |
UDP_PORT_NO = 8126 |
This file contains 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
#[derive(Debug)] | |
pub enum Superheroes { | |
Superman(Superman), | |
Batman(Batman) | |
} | |
#[derive(Debug)] | |
pub struct Superman { | |
id: i32, | |
name: String, |
This file contains 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/sh | |
# Install nix via yay (AUR helper) | |
yay -S archlinux-nix | |
# Read: https://nixos.org/nix/manual/#ssec-multi-user | |
# Add nix builder groups | |
sudo groupadd -r nixbld | |
for n in $(seq 1 10); do sudo useradd -c "Nix build user $n" \ |
OlderNewer