2013年12月4日 星期三

[Apple] iTunes 11 刪除 PDF 書籍

iTunes11 開始,書籍便獨立成一個 iBook APP,筆者遇到一個小 Bug,就是無法移除 iTunes 上的 PDF 書籍,研究之後有了結果, 首先開啟 OSX 的 iBook,然後點選上方工具列的[檔案]-[從iTunes搬移書籍]。 所以現在會看到 iBook 和 iTunes 的書籍顯示是一模一樣的,以後就是在 iBook 管理書籍,在 iTunes 上做同步的動作。

2013年11月27日 星期三

LACP - Extreme Summit X430 and HP Procuve 2610


實體環境設定

Extreme X430 的 Port 22,24 要連到 HP 2610 的 Port 5,6



Extreme:

#enable sharing 24 grouping 22, 24 algorithm address-based L2 lacp


HP:
#configure terminal
#trunk 5-6 trk1 lacp
#vlan XXX
#untag trk1


設定完成後

Extreme:

#show lacp

LACP Up                             : Yes
LACP Enabled                        : Yes
System MAC                          : 00:04:96:xx:xx:xx
LACP PDUs dropped on non-LACP ports : 1500

Lag        Actor    Actor   Partner            Partner  Partner  Agg   
           Sys-Pri  Key     MAC                Sys-Pri  Key      Count 
--------------------------------------------------------------------------------
24             0    0x0400  00:1f:28:xx:xx:xx  60032    0x0035   2
================================================================================

# show sharing
Load Sharing Monitor
Config    Current    Agg       Ld Share    Ld Share  Agg   Link    Link Up
Master    Master     Control   Algorithm   Group     Mbr   State   Transitions
==============================================================================
    24     22        LACP      L2          22         Y      A       23
                               L2          24         Y      A       20
==============================================================================
Link State: A-Active, D-Disabled, R-Ready, NP-Port not present, L-Loopback
Load Sharing Algorithm: (L2) Layer 2 address based, (L3) Layer 3 address based
                        (L3_L4) Layer 3 address and Layer 4 port based
Number of load sharing trunks: 1


HP:

# show lacp

                           LACP

   PORT   LACP      TRUNK     PORT      LACP      LACP
   NUMB   ENABLED   GROUP     STATUS    PARTNER   STATUS
   ----   -------   -------   -------   -------   -------
   5      Active    Trk1      Up        Yes       Success
   6      Active    Trk1      Up        Yes       Success

#show trunks

 Load Balancing

  Port | Name                             Type      | Group Type 
  ---- + -------------------------------- --------- + ----- -----
  5    | 4F6(409)                         10/100TX  | Trk1  LACP 
  6    | 4F5(403)                         10/100TX  | Trk1  LACP




# show vlans ports trk1

 Status and Counters - VLAN Information - for ports Trk1

  VLAN ID Name                 | Status     Voice Jumbo
  ------- -------------------- + ---------- ----- -----

  XXX    V_XXX                | Port-based No    No  

2013年8月6日 星期二

在 CentOS 6.4 安裝 OpenVAS



筆者最先在 CentOS 5.9 上安裝,安裝完成後使用瀏覽器無法連線,然後檢查出 9392 PORT並沒有任何服務上網查了一下解決辦法須執行下列指令,但是非常地不穩,索性就換成 CentOS 6.4,以下為安裝步驟。

