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 / omz setup.md
Last active October 25, 2021 12:02
oh-my-zsh setup instruction
@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 / CMakeLists.txt
Last active March 1, 2021 02:48 — forked from baiwfg2/CMakeLists.txt
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@mightbxg
mightbxg / FastCorner.cpp
Created March 25, 2021 03:32
FAST corner detector using Halide
#include "Halide.h"
#include <halide_benchmark.h>
#include <halide_image_io.h>
#include <iostream>
using namespace Halide;
using namespace std;
int main(int argc, char** argv)
{
@mightbxg
mightbxg / pacman.conf
Created July 19, 2021 04:02 — forked from emilydelorme/pacman.conf
My personnal pacman.conf using wget
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
@mightbxg
mightbxg / onnxruntimeConfig.cmake
Last active July 30, 2021 07:07
ONNX Runtime CMake config file, put it to share/cmake/onnxruntime, see https://github.com/microsoft/onnxruntime/issues/3124#issuecomment-676239644
# This will define the following variables:
# onnxruntime_FOUND -- True if the system has the onnxruntime library
# onnxruntime_INCLUDE_DIRS -- The include directories for onnxruntime
# onnxruntime_LIBRARIES -- Libraries to link against
# onnxruntime_CXX_FLAGS -- Additional (required) compiler flags
include(FindPackageHandleStandardArgs)
# Assume we are in <install-prefix>/share/cmake/onnxruntime/onnxruntimeConfig.cmake
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
@mightbxg
mightbxg / bdd_extract_images_for_hfnet.py
Created August 23, 2021 07:02
extract bdd images for hfnet training
#!/usr/bin/env python
import json
import tqdm
from pathlib import Path
import shutil
def load_night_and_dawn_list(fn):
print('loading night&dawn image list from', fn)
fns_night = []
@mightbxg
mightbxg / sshexec.py
Last active August 27, 2021 08:30
Execute remote command via SSH
#!/usr/bin/env python3
import argparse
import paramiko
def try_connect(host, user, password) -> bool:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
ssh.connect(host, username=user, password=password)
@mightbxg
mightbxg / notify-after.py
Created August 27, 2021 09:56
Notify remotely after running local command
#!/usr/bin/env python3
# prerequisites:
# - sshexec.py
# - notify-send package on remote mechine
import argparse
import sshexec
import getpass
import subprocess
@mightbxg
mightbxg / ftp.py
Created September 6, 2021 09:11
simple ftp server
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# @file ftp.py
# @brief ftp.py
# @version V1.0
# @author Nick.Liao
# @date 2017-10-18
#