Compare commits

...

3 Commits

Author SHA1 Message Date
leimingsheng
455b1509e5 Merge branch 'main' of 121.36.59.21:Marcin/work_sript 2025-04-07 18:51:00 +08:00
leimingsheng
daa30910c5 feat(auto_work : obsidian_sync)备份obsidian同步脚本 2025-04-07 18:48:47 +08:00
leimingsheng
78a17a2843 fix (master : nicsensor)修复tmp112的读数时对数位取值的问题 2024-12-31 10:25:44 +08:00
3 changed files with 31 additions and 1 deletions

3
02.nicsensor/nicsensor.sh Executable file → Normal file

@ -937,7 +937,8 @@ convert_tmp112_data(){
dec_val=$(echo "ibase=16; $upper_hex_value" | bc)
binary_number=$(echo "ibase=16;obase=2;$upper_hex_value" | bc)
last_digit=$(echo $binary_number | cut -c 16)
bin_length=$(echo $binary_number | awk '{print length($0)}')
last_digit=$(echo $binary_number | cut -c $bin_length)
if [ $last_digit -eq 0 ];then
temp=$(echo "scale=4; $dec_val / 16 * 0.0625" | bc)
elif [ $last_digit -eq 1];then

@ -0,0 +1,9 @@
@echo off
::配置Obsidian workspace地址
set obsidian_path="D:\Files\3.SelfLerning\Marcin's_Repo"
::切换目录到 Obsidian workspace下
D:
cd %obsidian_path%
::先拉取远端更新
git pull

@ -0,0 +1,20 @@
@echo off
::配置Obsidian workspace地址
set obsidian_path="D:\Files\3.SelfLerning\Marcin's_Repo"
::切换目录到 Obsidian workspace下
D:
cd %obsidian_path%
::判断是否有更新并将更新同步到远端仓库
for /f "delims=" %%a in ('git status --porcelain') do (
set HAS_CHANGES=1
goto end_loop
)
:end_loop
if defined HAS_CHANGES (
git add -A
git commit -m "Daily Sync from workbook"
git push origin main
) else (
echo Git has no changes.
)