2010年5月24日

增加 Linux 的路徑

增加 /sbin 目錄至現行路徑 (path)

PATH="$PATH":/sbin

2010年5月21日

[鳥] 宣傳 ECFA


今天經過內湖的中油麗 X 街加油站,發現怎麼那麼多旗子,仔細一看才發現是鳥宣傳,一直喊虧損,油價一定要調漲,老百姓多付的錢,就花在這上面


謎之手 XD

2010年5月19日

Cisco switch port mirror (2924 / 3750) 實作方式

----- Cisco 3750 -----
情境:將 f0/5 port mirror 到 f0/6

en
conf t
monitor session 1 source int f0/5
monitor session 1 destination int f0/6


上面的 1 為 session 代號,可為 1 - 66

查看 mirror 狀態
sh monitor session 1

----- Cisco 2924 -----
情境 : 將 f0/5 port mirror 到 f0/6 (直接進入 destination port, 再把要偵測的 port 流量導入)

en
conf t
int f0/6
port monitor f0/5


查看 mirror 狀態
sh port monitor

P.S 以上均可設定多 port mirror 至同一個 destination port, 也可設定單 port mirror 到多個 destination

這樣就可以把有安裝抓封包軟體的電腦接在 switch 的 destination port 上來 monitor source port 的狀態了,利用 Linux 文字模式抓封包程序可參照 Linux 環境下,利用Wireshark或Tcpdump擷取封包

2010年3月23日

如何避免 Apache 網站的目錄內容顯示出來

環境:CentOS with Apache/2.2.3

cd /etc/httpd/conf
vim httpd.conf

找尋下面這段文字,並把 Indexes 刪除
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None Order allow,deny
Allow from all
</Directory>

如下
<Directory "/var/www/html">
Options FollowSymLinks
AllowOverride None Order allow,deny
Allow from all
</Directory>

存檔

重起服務
service httpd restart

測試應該就會出現
Forbidden
You don't have permission to access /hello/image on this server.

收工~

2009年12月23日

在 Windows 開機完畢後,自動執行 VirtualBox 並開啟 VM

1. 建立 virtual.bat,內容如下
@ECHO OFF
"D:\Program Files\Sun\xVM VirtualBox\VirtualBox.exe" -startvm ubuntu

其中 ubuntu 是 VirtualBox 裡面 VM 的名稱

2. 將此 bat 檔放入 "程式集" 的 "啟動" 中