Skip to content

Instantly share code, notes, and snippets.

View hoangnt2601's full-sized avatar
💪
Gymming with code

Hoang Nguyen hoangnt2601

💪
Gymming with code
  • Nautilus JSC
  • Hà Nội Việt Nam
View GitHub Profile
@hoangnt2601
hoangnt2601 / special_git_command.md
Last active August 25, 2022 04:10
special git command
  • Add only modified changes and ignore untracked files
git ls-files --modified | xargs git add
  • Stash the changes in a dirty working directory away
git stash save
git stash apply [index]
  • error: insufficient permission for adding an object to repository database .git/objects
@hoangnt2601
hoangnt2601 / streamming_rtsp.md
Last active September 14, 2022 01:44
streamming
  1. GStreamer
  • Play video:
gst-launch-1.0 playbin uri=rtsp://...
gst-launch-1.0 rtspsrc location=rtsp://... latency=200 protocols=4 ! queue ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! autovideosink
gst-launch-1.0 filesrc location=file.mp4 ! decodebin ! videoconvert ! autovideosink
  • Write image:
@hoangnt2601
hoangnt2601 / SDLC.md
Created May 15, 2021 15:17
Những giai đoạn của vòng đời phát triển phần mềm

Vòng đời phát triển phần mềm SDLC chia thành nhiều giai đoạn khác nhau. Cụ thể là: Requirement Analysis, Design, Implementation, Testing, Deployment và Maintenance.

– Requirement Analysis: Đây là giai đoạn đầu tiên của một SDLC. Các kỹ sư sẽ tiến hành thu thập các thông tin sơ khai về phần mềm muốn phát triển.

– Design: Thiết kế tổng thể, chi tiết về phần mềm muốn phát triển. Đây là giai đoạn sơ khai để phát triển một phần mềm bất kỳ.

– Implementation: Hai bên có thể trao đổi để chốt được phương án phát triển tốt nhất. Ở giai đoạn Implementation các lập trình viên tiến hành coding theo những tài liệu và mẫu thiết kế được khách phê duyệt.

– Testing: Tiến hành kiểm thử và cập nhật những lỗi lên các tool quản lý theo yêu cầu. Kiểm thử viên và lập trình viên sẽ sửa lỗi và cập nhật lại tình hình của phần mềm. Các kiểm thử viên tiến hành test lỗi dựa vào các mã hóa đã được tạo. Tester có thể áp dụng các phương pháp kiểm thử khác nhau để phát hiện ra lỗi nhanh nhất và tiến hành fix lại lỗi.

@hoangnt2601
hoangnt2601 / preprocess_image_ocr.py
Created May 12, 2021 08:52
preprocess image for ocr
import cv2
import numpy as np
import PIL.Image as Image
import imutils
def increase_brightness(image, value=10):
hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv)
@hoangnt2601
hoangnt2601 / setup.py
Created February 19, 2021 01:38
Build binary python code
# coding: utf-8
import os
import sysconfig
from glob import glob
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as _build_py
from Cython.Build import cythonize
@hoangnt2601
hoangnt2601 / opencv_build_on_jetson_nano.md
Last active February 19, 2021 01:36
How to build opencv on Jetson Nano

python3 -m pip install numpy
wget -O opencv.zip https://github.com/opencv/opencv/archive/4.1.2.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.1.2.zip
unzip opencv.zip
unzip opencv_contrib.zip
mv opencv-4.1.2 opencv
mv opencv_contrib-4.1.2 opencv_contrib \

cd opencv && mkdir build
cd opencv/build && cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_CUDA=OFF -D WITH_CUBLAS=OFF -D WITH_CUDNN=OFF -D WITH_LIBV4L=ON -D BUILD_opencv_python3=ON -D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D OPENCV_DNN_CUDA=OFF -D WITH_GSTREAMER=ON -D WITH_GTK=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules .. \

gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
gst-launch-1.0 v4l2src device=/dev/video0 ! tee name=t t.! queue ! videoconvert ! autovideosink t.! queue ! videoconvert ! v4l2sink device=/dev/video2
@hoangnt2601
hoangnt2601 / curl.md
Created January 19, 2021 08:30 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@hoangnt2601
hoangnt2601 / Dockerfile
Created November 18, 2020 01:35
Build docker image for deep learning env
FROM okwrtdsh/anaconda3:10.0-cudnn7
RUN apt-get update -qq \
&& apt-get install --no-install-recommends -y \
graphviz \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# opencv install
RUN conda install -c anaconda opencv