Skip to content

Instantly share code, notes, and snippets.

View akmamun's full-sized avatar
🎯
Focusing

Al Mamun Khan akmamun

🎯
Focusing
View GitHub Profile
@akmamun
akmamun / HpLaptopWifi
Created July 3, 2019 18:22
Hp Laptop Wifi solution
And With good information to COE2k14
2) Install :
:~$ sudo apt update && sudo apt install git dkms
:~$ cd Downloads
@akmamun
akmamun / video_recoding.py
Created September 4, 2019 06:50
Video Recording
import cv2
url = "rtsp camera url"
cap = cv2.VideoCapture(url)
fourcc = cv2.VideoWriter_fourcc(*'vp80')
fps = cap.get(cv2.CAP_PROP_FPS)
width, height = int(cap.get(3)), int(cap.get(4))
print(fps,width, height)
@akmamun
akmamun / json_to_csv.py
Last active December 11, 2019 10:13
Json to CSV Python
#pip install pandas
import json
from datetime import datetime
import pandas as pd
sheet = [
{
"face": {
"id": "1",
@akmamun
akmamun / git.md
Created January 5, 2020 19:01
Git Essential

Git Essential

Git initialization

  • Only one time need to initialization
git init

Git add

  • Add single file or folder or all changes made
@akmamun
akmamun / run.sh
Created January 26, 2020 18:56
Docker Serve React Build Pack with Nginx
docker run --mount type=bind,source="$(pwd)"/build,target=/usr/share/nginx/html -p 8080:80 nginx
@akmamun
akmamun / .gitignore
Created March 11, 2020 06:42
Sample Node Git Ignore File
node_modules
build
npm-debug.log
.env
.DS_Store
@akmamun
akmamun / mailjet_send_mail.py
Created July 8, 2020 15:22
Python3 MailJet(https://www.mailjet.com/) Send Mail Service
#pip install mailjet_rest
from mailjet_rest import Client
from os import getenv
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
api_key = getenv("MAIL_API_KEY")
api_secret = getenv("MAIL_API_SECRET")
@akmamun
akmamun / base_64_image_check.py
Created February 2, 2021 17:45
Base 64 Image Check
def is_base64(base_64):
try:
if len(base_64) == 0:
return False
if isinstance(base_64, str):
# If there's any unicode here, an exception will be thrown and the function will return false
sb_bytes = bytes(base_64, 'ascii')
elif isinstance(sb, bytes):
sb_bytes = base_64
@akmamun
akmamun / django_mail.py
Last active December 6, 2021 15:15
Django send email for both html template and text
from django.conf import settings
from django.core.mail import EmailMessage
from django.template.loader import get_template
class EmailService:
def __init__(self):
self.from_email = settings.EMAIL_HOST
def send_email(self, subject: str, template: str, data=None):
@akmamun
akmamun / docker-compose.yml
Last active November 21, 2021 16:07
Docker Compose Host Mode Container
version: "3"
services:
server:
container_name: django_app
build: . # from Dockerfile or image name
command: gunicorn core.wsgi:application --bind 0.0.0.0:8001
# ports:
# - 8000:8000
network_mode: host