Skip to content

Instantly share code, notes, and snippets.

View pexcn's full-sized avatar
🇹🇼

Sing Yu Chan pexcn

🇹🇼
  • Earth ⇄ Venus
  • Cantonia, West Taiwan
View GitHub Profile

Windows 和 macOS 共享蓝牙配对信息

  1. 将设备与 Windows 配对
  2. 重新启动并将设备与 macOS 配对
  3. 打开 "钥匙串访问", 搜索 "bluetooth" 并找到对应的条目
  4. 打开条目,显示密码,提取 plist
  5. 重启使用 SYSTEM 权限打开 Windows 注册表,定位到 HKLM\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\网卡MAC地址\设备地址
  6. 按照以下键值对的对应关系,使用注册表的导入和导出功能修改,最后重启系统

| macOS 键 | Windows 键 | 排序 |

@pexcn
pexcn / README.md
Created August 22, 2024 06:33 — forked from Mnkai/README.md
TDP and turbo parameter modification with MSR on non-overclockable Intel CPU (such as Intel i7-8550U)

TDP and Turbo Parameter Modification with MSR on Non-Overclockable CPUs

Disclaimer

  • Modifying MSR may void your CPU's (or system board's) warranty. Proceed with caution. I am not responsible for any damage caused by this article.
  • MSR addresses vary significantly between CPUs. Check your CPU's MSR address using Intel's documentation.
  • This has only been tested on the Intel i7-8550U (Kaby Lake R).
  • This article is a translation of this article. If you can read Korean, I recommend reading that article instead.

Introduction

@pexcn
pexcn / qcom-ipq60xx-cpxx.dts
Created October 3, 2023 17:02 — forked from macromorgan/qcom-ipq60xx-cpxx.dts
Xiaomi AX1800 Device Tree
/dts-v1/;
/ {
MP_256;
model = "Qualcomm Technologies, Inc. IPQ6018/AP-CP02-C1";
compatible = "qcom,ipq6018-cp02", "qcom,ipq6018";
qcom,msm-id = <0x192 0x00>;
#address-cells = <0x02>;
#size-cells = <0x02>;
interrupt-parent = <0x01>;
@pexcn
pexcn / upload-github-release-asset.sh
Created November 7, 2022 02:26 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
#!/usr/bin/env bash
CIPHERS='ALL:eNULL'
DELAY=${2:-0.1}
SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]}
MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}')
echo Using $(openssl version).
declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites )
@pexcn
pexcn / microsoft_edge_uninstaller_21h1_ltsc.bat
Created May 28, 2022 16:35 — forked from ishad0w/microsoft_edge_uninstaller_21h1_ltsc.bat
Microsoft Edge Uninstaller [Windows 10 LTSC 2021/21H1 Edition]
@echo off
@title Microsoft Edge Uninstaller [Windows 10 LTSC 2021/21H1 Edition]
ver
echo+
goto check_admin_permissions
:check_admin_permissions
echo Script must Run as Administrator! Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
@pexcn
pexcn / monthly-timer.sh
Created January 19, 2022 03:08
Run script monthly on systemd.
#!/bin/bash
cat << EOF > /etc/systemd/system/monthly.timer
[Unit]
Description=Run script monthly
[Timer]
OnCalendar=*-*-01 02:00:00
[Install]

Unpack Android system.new.dat.br

pacman -S brotli p7zip
curl -L -o /usr/local/bin/sdat2img.py https://github.com/xpirt/sdat2img/raw/master/sdat2img.py && chmod +x sdat2img.py

brotli -d system.new.dat.br
sdat2img.py system.transfer.list system.new.dat system.img
7z -y -bsp0 -bso0 x system.img

Fix magisk stock backup does not exist

# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
@pexcn
pexcn / git-wrap-gitlens.bat
Last active May 25, 2021 15:52
Use msys2 git on vscode
@echo off
setlocal
rem https://github.com/eamodio/vscode-gitlens/issues/965#issuecomment-734013893
set PATH=%~dp0usr\bin;%PATH%
:loop
if "%~1" equ "rev-parse" goto rev_parse
shift