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
malayalam_character = ['അ','ആ','ഇ','ഈ','ഉ','ഊ','ഋ','ഌ','എ','ഏ','ഐ','ഒ','ഓ','ഔ','ക','ഖ','ഗ','ഘ','ങ','ച','ഛ','ജ','ഝ','ഞ','ട','ഠ','ഡ','ഢ','ണ','ത','ഥ','ദ','ധ','ന','ഩ','പ','ഫ','ബ','ഭ','മ','യ','ര','റ','ല','ള','ഴ','വ','ശ','ഷ','സ','ഹ','ഺ','\u0d3c','ഽ','ാ','ി','ീ','ു','ൂ','ൃ','ൄ','െ','േ','ൈ','\u0d49','ൊ','ോ','ൌ','്','ൎ','ൗ','ൠ','ൡ','ൢ','ൣ','൦','൧','൨','൩','൪','൫','൬','൭','൮','൯','൹','ൺ','ൻ','ർ','ൽ','ൾ','ൿ','ං'] |
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 | |
# Thanks to @fvclaus | |
curl --silent --show-error http://127.0.0.1:4040/api/tunnels | sed -nE 's/.*public_url":"(https:[^"]*).*/\1/p' |
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 pymongo import MongoClient | |
client = MongoClient() | |
db = client.alexa | |
users_collection = db.user_details | |
#insert | |
users_collection.insert_one({"user":id, | |
"time":datetime.datetime.utcnow(), | |
"activated":False, |
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
# post_loc.txt contains the json you want to post | |
# -p means to POST it | |
# -H adds an Auth header (could be Basic or Token) | |
# -T sets the Content-Type | |
# -c is concurrent clients | |
# -n is the number of requests to run in the test | |
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
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
gcloud auth configure-docker | |
#gcloud project name - deeplearning-181416 | |
#local image name - eminn/grafana-dashboard | |
#grafane-image is image and v1 is the tag | |
docker tag eminn/grafana-dashboard gcr.io/deeplearning-181416/grafane-image:v1 | |
docker push gcr.io/deeplearning-181416/grafane-image:v1 |
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
import logging | |
import logging.handlers as handlers | |
import time | |
logger = logging.getLogger('my_app') | |
logger.setLevel(logging.INFO) | |
# Here we define our formatter | |
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') |
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
import glob | |
import os | |
from PIL import Image | |
import concurrent.futures | |
def make_image_thumbnail(filename): | |
# The thumbnail will be named "<original_filename>_thumbnail.jpg" | |
base_filename, file_extension = os.path.splitext(filename) | |
thumbnail_filename = f"{base_filename}_thumbnail{file_extension}" |
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
import logging | |
app = Flask(__name__) | |
# gunicorn_error_logger = logging.getLogger('gunicorn.error') | |
# app.logger.handlers.extend(gunicorn_error_logger.handlers) | |
# app.logger.setLevel(logging.DEBUG) | |
# app.logger.debug('this will show in the log') | |
# gunicorn_logger = logging.getLogger(‘gunicorn.error’) |
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
sudo apt install --reinstall python-debian python3-debian python-chardet python3-chardet |
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
sudo apt-get install libpq-dev postgresql postgresql-contrib | |
sudo -u postgres -i | |
psql | |
create database tagger; | |
create user tagger_user with password 'passsss'; | |
grant all privileges on database tagger to tagger_user; | |
ALTER ROLE tagger_user SET client_encoding TO 'utf8'; | |
ALTER ROLE tagger_user SET default_transaction_isolation TO 'read committed'; | |
ALTER ROLE tagger_user SET timezone TO 'UTC'; | |
OlderNewer