惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Cisco Talos Blog
Cisco Talos Blog
C
Check Point Blog
博客园_首页
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Martin Fowler
Martin Fowler
Recorded Future
Recorded Future
S
Security @ Cisco Blogs
L
LINUX DO - 最新话题
博客园 - 司徒正美
P
Privacy International News Feed
G
Google Developers Blog
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
K
Kaspersky official blog
I
InfoQ
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Webroot Blog
Webroot Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
大猫的无限游戏
大猫的无限游戏
D
Docker
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Microsoft Azure Blog
Microsoft Azure Blog
Spread Privacy
Spread Privacy
量子位
H
Hacker News: Front Page
Simon Willison's Weblog
Simon Willison's Weblog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
SecWiki News
SecWiki News
S
Security Affairs
Latest news
Latest news
人人都是产品经理
人人都是产品经理
C
CERT Recently Published Vulnerability Notes
S
Security Archives - TechRepublic
V
Visual Studio Blog
T
Troy Hunt's Blog
S
Secure Thoughts
F
Fortinet All Blogs
V
V2EX
The Register - Security
The Register - Security
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - slaughter

java api下载网站 国外好的软件测试网站 watir,ruby版本查看方法 - slaughter - 博客园 Watir隐藏IE运行的方法 Ruby对MS Access的操作 Eclipse下安装RDT (转)什么是Unicode?什么是UTF-8?(1) Ruby的库路径 - slaughter - 博客园 ruby下snmp-trap发包实例 - slaughter - 博客园 职业选择(转) ruby编码中碰到的一个诡异问题 - slaughter - 博客园 java读写文件(转) 在Java中操纵UDP(转) 在Java中使用UDP协议编程的相关类(转) 终于给宝宝确定了名字 RFT的对象识别技术 Ruby设置IE不可见 VC对EXCEL操作 Ruby转exe方法(转)
Ruby对于串口的设置实例 - slaughter - 博客园
slaughter · 2008-08-12 · via 博客园 - slaughter

这两天由于一直在寻找Ruby对于串口的控制方法,仅仅是希望能够通过com口对网络设备进行配置,但花费了两天才实验成功!

以下为一个简单实例(串口通过文件的方式进行操作)

目的:通过串口登陆到交换机,设置交换机名为S3760_3

f = File.open("com1:", "w+")
f.write("\n")
f.write("en")
f.write("\n")
f.write("con")
f.write("\n")
f.write("hostname S3760_3")

f.close

我进行了测试,调试通过!

以下也有其他的方法,但总体感觉比较麻烦,如果要实现比较复杂的操作大家可以参考: 

http://webscripts.softpedia.com/script/Server-Management/ruby-serialport-19279.html

http://wiki.rubygarden.org/Ruby/page/show/WindowsSerialPort