Skip to content

Instantly share code, notes, and snippets.

View Connection to Estonian SPM
private void populateEESpeciesProfileModule() {
eeSpmLookup = new HashMap<>();
/* ee term | spm term */
eeSpmLookup.put("General Description", "General description");
//eeSpmLookup.put("Ecology", "")
//eeSpmLookup.put("Phylogeny", "")
eeSpmLookup.put("Distribution", "Distribution");
eeSpmLookup.put("DiagnosticDescription", "Diagnostic description");
eeSpmLookup.put("Morphology", "Morphology");
Inkimar / command-add-datasource.cli
Last active May 2, 2016
Adding a mysql-datasource to wildfly 8.x , you need to download the mysql java connector
View command-add-datasource.cli
deploy customization/mysql-connector-java-5.1.38-bin.jar
data-source add --name=MediaDS \
--jndi-name=java:/MediaDS \
--driver-name=mysql-connector-java-5.1.38-bin.jar_com.mysql.jdbc.Driver_5_1 \
--connection-url=jdbc:mysql://dbmedia:3306/media?useUnicode=true&amp;characterEncoding=UTF-8 \
--user-name=xxxx \
--password=xxxx \
--check-valid-connection-sql="SELECT 1" \
--background-validation=true \
--background-validation-millis=60000 \
Inkimar / gist:54f85bebad3b8695a5cdf35c58b43d01
Created Sep 14, 2016
test 2 lists, no regard to order - using hamcrest
View gist:54f85bebad3b8695a5cdf35c58b43d01
import static org.hamcrest.Matchers.containsInAnyOrder;
public void TEST_HAMCREST_listTestsWithoutOrder() {
List<String> list1 = new ArrayList<>();
List<String> list2 = new ArrayList<>();
View gist:ad5dd185b8d8605a5c85d331d53ee4b7
def name='World'; println "change file names"
String oldFilename = "old.txt"
String newFilename = "new.txt"
new File(oldFilename).renameTo(new File(newFilename))
Inkimar / standalone-snippet.xml
Created Sep 27, 2016
wildfly 8.1, update standalone.xml with 'max-header-size="974247881" '
View standalone-snippet.xml
<!-- able to uploead 9.0 MB file-->
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" max-header-size="974247881"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
Inkimar / gist:0cecaf0164fb33a24f15fcd7a8a1d13a
Created Oct 26, 2016
inlcude an environment-file in : i.e Makefile and ... shell-script
View gist:0cecaf0164fb33a24f15fcd7a8a1d13a
in Makefile
include .env2
in bash-script
source .env2
Inkimar / gist:72b8664abd3086bdf48d270c148f1c2d
Last active Oct 28, 2016
erase all docker images and containers
View gist:72b8664abd3086bdf48d270c148f1c2d
# Delete all containers
docker rm -f $(docker ps -a -q)
# Delete all images
docker rmi -f $(docker images -q)
remove one image:
docker rmi dina/media:v0.4
View gist:d8fe774cb320886e299975916c91613e
example :
~/$WILDFLY_HOME/bin $ ./ --connect
[standalone@localhost:9990 /] /subsystem=datasources:read-resource
"outcome" => "success",
"result" => {
"data-source" => {
"ExampleDS" => undefined,
"MediaDS" => undefined
Inkimar / gist:586b25b082d62a10181b5ceb6271dce9
Last active Oct 28, 2016
Fetch docker image and inspect the image
View gist:586b25b082d62a10181b5ceb6271dce9
docker pull dina/media:v0.4
docker run --rm -it dina/media:v0.4 bash
docker run -it -p 9990:9990 dina/media:v0.4
remove one image:
docker rmi dina/media:v0.4
remove a single container ( whith id = beec50b40e9cf67cddd7cf38557f60510d22d2d90182932dfd56974da5075b27 )
View gist:d5191ce2d80cfce126a478570865806d