over 7 years ago
既然 Microservices 未來只會多不會少,還是可以多利用 Spring 的項目來做管理,這邊用簡單的方式來做不同AP的設定同步,使用 SpringCloud 跟 RabbitMQ
Read on → over 7 years ago
Vagrant 主要功能在管理虛擬機,但是有時要同時是用資料庫跟NoSQL時,開多台虛擬機又很浪費記憶體,這邊介紹用 Vagrant 讓你在不同地方不同主機都可以建立一樣的環境,並使用 Docker 乘載你要的應用在同一台虛擬機上,爽XD。
Read on → over 7 years ago
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
@Component
public class ApplicationStartup implements ApplicationListener<ContextRefreshedEvent>{
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
System.out.println("Spring Boot Startup");
}
}
over 7 years ago
CSV常常做為資料交換的一種手段,透過第三方元件可加快開發速度與讀取速度,這邊紀錄用opencsv跟apache.commons.csv兩種不同的用法
Read on → over 7 years ago
讓操作 NoSQL 像 ORM 般簡單,這邊是用 Elasticsearch 當儲存,並用 jsoup 來爬文
http://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/
Read on → over 7 years ago
apply plugin: 'java'
apply plugin: 'eclipse'
repositories {
mavenCentral()
}
dependencies {
compile 'org.springframework.security:spring-security-core:4.0.1.RELEASE'
}
package com.sam.test;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
public class Test1 {
public static void main(String[] args) {
int i = 0;
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
while (i < 10) {
String password = "123456";
String hashedPassword = passwordEncoder.encode(password);
System.out.println(hashedPassword);
i++;
}
System.out.println(passwordEncoder.matches("123456ergnesiougsefwewfwer34Tt1", "$2a$10$Ja8bUpc2cacAB0EvXcj1JO2i4PgGWWvxaQ.FSZ.prQdCkEFEQNNBi"));
}
}
$2a$10$RjV.cEW29EGHXZZfFNoQFOz/J.PVVvkc2MWdUv1XQQhwWUfDSw7fa
$2a$10$pPKzHES6BE6YV9pqZwpaeeZEpA7jf24WWUdctXpmyzyk7z4kBh.2S
$2a$10$F9sRVVH90yRtnjJeC28HQOtWMDwqD1FqQ/Lhjf4UGRmVVA7HoJjxK
$2a$10$Dst6SnEdB2g1L9o0LfJoQ.Y8XwKoaKkoSkGNMxKsOaRRdHvB5yysy
$2a$10$igeXt7sS7jguvQBl4ILzy.DICtQa6zkdGiCp9u/lQ2KDv/wPU9E7W
$2a$10$lD00aUWxJG/Xiq5bMHdhZOHbaEHKpYAAs8k847Q0Vq7nQVNX1pRu.
$2a$10$fgLEGoiVPIKXw8h2qYtUp.UrcQawvXYZDEEj1AUwORUNFu70i5il.
$2a$10$d4nNA9OSjfPWvaKsDScxAuwBlUpX909fY1/Pwq7lsZhZ0Vx/DZF4W
$2a$10$hgQqIohovnGbA.UbIzom8OanIHyrA3lMRH3JMQcO.3saJ5XMujRl.
$2a$10$c85hYXPx4niZCCkmxeqXHOriQvvaWBSd9SVpYoq2ZAbs0uUa1ESL.
false