Skip to content

Instantly share code, notes, and snippets.

View Harry-Chen's full-sized avatar
💤
Sleeping...

Shengqi Chen Harry-Chen

💤
Sleeping...
View GitHub Profile
@Harry-Chen
Harry-Chen / README.md
Last active March 31, 2024 17:23
Port i915 OOT module to Linux 6.6 (TrueNAS SCALE 24.04)

THIS PATCH IS NOT TESTED AND COMES WITH ABSOLUTE NO WARRANTY. USE AT YOUR OWN RISK!

You can use it to install OOT i915 module on Linux 6.6 (e.g. TrueNAS SCALE 24.04).

Most modifications are very dirty fixes to make it compiile.

The following change, especially, is to fix the interaction between KMD and UMD (Intel Media Driver). Otherwise the initialization procedure in userland library iHD_drv_video.so would encounter an error on an ioctl call here.

DISCLAIMER: This change might lead to problems such as GPU hangup, memory leak in kernel or at worst, kernel panic. I owe no responsibility in case of any incidents.

@Harry-Chen
Harry-Chen / README.md
Last active March 28, 2024 07:25
TrueNAS customization after upgrade

Recover apt

#!/bin/bash

mount -o remount,rw /usr

cd /usr/local/bin
mkdir evil_apt
mv apt* dpkg evil_apt/
@Harry-Chen
Harry-Chen / main.py
Created February 27, 2024 12:53
Recover LFS file tree from GitLab object directory (hashed path)
#!/usr/bin/env python3
import sys
import click
import pathlib
import shutil
@click.command()
@click.option('-d', '--delim', default=' - ', help='Delimiter used in the LFS object list')
@click.option('-l', '--level', default=2, type=click.IntRange(0, 31), help='Number of levels in the LFS object tree')
@Harry-Chen
Harry-Chen / README.md
Last active March 13, 2024 13:03
NetBox Docker deployment under sub-directory

Assume your deployment is under /netbox:

Add to configuration/configuration.py

BASE_PATH = environ.get('BASE_PATH', '')

Add to env/netbox.env

@Harry-Chen
Harry-Chen / build-common.sh.patch
Last active March 30, 2022 12:50
Big-endian patch for Arm GNU Toolchain
--- build-common.sh 2021-10-18 11:12:29.000000000 +0800
+++ ../gcc-arm-none-eabi-10.3-2021.10/build-common.sh 2021-12-29 21:25:38.581385064 +0800
@@ -240,9 +240,9 @@
BUILDDIR_NATIVE=$ROOT/build-native
BUILDDIR_MINGW=$ROOT/build-mingw
INSTALLDIR_NATIVE=$ROOT/install-native
-INSTALLDIR_NATIVE_DOC=$ROOT/install-native/share/doc/gcc-arm-none-eabi
+INSTALLDIR_NATIVE_DOC=$ROOT/install-native/share/doc/gcc-armeb-none-eabi
INSTALLDIR_MINGW=$ROOT/install-mingw
-INSTALLDIR_MINGW_DOC=$ROOT/install-mingw/share/doc/gcc-arm-none-eabi
@Harry-Chen
Harry-Chen / build_project.tcl
Created July 17, 2019 05:30
Vivado Tcl Scripts
update_compile_order -fileset sources_1
reset_run impl_1
reset_run synth_1
launch_runs -jobs 2 impl_1 -to_step write_bitstream
wait_on_run impl_1
exit

Keybase proof

I hereby claim:

  • I am Harry-Chen on github.
  • I am harrychen (https://keybase.io/harrychen) on keybase.
  • I have a public key whose fingerprint is F858 3EFA A9A9 1F3A A34B 3C92 CE11 A7B0 7B3A B946

To claim this, I am signing this object:

@Harry-Chen
Harry-Chen / openpgp.txt
Created April 2, 2016 09:43
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:f8583efaa9a91f3aa34b3c92ce11a7b07b3ab946]
@Harry-Chen
Harry-Chen / openpgp.txt
Created April 2, 2016 09:37
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:f8583efaa9a91f3aa34b3c92ce11a7b07b3ab946]
@Harry-Chen
Harry-Chen / openpgp.txt
Created February 15, 2016 16:10
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:f8583efaa9a91f3aa34b3c92ce11a7b07b3ab946]