Skip to content

Instantly share code, notes, and snippets.

View cobaohieu's full-sized avatar

Hieu C B cobaohieu

View GitHub Profile
@ThioJoe
ThioJoe / Appx-Uninstaller.ps1
Last active July 23, 2024 01:23
A basic script for uninstalling a list of app packages in Windows 10/11, including those pre-installed with Windows
# A basic script for uninstalling app packages in Windows 10/11, including those pre-installed with Windows
#
# Note: If you get an error about the script not being allowed to run, the below command will change the execution polciy temporarily for one session only:
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
#
# To execute the script, open a Powershell window to the directory with the script and run the following command using your scripts file name (and don't forget the .\ )
# .\WhateverScriptName.ps1
# -------------------------------------------------------------------------------------------
# Script by ThioJoe - https://github.com/ThioJoe
@convict-git
convict-git / concurrency-sync-cpp.md
Created August 8, 2021 13:31
Concurrency and Synchronization using Modern C++ - (Not so) Short Notes

Concurrency and Synchronization using Modern C++

Thread Management

Each running program has at least one thread which is occupied by its entry point. There can be many threads for a single program and the memory is shared among all threads. The objects possessed by the main thread (and shared by other threads as a reference to it) would be destroyed as soon as they go out of scope. This might lead to corrupt memory access by the rest of the threads.

Hence, sometimes, it's very important to make sure that all the threads are joined using std::thread::join() before the main thread terminates. Other times, you basically want a daemon thread running in background even after the termination of main thread and that can be achieved by calling std::thread::detach(), but it may or may not be possible to join a detachable thread.

Resource Acquisition Is Initialization (RAII) is a famous programming idiom in C++ (a misnomer actually) also (better) known and understood as **Scope-Bound Resource Managemen

{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@otamajakusi
otamajakusi / Dockerfile
Last active May 29, 2021 03:04
Dockerfile for YOLOv5 on Jetson Nano
FROM nvcr.io/nvidia/l4t-pytorch:r32.4.4-pth1.6-py3
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update
RUN apt install -y cmake libgtk2.0-dev wget
RUN wget https://nvidia.box.com/shared/static/9eptse6jyly1ggt9axbja2yrmj6pbarc.whl -O torch-1.6.0-cp36-cp36m-linux_aarch64.whl
RUN python3 -m pip install torch-1.6.0-cp36-cp36m-linux_aarch64.whl
RUN python3 -m pip install scikit-build
@HViktorTsoi
HViktorTsoi / ShadowHighlightCorrection.py
Last active June 18, 2024 14:42
Image shadow and highlight correction/adujstment with opencv.
import numpy as np
import cv2
def correction(
img,
shadow_amount_percent, shadow_tone_percent, shadow_radius,
highlight_amount_percent, highlight_tone_percent, highlight_radius,
color_percent
):
"""
@diegopacheco
diegopacheco / bazel-ubuntu-20.04.md
Created December 4, 2020 17:41
Installing Google Bazel on Ubuntu 20.04 LTS
sudo apt install curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list

sudo apt update && sudo apt install bazel
sudo apt update && sudo apt full-upgrade
bazel --version
@rometsch
rometsch / BH456A_linux_driver.md
Last active October 16, 2023 08:16
MPOW BH456A Bluetooth USB Adapter Kernel Module Adjustements (Realtek RTL8761B chip)

Problem

The MPOW Bluetooth 5 dongle (Model: BH456A) does not work out of the box on Ubuntu 20.04 (kernel 5.4.0-42).

Solution

Patch the bluetooth kernel module and copy the firmware binaries to /lib/firmware.

Copy the fimware

@zhensongren
zhensongren / uninstall_python3.MD
Last active July 24, 2024 17:17
How to uninstall python3 from Ubuntu

To list all python versions in default locations

ls /usr/bin/python*

To remove just python3 package

sudo apt-get remove python3.5

plus it's dependent packages

sudo apt-get remove --auto-remove python3.5

plus configuration and/or data files of python3

sudo apt-get purge python3.5

@cpmpercussion
cpmpercussion / short_report.tex
Created January 15, 2020 23:57
A LaTeX template for short student reports
% LaTeX Template for short student reports.
% Citations should be in bibtex format and go in references.bib
\documentclass[a4paper, 11pt]{article}
\usepackage[top=3cm, bottom=3cm, left = 2cm, right = 2cm]{geometry}
\geometry{a4paper}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage{graphicx}
\usepackage{amsmath,amssymb}
\usepackage{bm}
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active July 26, 2024 06:54
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9