This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public java.lang.String toString() { | |
#if ( $members.size() > 0 ) | |
#set ( $i = 0 ) | |
return "{\"_class\":\"$classname\", " + | |
#foreach( $member in $members ) | |
#set ( $i = $i + 1 ) | |
#if ( $i == $members.size() ) | |
#set ( $postfix = "+" ) | |
#else | |
#set ( $postfix = "+ "", "" + " ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download Community Ed. GraalVM from https://github.com/graalvm/graalvm-ce-builds/releases | |
Unpack. | |
# sudo mv graalvm-ce-19.0.0 /Library/Java/JavaVirtualMachines | |
sudo mv graalvm-ce-java11-20.0.0 /Library/Java/JavaVirtualMachines | |
Verify: /usr/libexec/java_home -V | |
vi ~/.zprofile | |
--- Add: --- | |
export JAVA_HOME=$(/usr/libexec/java_home -v 11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do printf 'HTTP/1.1 200 OK\n\n' | nc -4 -k -l 23456; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dk.jlo.util; | |
import java.lang.reflect.Field; | |
/** | |
* Injects an object into a (private) field in a bean; primarily for poor man's injection for unit testing when not running in a Dependency Injection environment.<p> | |
* Travels through super classes if necessary.<p> | |
* Usage: | |
* <pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "\033]0;${1}\007\c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/@xsi:nil = 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $(ps -ef|grep -E "java.*jboss"|grep -v grep|wc -l) -ne 1 ] ; then | |
echo "Too many (or no) java processes!" | |
else | |
jmap -heap $(ps -ef|grep -E "java.*jboss"|grep -v grep|tr -s " "|cut -d\ -f2) | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This might be helpful when generating signed (not strictly self-signed) certificates for use in development on MacOSX. | |
Testing (against server using the generated server cert): | |
curl --trace - -3 --insecure --cert clientcert.p12:changeit --get https://localhost:443/ | |
Troubleshooting: | |
- Check the keychain (Cmd-Space "Keychain Access") for old entries. Delete them :-) | |
- "-3" avoids some MacOSX curl quirkiness. | |
- "--insecure" seems to be necessary for MacOSX curl. If you find a way to use "--cacert cacert.pem" instead then tell me :-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while pwd=$(openssl rand -base64 9); [[ ${pwd} == *[[:punct:]]* ]]; do :; done; echo ${pwd} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data-source add --jndi-name=java:/<blah>DS --name=<blah>Pool --connection-url=jdbc:oracle:thin:@//<db-hostname>:1521/<SID/db.service> --driver-name=oracle --driver-class=oracle.jdbc.driver.OracleDriver --user-name=<db-user> --password=<db-user-password> --check-valid-connection-sql=select\ 1\ from\ dual --validate-on-match=false --background-validation=true --background-validation-millis=20000 |
NewerOlder