Flag | Description |
---|---|
-v | Verbose Mode |
-x | Safe Mode |
-s | Single User Mode |
-no-zp | Zone Postponing (use if hanging) |
cpus=1 | Single CPU Core Mode |
-f | No Kext Cache Mode (use if hanging) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LOGPATH=/var/log/v2ray/ | |
TIME=`date +"%Y%m%d %H:%M"` | |
MAXLOGDAY=20 | |
cd $LOGPATH | |
# split logs | |
tar -zcf ${TIME}.log.tgz *.log | |
cat /dev/null > error.log | |
cat /dev/null > access.log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Better work with oh-my-pwsh | |
# Put below content into $PROFILE | |
function su-fun {Start-Process powershell -Verb runAs -argumentlist '-NoExit', "cd '$pwd';", "$args"} | |
set-alias su su-fun | |
set-alias sudo su-fun | |
$env:PYTHONIOENCODING="utf-8" | |
# Remove curl alias | |
If (Test-Path Alias:curl) {Remove-Item Alias:curl} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import plistlib | |
from shutil import copyfile | |
files = ["/Volumes/EFI/EFI/OC/Kexts/VirtualSMC.kext/Contents/Info.plist", | |
"/Volumes/EFI/EFI/OC/Kexts/FakeSMC.kext/Contents/Info.plist"] | |
idProduct = 9486 | |
idVendor = 16700 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
DISKS=($(diskutil list | grep -i efi | grep -o "disk[0-9]s[0-9]")) | |
for disk in $DISKS; do | |
echo "正在挂载 $disk..." | |
sudo diskutil mount $disk | |
done | |
open /Volumes |
https/http 协议的执行:
# 设置 http 代理
git config --global https.proxy http://127.0.0.1:8080
# 或 socks5 代理
git config --global http.proxy socks5h://127.0.0.1:1080
# 取消代理
git config --global --unset http.proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
API_KEY="" # 这里填入 sm.ms 的 API key | |
for item in "$@"; do | |
curl -s -X POST \ | |
-F "smfile=@${item}" \ | |
-H "Content-Type: multipart/form-data" \ | |
-H "Authorization: ${API_KEY}" \ | |
https://smms.app/api/v2/upload \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# user, host, full path, and time/date on two lines for easier vgrepping | |
function hg_prompt_info { | |
if (( $+commands[hg] )) && grep -q "prompt" ~/.hgrc; then | |
hg prompt --angle-brackets "\ | |
<hg:%{$fg[magenta]%}<branch>%{$reset_color%}><:%{$fg[magenta]%}<bookmark>%{$reset_color%}>\ | |
</%{$fg[yellow]%}<tags|%{$reset_color%}, %{$fg[yellow]%}>%{$reset_color%}>\ | |
%{$fg[red]%}<status|modified|unknown><update>%{$reset_color%}< | |
patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset_color%})|pre_unapplied(%{$fg_bold[black]%})|post_unapplied(%{$reset_color%})>>" 2>/dev/null | |
fi | |
} |
转自——使用root跳过小米USB安装应用确认(续) | LeadroyaL's website
最近又抓来一台小米手机当测试机,部署环境时候发现了新的 usb 相关功能的修改方式。
众所周知,小米手机开启 USB 安装功能,需要插入 SIM 卡登陆、需要登小米账号。我这台手机已root,懒得登陆了,就准备通过修改文件的方式来开启相关功能,还真做到了。 关键词:root,无需 xposed,无需 frida。 测试环境:miui9、miui10、miui11、miui12。