2025年2月17日 星期一

Debain 12 安裝執行 bandersnatch

安裝
apt install -y pip
pip install bandersnatch --break-system-packages

產生 /etc/bandersnatch.conf 設定檔
bandersnatch mirror

修改 /etc/bandersnatch.conf 設定檔

執行同步
bandersnatch mirror

2025年2月16日 星期日

APT-Cacher 設定

安裝
apt install -y apt-cacher 

編輯 /etc/apt-cacher/apt-cacher.conf
allowed_hosts = 192.168.0.0/16
allowed_hosts = * 

distinct_namespaces = 1

相關目錄
/var/cache/apt-cacher

相關指令
systemctl status apt-cacher.service    

使用端設定
編輯 /etc/apt/apt.conf.d/90-apt-proxy.conf  加入
Acquire::http::Proxy "http://<apt-cacher-host>:3142";
Acquire::https::Proxy "http://<apt-cacher-host>:3142";
Acquire::HTTPS::proxy "DIRECT";

2025年2月3日 星期一

Debian 12 X window 浮水印應用 activate-linux

安裝環境設定
apt install git gcc libconfig-dev libcairo2-dev libxi-dev libx11-dev x11proto-core-dev x11proto-dev \
libxt-dev libxext-dev libxfixes-dev libxinerama-dev libxrandr-dev libwayland-dev wayland-protocols libpango1.0-dev 

安裝
git clone https://github.com/MrGlockenspiel/activate-linux
cd activate-linux/
make
make install 

執行
export DISPLAY=:0.0;
/usr/local/bin/activate-linux

統計檔案內數值

cat data.txt |grep . |paste -sd+  | bc

cat data.txt
1
2
3
4
5
6

Linux sh PS下隱藏參數(Hidden)

參考  https://github.com/scriptzteam/Hidden

Debian 12 安裝 Clamav

安裝
sudo apt install -y clamav clamav-daemon clamtk

相關服務
clamav-daemon
clamav-daemon.socket
clamav-freshclam

相關設定檔案及目錄
/var/lib/clamav
/var/log/clamav
/etc/clamav/freshclam.conf
/etc/clamav/clamd.conf
~/.clamtk/db/freshclam.conf

病毒碼 更新 Proxy
編輯  /etc/freshclam.conf  加入
# Proxy settings
# Default: disabled
#HTTPProxyServer myproxy.com
#HTTPProxyPort 1234
#HTTPProxyUsername myusername
#HTTPProxyPassword mypass
# If your servers are behind a firewall/proxy which applies User-Agent
# filtering you can use this option to force the use of a different

# User-Agent header.
# Default: clamav/version_number
#HTTPUserAgent SomeUserAgentIdString

HTTPProxyServer 192.168.2.4
HTTPProxyPort 3128

手動更新病毒碼

freshclam

手動下載病毒碼
wget --user-agent='CVDUPDATE/0' https://database.clamav.net/main.cvd https://database.clamav.net/daily.cvd https://database.clamav.net/bytecode.cvd

手動掃描
clamscan /path/to/directory
clamscan -r --remove /path/to/directory
clamscan -r --bell -i /path/to/directory

Debian 12 安裝 nginx reverse stream proxy

安裝
apt install -y nginx libnginx-mod-stream

編輯 /etc/nginx/nginx.conf 加入
stream {
    server {
        listen 3389;
        proxy_pass 10.10.10.10:3389;
    }
}

stream {
    server {
        listen 443;
        proxy_pass admin;
    }

    upstream admin {
        server 10.10.10.10:443;
    }
}