Skip to content

Instantly share code, notes, and snippets.

Avatar

Miro Cupak mcupak

View GitHub Profile
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 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 / 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
@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>
@mcupak
mcupak / proxy-forwarding.cli
Created Oct 9, 2017
Set up proxy address forwarding in WildFly
View proxy-forwarding.cli
/subsystem=undertow/server=default-server/http-listener=default\
:write-attribute(name=proxy-address-forwarding,value=true)
/subsystem=undertow/server=default-server/http-listener=default\
:write-attribute(name=redirect-socket,value=proxy-https)
@mcupak
mcupak / proxy-forwarding.xml
Created Oct 9, 2017
Set up proxy address forwarding in WildFly.
View proxy-forwarding.xml
<subsystem xmlns="urn:jboss:domain:undertow:3.0">
...
<server name="default-server">
...
<http-listener name="default" socket-binding="http"
proxy-address-forwarding="true" redirect-socket="proxy-https"/>
...
</server>
...
</subsystem>
@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 / duplicate-service-exception.log
Created Oct 9, 2017
Service jboss.pojo."org.jboss.netty.internal.LoggerConfigurator".DESCRIBED is already registered
View duplicate-service-exception.log
Caused by: org.jboss.msc.service.DuplicateServiceException: Service
jboss.pojo."org.jboss.netty.internal.LoggerConfigurator".DESCRIBED
is already registered
@mcupak
mcupak / netty-tree.txt
Created Oct 9, 2017
Netty - jboss-beans.xml
View netty-tree.txt
netty-3.3.0.Final
├── META-INF
│   ├── ...
│   ├── jboss-beans.xml
│   └── ...
└── ...