1 2 3 4 5 6 > 下一頁 | 最後一頁 1/6
檢視方式: 列表 摘要
How to disable "RESEND" warning in firefox (reload網頁時如何避免firefox出現警告訊息)
allanh 在天空部落發表於11:27:50 | 未分類
昨天寫java script遇到一個問題
當使用者按下網頁(opener)表單中的一個按鈕後,
我們必須彈出一個小視窗(top) 提示使用者目前程式的進度表

當程式跑完就會出現finish的訊息, 此時也會去重新整理opener的頁面
而重新整理的語法我是這樣寫的
opener.location.reload();
這語法雖然可以跑, 但是firefox會彈出一個resend的警告對話框
如下面這個網頁(php方法)所示,
www.ajaxray.com/blog/2008/01/12/how-to-avoid-postdata-resend-warning/

最簡單的方法是直接重導到另一個網頁, 但在我的網頁中有許多參數是需要一起送過去的
但如果直接重導, 我的參數們就會被鬼隱掉了orz
因此, 我的解法方法是需要搭配其他語言(c, php, asp..etc)
先利用DOM的特性去將opener的表單直接submit, 再用另一支程式去接參數
java script實作的部份如下


觀看全文...
IPv6 Multicast Forwarding with XORP on ubuntu 9.04
allanh 在天空部落發表於14:51:40 | XORP

1. 什麼是 XORP?
    XORP是一個extensible open source的路由平台, 可用來當作cisco或juniper一種低成本路由器替代方案.目前xorp支援大多數IPv4及IPv6的路由協議, 如OSPF, RIP, BGP, OLSR, VRRP, PIM, IGMP(Multicast)等, 並藉由模組化的設計, 能夠更快速地引進新的網路協議, 特性或功能.在官網也有相當豐富的參考文件可參閱, 包含xorp的程式架構與使用手冊, 可協助開發人員更加容易地去修改或新增所需之功能.

2. XORP支援的作業系統為:
  * DragonFlyBSD
  * FreeBSD
  * NetBSD
  * OpenBSD
  * Mac OS X ???
  * Linux (x86-32, x86-64, Sparc)
   更多的資訊請參閱原始碼的 xorp/BUILD_NOTES 這檔案



觀看全文...
Using a Shell Script to set Up IPv6 features in Linux (利用shell script來設定ipv6參數)
allanh 在天空部落發表於11:26:42 | ubuntu

在Linux中, IPv6相關的參數都可以在/proc設定
其相關說明可參考
Linux IPv6 Howtoip-sysctl.txt(英文)

Q1: 要如何知道目前系統上有哪些IPv6參數呢?
A:   因為linux各版本所擁有的參數不太一樣, 可利用下列指令先行確認
  ls /proc/sys/net/ipv6/conf/all
Q2: 若是要查看目前IPv6變數的值為何? 該下什麼指令呢?
A:   介面名稱可以像是all, default, eth0, eth1, rl0..., 參數名稱可由Q1的指令得知
    cat /proc/sys/net/ipv6/conf/介面名稱/參數名稱
Q3: 想查看每一個ipv6參數的值, 但每個都要cat會不會太辛苦呢?
A: 嗯 若是能下一道指令就能列出所有的ipv6參數, 應該會省事許多,






觀看全文...
Serial Console Setup on Ubuntu 9.04
allanh 在天空部落發表於16:46:18 | ubuntu

ubuntu上面設定Serial console相當容易, 可參考Serial Console Howto.
我的設定方法如下:

 

 

 

 


1.
檢查是否有tty裝置

dmesg | grep tty

 

[ 0.000000] console [tty0] enabled

 

[ 0.775445] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

 

[ 0.775529] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A

 

[ 0.775780] 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

 

[ 0.775894] 00:07: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A


2.
到/etc/event.d目錄下, 檢查 ttyS0 這個檔案是否存在

cd /etc/event.d
ls


3. 如果ttyS0存在則跳過這一步驟, 若不存在請先複製tty1的設定來建立ttyS0

cp tty1 ttyS0


3. 編輯ttyS0的內容, 特別是最下面那二行

