2022年12月15日 星期四

SecureCRT & Notepad++ 的 網路設備 關鍵字顯示 (Keyword Highlighting/Syntax highlighting)

 
From:https://chingfengwang.com/2020/12/10/securecrt-and-notepad-keyword-highlighting-syntax-highlighting/


由於常常用
SecureCRT終端機軟體及文字編輯器 NOTEPAD++ ,發現常常盯著眼睛有點花 ,之前有找到 Notepad++ 的,今天阿豐找到感覺不錯的 SCRT 跟 Notepad++ 的語法:)

1.SecureCRT 的 Text Highlighting
#出處:feral packet 網站
https://feralpacket.org/?p=817 

#下載ini:

從作者的 feral packet 網站 下載: http://download.feralpacket.org/feralpacket.ini 

#下載後把複製 ini 到:
#MAC:
/Users/username/Library/Application/Support/VanDyke/SecureCRT/Config/Keywords/.

Windows: 存放在 %APPDATA%,  
C:\Users\{使用者名稱}\AppData\Roaming\VanDyke\Config\Keywords>

Linux:
複製 ini 檔案到: /home/username/.vandyke/SecureCRT/Config/Keywords/

#設定方式:
SecureCRT Settings:
– Session Options -> Terminal -> Appearance
-> Current color scheme
-> White / Black
-> Highlight keywords
-> Name: feralpacket
-> Style: Color 打勾

– Keyword List Properties
-> Match case 打勾

– To set for the default session:
-> Global Options -> General -> Default Session
-> Edit Default Settings…

#作者的截圖:

範例:出處 feral packet 網站

更多截圖可以到作者網站看喔:)

2.NOTEPAD++

給notepad++用的顯示不同網路設備 config 的語法 ( Syntax Highlight )下載:

https://github.com/click0/npp-udl

#安裝:

解壓縮後,抓下來把要用的 xml 丟到: 

C:\Users\{​使用者名稱}​\AppData\Roaming\Notepad++\userDefineLangs
1.然後再開啟notepad++ ,

2. 跟需要的config 檔案

3.至 語言 > 選擇需要的設備語言 (如 Junos , iOS)

下面是作者範例的截圖:
(出處為作者github專案 https://github.com/click0/npp-udl )

  • Quagga config or ( Cisco IOS )
  • AlliedTelesis switch config
  • Mikrotik router config ( RouterOS )
  • Juniper router config ( JunOS )

#參考資料:
1.feral packet , Regular Expressions For SecureCRT Keyword Highlighting – Update , https://feralpacket.org/?p=817
2.npp-udl, Syntax Highlight Rules for Notepad++ Text Editorhttps://github.com/click0/npp-udl
3.https://npp-user-manual.org/docs/user-defined-language-system/

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...