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 / 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 / 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 / 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 / date_time.js
Created May 19, 2019 08:29
JS Date Time
const options = {
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric'
}
new Intl.DateTimeFormat('en-US', options).format(date) //"7/22/2018, 7:22:13 AM"
@akmamun
akmamun / docker
Created April 22, 2019 09:09
Python flask app dockerize
from alpine:latest
RUN apk add --no-cache python3-dev \
&& pip3 install --upgrade pip
WORKDIR /app
COPY . /app
RUN pip3 --no-cache-dir install -r requirements.txt
@akmamun
akmamun / mongo_export_data
Created April 20, 2019 11:37
Mongo DB export command line
mongoexport --db meghna --collection recognitions --out recognitions.csv
@akmamun
akmamun / compile.py
Created March 27, 2019 09:51
Protecting Python and Flask App Sources With Cython
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
ext_modules = [
Extension("test", ["test.py"]),
]
@akmamun
akmamun / GOPATH Set
Last active May 6, 2019 09:18
Set Go Lang Path
#add those in bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
@akmamun
akmamun / protobuf3-on-ubuntu
Created February 17, 2019 20:07
Install protobuf 3 on Ubuntu
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0rc2/protoc-3.7.0-rc-2-linux-x86_64.zip
# Unzip
unzip protoc-3.7.0-rc-2-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@akmamun
akmamun / base64_to_image.py
Created February 13, 2019 12:42
Base 64 to Image Convert in Python
import os
SAVE_DIR = os.path.dirname(os.path.abspath(__file__))
def base64_to_image(filename):
path = os.path.join(SAVE_DIR, 'images/')
if not os.path.isdir(path):
os.mkdir(path)
data = base64.b64decode(filename)
filename = 'frame' + str(datetime.datetime.now().microsecond) + '.jpg'
destination = "/".join([path, filename])