Skip to content

Instantly share code, notes, and snippets.

Avatar

Miro Cupak mcupak

View GitHub Profile
View ssl.cli
# WildFly reverse proxy setup script.
# Run with: $WILDFLY_HOME/bin/jboss-cli.sh --connect --file=ssl.cli
batch
/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=redirect-socket,value=proxy-https)
/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding,value=true)
/socket-binding-group=standard-sockets/socket-binding=proxy-https:add(port=443)
run-batch
View disable-pojo.cli
# Script disabling the POJO subsystem on WildFly.
# Run with: $WILDFLY_HOME/bin/jboss-cli.sh --connect --file=disable-pojo.cli
batch
/subsystem=pojo:remove
/extension=org.jboss.as.pojo:remove
run-batch
View deployment-timeout.cli
# Script for increasing deployment-related timeouts on WildFly to 15 minutes.
# Run with: $WILDFLY_HOME/bin/jboss-cli.sh --connect --file=deployment-timeout.cli
batch
/system-property=jboss.as.management.blocking.timeout:add(value=900)
/subsystem=deployment-scanner/scanner=default:write-attribute(name=deployment-timeout,value=900)
run-batch
View enable-access-log.cli
# Script for enabling access log based on Undertow on WildFly.
# Run with: $WILDFLY_HOME/bin/jboss-cli.sh --connect --file=enable-access-log.cli
batch
/subsystem=undertow/server=default-server/host=default-host/setting=access-log:add(pattern="%h %t \"%r\" %s \"%{i,User-Agent}\"",use-server-log=true)
run-batch
@mcupak
mcupak / enable-request-dumping-handler.cli
Last active Sep 21, 2017
Activating RequestDumpingHandler from Undertow on WildFly - https://mirocupak.com/logging-requests-with-undertow/
View enable-request-dumping-handler.cli
# Script for activating request logging based on Undertow's RequestDumpingHandler on WildFly.
# Run with: $WILDFLY_HOME/bin/jboss-cli.sh --connect --file=enable-request-dumping-handler.cli
batch
/subsystem=undertow/configuration=filter/custom-filter=request-logging-filter:add(class-name=io.undertow.server.handlers.RequestDumpingHandler, module=io.undertow.core)
/subsystem=undertow/server=default-server/host=default-host/filter-ref=request-logging-filter:add
run-batch
View latexmk.sh
#! /bin/bash
grep -l '\\documentclass' *tex | xargs latexmk -pdf -pvc -silent
@mcupak
mcupak / jshell-demo.jsh
Created Mar 22, 2017
JShell commands from the live demo of "REPL: Java developer’s new friend" talk at Devoxx US 2017.
View jshell-demo.jsh
2+2
int x = $1 *10
$1 = 10
/vars
/v
System.out.println("hello devoxx")
Thread.sleep(2000)
ZonedDateTime.now()
import java.time.*
ZonedDateTime.now()
@mcupak
mcupak / javaone.jsh
Created Oct 4, 2017
JShell history export from Exploring Java 9 with REPL talk at JavaOne 2017.
View javaone.jsh
ls
1+1
int x = 1+1
System.out.println(x)
/vars
/types
/list
/l
/help
HashSet<String> set = new HashSet<String>()
@mcupak
mcupak / socket-binding.cli
Last active Oct 9, 2017
Creating a new named configuration for a socket in WildFly.
View socket-binding.cli
/socket-binding-group=standard-sockets/socket-binding=proxy-https:add(port=443)
@mcupak
mcupak / socket-binding.xml
Created Oct 9, 2017
Adding a socket-binding element to the socket-binding-group element in WildFly.
View socket-binding.xml
<socket-binding-group name="standard-sockets" default-interface="public"
port-offset="${jboss.socket.binding.port-offset:0}">
...
<socket-binding name="proxy-https" port="443"/>
...
</socket-binding-group>