阻擋暴力破解除了防火牆、OTP、MFA 外,還可以安裝 fail2ban 來阻止暴力破解
安裝方式 
apt install fail2ban

helloworld 發表在 痞客邦 留言(0) 人氣()

類似 apache 等 web server 的 rewrite rule 功能
    command:
      - "........"
      - "........"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure" ## force redirect to https
      - "--entrypoints.web.http.redirections.entryPoint.scheme=https"
      - "--entrypoints.web.http.redirections.entrypoint.permanent=true"
      - "--entrypoints.websecure.address=:443"
測試
root@lab:/home/lab# curl -I http://lab.pass.tw/testurl
HTTP/1.1 308 Permanent Redirect
Location: https://lab.pass.tw/testurl
Date: Mon, 19 Dec 2022 08:28:03 GMT
Content-Length: 18
Content-Type: text/plain; charset=utf-8
 

helloworld 發表在 痞客邦 留言(0) 人氣()

以前在 troubleshooting 或是 debug crontab 的時候,習慣會去看一下 /var/mail 下面的郵件
正常的輸出及錯誤訊息都會記錄在郵件裡面
但現在的Linux 預設都沒有安裝MTA
所以如果不想額外安裝或是沒有權限可以安裝的話
可以直接輸出在自訂的log 內

helloworld 發表在 痞客邦 留言(0) 人氣()

image
登入ssh, 檢查調整前硬碟狀況
root@example:~# lsblk
NAME   MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda      8:0    0  80G  0 disk
└─sda1   8:1    0  80G  0 part /

helloworld 發表在 痞客邦 留言(0) 人氣()

adminer 預設 port 為 8080,雖然不是正規的 80,433 
但也很容易跟其他port 衝到
修改方法1,將container 的8080/tcp 對應到 host的 8088/tcp
    ports:
      - 8088/8080

helloworld 發表在 痞客邦 留言(0) 人氣()

# yum install -y yum-utils
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
測試
# docker --version
Docker version 20.10.21, build baeda1f

helloworld 發表在 痞客邦 留言(0) 人氣()

vim 的 visual mode 對有些人可能比較方便
但我就是用不習慣XD
要怎麼關閉呢
vi ~/.viminfo (如果沒有的話,請自行建立)
新增一行 set mouse-=a
或是直接下指令新增
echo "set mouse-=a" >> ~/.vimrc
source ~/.vimrc
 

helloworld 發表在 痞客邦 留言(0) 人氣()

IMG_1721
因為習慣的關係,常會用到insert key 
但是剛拿到華碩的notebook 時,一時不知道該如何是好,insert 鍵到底在哪邊
原來是跟 del 同一個鍵,字超級小
要怎麼按 insert 鍵 : Fn + Shift + Delete
抱怨....好難用...設計華碩鍵盤的人在想什麼

helloworld 發表在 痞客邦 留言(0) 人氣()

搜尋image
# docker search httpd
下載 image
# docker pull httpd

helloworld 發表在 痞客邦 留言(0) 人氣()

1. 下載mysql image
# docker pull mysql:8
2. 查看目前的images 有哪些
# docker images

helloworld 發表在 痞客邦 留言(0) 人氣()

image
windows 內建的zip 解壓縮功能很方便也很直覺
如果沒有其他特殊需求,比如說要解 rar tar 7z 之類的檔案,其實真的可以不用再去下載其他的解壓縮工具
但壓縮成zip檔就沒那麼直覺了
以下是操作範例

helloworld 發表在 痞客邦 留言(0) 人氣()

在批次檔內可以使用 %~dp0 指定工作路徑
但如果要指定網芳上的路徑,則會出現以下錯誤訊息
UNC 路徑不可當作 CMD 目前的目錄
解決方式,改用 pushd
如:
cd /d %~dp0
xxx.exe
yyy.exe

helloworld 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。