vi ttyS0

# tty1 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
exec /sbin/getty -L  9600 ttyS0 vt100


4.
重新開機後, 就可以用RS-232來測試serial console是否正確

reboot


註: 在ubuntu 9.04這樣設定就可以了, 其他套裝版本(如Fedora, suse)請參閱相關說明文件, 或 linux serial console howto



Compile ubuntu kernel with IPv6 (讓ubuntu支援IPv6)
allanh 在天空部落發表於12:56:48 | ubuntu
本文將簡單地敘述如何重新編譯ubuntu核心, 使其能支援更完整的IPv6功能
網路上已有許多重編核心的
範例,  所以在這只會針對IPv6的部份多加描述喔:)
[測試環境]
OS: Ubuntu 9.04 (安裝好的版本是2.6.18-11)
kernel: linux-2.6.32

1. 更新套件清單
aptitude update

2.
安裝核心編譯所需之套件, 以及其他會用到的套件
aptitude  install debhelper kernel-package libncurses5-dev libncurses5 \ 
build-essential bin86 fakeroot  bison flex indent ipsec-tools traceroute

3. 下載linux-2.6.32至任一目錄 (建議可以去義守大學伺服器下載)
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.tar.bz2

4. 解壓縮並建立核心原始碼目錄的symbolic link
tar xjf linux-2.6.32.tar.bz2
ln -s linux-2.6.32 linux

5. 到核心原始碼目錄下, 複製現有的核心設定檔做為預設設定檔
cd /usr/src/linux
cp /boot/config-`uname -r` ./.config

6. 依據個人需求來設定核心
(在這也提供我所使用的config檔)
make menuconfig
所有的IPv6選項都要選, “Virtualization”不要編進核心


觀看全文...
XORP 目前支援的通訊協定
allanh 在天空部落發表於17:02:11 | XORP
參考文件 xorp.ct/README

* RIP and RIPng:
    - RFC 2453 (RIP version 2)
    - RFC 2082 (RIP-2 MD5 Authentication)
    - RFC 2080 (RIPng for IPv6)

  * BGP4:
   - RFC 4271 (A Border Gateway Protocol 4 (BGP-4))
   - RFC 3392 (Capabilities Advertisement with BGP-4)
   - RFC 4760 (Multiprotocol Extensions for BGP-4)
   - RFC 2545 (Use of BGP-4 Multiprotocol Extensions for IPv6 Inter-Domain
              Routing)
   - RFC 1997 (BGP Communities Attribute)
   - RFC 2796 (BGP Route Reflection - An Alternative to Full Mesh IBGP)
   - RFC 3065 (Autonomous System Confederations for BGP)
   - RFC 2439 (BGP Route Flap Damping)
   - RFC 4893 (BGP Support for Four-octet AS Number Space)
   - RFC 1657 (Definitions of Managed Objects for the Fourth Version
              of the Border Gateway Protocol (BGP-4) using SMIv2)

  * OSPFv2:
   - RFC 2328 (OSPF Version 2)
   - RFC 3101 (The OSPF Not-So-Stubby Area (NSSA) Option)

  * OSPFv3:
   - draft-ietf-ospf-ospfv3-update-14.txt (OSPF for IPv6)

  * PIM-SM:
    - draft-ietf-pim-sm-v2-new-11.{ps,txt}
    - draft-ietf-pim-sm-bsr-03.{ps,txt}

  * IGMP v1, v2, and v3:
    - RFC 2236 (Internet Group Management Protocol, Version 2)
    - RFC 3376 (Internet Group Management Protocol, Version 3)

  * MLD v1 and v2:
    - RFC 2710 (Multicast Listener Discovery (MLD) for IPv6)
    - RFC 3810 (Multicast Listener Discovery Version 2 (MLDv2) for IPv6)

  * VRRP v2:
    - RFC 3768 (Virtual Router Redundancy Protocol (VRRP))



XORP中的multicast問題
allanh 在天空部落發表於10:40:56 | XORP
今天在弄xorp的ipv6 multicast routing的部份,
目的是要讓router能返回一個Packet Too Big的封包..

