Skip to content

Instantly share code, notes, and snippets.

View LiberiFatali's full-sized avatar

Cless LiberiFatali

  • Vietnam
View GitHub Profile
@LiberiFatali
LiberiFatali / su.py
Created February 7, 2018 08:49 — forked from pebbie/su.py
Implementation of document binarization algorithm by (Bolan Su et al, 2010)
"""
author: Peb Ruswono Aryan
Binarization Algorithm by Su et al.
@inproceedings{Su:2010:BHD:1815330.1815351,
author = {Su, Bolan and Lu, Shijian and Tan, Chew Lim},
title = {Binarization of Historical Document Images Using the Local Maximum and Minimum},
booktitle = {Proceedings of the 9th IAPR International Workshop on Document Analysis Systems},
series = {DAS '10},
import numpy as np
import faiss
def search_knn(xq, xb, k, distance_type=faiss.METRIC_L2):
""" wrapper around the faiss knn functions without index """
nq, d = xq.shape
nb, d2 = xb.shape
assert d == d2
@LiberiFatali
LiberiFatali / install-cuda-10-bionic.sh
Created September 9, 2019 08:54 — forked from bogdan-kulynych/install-cuda-10-bionic.sh
Install CUDA 10 on Ubuntu 18.04
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && sudo apt update
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
@LiberiFatali
LiberiFatali / triple-birthday-problem.ipynb
Created April 20, 2020 01:50
Triple birthday problem.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LiberiFatali
LiberiFatali / intel-nvidia.md
Created September 20, 2022 08:17 — forked from wangruohui/intel-nvidia.md
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
@LiberiFatali
LiberiFatali / pyqt_icons.py
Created March 16, 2023 09:35 — forked from ostr00000/pyqt_icons.py
Simple program to display all icons available for pyqt
"""
Create widget with available icons from qt and based on freedesktop.org
https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
"""
from PyQt5.QtCore import QSize
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget, QGridLayout, QStyle, \
QFormLayout, QLabel, QScrollArea, QLineEdit, QTabWidget
@LiberiFatali
LiberiFatali / m3u8.md
Last active June 2, 2023 07:03 — forked from primaryobjects/m3u8.md
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@LiberiFatali
LiberiFatali / intel-nvidia-offload-rendering.md
Created September 20, 2022 08:18 — forked from haipnh/intel-nvidia-offload-rendering.md
Intel for display, NVIDIA for computing and offload rendering

Purposes

  1. iGPU will be used for main display and rendering daily-use softwares in default
  2. Dedicated GPUs will be used for computing or offload rendering
  3. Reduce the used VRAM of Dedicated GPU, which is mostly used for X11 server rendering

Tested Hardware Configuration

OS: Ubuntu 18.04.4 LTS
Mainboads
├── iGPU
@LiberiFatali
LiberiFatali / rtsp_authentication.py
Last active June 23, 2023 01:47 — forked from crayfishapps/rtsp_authentication.py
RTSP client with basic and digest authentication - converted to Python3
#! /usr/bin/python
import socket,time,string,base64,hashlib,xml.etree.ElementTree as ET
import sys
RTSP_VERSION = "RTSP/1.0"
LINE_SPLIT_STR = "\r\n"
HEADER_END_STR = LINE_SPLIT_STR*2
@LiberiFatali
LiberiFatali / GITCRASHCOURSE.MD
Created June 27, 2023 03:11 — forked from brandon1024/GITCRASHCOURSE.MD
Git Crash Course for Beginners

Git Crash Course for Beginners

Preface

A good understanding of Git is an incredibly valuable tool for anyone working amongst a group on a single project. At first, learning how to use Git will appear quite complicated and difficult to grasp, but it is actually quite simple and easy to understand.

Git is a version control system that allows multiple developers to contribute to a project simultaneously. It is a command-line application with a set of commands to manipulate commits and branches (explained below). This tutorial will help you get started, and in no time you will be a Git Ninja!

Contents: