Skip to content

Instantly share code, notes, and snippets.

View BH1SCW's full-sized avatar

F.J Kong BH1SCW

View GitHub Profile
@BH1SCW
BH1SCW / gist:6d8480f85ec8e796c3fa3d81f8e1133c
Created April 28, 2022 06:24 — forked from kwilczynski/gist:dc69ed5acb27a19ec1e29914895d7666
Install lei for kernel development using lore directly on Ubuntu
apt install -y vim
apt install -y wget
apt install -y sqlite3 (used by a test, not needed for the build to complete)
apt install -y curl
apt install -y git
apt install -y build-essential
apt install -y pkg-config
@BH1SCW
BH1SCW / gist:94d4f43c62cdc4a6f57066e4e274472b
Created April 12, 2022 01:52 — forked from Cyan4973/gist:5b835641c134b8d6e7c3
Takayuki's Streaming example 2 (simplified)
// LZ4 streaming API example 2 (ring buffer)
#define _CRT_SECURE_NO_WARNINGS // for MSVC
#include "lz4.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@BH1SCW
BH1SCW / Uninstall-pkg.md
Created March 25, 2022 14:43 — forked from githubutilities/Uninstall-pkg.md
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
@BH1SCW
BH1SCW / gist:aa038b889dd10d8c24b4bb6647fe835d
Created January 17, 2022 09:54 — forked from brandonros/gist:9086f20135233b1fcf10212cc0830d31
OBD-II data/parameter identifier groups to log for ECU tuning
1. general (rpm, speed, gear, time)
2. engine load (actual + target)
3. torque (actual + target)
4. accelerator pedal angle
5. throttle body angle
6. boost (actual + target)
7. wastegate duty cycle
8. fuel trims (short term)
9. fuel pressure (low + high)
10. ignition timing (all cylinders + average)
#!/usr/bin/env bash
# --slave /usr/bin/$1 $1 /usr/bin/$1-\${version} \\
function register_clang_version {
local version=$1
local priority=$2
update-alternatives \
--install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${version} ${priority} \
@BH1SCW
BH1SCW / clash.service
Created December 19, 2021 14:39 — forked from akillcool/clash.service
clash auto start and update subcribe configuration
# edit and save this file to /usr/lib/systemd/system/clash.service
[Unit]
Description=clash
After=network.target
[Service]
WorkingDirectory="your home directory"/.config/clash
ExecStart="your home directory"/.config/clash/start-clash.sh
ExecStop="your home directory"/.config/clash/stop-clash.sh
Environment="HOME=your home directory"
@BH1SCW
BH1SCW / ctags_with_dep.sh
Created September 6, 2021 07:57 — forked from xuhdev/ctags_with_dep.sh
Generate ctags file for C or C++ files and its depedencies (included header files). This could avoid you to always generate a huge tags file.
#!/bin/sh
# https://www.topbug.net/blog/2012/03/17/generate-ctags-files-for-c-slash-c-plus-plus-source-files-and-all-of-their-included-header-files/
# ./ctags_with_dep.sh file1.c file2.c ... to generate a tags file for these files.
gcc -M "$@" | sed -e 's/[\\ ]/\n/g' | \
sed -e '/^$/d' -e '/\.o:[ \t]*$/d' | \
ctags -L - --c++-kinds=+p --fields=+iaS --extra=+q
@BH1SCW
BH1SCW / things-to-fantastical.applescript
Created September 2, 2021 07:03 — forked from IskenHuang/things-to-fantastical.applescript
Things3 complete todos create calendar event to fantastical.
(*
## Goal
This script is make new calendar event to fantastical2 from things3 complete todos in 'Logbook' on specified date.
## How to use:
* Default is today
* `$ osascript things-to-fantastical.applescript`
* The specified date
* `$ osascript things-to-fantastical.applescript 2017/08/12`
*)
@BH1SCW
BH1SCW / mosh-agent-forwarding-ng.rb
Created August 21, 2021 06:36 — forked from snixon/mosh-agent-forwarding-ng.rb
Homebrew Formula: mosh with agent forwarding
require "formula"
class MobileShell < Formula
desc "Remote terminal application"
homepage "https://mosh.mit.edu/"
url "https://mosh.mit.edu/mosh-1.2.5.tar.gz"
sha256 "1af809e5d747c333a852fbf7acdbf4d354dc4bbc2839e3afe5cf798190074be3"
bottle do
sha256 "046b0c48cd1c573d57500e683122e3152a00556ad960938c6caa962b0c2ef460" => :el_capitan
@BH1SCW
BH1SCW / patch-edid.md
Created August 10, 2021 01:19 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):