PIXNET Logo登入

495884965

跳到主文

XXX

部落格全站分類:心情日記

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 6月 12 週四 201423:33
  • JAVASCRIPT

function myFunction()
{
var x=document.getElementById("fname");
document.getElementById("show").innerHTML="\n你好\n你的帳號"+x.value+"開好了";
}
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(5)

  • 個人分類:[Script]
▲top
  • 3月 06 週四 201409:37
  • [Expect] SSH自動登入 part2

#vi ssh-expect
===================
#!/usr/bin/expect
set timeout 60
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(175)

  • 個人分類:[Script]
▲top
  • 12月 27 週五 201315:41
  • [Expect] 連上Cisco Switch取得Por Status

#vi test.sh
-------------------------------
set device 10.0.0.1
set passwd [你的密碼]
spawn telnet $device
expect "Password:"
send "$passwd\n"
expect ">"
send "en\n"
expect "Password:"
send "$passwd\n"
send "ter len 0\r"
send "show ip int brief\r"
expect "GigabitEthernet0/2"
puts "$expect_out(buffer)"
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(187)

  • 個人分類:[Script]
▲top
  • 12月 27 週五 201315:34
  • [Expect] SSH自動登入

#vi test.sh
-------------------------------------------
#!/usr/bin/expect -f
set host [lindex $argv 0] 
set password [密碼填此處]
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(382)

  • 個人分類:[Script]
▲top
  • 11月 11 週一 201314:37
  • [script][expect-3]

參考
expect要紀錄執行結果或輸出
可以用log_file這個指令
#!/usr/bin/expect -f
log_file -noappend /tmp/myfile.log
#log_file預設append or create if not exist
#若你要每次重新紀錄,要加上-noappend指令
另外
send_log也可以將送訊息到log_file指定的檔案
send_log "end of it"
log_file [args] [[-a] file]If a filename is provided, log_file will record a transcript of the session (beginning at that point) in the file. log_file will stop recording if no argument is given. Any previous log file is closed.
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(291)

  • 個人分類:[Script]
▲top
  • 8月 16 週五 201309:20
  • [script][expect-2]

#vi myscript
#此script可一次帶多個參數

#依序執行
#!/usr/bin/expect -f
log_user 1
spawn telnet 1.1.0.2
sleep 1
expect "Login:"
send "admin\n"
expect "Password:"
send "1234\n"
sleep 2
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(21)

  • 個人分類:[Script]
▲top
  • 4月 20 週三 201115:50
  • [Script] while 示範

 
#!/bin/sh
i=2
while [ $i -lt 5 ]     //注意空格
do
        zcat /var/log/ip.log.$i.bz2
        i=`expr $i + 1`
done
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(48)

  • 個人分類:[Script]
▲top
  • 4月 18 週一 201115:39
  • [Script][Expect-1]

 

#!/usr/bin/expect
log_user 0             //0不顯示輸出
spawn telnet 10.0.8.250
expect " Login Menu"
sleep 1
expect " Login: "
send "your account\r"
expect " Password: "
send "your passwd\r"
expect "Command>"
send "a\r"
expect "Command>"
send "p\r"
expect "Command>"
send "p\r"
send_user "Complete!!"   //送訊息給user
interact
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(183)

  • 個人分類:[Script]
▲top
  • 4月 14 週四 201110:18
  • [script]統計squid Hit-rate的紀錄

 
#統計squid Hit-rate
 
(繼續閱讀...)
文章標籤

slinbody 發表在 痞客邦 留言(0) 人氣(134)

  • 個人分類:[Script]
▲top
1

個人資訊

slinbody
暱稱:
slinbody
分類:
心情日記
好友:
累積中
地區:

熱門文章

  • (1,072)Outlook 無法寄出信
  • (1,632)SENDMAIL 相關問題
  • (2,411)Freeradius筆記
  • (1,067)FreeBSD + 無線網卡 組 無線AP
  • (2,386)ZFS raidz以上擴充容量
  • (1,952)網卡設定auto or allow-hotplug
  • (872)將圖片和mp3合併輸出成mp4
  • (674)vim diff mode color

文章分類

toggle Window (2)
  • Outlook (2)
  • Window (5)
toggle Freebsd (2)
  • FreeBSD (21)
  • FreeBSD-IPFW (3)
toggle linux (4)
  • Linux-sendmail (6)
  • Linux-Proxy (1)
  • Linux-NIS (1)
  • Linux-dovecot (1)
  • [Script] (9)
  • SNMP (5)
  • 網路 (9)
  • 電子郵件 (1)
  • LINUX (62)
  • 未分類文章 (1)

最新文章

  • Mysql utf8 to utf8mb4
  • curl upload file
  • fisa vim on rasbian
  • Amazon cloud drive
  • tcpdump 觀察 http header
  • telegram python api
  • find before after some time
  • vim diff mode color
  • diff 檔案內容比對
  • HC-05 vs HC-06

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: