2022年8月29日 星期一

SSH Client 無法連線至SSH Server 設定

因為工作用的SERVER 是比較老舊的, 所以在使用Linux Clinet SSH 連線至SERVER時會有一些錯誤。
目前的解決方式是修改Client SSH Config.
/etc/ssh 是Client 的設定資料夾
/etc/sshd 是Server 的設定資料夾

這次遇到的問題是無法連線至遠端的Server, 所以是修改 /etc/ssh 資料夾。
問題1: 
Unable to negotiate with 10.198.***.*** port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 

問題2:
Unable to negotiate with 10.198.***.** port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

因為我的環境中, SSH 會include /etc/ssh/ssh_config.d/*.conf,所以我在該路徑加了一個melin.conf 

內容如下: 


KexAlgorithms diffie-hellman-group1-sha1,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

Host *
    HostKeyAlgorithms=+ssh-dss



2022年2月25日 星期五

透過 Gmail 發信二段驗證設定

Google 啟用二段式驗證後, 會無法登入,
其他需要調整
  1. 加密 SSL/TLS ->STARTTLS
  2. PORT 587, 原本可能就設定錯誤
  3. 密碼: 至Google 帳戶設定





這封郵件來自 Evernote。Evernote 是您專屬的工作空間,免費下載 Evernote

2021年11月27日 星期六

get current mathod name

image

java static get Class Name

for log4j static object initialize class name.

 

static String CLASS_NAME = java.lang.invoke.MethodHandles.lookup().lookupClass().getName(); 
static Logger log = Logger.getLogger(CLASS_NAME); 

2021年10月6日 星期三

Add Maven dependencies to Eclipse Deployment Assembly

image

在Eclipes Project 中,加入<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>

image

 

手動使用這個方法在執行Maven-update project 之後,該項設定會消失。可以透過Eclipse 的設定來處理:

 

image

image

image

image

 

在Java Build Path->Order and Export 勾選 Maven Dependencies

image

如此再執行Maven Update Project,Deployment Assembly關於Maven Dependency設定還是會不見。但另外新增一個專案,將.classpath、.project copy 至此專案,則看似正常,所以還在確認解決方法。

2021年7月29日 星期四

Maven install a jar to private repository

pom 需要有一個效果就是引用本機的JAR檔.

 

可以這麼作

<dependency>

<groupId>com.sample</groupId>
<artifactId>sample</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Name_Your_JAR.jar</systemPath>
</dependency>

 

也可以這麼作

mvn install:install-file
-Dfile=D:/tmp/myTest.jar
-DgroupId=com.test
-DartifactId=myTest
-Dversion=1.0
-Dpackaging=jar

<dependency>
    <groupId>com.test</groupId>
    <artifactId>myTest</artifactId>
    <version>1.0</version>
    <scope>provided</scope>
</dependency>

Ads

Seo Services