環境配置:
OS: ubuntu 9.04+xorp.ct
tool: Self-test-5.0.0

縮寫:
TN: Testing Node
NUT: Node Under Test
MTU: Maximum Transmission Unit

測試程序如下...

1. 執行xorp
2. TN 對 NUT發出mld 來建立multicast group
3. TN 傳送一個multicast packet 給NUT, 測試是否能轉送
4. 將NUT的網路介面mtu更改成1280
5. TN再傳送一個大小為1500的multicast packet 給NUT, 測試是否能回傳packet too big訊息

結果, NUT並沒有回傳packet too big訊息, 封包也沒有轉送出去....

--解決方案--


觀看全文...
ubuntu 開機忽略disk ckeck
allanh 在天空部落發表於16:52:15 | ubuntu
今天要做開機自動取得ipv6位址的測試, 我是用TAHI的Self-test-5.0來測
但我發現一個問題, 就是在連續開關機幾次後, grub開機時會檢查disk
結果還沒檢查完, 測試程式以為收不到封包就給我個NG :(

去查了一下/etc/fstab部份, 修改最後一個fsck參數可以忽略掉開機檢查檔案系統的步驟

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
        /                              /               ext3    relatime,errors=remount-ro 0       0

設成0就是不檢查的意思

grep: include/linux/compile.h: No such file or directory
allanh 在天空部落發表於17:41:59 | ubuntu
今天在ubuntu-9.04 (kernel版本為linux-2.6.29) 上 rebuild kernel時出現下面這問題,

grep: include/linux/compile.h: No such file or directory

問了一下google大神, 結果在debian的bug回報找到解決方法~

1. 檢查kernel-package版本
    apt-cache policy kernel-package     

2. 若版本是11.x 則需要手動修改才能編譯2.6.33+的核心,

原文如下
This is an issue with kernel-package (<12.032) when building kernel v2.6.33+. The kernel filesystem hierarchy has changed to separate generated header files from repository header files.
The debian bug report is here -> http://bugs.debian.org/cgi-bi/bugreport.cgi?bug=561569 Don't use those patches though as Karmic's kernel-package is 11.015 and those reports refer to 12.031. You can use the attached patch on Karmic's kernel-package (in /usr/share/kernel-package). But first save the originals (this is what the patch operates against).

3. 解決方法有2種, 其1是抓最新版本的kernel-package, 解壓縮, 編譯, 安裝
wget https://launchpad.net/ubuntu/maverick/+source/kernel-package/12.033/+files/kernel-package_12.033.tar.gz

tar -zxvf kernel-package_12.033
cd kernel-package-12.033
fakeroot debian/rules binary
cd ..
dpkg -i kernel-package_12.033_all.deb

再重編一次kernel就過了

第二種方法是直接去改程式碼, 請點內文觀看



觀看全文...
NetBSD pkgsrc
allanh 在天空部落發表於10:54:59 | 未分類
http://www.netbsd.org/docs/pkgsrc/

pkgsrc是NetBSD安裝套件的工具

目前我比較常直接用編譯的方法來裝套件

編譯方式其實很簡單

cd /usr/pkgsrc/套件目錄
make
make install
make clean
make clean-depends

不過我用的是NetBSD 1.6.1..版本太老舊有些無法從FTP取得
所以手動下載套件編譯需要的檔案..
例如 perl-5.6.1.tar.gz
下載後把這個檔案移到 /usr/pkgsrc/distfiles/
然後再重覆make 的動作就可以了

1 2 3 4 5 6 > 下一頁 | 最後一頁 1/6
檢視行動版網頁  |  檢視正常版網頁
系統公告
個人檔案
個人圖檔
ID:allanh
暱稱:ンアハ
地區:臺北縣

熱情贊助
文章分類
allanh的最近文章發表
yam今日我最殺
人氣指數
當日人次:
累積人次:
我推薦誰
誰推薦我
誰來我家
自由欄位
RSS 訂閱
其它資訊
本部落所刊登之內容,皆由作者個人所提供,不代表 yam 天空部落 本身立場。
POWERED BY
POWERED BY 天空部落
會員登入免費註冊