Skip to content

Instantly share code, notes, and snippets.

@ted423
ted423 / tarxz.sh
Created November 4, 2025 06:04
tarxz.sh
#!/bin/bash
if [ "$#" -gt 0 ]; then
# 获取最后一个参数,参数放在前面,要打包的路径放在最后
allarg="$*"
last_arg="${!#}"
if [[ "$last_arg" == "." || "$last_arg" == ".." ]]; then
echo "请勿打包 . .. 目录,会导致产生的压缩文件被打包,造成问题"
exit 1
fi
target_dir=$(dirname "${!#}")
@ted423
ted423 / getPCmonitorSN.bat
Created November 4, 2025 06:34
getPCmonitorSN.bat
@echo off
setlocal enabledelayedexpansion
chcp 65001 >nul
REM bat default is ANSI(gbk) set to utf-8
echo 脚本很可能需要管理员权限才能获取显示器SN
where pwsh >nul 2>nul
if %errorlevel% equ 0 (
echo "use PowerShell 7(pwsh)"
@ted423
ted423 / disBitlocker.bat
Created November 4, 2025 06:35
disBitlocker.bat
@echo off
setlocal enabledelayedexpansion
REM 遍历所有可能的盘符
for %%D in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
REM 检查盘符是否存在
if exist %%D:\ (
echo -------------------------------
echo [%date% %time%] 检查 %%D:\