2023/12/31
2023/12/29
2023/12/23
2023/12/22
2023/12/15
2023/12/10
今天在玩winget
記錄一下在 win11 碰到的問題
內建有安裝但下
winget search notepad 找不到任何東西
要安裝最新版本
https://github.com/microsoft/winget-cli/releases/
目前最新
https://github.com/microsoft/winget-cli/releases/download/v1.6.3133/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle
下載後打開
powersell
add-appxpackage ./下載檔名 才能安裝
直接點二下無法安裝
裝好後無法使用 msstore 資料源
一直出現錯誤
搜尋來源時失敗: msstore
執行命令時,發生意外的錯誤:
0x8a15005e : The server certificate did not match any of the expected values.
winget source reset 也沒用
查了才發現 msstore 憑証有問題 有夠無言
下指令bypass msstore 憑証
winget settings --enable BypassCertificatePinningForMicrosoftStore
或加入以下機碼
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller]
"EnableBypassCertificatePinningForMicrosoftStore"=dword:00000001
winget install 一直跳出 UAC 畫面
安裝 gsudo 解決
winget install gerardog.gsudo
重開几
gsudo winget upgrade --all
或
sudo winget upgrade --all
安裝時還是會跳出 gsudo 的UAC 不過只會跳一次 安裝軟体不會再跳
方便好用的工具
尤其是OS裝完後續安裝軟体
還有更新目前安裝的所有軟体
gsudo winget upgrade --all
winget pin add <package> --version
自動接受安裝合約
--accept-package-agreements
2023/12/08
2023/12/02
2023/11/22
2023/11/19
proxmox 8 安裝後修正apt source 並更新
#!/bin/bash
sed -i '1s/^/#/' /etc/apt/sources.list.d/ceph.list
sed -i '1s/^/#/' /etc/apt/sources.list.d/pve-enterprise.list
echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" >> /etc/apt/sources.list
echo "export http_proxy=http://10.1.1.1:3128" > /root/update
echo "apt-get update" >> /root/update
echo "apt-get upgrade -y" >> /root/update
echo "apt-get autoremove -y --purge" >> /root/update
chmod +x /root/update
/root/update
2023/11/01
2023/10/14
最近nas因為更新發生nfs不能使用的問題
因此暫時把graylog搬到其他台還沒更新的nas上
搬完後發現ES變成red
下指令看一下是那些shards
curl -XGET localhost:9200/_cat/shards|grep UNASSIGNED
index.action 0 r UNASSIGNED
index.do 0 r UNASSIGNED
index.aspx 0 r UNASSIGNED
graylog_159 2 p UNASSIGNED
index.htm 0 r UNASSIGNED
index.py 0 r UNASSIGNED
index.php 0 r UNASSIGNED
index.cgi 0 r UNASSIGNED
index.html 0 r UNASSIGNED
index.cfm 0 r UNASSIGNED
index.pl 0 r UNASSIGNED
index.jsp 0 r UNASSIGNED
index.asp 0 r UNASSIGNED
2023/08/14
2023/08/05
2023/07/06
2023/07/05
2023/07/04
2023/06/12
2023/06/05
2023/05/24
2023/05/05
一直以來都會定時去 graylog 撈 資料
會使用到多個 OR 的下法
accept AND ( 192.168.33.238 OR 192.168.34.215 OR 192.168.33.43 OR 192.168.34.142 OR 192.168.54.247 OR 192.168.7.253 OR 192.168.26.237 OR 192.168.26.228 OR 192.168.25.211 OR 192.168.25.206 OR 192.168.25.117 OR 192.168.26.104 OR 192.168.25.183 OR 192.168.31.241 OR 192.168.30.112 OR 192.168.30.80 OR 192.168.29.6 OR 192.168.29.3 OR 192.168.30.60 OR 192.168.30.58 OR 192.168.29.143 OR 192.168.30.57 OR 192.168.29.223 OR 192.168.29.164 OR 192.168.29.84 OR 192.168.30.200 OR 192.168.30.32 OR 192.168.29.29 OR 192.168.29.199 OR 192.168.29.205 OR 192.168.29.210 OR 192.168.29.200 OR 192.168.29.234 OR 192.168.30.220 OR 192.168.30.194 OR 192.168.29.83 OR 192.168.29.4 OR 192.168.30.108 OR 192.168.29.177 OR 192.168.29.107 OR 192.168.29.32 OR 192.168.30.33 OR 192.168.30.173 OR 192.168.30.247 OR 192.168.30.122 OR 192.168.30.55 OR 192.168.29.19 OR 192.168.29.10 OR 192.168.30.123 OR 192.168.30.201 OR 192.168.29.253 OR 192.168.30.85 OR 192.168.29.48 OR 192.168.30.37 OR 192.168.30.66 OR 192.168.9.100 OR 192.168.30.163 OR 192.168.30.114 OR 192.168.30.59 OR 192.168.30.199 OR 192.168.30.227 OR 192.168.30.41 OR 192.168.29.246 OR 192.168.29.161 OR 192.168.74.248 OR 192.168.74.12 OR 192.168.10.111 OR 192.168.10.104 OR 192.168.50.154 OR 192.168.52.1 OR 192.168.52.3 OR 192.168.50.243 OR 192.168.50.220 OR 192.168.50.179 OR 192.168.50.99 OR 192.168.50.138 OR 192.168.50.98 OR 192.168.50.182 OR 192.168.50.206 OR 192.168.50.234 )
但今天使用同樣的語法
While retrieving data for this widget, the following error(s) occurred:
OpenSearch exception [type=too_many_nested_clauses, reason=Query contains too many nested clauses; maxClauseCount is set to 1024].
問了bing
要修改 /etc/opensearch/opensearch.yml
加上
indices.query.bool.max_clause_count: 10240
2023/05/03
2023/04/21
2023/04/20
2023/04/14
為了因應centos 7 EOS
今天在轉移程式到 almalinux 9 時 mutt 一直無法寄信
mail server 的log如下
Apr 14 10:09:09 mail postfix/smtpd[523701]: connect from unknown[10.0.0.1]
Apr 14 10:09:09 mail postfix/smtpd[523701]: lost connection after STARTTLS from unknown[10.0.0.1]
看來almalinux 9的mutt 預設會使用 STARTTLS
在 .muttrc 加上以下這行
set ssl_force_tls = no
目前寄信正常了
20240308 後記
轉換到新mail server後 有些mutt又出現不能寄信的狀況
以下是log
Mar 8 06:13:01 mail postfix/smtpd[27212]: warning: TLS library problem: error:0A000126:SSL routines::unexpected eof while reading:ssl/record/rec_layer_s3.c:320:
Mar 8 06:13:01 mail postfix/smtpd[27212]: lost connection after STARTTLS from unknown[10.0.0.1]
2023/04/09
2023/03/02
使用curl 撈取 loki 資料的語法
依需求需要更改之處
job="abc"
查詢的關鍵字 192.168.1.2
查詢的區間
curl -G -s "http://10.0.0.1:3100/loki/api/v1/query_range" --data-urlencode 'query={job="abc"} |~ "192.168.1.2"' --data-urlencode "start=$(date -u +'%Y-%m-%dT%H:%M:%SZ' -d '-8 hour')" --data-urlencode "end=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
curl -G -s "http://10.0.0.1:3100/loki/api/v1/query_range" --data-urlencode 'query={job="abc"} |~ "192.168.1.2"' --data-urlencode "start=$(date -u +'%Y-%m-%dT%H:%M:%SZ' -d '-7 day')" --data-urlencode "end=$(date -u +'%Y-%m-%dT%H:%M:%SZ')"|jq
2023/02/28
今天早上三點多開始收到ntopng的告警
進主几看了一下 process不見了
重開也沒用
看了一下log
ntopng果然有更新
更新後起不來
接下來看ntopng的log
發現本次更新後必須使用到 libbpf.so.0
Feb 28 08:09:17 W-ntopng-ubuntu-2004 ntopng[3247]: /usr/bin/ntopng: error while loading shared libraries: libbpf.so.0: cannot open shared object file: No such file or directory
Feb 28 08:09:22 W-ntopng-ubuntu-2004 ntopng[3272]: /usr/bin/ntopng: error while loading shared libraries: libbpf.so.0: cannot open shared object file: No such file or directory
Feb 28 08:09:28 W-ntopng-ubuntu-2004 ntopng[3294]: /usr/bin/ntopng: error while loading shared libraries: libbpf.so.0: cannot open shared object file: No such file or directory
apt install libbpf0
目前正常了 再觀察看看
2023/02/22
2023/02/13
今天早上要進ntop管理介面的時候
打完帳號密碼登不進去
進os看了一下HD滿了
然後再看log
出現一堆如下的訊息 把HD塞爆了
Feb 13 08:14:29 W-ntopng ntopng[286]: 13/Feb/2023 08:14:29 [SQLiteAlertStore.cpp:151] ERROR: SQL Error: database disk image is malformed
Feb 13 08:14:29 W-ntopng ntopng[286]: INSERT INTO flow_alerts (alert_id, interface_id, tstamp, tstamp_end, severity, ip_version, cli_ip, srv_ip, cli_port, srv_port, vlan_id, is_cli_attacker, is_cli_victim, is_srv_attacker, is_srv_victim, proto, l7_proto, l7_master_proto, l7_cat, cli_name, srv_name, cli_country, srv_country, cli_blacklisted, srv_blacklisted, cli_location, srv_location, cli2srv_bytes, srv2cli_bytes, cli2srv_pkts, srv2cli_pkts, first_seen, community_id, score, flow_risk_bitmap, alerts_map, cli_host_pool_id, srv_host_pool_id, cli_network, srv_network, probe_ip, input_snmp, output_snmp, json, info) VALUES (26, 3, 1676247257, 1676247266, 3, 4, '192.168.40.66', '192.168.0.65', 44983, 80, 0, 0, 0, 0, 0, 6, 7, 0, 5, '', '', '', '', 0, 0, 0, 0, 126, 120, 2, 2, 1676247257, '1:rj5vzKw7WQX8TONTQ++bh3BkBh8=', 10, 70368744177664, X'04000000', 0, 0, 65535, 65535, '0.0.0.0', 0, 0, '{"ntopng.key":12345678,"hash_entry_id":23456789,"alert_generation": {"script_key":"ndpi_unidirectional_traffic","subdir":"flow","flow_risk_info":"{\"46\":\"No client to server traffic\"}"},"proto": {"http": {},"confidence":0}}', '');
google了一下是 sqllite 因為斷電導致有問題
果然
斷一次電事情一堆
看是有recovery sqlite的方法
算了
直接倒回事發前一天晚上的備分好了
倒回後目前正常
再觀察看看
https://blog.csdn.net/wolfking0608/article/details/71076588