Skip to content

Instantly share code, notes, and snippets.

@mcupak
mcupak / tcpdump.out
Created October 9, 2017 06:25
Testing data source via tcpdump.
$ tcpdump -vv -X host 1.1.1.1
tcpdump: data link type PKTAP
tcpdump: listening on pktap, link-type PKTAP (Apple DLT_PKTAP), capture size 262144 bytes
23:31:22.697824 IP (tos 0x2,ECT(0), ttl 64, id 56259, offset 0, flags [DF], proto TCP (6), length 89)
host.61391 > 1.1.1.1.bc.googleusercontent.com.mysql: Flags [P.], cksum 0x042f (correct),
seq 1486677046:1486677083, ack 1535448375, win 4096, options [nop,nop,TS val 964209410 ecr 23504386],
length 37
0x0000: 0026 444e c879 acbc 32c9 f89b 0800 4502 .&DN.y..2.....E.
0x0010: 0059 dbc3 4000 4006 5ad4 c0a8 014d 689a .Y..@.@.Z....Mh.
0x0020: d975 efcf 0cea 589c e436 5b85 1537 8018 .u....X..6[..7..
@mcupak
mcupak / printenv.out
Created October 9, 2017 06:27
Generating a file containing environment variables.
$ printenv > $JBOSS_HOME/env.properties
@mcupak
mcupak / pass-properties-to-cli.out
Created October 9, 2017 06:29
Supply a properties file to the WildFly CLI.
$ $JBOSS_HOME/bin/jboss-cli.sh --file=myscript.cli --properties=env.properties
@mcupak
mcupak / property-setter.cli
Created October 9, 2017 06:31
Setting a system property in WildFLy.
/system-property=${PROPERTY_NAME}:add(value="bar")
@mcupak
mcupak / use-property-setter.out
Created October 9, 2017 06:31
Using property-setter.cli.
$ export PROPERTY_NAME=foo
$ printenv > env.properties
$ ./bin/jboss-cli.sh -c --file=property-setter.cli --properties=env.properties
{"outcome" => "success"}
@mcupak
mcupak / system-property.xml
Created October 9, 2017 06:32
System property in WildFly.
<system-properties>
<property name="foo" value="bar"/>
</system-properties>
@mcupak
mcupak / property-setter.cli
Created October 9, 2017 06:34
Set property value in WildFly.
/system-property=foo:add(value="${PROPERTY_VALUE}")
@mcupak
mcupak / use-property-setter.out
Created October 9, 2017 06:35
Using property-setter.cli.
$ export PROPERTY_VALUE=bar
$ printenv > env.properties
$ ./bin/jboss-cli.sh -c --file=property-setter.cli --properties=env.properties
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0211: Cannot resolve expression '${PROPERTY_VALUE}'",
"rolled-back" => true
}
@mcupak
mcupak / set-resolve-parameter-values.out
Created October 9, 2017 06:37
Changing resolve-parameter-values in jboss-cli.xml.
$ sed -i "s/<resolve-parameter-values>false<\/resolve-parameter-values>/\
<resolve-parameter-values>true<\/resolve-parameter-values>/" \
$JBOSS_HOME/bin/jboss-cli.xml
@mcupak
mcupak / update-properties.out
Created October 9, 2017 06:38
Update properties in WildFly.
$ ./bin/jboss-cli.sh -c --file=property-setter.cli --properties=env.properties
{"outcome" => "success"}