Skip to content

Instantly share code, notes, and snippets.

View ayanamist's full-sized avatar

ayanamist ayanamist

View GitHub Profile
@ayanamist
ayanamist / miui_system_apps_url.md
Last active February 8, 2024 14:27
MIUI系统应用在应用商店的url

电脑上打不开,必须要用MIUI系统打开,会跳转到商店对应页面

@Ruffo324
Ruffo324 / Hyper-V PCI-Passthroug.ps1
Last active May 2, 2024 16:56
Hyper-V PCIe passthrough CheatSheet
# Change to name of TARGET-VM.
$vm='CHANGE_ME'
# Change to PCI device location (💡 Location).
$Location = 'CHANGE_ME'
# Enable CPU features.
Set-VM -GuestControlledCacheTypes $true -VMName $vm
# Host-Shutdown rule must be changed for the VM.
Set-VM -Name $vm -AutomaticStopAction TurnOff
@acolyer
acolyer / service-checklist.md
Last active January 30, 2024 17:39
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@derrickorama
derrickorama / make-cert-and-pk.md
Last active April 17, 2024 23:10
Extracting certs/private keys from certificates that disable private key exporting

Situation

  • I have to use a Windows client to install a certificate (say via the Magnum PKI Client)
  • I cannot export the private key for this certificate
  • I am a Linux user that needs to have the cert and private key

Solution (steps)

Install/export certificate using Windows VM

@oasisfeng
oasisfeng / master-key-patch.java
Last active December 19, 2015 17:39
Xposed module to patch Master-Key security vulnerability.
package com.oasisfeng.security.masterkeypatch;
import java.lang.reflect.Field;
import java.util.LinkedHashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import android.util.Log;
import de.robv.android.xposed.IXposedHookLoadPackage;
git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" > changes.patch
@shime
shime / _readme.md
Last active November 8, 2020 08:54 — forked from ryin/tmux_local_install.sh
installation script for tmux 1.9a

Having trouble installing the latest stable version of tmux?

I know, official package for your OS/distro is outdated and you just want the newest version of tmux.

Well, this script should save you some time with that.

Prerequisities

  • gcc
@greensea
greensea / OpenVPN-2.2.2-obfs.patch
Last active March 22, 2023 09:17
The obfs patch obsfucate OpenVPN traffic, make it looks like random traffic. The obfs patch add two options for OpenVPN. --obfs-salt <string> is a secret to generate the input XOR stream. To enable the obfs patch, this options must be set. --obfs-padlen <num> is a positive integer max to 255. This option tells obfs patch to padding random conten…
--- openvpn-2.2.2.orig/options.c 2011-12-14 00:58:56.000000000 +0800
+++ openvpn-2.2.2/options.c 2012-12-21 10:44:57.683130505 +0800
@@ -54,6 +54,10 @@
#include "memdbg.h"
+extern char* _socket_obfs_salt;
+extern int _socket_obfs_salt_len;
+extern int _socket_obfs_padlen;
+
@neekey
neekey / gist-blog-browser-js-error-catch-summary.md
Last active July 31, 2020 10:14
浏览器错误捕捉总结

捕捉浏览器中的JS运行时错误,主要通过监听window.onerror来实现。但是对于不同的脚本执行方式以及不同的浏览器,能捕获到的信息会有区别。

window.onerror 讲接收3个参数:

  • msg:错误描述,比如:a is not defined
  • url:出错脚本所在的url
  • lineNumber:出错脚本的行数

本文将对不同浏览器和不同的脚本执行方式进行测试,并总结这些区别。

@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8