Skip to content

Instantly share code, notes, and snippets.

View wjx0912's full-sized avatar
🌴
On vacation

wjx0912

🌴
On vacation
View GitHub Profile
@lvxianchao
lvxianchao / npm.taobao.sh
Last active October 26, 2025 09:55
设置 npm 和 yarn 的镜像源为淘宝镜像源
# ==========================================================
# NPM
# ==========================================================
npm set registry https://registry.npmmirror.com # 注册模块镜像
npm set disturl https://npmmirror.com/mirrors/node # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像
@fwaeytens
fwaeytens / frida-trace.txt
Created December 1, 2019 18:27
Frida-trace
C:\Python27\Scripts>frida-trace.exe -i "CreateFile*" notepad.exe
Instrumenting functions...
CreateFileMappingFromApp: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\KERNELBASE.dll\\CreateFileMappingFromApp.js"
CreateFile2: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\KERNELBASE.dll\\CreateFile2.js"
CreateFileA: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\KERNELBASE.dll\\CreateFileA.js"
CreateFileMapping2: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\KERNELBASE.dll\\CreateFileMapping2.js"
CreateFileW: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\KERNELBASE.dll\\CreateFileW.js"
CreateFileMappingW: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\KERNELBASE.dll\\CreateFileMappingW.js"
CreateFileMappingNumaW: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\KERNELBASE.dll\\CreateFileMappingNumaW.js"
CreateFileMoniker: Loaded handler at "C:\\Python27\\Scripts\\__handlers__\\ole32.dll\\CreateFileMoniker.js"
@Mefistophell
Mefistophell / RUST.MD
Last active August 29, 2025 16:15
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]
@gwsu2008
gwsu2008 / jenkins-approve-script.groory
Created June 3, 2020 06:13
jenkins-approve-script.groory
import java.lang.reflect.*;
import jenkins.model.Jenkins;
import jenkins.model.*;
import org.jenkinsci.plugins.scriptsecurity.scripts.*;
import org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.*;
scriptApproval = ScriptApproval.get()
alreadyApproved = new HashSet<>(Arrays.asList(scriptApproval.getApprovedSignatures()))
import jenkins.model.*
instance = Jenkins.getInstance()
globalNodeProperties = instance.getGlobalNodeProperties()
envVarsNodePropertyList = globalNodeProperties.getAll(hudson.slaves.EnvironmentVariablesNodeProperty.class)
newEnvVarsNodeProperty = null
envVars = null
if ( envVarsNodePropertyList == null || envVarsNodePropertyList.size() == 0 ) {
newEnvVarsNodeProperty = new hudson.slaves.EnvironmentVariablesNodeProperty();