Skip to content

Instantly share code, notes, and snippets.

View mcupak's full-sized avatar

Miro Cupak mcupak

View GitHub Profile
@mcupak
mcupak / ssl.cli
Last active November 11, 2019 11:23
Configuring WildFly behind a reverse proxy with TLS - https://mirocupak.com/configuring-wildfly-behind-a-reverse-proxy-with-tls/
# 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
# 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
# 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
@mcupak
mcupak / enable-access-log.cli
Last active March 10, 2020 15:56
Enabling access log with Undertow on WildFly - https://mirocupak.com/logging-requests-with-undertow/
# 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 September 21, 2017 12:28
Activating RequestDumpingHandler from Undertow on WildFly - https://mirocupak.com/logging-requests-with-undertow/
# 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
@mcupak
mcupak / latexmk.sh
Last active January 19, 2017 17:12
Building a LaTeX document with Latexmk - https://mirocupak.com/best-development-setup-for-latex/
#! /bin/bash
grep -l '\\documentclass' *tex | xargs latexmk -pdf -pvc -silent
@mcupak
mcupak / jshell-demo.jsh
Created March 22, 2017 21:47
JShell commands from the live demo of "REPL: Java developer’s new friend" talk at Devoxx US 2017.
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 October 4, 2017 21:56
JShell history export from Exploring Java 9 with REPL talk at JavaOne 2017.
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 October 9, 2017 04:24
Creating a new named configuration for a socket in WildFly.
/socket-binding-group=standard-sockets/socket-binding=proxy-https:add(port=443)
@mcupak
mcupak / socket-binding.xml
Created October 9, 2017 04:19
Adding a socket-binding element to the socket-binding-group element in WildFly.
<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>