2011年2月25日 星期五

ubuntu 10.0 4 重設root密碼方法

1. 開機時先進入到GRUB,選擇Recovery Mode後,按 "e" 進入編輯模式
2. 把最後面 "ro single" 改成 "rw single init=/bin/bash"

按 ctrl+x 去boot 便可以用root單人模式 login,再用passwd 修改root密碼即可!

2011年2月21日 星期一

Mapping IP Multicast to MAC-Layer Multicast

To support IP multicasting, the Internet authorities have reserved the multicast address range of 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for Ethernet and Fiber Distributed Data Interface (FDDI) media access control (MAC) addresses. As shown in Figure 4.1, the high order 25 bits of the 48-bit MAC address are fixed and the low order 23 bits are variable.
Cc957928.INAF01(en-us,TechNet.10).gif Figure 4.1 Mapping IP Multicast Addresses to Ethernet and FDDI MAC Addresses
To map an IP multicast address to a MAC-layer multicast address, the low order 23 bits of the IP multicast address are mapped directly to the low order 23 bits in the MAC-layer multicast address. Because the first 4 bits of an IP multicast address are fixed according to the class D convention, there are 5 bits in the IP multicast address that do not map to the MAC-layer multicast address. Therefore, it is possible for a host to receive MAC-layer multicast packets for groups to which it does not belong. However, these packets are dropped by IP once the destination IP address is determined.
For example, the multicast address 224.192.16.1 becomes 01-00-5E-40-10-01. To use the 23 low order bits, the first octet is not used, and only the last 7 bits of the second octet is used. The third and fourth octets are converted directly to hexadecimal numbers. The second octet, 192 in binary is 11000000. If you drop the high order bit, it becomes 1000000 or 64 (in decimal), or 0x40 (in hexadecimal). For the next octet, 16 in hexadecimal is 0x10. For the last octet, 1 in hexadecimal is 0x01. Therefore, the MAC address corresponding to 224.192.16.1 becomes 01-00-5E-40-10-01.
Token Ring uses this same method for MAC-layer multicast addressing. However, many Token Ring network adapters do not support it. Therefore, by default, the functional address 0xC0-00-00-04-00-00 is used for all IP multicast traffic sent over Token Ring networks. For more information about Token Ring support for IP multicasting, see RFC 1469.

2011年2月10日 星期四

jperf 圖形(GUI) 介面的 iperf

jperf 是有圖形 GUI 介面的 iperf,不過他是架構在 iperf 必須先安裝過 iperf 才可以使用.下載點在 http://code.google.com/p/xjperf/downloads/list 方式也很簡單,先行安裝完 iperf . 再解開 jperf 即可執行

How to copy svn working dir without svn hidden dirs and files

rysnc is a very powerful alternative to cp. It provides basic things like you want here, progress meters, copying to remote sites, a diff algorithm to efficiently maintain mirrors, compression, etc.

I think you want something like this:


Code:
rsync -r --exclude=.svn /home/user/progname/ /home/user/progname.copy

2011年2月9日 星期三

DD-WRT Default internal device network





The DD-WRT user interface is an awesome piece of work, as it front-ends what amounts to a really quite sophisticated combination of switching and routing. This document is a concise and hopefully mostly accurate description of what the UI is actually configuring for you from the perspective of internal network devices and the data flows between them.


2011年2月8日 星期二

DD-WRT V24 enable PPPoE Relay

原來 PPPoE-Relay 功能預設是在付費的 DD-WRT 韌體才有,但有人提出變通方案:利用姊妹品 OpenWRT 的套件 rp-pppoe-relay 來達成。簡單來說在AP啟動時執行這個小程式就可以達成這項任務,但是這個小程式要放在AP裡面很困難,因為AP裡面沒有很便利的讀寫區,有的只是燒錄的 ROM跟RAMDISK,前者無法寫入後者重開機就消失了。如果有開啟額外 Flash 空間建立 JFFS2 的話就可以拿它來用,或者也可以靠外部 USB 來達成。

1. 先取得 pppoe-relay 檔案 URL 位置。參考DD-WRT PPPoE Passthrough (on WRT54G)這篇我們可以知道 OpenWRT 網站有 pppoe-relay 檔案可以下載 (這裡)。複製URL位置備用。

2. telnet 192.168.1.1
登入AP,帳號固定是root,密碼看你的設定。

3. cd /tmp
切換到RAMDISK下,我們要做些解壓的動作。

4. wget (剛才那個套件的網址)
可以下載到套件包。

5. tar -xzf rp-pppoe-relay_3.10-1_mipsel.ipk
解壓套件。

6. tar -xzf data.tar.gz
再解一層。

7. cp usr/sbin/pppoe-relay /jffs
複製檔案到 JFFS 下,如果你剛才有開啟JFFS2或是擴充USB隨身碟並掛到/jffs下應該會有空間可放

8. 到網頁介面的系統管理→指令新增一行
sleep 10 && /jffs/pppoe-relay -S vlan1 -C br0


from:http://blog.new-studio.org/2010/02/asus-wl-520gu-dd-wrt.html

SSH 免密碼登入 快速三步驟

被登入的主機當 Server,自己的當 Client

Step1 : 在 Client 端建立 Public 與 Private Key

$ssh-keygen -t dsa <==這個步驟產生 Keys
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): <== 按下 Enter
Enter passphrase (empty for no passphrase): <== 按 Enter
Enter same passphrase again: <== 再按一次 Enter
Your identification has been saved in /root/.ssh/id_dsa. <== 私鑰
Your public key has been saved in /root/.ssh/id_dsa.pub. <== 公鑰
The key fingerprint is:
c4:ae:d9:02:d1:ba:06:5d:07:e6:92:e6:6a:c8:14:ba test@test.com

Step2 : 在 Server 端放置 Client 可以登入的公鑰

$cd ~/.ssh
$scp id_dsa.pub root@192.168.1.1:~/

Step3 : 登入到 Server 端,將公鑰轉存到 authorized_keys 檔案中

$ssh 192.168.1.1
$cat id_dsa.pub >> .ssh/authorized_keys

How to use simple speedtest in RaspberryPi CLI

  pi@ChunchaiRPI2:/tmp $  wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --2023-06-26 10:4...