coap-client
is a wget-like tool to generate simple requests for retrieval and modification of resources on a remote server.
Replay
Opensource, Embedded, VPN, Linux, Ubuntu, Windows tips ...
2021年7月18日
coap-client 4.3.0 Windows build
2021年1月24日
在WIN10使用mvn compile java 時找不到JDK
使用mvn compile JAVA project時出現以下錯誤訊息,但JDK已經安裝而且也在使用者PATH路徑下
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
原因在WIN10下, 已將Oracle\Java\javapath變數加在"系統變數"下. 並非指到安裝的JDK.
以連結的形式 指到子目錄javapath_target_149203015下的3個執行檔
2020年5月8日
tinc VPN 試用心得
選擇用tinc的原因是因為官網的這句話.
Automatic full mesh routingRegardless of how you set up the tinc daemons to connect to each other, VPN traffic is always (if possible) sent directly to the destination, without going through intermediate hops.
不過到我架設起來為止並沒有成功的建立起P2P的連線. 反而是ZeroTier 成功了, 而且ZeroTier不用自己架Server, 滿方便的.
Install
Debian Linux: sudo apt install tinc
Windows: 官網載點
tinc架設方式, 把sun-moon兩台windows 作VPN連線, moon 可以遠端桌面到sun這台PC上.
Server & Client所需的設定檔基本上是一樣的, key 在3台設備都要有
server | client1 | client2 |
tinc.conf | tinc.conf | tinc.conf |
tinc-down | rsa_key.priv | rsa_key.priv |
tinc-up | hosts/main | hosts/main |
rsa_key.priv | hosts/client1 | hosts/client1 |
hosts/main | hosts/client2 | hosts/client2 |
hosts/client1 | ||
hosts/client2 |
設定
linux可參考 使用 Tinc VPN 实现远程办公
Windows可參考 官方教學windows-install
測試
client1(192.168.100.100) ping Server (192.168.100.1), latency 194ms
client2(192.168.100.101) ping server (192.168.100.1), latency 198ms
client2(192.168.100.101) ping client1 (192.168.100.100) , latency 394 ms
基本上就是透過server relay 封包的時間( client1 to server + server to client2).
雖然client1 可以看到 client2 外部ip 地址 (而非server), 但P2P似乎沒有生效.
References
2020年4月29日
syslogd: logging different device's log to different files on windows
Most of the syslog server (syslogd) on Widows cannot change the default listening port number (udp 514).
If there are may devices remote syslog to a syslog server with dynamic ip address, without correct host name, it may not able to know which log belongs to which device.
I found that syslog4j already implement syslog server with configurable port number and log file name:
Usage:SyslogServer [-h <host>] [-p <port>] [-o <file>] [-a] [-q] <protocol>-h <host> host or IP to bind-p <port> port to bind-t <timeout> socket timeout (in milliseconds)-o <file> file to write entries (overwrites by default)-a append to file (instead of overwrite)-q do not write anything to standard outprotocol Syslog4j protocol implementation (tcp, udp, ...)
Example:
Run sysylogd on port 514 and log to log1.txt
# java -cp syslog4j.jar org.productivity.java.syslog4j.server.SyslogServer -p 514 -o log1.txt -a -q udp
Run sysylogd on port 515 and log to log2.txt
# java -cp syslog4j.jar org.productivity.java.syslog4j.server.SyslogServer -p 515 -o log2.txt -a -q udp
You can run many syslogd as long as port number is different.
2016年12月26日
停用遠端桌面音訊重新導向
雖然遠端桌面時, 可以在client端設定是否要將遠端的音訊重新導向到本機, 當你有多台Server要遠端控制時就不會想要每次修改設定.
我的解決方式是修改遠端Server的音效設定值. 修改群組原則的設定.
2016年8月19日
Windows 7 PPTP VPN 不使用遠端的 default gateway
一般來說, 如果建立VPN後, 會把所有的網路封包轉到VPN Server上.如此client就可以access VPN server的網段,而且封包也會透過VPN Server的網段出去internet.
如果只想要去存取VPN Server的網段,如網芳,其它封包仍要走自己的local的gateway出去,那就要移除PPTP VPN所設定的default gateway.
另外一個應用就是你有兩個VPN, 兩個都要能夠同時使用, 這時就不能讓VPN 去修改你電腦的default gateway.
訂閱:
文章 (Atom)
coap-client 4.3.0 Windows build
coap-client is a wget -like tool to generate simple requests for retrieval and modification of resources on a remote server. Got the sour...
-
為了要測試重開機幾次會失敗, 寫了一個script來記算. 因為busybox的shell只提供了有限的功能, 不能像bash一樣宣告整數變數, 所以count的處理算比較麻煩. #!/bin/sh FILE = /etc/count timeout = 2 if ...
-
寫bash script時候, 用grep或awk取出來的值, 裡面還包含了一些non-printable的字; 作字串比對時, 就會一直出錯. 這時可以用 tr 這個指令移除看不到的字(如換行符號): # echo $VAR_WITH_NON_PRINT | tr -d &...
-
選擇用tinc的原因是因為官網的這句話. Automatic full mesh routing Regardless of how you set up the tinc daemons to connect to each other, VPN traffic i...