Skip to content

Instantly share code, notes, and snippets.

View wangjiezhe's full-sized avatar
🏠
Working from home

Jiezhe Wang wangjiezhe

🏠
Working from home
View GitHub Profile
@wangjiezhe
wangjiezhe / AdGuardHome.yaml
Last active September 19, 2024 09:07
搭建 DNS 服务器,在车机上安装软件
dns:
rewrites:
- domain: dzsms.gwm.com.cn
answer: **.**.**.**
diff --git a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs
index 515473fbabc..fa3c6875964 100644
--- a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs
+++ b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs
@@ -15,8 +15,8 @@ pub fn target() -> Target {
options: TargetOptions {
abi: "abi64".into(),
// NOTE(mips64r2) matches C toolchain
- cpu: "mips64r2".into(),
- features: "+mips64r2,+xgot".into(),
timeout 5
default 0
showmenu 1
title Gentoo
kernel /dev/fs/ext2@wd0/vmlinuz-6.6.37-gentoo
args console=tty root=/dev/sda3
# /etc/fstab: static file system information.
#
# See the manpage fstab(5) for more information.
#
# NOTE: The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# NOTE: Even though we list ext4 as the type here, it will work with ext2/ext3
# filesystems. This just tells the kernel to use the ext4 driver.
#
@wangjiezhe
wangjiezhe / config
Last active July 15, 2024 13:09
Kernel configuration for Lemote YeeLoong 8089D
#
# Automatically generated file; DO NOT EDIT.
# Linux/mips 6.6.38-gentoo Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="mips64el-unknown-linux-gnuabi64-gcc (Gentoo 14.1.1_p20240622 p3) 14.1.1 20240622"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=140101
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24200
@wangjiezhe
wangjiezhe / geo.Caddyfile
Last active September 19, 2024 10:24
Reverse proxy for Google Map using caddy.
geo.domain.ltd {
# cert setting missing
handle /vt/* {
reverse_proxy mt0.google.com mt1.google.com mt2.google.com mt3.google.com {
header_up Host {upstream_hostport}
}
}
handle {
respond 404
}
@wangjiezhe
wangjiezhe / config.yml
Created June 7, 2024 14:00
Reverse proxy for Docker Hub using docker and caddy.
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
delete:
@wangjiezhe
wangjiezhe / train.py
Last active July 12, 2024 13:07
Accelerating Inference in TensorFlow with TensorRT User Guide https://docs.nvidia.com/deeplearning/frameworks/tf-trt-user-guide/index.html
import tensorflow as tf
from tensorflow import keras
# Define a simple sequential model
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(10)
])
@wangjiezhe
wangjiezhe / nvidia_pcibusid.cc
Last active December 31, 2023 11:20
Get PCI Bus ID for Nvidia GPU. Compiled and run by `nvcc -arch=sm_89 nvidia_pcibusid.cc -o nvidia_pcibusid -lcuda -run`
#include <iostream>
#include <cuda_runtime.h>
#include <cuda.h>
int main() {
CUresult cuResult;
cuInit(0);
int deviceCount;
cuResult = cuDeviceGetCount(&deviceCount);
@wangjiezhe
wangjiezhe / hyper-v.cmd
Created November 18, 2023 01:08
在 Windows 家庭版上安装 Hyper-V
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL