[POSIX][Command] Linux 常用情境指令集
Intro POSIX (可移植作業系統介面) – Wikipedia POSIX 定義指令列表 (List of POSIX commands) – Wikipedia HD capacity – 硬碟容量相關 df – 列出本機硬碟使用情況 $ df # 指定掛載點 (Mounted on) $ df / # 自動換算顯示合適容量單位 (-h=/1024 | -H=/1000) $ df -h $df -H # […]
網頁開發知識 | Web-Dev Blog
Intro POSIX (可移植作業系統介面) – Wikipedia POSIX 定義指令列表 (List of POSIX commands) – Wikipedia HD capacity – 硬碟容量相關 df – 列出本機硬碟使用情況 $ df # 指定掛載點 (Mounted on) $ df / # 自動換算顯示合適容量單位 (-h=/1024 | -H=/1000) $ df -h $df -H # […]
Intro 可以利用/etc/pam.d/下檔案的 hook 效果去觸發執行外部 Shell script file,而 Shell 中去抓取登入者資訊並寄送 email,以達到 SSH Login 自動發信通知 作法 先撰寫建立好 Shell script file 作為發送信件程式: $ vim /etc/ssh/login-notify.sh #!/bin/sh # Change these two lines: sender="sender-address@example.com" recepient="notify-address@example.org" if [ "$PAM_TYPE" != "close_session" ]; then host="`hostname`" subject="SSH Login: […]
Image: Build | Tag | Commit | Pull/Push | Docker File | Compose File Container: Run Cheat Sheet | dockerlabs Command-line interfaces (CLIs) from Docker Docs: Docker CLI Docker compose CLI Daemon (dockerd) CLI CLI Auto-completion: MacOS – How to […]
Intro Docker – Wikipedia Docker 官方網站 Docker Documentation Concept – 概念 Difference between VM vs Docker Docker overview | Docker Documentation Quick Start Guides – Get started | Docker Documentation Docker 指令集 | 指令速查表 – YIDAS Code PHP and Nginx […]
Intro Kubernetes – Wikipedia Kubernetes Documentation Kubernetes,簡稱 K8s,是一個開源平台,用來自動化部署、擴展以及管理容器化應用程式。最初由 Google 開發,現在由 Cloud Native Computing Foundation (CNCF) 維護,已經成為容器編排的業界標準。 隨著應用程式越來越複雜,手動管理容器變得非常麻煩。K8s 提供了一些強大的功能,讓運維和開發更輕鬆: 自動排程 (Scheduling):智慧地把容器放到資源最優的節點上 自我修復 (Self-Healing):當容器或節點出問題時,K8s 會自動重啟、重新排程或替換 動態擴展 (Scaling):根據流量需求自動增減容器 服務發現 & 負載平衡 (Service Discovery & Load Balancing):自動為容器提供穩定的存取點並分流流量 宣告式管理 (Declarative Configuration):只要用 YAML/JSON 定義好「想要的狀態」,K8s 會自動幫你達成 Key […]
Intro Server使用工具:OpenSSH 設定SFTP服務主要會限制User僅限使用SFTP以及路徑限制。 安裝與設定 設定/etc/ssh/sshd_config: # 開啟internal-sftp Subsystem,將會限制僅使用SFTP而非SSH (反註解原本設定) Subsystem sftp internal-sftp 在設定Match條件,可以使用group為條件: Match group sftp_only ChrootDirectory /home/%u X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp 設定完成並重啟服務後,新增user至指定group(範例為sftp_only),並將ChrootDirectory(範例為/home/%u)目錄所有者設定為root,即能使user登入SFTP 應用上,可另外加設定Match條件,ChrootDirectory也可以設定固定為如/srv,使用者即不需要家目錄 進階 使用者與群組指令 # 新增群組 groupadd sftp_only # 新增使用者,如為固定ChrootDirectory則可不設家目錄-m useradd -s /bin/false -G sftp_only username […]