Skip to content

Instantly share code, notes, and snippets.

View tonfever's full-sized avatar

Panuwat Srisawat tonfever

View GitHub Profile
@tonfever
tonfever / split.zsh
Created January 6, 2021 16:27
Split files into smaller files by splitting lines
% split -l 10000 big.csv chunk-
@tonfever
tonfever / RouteBuilderTest
Created July 17, 2019 04:58
Camel sample of multiplecast test
public class MulticastTest extends CamelTestSupport {
@Override
public boolean isUseRouteBuilder() {
return true;
}
@Override
protected RoutesBuilder createRouteBuilder() {
return routeBuilder(routeBuilder -> {
@tonfever
tonfever / profiles.xml
Created February 15, 2019 05:56
Sample of Cisco AnyConnect Secure Mobility Client Profiles
<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">
<ServerList>
<HostEntry>
<User>XXXX</User> <!-- your username -->
<HostName>YYYYY</HostName> <!-- your hostname that will show as a profile -->
<HostAddress>ZZZZZZ</HostAddress> <!-- host url -->
</HostEntry>
</ServerList>
<ServerList>
@tonfever
tonfever / Docker
Created February 7, 2019 03:51 — forked from mitchwongho/Docker
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@tonfever
tonfever / DefaultScenario.java
Created September 5, 2018 06:24
DefaultScenario of Citrus Simulator
@Scenario("DEFAULT_SCENARIO")
public class DefaultScenario extends AbstractSimulatorScenario {
@Override
public void run(ScenarioRunner scenario) {
scenario
.http()
.receive(httpServerReceiveActionBuilder -> httpServerReceiveActionBuilder
.get()
);
@tonfever
tonfever / CreateNewOrder.java
Created September 5, 2018 06:22
Sample Scenario for Citrus Simulator
@Scenario("CreateNewOrder")
@RequestMapping(value = "/services/rest/v1/order", method = RequestMethod.POST)
public class CreateNewOrderScenario extends AbstractSimulatorScenario {
@Override
public void run(ScenarioRunner scenario) {
scenario
.http()
.receive(httpServerReceiveActionBuilder -> {
httpServerReceiveActionBuilder.post();
});
@tonfever
tonfever / pom.xml
Last active September 5, 2018 07:01
Pom for setting up Citrus Simulator
<dependency>
<groupId>com.consol.citrus</groupId>
<artifactId>citrus-simulator-starter</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>com.consol.citrus</groupId>
<artifactId>citrus-simulator-ui</artifactId>
<version>1.0.2</version>
</dependency>
@tonfever
tonfever / Md5UtilTest.java
Last active May 9, 2018 07:17
Generate MD5 message
import org.apache.commons.codec.digest.DigestUtils;
import org.junit.Assert;
import org.junit.Test;
import javax.xml.bind.DatatypeConverter;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Md5UtilTest{
@tonfever
tonfever / application.properties
Last active April 24, 2018 08:36
spring boot application.properties
spring.datasource.url=jdbc:mysql://HOST:PORT/DATABASE
spring.datasource.username=USERNAME
spring.datasource.password=USER_PASSWORD
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
@tonfever
tonfever / merge.sql
Created June 15, 2017 07:22
Using merge on Oracle example
MERGE INTO <TABLE_NAME> <ALIAS1> USING
(
SELECT
:COLUMN1 AS COLUMN1
,:COLUMN2 AS COLUMN2
,:COLUMN3 AS COLUMN3
FROM DUAL
) <ALIAS2> ON
(
--- CONDITION