Skip to content

Instantly share code, notes, and snippets.

View mightbxg's full-sized avatar

Xinguang Bian mightbxg

  • Nanjing, Jiangsu, China
View GitHub Profile
@mightbxg
mightbxg / font_installation_guide.md
Created May 25, 2022 03:11
How to install fonts on linux

Reference

Download fonts:

  1. nerd-fonts
  2. Sarasa-Gothic (中文)

Installation:

  1. Run mkdir -p ~/.local/share/fonts
  2. Move font files or folders to ~/.local/share/fonts
  3. Reboot or run fc-cache -fv
@mightbxg
mightbxg / install_sogou_on_kubuntu.md
Last active March 12, 2024 02:25
Kubuntu 安装搜狗拼音
@mightbxg
mightbxg / utils.hpp
Last active February 22, 2023 02:54
commonly used utilities in C++
/// @brief String format from OpenCV
inline std::string format(const char* fmt, ...)
{
std::vector<char> buf(1024);
while (true) {
va_list va;
va_start(va, fmt);
int bsize = static_cast<int>(buf.size());
int len = std::vsnprintf(buf.data(), bsize, fmt, va);
va_end(va);
@xaliander
xaliander / NVIDIA_Performance_Counters.md
Last active December 11, 2023 06:54
ERR_NVGPUCTRPERM: Permission issue with Performance Counters

Error

ERR_NVGPUCTRPERM: Permission issue with Performance Counters

Solutions for this issue

NVIDIA has a page that addresses the issue. Unfortunately, the instructions didn't solve the problem for me. However, I found a solution from rameshgunjal in the NVIDIA forums.

Option 1: Running the program as admin

You might have noticed that sudo nv-nsight-cu results in an error. Instead, you have to provide the path: sudo /usr/local/cuda/bin/nv-nsight-cu. The same applies for other applications as well: sudo /usr/local/cuda/bin/nsight-sys.

@mightbxg
mightbxg / git alias.md
Last active October 25, 2021 12:01
commonly used git alias

设置别名:

git config --global alias.%ALIAS% %COMMAND%

显示已设置的别名:

git config --get-regexp alias

常用别名:

@mightbxg
mightbxg / omz setup.md
Last active October 25, 2021 12:02
oh-my-zsh setup instruction
@madkoding
madkoding / pair-dual-boot-bluetooth.md
Last active May 18, 2024 11:25
Pairing bluetooth devices in dual boot with Linux Ubuntu and Windows 10/11

Pairing Bluetooth Devices in Dual Boot with Linux Ubuntu and Windows 10/11

Introduction

This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.

Instructions

1. Pair in Linux First

  • Pair your Bluetooth device in Linux. This is crucial to ensure the LinkKey remains consistent.
  • Note: Do not re-pair the device in Linux after completing the pairing in Windows.
@abel0b
abel0b / install-linux-perf-on-wsl2.sh
Last active May 11, 2024 18:49
Install perf on WSL 2
apt install flex bison
git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1
cd WSL2-Linux-Kernel/tools/perf
make -j8
sudo cp perf /usr/local/bin
@sleepdefic1t
sleepdefic1t / MACOS_CLANG_TIDY.md
Last active May 4, 2024 10:54
brew clang-tidy on macOS
brew install llvm
ln -s "/usr/local/opt/llvm/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "/usr/local/opt/llvm/bin/clang-tidy" "/usr/local/bin/clang-tidy"

use cmake file

  find_program(CLANG_TIDY_BIN clang-tidy)
 find_program(RUN_CLANG_TIDY_BIN /usr/local/Cellar/llvm/10.0.0_3/share/clang/run-clang-tidy.py)
@GuillaumeDua
GuillaumeDua / cpp_legacy_inheritance_vs_std_variant.md
Last active April 18, 2024 10:50
C++ legacy inheritance vs CRTP + std::variant