[Unix] tcpdump 數據包剖析器指令指南
Intro Wikipedia – tcpdump MAN PAGE OF TCPDUMP 用法 $ tcpdump -i [interface] ‘[expression]’ $ tcpdump -i en0 ‘tcp && host www.yidas.com’ # No interface flag is equal to any $ tcpdump -i any ‘port 22’ tcpdump Expression Manual
網頁開發知識 | Web-Dev Blog
Intro Wikipedia – tcpdump MAN PAGE OF TCPDUMP 用法 $ tcpdump -i [interface] ‘[expression]’ $ tcpdump -i en0 ‘tcp && host www.yidas.com’ # No interface flag is equal to any $ tcpdump -i any ‘port 22’ tcpdump Expression Manual
Intro 現今大多 Unix/Linux(包含Mac OS),預設.bashrc會自動引入.bash_aliases: # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases […]
Intro Wiki – 分頁Swap 常見的應用情境如開發環境要做套件安裝如PHP Composer,則可以利用暫時設定檔案Swap的方式解決。 基本用法 查看Swap狀態: swapon -s 卸載Swap: # Partition swapoff /dev/hdb2 # File swapoff /swapfile 透過Partition分割 透過檔案增加 主要透過swapon與swapoff指令來操作設定分頁,利用實體所在硬碟分割區中的檔案提供Swap。 先建立一個想要配給Swap容量的檔案於硬碟分割區,可以透過fallocate指令: fallocate -l 2G /swapfile 格式化此檔案為Swap file: chmod 600 /swapfile mkswap /swapfile swapon /swapfile 確認查看或設定自動掛載 完成後可以使用swapon -s指令確認查看,另外如要自動掛載則可以於/etc/fstab加入設定: /swapfile […]
Intro RFC4252 – The Secure Shell (SSH) Authentication Protocol SSH – OpenBSD manual page server ssh_config — OpenSSH SSH client configuration files ssh $ ssh user@host.com ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] […]
Intro ps (process status) pstree 通用 $ ps aux Grep應用: $ ps aux | grep php $ ps aux | egrep “php|PID” $ ps aux | { head -1; grep “php”;} head & tail $ ps aux | head -n […]
Intro Ubuntu Desktop Grub2 Menu /etc/default/grub: 設為最後一次記憶開機區 # Modify GRUB_DEFAULT=saved # Add GRUB_SAVEDEFAULT=true 指定開機區 # Modify GRUB_DEFAULT=”Windows NT/2000/XP (loader) (on /dev/sda1)” 名稱可從 `grep menuentry /boot/grub/grub.cfg~ 查找 最後Restart: $ sudo update-grub Display Scale $ sudo apt install gnome-tweak-tool $ gnome-tweaks IME […]
Intro Postfix Wiki Postfix為目前主要Linux底層送信軟體,如mail, sendmail (PHP mail底層)也都是基於Postfix發信。 本篇為純送信Mail Server指南,OS環境為Ubuntu 16.04。 Postfix – Ubuntu (Dovecot SASL) 快速安裝檔 安裝 $ sudo apt install postfix 設定 (Interactive) $ sudo dpkg-reconfigure postfix 或者直接對應設定檔:/etc/postfix/main.cf 基本設定完後,就已經完成基本寄信Relay Server,預設無驗證僅採用mynetworks allowed host。 驗證 Postfix需搭配SASL驗證(對應OS系統使用者帳密),預設使用Cyrus SASL、可選用Dovecot SASL,雖然本篇是純粹寄信(SMTP)不做收信(POP3/IMAP)理當用Dovecot有點多餘,但Dovecot SASL整合個人覺得較方便。 Dovecot SASL […]
Intro Logical Volume Manager (Linux) 雖然個人不喜用LVM來管理硬碟,但遇上使用LVM的機器還是得適應。 PV基本操作 搜尋PV硬碟 pvscan $ pvscan 顯示PV狀態 pvdisplay $ pvdisplay 建立PV pvcreate $ pvcreate /dev/sdb $ pvcreate /dev/sdb{1,2,3} 移除PV pvremove $ pvremove /dev/sdb VG基本操作 vgscan 搜尋VG $ vgscan vgdisplay 顯示系統VG狀態 $ vgdisplay vgcreate 建立VG $ […]
Intro Proxmox Concepts USB安裝 Storage – 硬碟&OS ISO Datacenter > Storage可以指定內容包括Disk image、ISO image複合選擇,如要新增Storage則可以自行在系統分割mount出一個資料夾給PVE新增: Datacenter > Storage > Add > Directory 系統mount範例:mkfs.ext4 /dev/sdb /mnt/hdd; mount /dev/sdb /mnt/hdd; (建議設fstab) ID: 自行取名,如hdd Directory: 對應系統資料夾位置,如/mnt/hdd Content: 套用的內容,如用於存放ISO或者Disk image PVE官方文件 – Storage: Directory 新增上傳OS ISO […]
Intro SSH的個人連線設定檔使用~/.ssh/config管理較為方便且是針對Host個別套用(如Git)。 設定 檔案:~/.ssh/config 使用:針對設定的Host別名快速連線:ssh host-alias-name 設定檔規範 Host alias-name HostName server.name Port port-number IdentitiesOnly yes IdentityFile ~/.ssh/private_ssh_file User username-on-remote-machine 設定範例 Host server.com Hostname 36.200.190.110 User nick_tsai Host gitlab Hostname gitlab.com IdentitiesOnly yes IdentityFile ~/pem/my-gitlab.pem Port 22 User nick Host alias1 […]