1. 紀錄
先在最外層 按下 "q" , 再按下你想要的巨集名稱, 例如: a
2. 輸入想要編輯的步驟
此時左下方會顯示 "recording" , 代表已經在紀錄中, 此時你所有
輸入的編輯指令都會被紀錄在巨集 a 當中. 例如: 我 i + teststring + Esc
3. 離開紀錄模式
編輯完後按 Esc 跳到最外層, 再按下 "q", 就會停止紀錄
4. 播放巨集
按下 @a, 播放剛才紀錄的巨集, 這樣就會播放一次
5. 連續播放巨集
按下 10@a, 就會播放剛才紀錄的巨集 10 次
All hardware and software things including network, system, UI, maintaining tools and the information security field
8/31/2013
8/27/2013
8/26/2013
STP switch port states
STP switch port states:
Blocking - A port that would cause a switching loop if it were active. No user data is sent or received over a blocking port, but it may go into forwarding mode if the other links in use fail and the spanning tree algorithm determines the port may transition to the forwarding state. BPDU data is still received in blocking state. Prevents the use of looped paths.
Listening - The switch processes BPDUs and awaits possible new information that would cause it to return to the blocking state. It does not populate the MAC address table and it does not forward frames.
Learning - While the port does not yet forward frames it does learn source addresses from frames received and adds them to the filtering database (switching database). It populates the MAC Address table, but does not forward frames.
Forwarding - A port receiving and sending data, normal operation. STP still monitors incoming BPDUs that would indicate it should return to the blocking state to prevent a loop.
Disabled - Not strictly part of STP, a network administrator can manually disable a port
Reference: wikipedia
8/19/2013
set the IPs and static route on ERX
show the config on certain interface
(config)# run show configuration interface gigabitEthernet X/X/X.YYY
set the ip address subnet on certain interface
(config)# interface gigabitEthernet X/X/X.YYY
(config)# ip address 1.1.1.1 255.255.255.0 secondary
set static route on router
(config)#ip route 1.1.1.1/24 2.2.2.2
or
(config)#ip route 1.1.1.1/24 gigabitEthernet X/X/X.YYY
setting targets:
o. let certain subnet can access to internet
(config)# run show configuration interface gigabitEthernet X/X/X.YYY
set the ip address subnet on certain interface
(config)# interface gigabitEthernet X/X/X.YYY
(config)# ip address 1.1.1.1 255.255.255.0 secondary
set static route on router
(config)#ip route 1.1.1.1/24 2.2.2.2
or
(config)#ip route 1.1.1.1/24 gigabitEthernet X/X/X.YYY
setting targets:
o. let certain subnet can access to internet
8/02/2013
python dictionary 入門
>>> tel = {'jack': 4098, 'sape': 4139} >>> tel['guido'] = 4127 >>> tel {'sape': 4139, 'guido': 4127, 'jack': 4098} >>> tel['jack'] 4098 >>> del tel['sape'] >>> tel['irv'] = 4127 >>> tel {'guido': 4127, 'irv': 4127, 'jack': 4098} >>> tel.keys() ['guido', 'irv', 'jack'] >>> 'guido' in tel True
7/31/2013
python write the json and php read it periodically
python part:
#save your data into python dictionary - Ex. testResultsJson
testResultsJson = {}
fjs = open('/var/www/xxx/state.json','w')
fjs.write(json.dumps(testResultsJson))
fjs.close()
php part:
#save your data into python dictionary - Ex. testResultsJson
testResultsJson = {}
fjs = open('/var/www/xxx/state.json','w')
fjs.write(json.dumps(testResultsJson))
fjs.close()
php part:
$file = "/var/www/xxx/state.json";
$obj = json_decode(file_get_contents($file));
#Ex. i want to get the timestamp info from this object.
$timestring = 'Last Updated:'.$obj.'timestamp.';
7/26/2013
GTM 常用指令紀錄
create gtm datacenter dc1 dc2
create gtm server ltm1 addresses add { 10.10.100.1 } monitor bigip datacenter dc1 virtual-servers add { 10.10.100.10:80 10.10.100.11:80 10.10.100.12:80 }
create gtm server ltm2 addresses add { 10.10.200.1 } monitor bigip datacenter dc3 virtual-servers add { 10.10.200.10:80 10.10.200.11:80 10.10.200.12:80 }
create gtm pool gpool1 members add { 10.10.100.10:80 {ratio 1} 10.10.100.11:80 {ratio 2} 10.10.100.12:80 {ratio 3} } load-balancing-mode ratio verify-member-availability disabled
create gtm pool gpool2 members add { 10.10.200.10:80 {ratio 1} 10.10.200.11:80 {ratio 2} 10.10.200.12:80 {ratio 3} } load-balancing-mode ratio verify-member-availability disabled
create gtm wideip test.wip.com pool-lb-mode ratio pools add { gpool1 { ratio 1 } gpool2 { ratio 2 } } persistence enabled ttl-persistence 300 rules add { testwip-rule }
create gtm server ltm1 addresses add { 10.10.100.1 } monitor bigip datacenter dc1 virtual-servers add { 10.10.100.10:80 10.10.100.11:80 10.10.100.12:80 }
create gtm server ltm2 addresses add { 10.10.200.1 } monitor bigip datacenter dc3 virtual-servers add { 10.10.200.10:80 10.10.200.11:80 10.10.200.12:80 }
create gtm pool gpool1 members add { 10.10.100.10:80 {ratio 1} 10.10.100.11:80 {ratio 2} 10.10.100.12:80 {ratio 3} } load-balancing-mode ratio verify-member-availability disabled
create gtm pool gpool2 members add { 10.10.200.10:80 {ratio 1} 10.10.200.11:80 {ratio 2} 10.10.200.12:80 {ratio 3} } load-balancing-mode ratio verify-member-availability disabled
create gtm wideip test.wip.com pool-lb-mode ratio pools add { gpool1 { ratio 1 } gpool2 { ratio 2 } } persistence enabled ttl-persistence 300 rules add { testwip-rule }
如何在 GTM 使用 tmsh 新增多members 到 pool當中
tmsh# gtm pool modify POOLNAME members add { ip1:port ip2.port }
7/25/2013
set static mac address on juniper router
(config)# arp 1.1.1.1 gigabitEthernet x/x/x/x AAAA.BBBB.CCCC
7/23/2013
常忘記但會用到的 shell script while loop
Example:
while true; do ls; sleep 2; done
while true; do [command]; sleep [duration]; done
while true; do ls; sleep 2; done
while true; do [command]; sleep [duration]; done
7/15/2013
紀錄常用protocol header
mac header size: 14 B
ip header size: 20 B
tcp header size: 20 B
udp header size: 8 B
ip header size: 20 B
tcp header size: 20 B
udp header size: 8 B
6/27/2013
一次觀看多個youtube影片的方法
1. 連結到此網站:
http://geoipro.mooo.com/youtube/testy.html
2. 輸入您所要看的youtube video ID 以及其他相關參數
3. 點擊 Gen crazy user
4. 享受一次觀看多個youtube的效果
http://geoipro.mooo.com/youtube/testy.html
2. 輸入您所要看的youtube video ID 以及其他相關參數
3. 點擊 Gen crazy user
4. 享受一次觀看多個youtube的效果
6/12/2013
SNAT 與 DNAT 的差別
假設 IP 封包 示意如下:
| src ip | dst ip | xxxx(payload) |
NAT大致有下列三種 :
1. SNAT
[change]
| src ip | dst ip | xxxx |
#修改 src ip
2. DNAT
[change]
| src ip | dst ip | xxxx |
#修改 dst ip
3. MASQUERADE (SNAT的一種)
假設 網卡 eth0 上的 IP 為 A-ip, 則由eth0 出去的封包:
[change to A-ip]
| src ip | dst ip | xxxx |
SNAT run on POSTROUTING chain, DNAT run on PREROUTING chain
| src ip | dst ip | xxxx(payload) |
NAT大致有下列三種 :
1. SNAT
[change]
| src ip | dst ip | xxxx |
#修改 src ip
2. DNAT
[change]
| src ip | dst ip | xxxx |
#修改 dst ip
3. MASQUERADE (SNAT的一種)
假設 網卡 eth0 上的 IP 為 A-ip, 則由eth0 出去的封包:
[change to A-ip]
| src ip | dst ip | xxxx |
SNAT run on POSTROUTING chain, DNAT run on PREROUTING chain
如何在用apt-get 安裝 vim 7.3
1. 在 /etc/apt/sources.list 中加入下列這行:
deb http://ftp.de.debian.org/debian sid main
2. 關閉vim並且運行下列指令:
sudo apt-get update
sudo apt-get remove vim-common vim-runtime vim-gtk vim-gui-common
sudo apt-get install vim-common vim-runtime
3. 在/etc/apt/sources.list 中移除 deb http://ftp.de.debian.org/debian sid main
4. 再跑一次 sudo apt-get update
deb http://ftp.de.debian.org/debian sid main
2. 關閉vim並且運行下列指令:
sudo apt-get update
sudo apt-get remove vim-common vim-runtime vim-gtk vim-gui-common
sudo apt-get install vim-common vim-runtime
3. 在/etc/apt/sources.list 中移除 deb http://ftp.de.debian.org/debian sid main
4. 再跑一次 sudo apt-get update
5. 完成
5/21/2013
5/17/2013
GTM 修改多個 WideIP 之設定方法
tmsh
Ex.
modify gtm wideip all last-resort-pool test-pool
The last-resort-pool part can be the any parameter within wideip
Ex.
modify gtm wideip all last-resort-pool test-pool
The last-resort-pool part can be the any parameter within wideip
5/12/2013
5/09/2013
4/24/2013
CTCP - Compound TCP
簡介:
CTCP 是 Microsoft 所研發的一種TCP algorithm, 原始是被用在Windows Vista (非預設) and Windows Server 2008 上的TCP Stack. 他主要是被設計成可以積極的調整送端的壅塞窗戶, 並且其主要針對頻寬大而延遲高的網路通道作最佳化, 而又不失TCP 之公平性. CTCP可以用hotfix 套用於Linux 與 Windows XP.
原則:
CTCP 使用queueing 延遲來作為壅塞的衡量參數. 如果queueing延遲很小, 那他就會假設目前網路通道上沒有link發生壅塞, 進而快速增加傳送速率.
CTCP 維護兩種壅塞窗戶, 一種是一般的AIMD窗戶, 另一種是以延遲為基準的窗戶, 而實際上的Sliding window size 就是以上兩種的總和. AIMD窗戶大小增加的行為與TCP Reno相同.
如果網路環境的延遲很小, 那麼延遲窗戶就會快速加大, 一旦發現queueing發生, 延遲窗戶就會快速減小, 來補償AIMD窗戶增加的量. 主要目的是要讓 AIMD 窗戶 size + 延遲窗戶 size ~= 定值 (趨近定值) 而當queue 發生時, 延遲窗戶所減少的量會接近於queue size, 以防止持續性的壅塞. 所以CTCP的特點在於, 他可以根據delay的程度來調整其窗戶 size.
設定:
在Windows 7 如果想要啟用的話, 可使用以下指令:
netsh interface tcp set global congestionprovider=ctcp
在Windows 8 的話, 可使用以下指令:
set-nettcpsetting -Settingname Custom -CongestionProvider CTCP
顯示目前您電腦的TCP設定:
netsh interface tcp show global
CTCP 是 Microsoft 所研發的一種TCP algorithm, 原始是被用在Windows Vista (非預設) and Windows Server 2008 上的TCP Stack. 他主要是被設計成可以積極的調整送端的壅塞窗戶, 並且其主要針對頻寬大而延遲高的網路通道作最佳化, 而又不失TCP 之公平性. CTCP可以用hotfix 套用於Linux 與 Windows XP.
原則:
CTCP 使用queueing 延遲來作為壅塞的衡量參數. 如果queueing延遲很小, 那他就會假設目前網路通道上沒有link發生壅塞, 進而快速增加傳送速率.
CTCP 維護兩種壅塞窗戶, 一種是一般的AIMD窗戶, 另一種是以延遲為基準的窗戶, 而實際上的Sliding window size 就是以上兩種的總和. AIMD窗戶大小增加的行為與TCP Reno相同.
如果網路環境的延遲很小, 那麼延遲窗戶就會快速加大, 一旦發現queueing發生, 延遲窗戶就會快速減小, 來補償AIMD窗戶增加的量. 主要目的是要讓 AIMD 窗戶 size + 延遲窗戶 size ~= 定值 (趨近定值) 而當queue 發生時, 延遲窗戶所減少的量會接近於queue size, 以防止持續性的壅塞. 所以CTCP的特點在於, 他可以根據delay的程度來調整其窗戶 size.
設定:
在Windows 7 如果想要啟用的話, 可使用以下指令:
netsh interface tcp set global congestionprovider=ctcp
在Windows 8 的話, 可使用以下指令:
set-nettcpsetting -Settingname Custom -CongestionProvider CTCP
顯示目前您電腦的TCP設定:
netsh interface tcp show global
訂閱:
文章 (Atom)