#gsad --port 9392 -f -v --http-only 
  1. 安裝最小化的 CentOS 6.4
  2. 關掉 selinux and eth 開機啟動
  3. 安裝 wget
    #yum install wget
  4. Configure Atomicorp Repository
    #wget -q -O - http://www.atomicorp.com/installers/atomic |sh
  5. 安裝openvas ,執行openvas-setup後,因為下載定義檔需要一段時間,請耐心等候。
    #yum install openvas
    #openvas-setup
    Step 1: Update NVT's
    Step 2: Configure GSAD
    The Greenbone Security Assistant is a Web Based front end
    for managing scans. By default it is configured to only allow
    connections from localhost.
    
    Allow connections from any IP? [Default: yes]
    Stopping greenbone-security-assistant:                     [  OK  ]
    Starting greenbone-security-assistant:                     [  OK  ]
    
    Step 3: Choose the GSAD admin users password.
    The admin user is used to configure accounts,
    Update NVT's manually, and manage roles.
    
    Enter administrator username [Default: admin] :
    Enter Administrator Password:
    Verify Administrator Password:
    ad   main:MESSAGE:15385:2013-08-06 14h30.58 CST: No rules file provided, the new user will have no restrictions.
    ad   main:MESSAGE:15385:2013-08-06 14h30.58 CST: User admin has been successfully created.
    
    Step 4: Create a user
    
    Using /var/tmp as a temporary file holder.
    
    Add a new openvassd user
    ---------------------------------
    
    
    Login : user
    Authentication (pass/cert) [pass] :
    Login password :
    Login password (again) :
    
    User rules
    ---------------
    openvassd has a rules system which allows you to restrict the hosts that chyau has the right to test.
    For instance, you may want him to be able to scan his own host only.
    
    Please see the openvas-adduser(8) man page for the rules syntax.
    
    Enter the rules for this user, and hit ctrl-D once you are done:
    (the user can have an empty rules set)
    
    Login             : user
    Password          : ***********
    
    Rules             :
    
    
    
    Is that ok? (y/n) [y]
    Starting openvas-administrator...
    Starting openvas-administrator:
                                                               [  OK  ]
    
    
    Setup complete, you can now access GSAD at:
      https://<IP>:9392
    
    

  6. #/etc/init.d/openvas-administrator start
    #openvas-nvt-sync
    #openvassd restart
    #openvasmd restart
  7. 檢查openvas是否安裝完成
    #wget https://svn.wald.intevation.org/svn/openvas/trunk/tools/openvas-check-#setup -O openvas-check-setup.sh --no-check-certificate
    #chmod +x openvas-check-setup.sh
    #./openvas-check-setup.sh --server
  8. 定期更新定義檔 #vi /etc/crontab
    00 5 * * * root openvas-nvt-sync



Service temporarily down 解決方式
openvas-mkcert -f 
openvas-mkcert-client -i -n 
#restart all daemons

2013年7月23日 星期二

每日自動備份 Fortigate 設定檔


For v5.0,build0252 (GA Patch 5)
首先在 Fortigate上面建立一個名為backup的使用者,密碼為YourPassword,權限設定如下:





















然後在 Linux 建立 sh 並賦予執行權限和建立排程,檔案內容如下:
(範例中的備份伺服器是使用 tftp)

#!/bin/bash
user="backup"
password="YourPassword"
tftp_ip="YourBackupServerIP"
fg_devices="YourFortigateIP"
date="$(date +"%Y%m%d")"
for fg_device in $fg_devices ; do
  expect -c "
  set timeout 30
  spawn ssh $user@$fg_device
  expect \"(yes/no)\" { send \"yes\r\"; exp_continue }
  expect \"*password:*\"
  set send_slow {1 0.05}
  send -s \"$password\r\"
  send_user \"$password\r\"
  expect \"FG*\"
  send -s \"execute backup full-config tftp $fg_device-$date.cfg $tftp_ip\n\"
  expect \"FG*\"
  send -s \"exit\n\"
  interact"
done


2013年7月16日 星期二

Aruba 認證出現問題 "Web Authentication Disabled, Please contact Administrator"

發生原因:
不詳。

解法:
進管理畫面的 clients 選擇 user 然後 disconnect。

2013年7月1日 星期一

解決 FortiAnalyzer-400B 日誌查看停在某一天, 但是LOG檔還是會有紀錄的問題。

在 CLI 執行 #execute sql-local rebuild-db

FortiAnalyzer-~# execute sql-local rebuild-db
Rebuild the whole SQL database has been requested.
This operation will remove the SQL database and rebuild from log data.
This operation will reboot the device.
Do you want to continue? (y/n)


等待重開機,再重新登入後右上會出現 build database 的圖示。

雖說筆者做完之後LOG資料還會存在,但是建議能備份就備份下來。

2013年4月15日 星期一

VMware vSphere 移除 Storage 問題

當使用 vCenter 要移除 iSCSI Storage 時,會出現 No virtual machine resides on the datastore
官網的 Knowledge Base 解決辦法是移除所有的 Snapshot 。
但是筆者移除後還是出現這個訊息,後來就把所有的 Virtual Machine 用 remove from inventory 指令移除後就可以順利把 iSCSI Storage 給 unmount 了。