2026/10/10

今天在升pve kernel時才發現很多guest都出現如下的問題
EFI disk 憑証 2026/6 就過期了
解決方法有說明
但因為做完要關几再開几
所以必須找適合的時間處理




2026/10/08

今天在升級 splunk時又出現以下問題

rpm -Uhv splunk-10.6.0.5-86587d4e3b27.x86_64.rpm
warning: splunk-10.6.0.5-86587d4e3b27.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID b3cd4420: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
verify that this sytem has all the commands we will require to perform the preflight step
This looks like an upgrade of an existing Splunk Server. Checking to see what component we are installing
extracting splunk_preinstall_base64 into splunk/bin directory
Cannot initialize: /opt/splunk/etc/system/metadata/local.meta: Permission denied
Cannot initialize: /opt/splunk/etc/apps/learned/metadata/local.meta: Permission denied
Currently configured KVStore database path="/opt/splunk/var/lib/splunk/kvstore"

-> Version file="/opt/splunk/var/run/splunk/kvstore_upgrade/versionFile70" does not exists or not accessible!
Failed to open file! Error=Permission denied

最近好几次有碰到同樣的狀況
搞了半天
最後用最簡單粗暴的方式解決
chmod -R 777 /opt/splunk/

再跑一次安裝就好了

2026/10/05

有user最近几天一直有大流量
但目前只能看到目的ip 無法知道是什麼程式造成
寫個bat 定時排程記錄
如果再發生有log可以查

@echo off
:: 取得年月日
set "yy=%date:~0,4%"
set "mm=%date:~5,2%"
set "dd=%date:~8,2%"

:: 取得時分秒
set "hh=%time:~0,2%"
set "min=%time:~3,2%"
set "ss=%time:~6,2%"

:: 如果小時小於 10(前面有空格),補 0
if "%hh:~0,1%"==" " set "hh=0%hh:~1,1%"

set "dt=%yy%%mm%%dd%_%hh%%min%%ss%"

echo 當前時間檔名:%dt%
tcpvcon.exe -a -c -n > "%dt%.csv"

2026/10/03

之前如果要打包並執行都會使用7z 再轉成執行檔
後來找了 bandizip 感覺方便許多

最近又發現 bat to exe
可以把所有需要的檔案一次打包並執行寫好的批次檔
重點是使用這個方式
就不用怕被看到原始碼了 

有個問題 很容易被M$誤判


2026/09/30

最近Novell ldap 換成AD

apache設定修改如下

舊

<Directory /var/www/test>
    AuthName ldap
    AuthType Basic
    AuthBasicProvider ldap
    AuthLDAPURL ldap://test.tw:389/o=users?cn?sub?(objectClass=*)
    AuthLDAPBindDN "cn=test01, ou=vendor, ou=people, o=users"
    AuthLDAPBindPassword passwd
    Require valid-user
</Directory>


新
<Directory /var/www/test>
    AuthName ldap
    AuthType Basic
    AuthBasicProvider ldap
    AuthLDAPURL ldap://test.tw:389/OU=user,DC=nkuht,DC=local?sAMAccountName?sub?(objectClass=*)
    AuthLDAPBindDN "test01@test.local"
    AuthLDAPBindPassword passwd
    Require valid-user
</Directory>



2026/09/26

之前討論怎麼把shell編譯成執行檔
這次來討論python
一般有二個方式 pyintaller 或 nuitka
先講 nuitka

安裝
pip install nuitka
執行需要 patchelf
sudo apt install  patchelf

再來就可以直接用了

python3 -m nuitka --standalone test.py

產生二個目錄

test.build
test.distt

執行檔在

test.distt 裡的 test.bin


2026/09/22

#!/bin/bash

刪除每次還原前系統自動建立的快照

for i in `echo "passwd"|sudo -S timeshift --list|grep Before|awk '{print $3}'`
do
        echo "passwd"|sudo -S timeshift --delete --snapshot "$i"
done

還原最後一份版本的快照

id=$(echo "passwd"|sudo -S timeshift --list|grep -v Before|tail -n 2|head -n 1|awk '{print $3}')

echo "passwd"|sudo -S timeshift --restore --snapshot "$id" --scripted


btrfs 不會自動重開几 會等到下次重開几才生效
rsync 還原後會自動馬上重開

 #!/bin/bash


/usr/bin/VBoxManage snapshot win11 restore 20260918

/usr/bin/VBoxManage startvm win11