Skip to content

Instantly share code, notes, and snippets.

@auryn31
auryn31 / firefoxIni.sh
Created Apr 10, 2018
create firefox ini
View firefoxIni.sh
(echo -e "[General]\nStartWithLastProfile=1\n"; i=0; for folder in $(ls
-td */|grep -v "Pending Pings"|grep -v "Crash Reports"|grep -v
profiles.ini); do name=$(echo $folder|cut -f2 -d"."); echo -e
"[Profile$i]\nName=$name\nIsRelative=1\nPath=$folder\n"; i=$((i+1));
done) > profiles.ini
View wildfly standard start cmd
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
View docker compose wildfly cluster
version: '3.5'
services:
wildfly1:
build:
context: .
args:
WILDFLY_NAME: wildfly_1_test
CLUSTER_PW: secret_password
image: wildfly_1_test
View wildfly docker cluster log
...
wildfly1_1 | ... INFO [org.infinispan.CLUSTER] (MSC service thread 1-3) ISPN000094: Received new cluster view for channel ejb: [wildfly_2_test|1] (2) [wildfly_2_test, wildfly_1_test]
wildfly1_1 | ... INFO [org.infinispan.CLUSTER] (MSC service thread 1-5) ISPN000094: Received new cluster view for channel ejb: [wildfly_2_test|1] (2) [wildfly_2_test, wildfly_1_test]
wildfly1_1 | ... INFO [org.infinispan.CLUSTER] (MSC service thread 1-1) ISPN000094: Received new cluster view for channel ejb: [wildfly_2_test|1] (2) [wildfly_2_test, wildfly_1_test]
wildfly1_1 | ... INFO [org.infinispan.CLUSTER] (MSC service thread 1-7) ISPN000094: Received new cluster view for channel ejb: [wildfly_2_test|1] (2) [wildfly_2_test, wildfly_1_test]
...
wildfly2_1 | ... INFO [org.infinispan.CLUSTER] (remote-thread--p6-t2) [Context=client-mappings] ISPN100002: Starting rebalance with members [wildfly_2_test, wildfly_1_test], phase READ_OLD_WRITE_ALL, topology id 2
View Dockerfile Wildfly Cluster
FROM jboss/wildfly
ADD helloworld.war /opt/jboss/wildfly/standalone/deployments/
ARG WILDFLY_NAME
ARG CLUSTER_PW
ENV WILDFLY_NAME=${WILDFLY_NAME}
ENV CLUSTER_PW=${CLUSTER_PW}
View wrk.sh
wrk -c 400 -d 10 - latency - timeout 1s http://localhost:8080/cars-locust
View load_sampledata.sh
wget https://pysparksampledata.blob.core.windows.net/sampledata/sampledata.csv > sampledata.csv
View DataProvider.kt
@Component
class DataProvider {
/**
* create flowable from sampledata.csv
* @return every 100ms one line
*/
fun getDataStream(): Flowable<String> {
val csvFile = this::class.java.getResource("/static/sampledata.csv").openStream()
View CSVStreamResponseOutput.kt
@Component
class CSVStreamResponseOutput : StreamingResponseBody {
var dataProvider: DataProvider
constructor(dataProvider: DataProvider) {
this.dataProvider = dataProvider
}
/**
View RestEndpoint.kt
@Controller
class RestEndpoint {
var streamResponse: CSVStreamResponseOutput
constructor(csvStreamResponseOutput: CSVStreamResponseOutput) {
this.streamResponse = csvStreamResponseOutput
}
@GetMapping(path = ["stream"], produces = [MediaType.APPLICATION_STREAM_JSON_VALUE])