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
@pexcn
pexcn / patch-rtc.py
Last active September 15, 2015 09:49 — forked from Lekensteyn/patch-rtc.py
Script to patch an Android recovery.img file, changing the qcom,qpnp-rtc-write Device Tree property (tested with an Android 5.1 image based on kernel 3.4 for a Nexus 5 (rev_11)).
#!/usr/bin/env python
"""
Patch a recovery image to enable RTC writing
Unfortunately it has not the intended effect (tested from recovery):
~ # /system/xbin/hwclock -w
hwclock: RTC_SET_TIME: Operation not permitted
<3>[ 25.821247] spmi_pmic_arb fc4cf000.qcom,spmi: pmic_arb_wait_for_done: transaction denied (0x5)
<3>[ 25.821338] qcom,qpnp-rtc qpnp-rtc-ee162000: SPMI write failed
@pexcn
pexcn / java_extract.bat
Created September 5, 2018 13:31 — forked from milolav/java_extract.bat
Batch file to extract portable version of java jre or jdk from installer
@echo off
rem Batch file that extracts java from installer
rem Original topic on stackoverflow:
rem http://stackoverflow.com/questions/1619662/how-can-i-get-the-latest-jre-jdk-as-a-zip-file-rather-than-exe-or-msi-installe
setlocal
if [%1]==[] goto usage
set fn=%~n1
7z.exe e %1 .rsrc\1033\JAVA_CAB10\111
if errorlevel 1 goto err
@pexcn
pexcn / modern_crypto.md
Created April 20, 2021 06:36 — forked from byronhe/modern_crypto.md
现代密码学实践指南[2015年]

现代密码学实践指南[2015年]

标签(空格分隔): 密码学


本文介绍目前现代密码学的最先进技术, 前半部分主要翻译自 《Cryptographic Right Answers》,附上收集的资料,和byron个人的理解。

@pexcn
pexcn / alpine.sh
Created April 21, 2021 16:52 — forked from trimsj/alpine.sh
Converts OpenVZ VPS to Alpine Linux
#!/bin/sh -e
# Converts OpenVZ VPS to Alpine Linux
# WARNING: This script will wipe any data in your VPS!
# GPLv2; Partly based on https://gitlab.com/drizzt/vps2arch
server=http://images.linuxcontainers.org
path=$(wget -O- ${server}/meta/1.0/index-system | \
grep -v edge | awk '-F;' '($1=="alpine" && $3=="amd64") {print $NF}' | tail -1)
cd /
@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 (
#!/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 / 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
@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 / 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