Skip to content

Instantly share code, notes, and snippets.

View n-WN's full-sized avatar
:shipit:
~DevSecOps~ AI infra

Zoee n-WN

:shipit:
~DevSecOps~ AI infra
View GitHub Profile
@n-WN
n-WN / mi_flash_all_platform.sh
Created April 28, 2025 07:02
mi_flash_all_platform
#!/bin/bash
# 检查产品是否匹配
fastboot getvar product 2>&1 | grep -E "^product: *gauguin" || { echo "Mismatch image and device"; exit 1; }
# 刷写镜像
fastboot flash super "$(dirname "$0")/images/super.img" || { echo "Flash super error"; exit 1; }
fastboot flash cust "$(dirname "$0")/images/cust.img" || { echo "Flash cust error"; exit 1; }
# 擦除和刷写其他镜像
#/bin/bash
declare -a remote_dirs=("sdcard/inshot/"
"sdcard/DCIM/"
"sdcard/Pictures/"
"sdcard/Download"
"sdcard/Movies/")
bak=bak_$(date +"%Y%m%d-%H%M%S")
for dir in "${remote_dirs[@]}"
@n-WN
n-WN / push_commits_by_chunks.sh
Created February 2, 2022 15:09 — forked from Sacristan/push_commits_by_chunks.sh
Push commits by chunks
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=10
# check if the branch exists on the remote
# if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# # if so, only push the commits that are not on the remote already
# range=$REMOTE/$BRANCH..HEAD
# else
# # else push all the commits