2023年11月21日 星期二

在windows 設定多個IP

 

因為Windows 11 22H2 112/‎1/‎21 22621.2715找不到以前可以設定多個IP,所以使用Command line的方式增加IP設定,使用"netsh"

使用方式: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password | *]
             [Command | -f ScriptFile]

exp:
設定IP
netsh interface ip set address "3USB-1N-White" static 10.254.1.25 255.255.255.0

增加IP
netsh interface ip add address "3USB-1N-White" 10.254.1.25 255.255.255.0

 
增加多個IP
netsh interface ip set address "3USB-1N-White" static 10.254.1.25 255.255.255.0

netsh interface ip add address "3USB-1N-White" 10.254.2.25 255.255.255.0
netsh interface ip add address "3USB-1N-White" 10.254.3.25 255.255.255.0
...

如果要設定包含gateway
netsh interface ip set address "3USB-1N-White" 10.254.1.25 255.255.255.0 10.254.1.1
netsh interface ip add address "3USB-1N-White" 10.254.2.25 255.255.255.010.254.2.1
netsh interface ip add address "3USB-1N-White" 10.254.3.25 255.255.255.010.254.3.1
...

netsh ?可查詢所有可用的命令:

這個內容中的命令:
?              - 顯示命令清單。
add            - 新增項目清單中的設定項目。
advfirewall    - 變更到 `netsh advfirewall' 內容。
bridge         - 變更到 `netsh bridge' 內容。
delete         - 刪除項目清單中的設定項目。
dhcpclient     - 變更到 `netsh dhcpclient' 內容。
dnsclient      - 變更到 `netsh dnsclient' 內容。
dump           - 顯示設定指令檔。
exec           - 執行指令檔。
firewall       - 變更到 `netsh firewall' 內容。
help           - 顯示命令清單。
http           - 變更到 `netsh http' 內容。
interface      - 變更到 `netsh interface' 內容。
ipsec          - 變更到 `netsh ipsec' 內容。
lan            - 變更到 `netsh lan' 內容。
mbn            - 變更到 `netsh mbn' 內容。
namespace      - 變更到 `netsh namespace' 內容。
netio          - 變更到 `netsh netio' 內容。
nlm            - 變更到 `netsh nlm' 內容。
p2p            - 變更到 `netsh p2p' 內容。
ras            - 變更到 `netsh ras' 內容。
rpc            - 變更到 `netsh rpc' 內容。
set            - 更新組態設定。
show           - 顯示資訊。
trace          - 變更到 `netsh trace' 內容。
wcn            - 變更到 `netsh wcn' 內容。
wfp            - 變更到 `netsh wfp' 內容。
winhttp        - 變更到 `netsh winhttp' 內容。
winsock        - 變更到 `netsh winsock' 內容。
wlan           - 變更到 `netsh wlan' 內容。

下列是可使用的子內容:
 advfirewall bridge dhcpclient dnsclient firewall http interface ipsec lan mbn namespace netio nlm p2p ras rpc trace wcn wfp winhttp winsock wlan

如果您要檢視命令的說明,請輸入該命令,後面接著一個空格,
 然後輸入 ?。

2023年7月21日 星期五

windows 11 開啟Wireshark 顯示網卡錯誤,"turn off promiscuous mode"

 在windows11更換Wireshark到4.0.7版,結果開啟時發生錯誤,如下圖



要如何關閉promiscuous mode呢?

我是由windows 10 升級到windows 11的,查詢網路後有效的解決方法如下

將網卡的驅動程式更換成舊的

操作如下,避免下次狀況又來(USB轉RS232也是如此)
開啟檔案總管,選擇本機按右鍵,選擇顯示其他選項,選擇管理,選擇裝置管理員,選網路介面卡,選到有問題的網卡名稱。

按右鍵,選擇更新驅動程式,選擇瀏覽電腦上的驅動程式,再選擇讓我從電腦上的可用驅動程式清單中挑選,選擇網卡公司的驅動程式(盡量不要選擇microsoft的),更新完成後再開啟Wireshark選擇原來有問題的網卡,如果還是不行,請再重複以上動作,直到選擇到可以正常使用Wireshark 為止。
我使用這方式是OK的,所以記錄下來提供參考,如果試過不行的,請再爬其他的,如果最後成功了也請分享給大家,否則一出狀況,搞個好幾天也是很煩。祝順利!





2022年5月5日 星期四

由Outlook行事曆匯入Google日曆

 利用ics檔案方式匯入Google日曆

1.在Outlook行事曆按右鍵,選取共用,以電子郵件傳送行事曆











2.選擇日期範圍,再選詳細資料為完整詳細資料

3.填入e-mail寄出

4.開啟Gmail收信,滑到最下面下載xxx行事曆.ics





使用CCache加快Linux平台編譯速度

 Using "Ccache" to improve compiler time


1. Install "Ccache"

2. Create a path for compiler

    ls /usr/lib/ccache

    mkdir /usr/lib/ccache

    pushd . //keep current path

    cd /usr/lib/ccache

    sudo ln -s ../../bin/ccache arm-marvell-linux-gnueabi-gcc

    sudo ln -s ../../bin/ccache arm-marvell-linux-gnueabi-g++

    sudo ln -s ../../bin/ccache arm-marvell-linux-gnueabi-cc

    sudo ln -s ../../bin/ccache arm-marvell-linux-gnueabi-c++

    popd //return pushd . keep current path

3. Put "Ccache" search path into $PATH 

    export PATH=/usr/lib/ccache:$PATH

4. Keep $PATH always

    vi ~/.profile

    ==>export PATH=/usr/lib/ccache:$PATH

5. Reopen connection and check $PATH

    echo $PATH

2020年10月22日 星期四

處理svn stat出現"~M"符號無法commit

1.還原"~M"檔案

    svn revert "檔案名稱"

2.重新修改檔案

3.再次使用svn stat檢查檔案差異

4.如果出現"?",則表示為新增檔案,要用

  svn add  "檔案名稱" 

5.再次使用svn stat檢查檔案差異

  "A" 為新增,"M"為異動

6.確認寫入svn,"-m"後面要帶異動訊息

  svn commit -m "modify and add files" 

利用Windows快捷鍵擷取螢幕畫面

 如何利用Windows快捷鍵擷取螢幕畫面

1.使用Shift + MS快捷鍵 + S

2.拖拉螢幕大小

3.Ctrl + V 貼上

Windows下如何用鍵盤控制應用程式位置

 當我們用雙螢幕顯示資料時,如果突然少一個螢幕後,該消失螢幕上的應用程式無法用滑鼠移動,這個時候就可以使用鍵盤來移動應用程式,等到可以看到應用程式後,再使用滑鼠控制應用程式位置。

步驟

1.用Alt+Tab鍵選擇無法用滑鼠控制的應用程式

2.按下Alt+Space

3.在新出現的對話框選擇"移動"


4.用鍵盤上、下、左、右鍵移動應用程式

5.可以看到並控制應用程式後再用滑鼠控制

6.或點一下上、下、左、右鍵後移動滑鼠