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 April 20, 2025 16:48
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

@shanselman
shanselman / ohmyposhv3-v2.json
Last active April 25, 2025 05:12
ohmyposhv3-v2
{
"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 April 11, 2025 15:39
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

@gbrow004
gbrow004 / ubuntu-MBP-16.md
Last active March 11, 2025 06:50
Ubuntu on Apple Macbook Pro 16-inch (2019)

Update!

This gist is out of date and I can no longer help much, as I got rid of my Mac.

Please visit T2 Linux website for more and better information:

https://t2linux.org/

Acknowledgements

This gist is just a compilation of the hard work that others have put in. I'm not a software developer, so if there are any mistakes or better ways of doing things, I'd appreciate any suggestions. Here's a list of the real heroes who made this possible:

@zhensongren
zhensongren / uninstall_python3.MD
Last active February 27, 2025 03:38
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}