Skip to content

Instantly share code, notes, and snippets.

View VisionOra's full-sized avatar
:octocat:
Always Up to Help you , Reach me out

Master X VisionOra

:octocat:
Always Up to Help you , Reach me out
View GitHub Profile
@VisionOra
VisionOra / gmail_draft.py
Created February 19, 2024 13:13
Create Gmail Draft
"""
# Draft Email on you Gmail Account
## Author: Sohaib Anwaaar
### Description:
Create Email Draft in your gmail account
### Create Credentials.json

Hello, my name is Sohaib and I am passionate about Artificial Intelligence.

Sohaib Anwaar GitHub stats

Top Langs

name: Zappa Deployment
env:
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
KEY_ID: ${{ secrets.KEY_ID }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
on:
push:
@VisionOra
VisionOra / Kafka_installation
Created November 4, 2022 06:13
Kafka Installation Docker Compose
---
version: '2'
services:
zk:
image: confluentinc/cp-zookeeper:6.1.1
hostname: zk
container_name: zk
ports:
- "2181:2181"
environment:
@VisionOra
VisionOra / chrome_headless.py
Created July 15, 2022 11:22 — forked from haranjackson/chrome_headless.py
Deploys the Python Selenium library and Chrome Headless to an AWS Lambda layer. You can specify the region, library version, and runtime. An example Lambda function is given.
from selenium.webdriver import Chrome
from selenium.webdriver.chrome.options import Options
options = Options()
options.binary_location = '/opt/headless-chromium'
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--start-maximized')
options.add_argument('--start-fullscreen')
@VisionOra
VisionOra / reveive_image_api.py
Created July 13, 2022 14:14
Python - Send bytes Images to apis (Image to string) -> (String to image)
###################################################################################
#
# Decode Image and use in your API
#
#
###################################################################################
def string_to_ndarray(image_str: str) -> np.ndarray:
#!/bin/bash
## This gist contains instructions about cuda v11.2 and cudnn 8.1 installation in Ubuntu 18.04 for PyTorch
#############################################################################################
##### forked by : https://gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73 ########
#############################################################################################
### steps ####
# verify the system has a cuda-capable gpu
@VisionOra
VisionOra / logger.py
Created June 24, 2022 03:25
Logging in python
import datetime
import logging
class Logger:
def setup_logger(self, name, log_file, level=logging.INFO):
"""To setup as many loggers as you want"""
formatter = logging.Formatter(
'%(asctime)s %(name)s - %(levelname)s - %(message)s')
@VisionOra
VisionOra / Upload_images_to_private_s3_bucket .py
Last active July 25, 2022 15:58
Upload images to private s3 bucket
import boto3
from botocore.exceptions import NoCredentialsError
import requests
import mimetypes
import time
import random
AWS_STORAGE_BUCKET_NAME = "backend-s3-assets"
AWS_S3_ACCESS_KEY_ID = "*********"
AWS_S3_SECRET_ACCESS_KEY = "************************************"
@VisionOra
VisionOra / gist:85ecc4b29f2df4b40feef4b8b71415b9
Last active September 30, 2022 11:50
Upload Image to public bucket aws s3
import boto3
from botocore.exceptions import NoCredentialsError
import requests
import mimetypes
import time
import random
AWS_STORAGE_BUCKET_NAME = "*********************"
AWS_S3_ACCESS_KEY_ID = "****************"